OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
6.9 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../ladspa/gcc41.patch
  5. # Copyright (C) 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. --- src/plugins/sine.cpp.vanilla 2006-03-04 20:47:26.038153500 +0100
  17. +++ src/plugins/sine.cpp 2006-03-04 20:56:45.961146500 +0100
  18. @@ -92,13 +92,38 @@
  19. }
  20. friend LADSPA_Handle instantiateSineOscillator(const LADSPA_Descriptor *,
  21. - unsigned long SampleRate) {
  22. - return new SineOscillator(SampleRate);
  23. - }
  24. + unsigned long SampleRate);
  25. friend void connectPortToSineOscillator(LADSPA_Handle Instance,
  26. unsigned long Port,
  27. - LADSPA_Data * DataLocation) {
  28. + LADSPA_Data * DataLocation);
  29. +
  30. + friend void activateSineOscillator(void * pvHandle);
  31. +
  32. + friend void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance,
  33. + unsigned long SampleCount);
  34. +
  35. + friend void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance,
  36. + unsigned long SampleCount);
  37. +
  38. + friend void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance,
  39. + unsigned long SampleCount);
  40. +
  41. + friend void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance,
  42. + unsigned long SampleCount);
  43. +
  44. + friend void cleanupSineOscillator(void *pvHandle);
  45. +
  46. +};
  47. +
  48. + LADSPA_Handle instantiateSineOscillator(const LADSPA_Descriptor *,
  49. + unsigned long SampleRate) {
  50. + return new SineOscillator(SampleRate);
  51. + }
  52. +
  53. + void connectPortToSineOscillator(LADSPA_Handle Instance,
  54. + unsigned long Port,
  55. + LADSPA_Data * DataLocation) {
  56. switch (Port) {
  57. case OSC_FREQUENCY:
  58. ((SineOscillator *)Instance)->m_pfFrequency = DataLocation;
  59. @@ -110,81 +135,81 @@
  60. ((SineOscillator *)Instance)->m_pfOutput = DataLocation;
  61. break;
  62. }
  63. - }
  64. -
  65. - friend void activateSineOscillator(void * pvHandle) {
  66. + }
  67. +
  68. + void activateSineOscillator(void * pvHandle) {
  69. ((SineOscillator *)pvHandle)->m_lPhase = 0;
  70. }
  71. - friend void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance,
  72. - unsigned long SampleCount) {
  73. + void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance,
  74. + unsigned long SampleCount) {
  75. SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  76. for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
  77. /* Extract frequency at this point to guarantee inplace
  78. - support. */
  79. + support. */
  80. LADSPA_Data fFrequency
  81. - = (poSineOscillator->m_pfFrequency[lIndex]);
  82. + = (poSineOscillator->m_pfFrequency[lIndex]);
  83. poSineOscillator->m_pfOutput[lIndex]
  84. - = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  85. - * poSineOscillator->m_pfAmplitude[lIndex]);
  86. + = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  87. + * poSineOscillator->m_pfAmplitude[lIndex]);
  88. poSineOscillator->setPhaseStepFromFrequency(fFrequency);
  89. - poSineOscillator->m_lPhase
  90. - += poSineOscillator->m_lPhaseStep;
  91. + poSineOscillator->m_lPhase
  92. + += poSineOscillator->m_lPhaseStep;
  93. }
  94. }
  95. - friend void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance,
  96. - unsigned long SampleCount) {
  97. + void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance,
  98. + unsigned long SampleCount) {
  99. SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  100. LADSPA_Data fAmplitude = *(poSineOscillator->m_pfAmplitude);
  101. for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
  102. /* Extract frequency at this point to guarantee inplace
  103. - support. */
  104. + support. */
  105. LADSPA_Data fFrequency
  106. - = (poSineOscillator->m_pfFrequency[lIndex]);
  107. + = (poSineOscillator->m_pfFrequency[lIndex]);
  108. poSineOscillator->m_pfOutput[lIndex]
  109. - = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  110. - * fAmplitude);
  111. + = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  112. + * fAmplitude);
  113. poSineOscillator->setPhaseStepFromFrequency(fFrequency);
  114. - poSineOscillator->m_lPhase
  115. - += poSineOscillator->m_lPhaseStep;
  116. + poSineOscillator->m_lPhase
  117. + += poSineOscillator->m_lPhaseStep;
  118. }
  119. }
  120. - friend void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance,
  121. - unsigned long SampleCount) {
  122. + void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance,
  123. + unsigned long SampleCount) {
  124. SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  125. poSineOscillator->setPhaseStepFromFrequency
  126. (*(poSineOscillator->m_pfFrequency));
  127. for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
  128. poSineOscillator->m_pfOutput[lIndex]
  129. - = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  130. - * poSineOscillator->m_pfAmplitude[lIndex]);
  131. - poSineOscillator->m_lPhase
  132. - += poSineOscillator->m_lPhaseStep;
  133. + = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  134. + * poSineOscillator->m_pfAmplitude[lIndex]);
  135. + poSineOscillator->m_lPhase
  136. + += poSineOscillator->m_lPhaseStep;
  137. }
  138. }
  139. - friend void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance,
  140. - unsigned long SampleCount) {
  141. + void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance,
  142. + unsigned long SampleCount) {
  143. SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  144. LADSPA_Data fAmplitude = *(poSineOscillator->m_pfAmplitude);
  145. poSineOscillator->setPhaseStepFromFrequency
  146. (*(poSineOscillator->m_pfFrequency));
  147. for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
  148. poSineOscillator->m_pfOutput[lIndex]
  149. - = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  150. - * fAmplitude);
  151. - poSineOscillator->m_lPhase
  152. - += poSineOscillator->m_lPhaseStep;
  153. + = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
  154. + * fAmplitude);
  155. + poSineOscillator->m_lPhase
  156. + += poSineOscillator->m_lPhaseStep;
  157. }
  158. }
  159. - friend void cleanupSineOscillator(void *pvHandle) {
  160. + void cleanupSineOscillator(void *pvHandle) {
  161. delete (SineOscillator *)pvHandle;
  162. }
  163. -};
  164. +
  165. /*****************************************************************************/