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.

157 lines
4.9KB

  1. /* SpiralSynthModular
  2. * Copyleft (C) 2002 David Griffiths <dave@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include "SpiralSynthModularInfo.h"
  19. #include "SpiralSynthPluginLocation.h"
  20. #include "FL/fl_draw.h"
  21. int SpiralInfo::BUFSIZE = 512;
  22. int SpiralInfo::FRAGSIZE = 256;
  23. int SpiralInfo::FRAGCOUNT = -1;
  24. int SpiralInfo::SAMPLERATE = 44100;
  25. long SpiralInfo::MAXSAMPLE = 32767;
  26. float SpiralInfo::VALUECONV = 1.0f/MAXSAMPLE;
  27. bool SpiralInfo::WANTMIDI = false;
  28. int SpiralInfo::FILTERGRAN = 50;
  29. string SpiralInfo::OUTPUTFILE = "/dev/dsp";
  30. string SpiralInfo::MIDIFILE = "/dev/midi";
  31. int SpiralInfo::POLY = 1;
  32. bool SpiralInfo::REALTIMEOUT = true;
  33. //int SpiralInfo::GUI_COLOUR = 139;
  34. //int SpiralInfo::GUIBG_COLOUR = 0;
  35. //int SpiralInfo::GUIBG2_COLOUR = 49;//45;
  36. int SpiralSynthModularInfo::GUICOL_Tool=179;
  37. int SpiralSynthModularInfo::GUICOL_Button=181;
  38. int SpiralSynthModularInfo::GUICOL_Canvas=181;
  39. int SpiralSynthModularInfo::GUICOL_Device=181;
  40. string SpiralSynthModularInfo::BGIMG;
  41. vector<string> SpiralSynthModularInfo::PLUGINVEC;
  42. string SpiralSynthModularInfo::PLUGIN_PATH;
  43. SpiralSynthModularInfo* SpiralSynthModularInfo::m_SpiralSynthModularInfo=NULL;
  44. SpiralSynthModularInfo* SpiralSynthModularInfo::Get()
  45. {
  46. if (!m_SpiralSynthModularInfo)
  47. {
  48. m_SpiralSynthModularInfo = new SpiralSynthModularInfo;
  49. }
  50. return m_SpiralSynthModularInfo;
  51. }
  52. SpiralSynthModularInfo::SpiralSynthModularInfo()
  53. {
  54. BGIMG="None";
  55. // default plugins + path, check these before dist...
  56. // this is one of the two plugin lists, th other is in
  57. // the SpiralSound/Plugins/PluginList.txt for the
  58. // configure/make/install scripts
  59. PLUGIN_PATH = PLUGIN_PATH_LOCATION;
  60. PLUGINVEC.push_back("OutputPlugin.so");
  61. PLUGINVEC.push_back("ScopePlugin.so");
  62. PLUGINVEC.push_back("MidiPlugin.so");
  63. PLUGINVEC.push_back("ControllerPlugin.so");
  64. PLUGINVEC.push_back("WaveTablePlugin.so");
  65. PLUGINVEC.push_back("OscillatorPlugin.so");
  66. PLUGINVEC.push_back("EnvelopePlugin.so");
  67. PLUGINVEC.push_back("SplitterPlugin.so");
  68. PLUGINVEC.push_back("SampleHoldPlugin.so");
  69. PLUGINVEC.push_back("NoteSnapPlugin.so");
  70. PLUGINVEC.push_back("MixerPlugin.so");
  71. PLUGINVEC.push_back("StereoMixerPlugin.so");
  72. PLUGINVEC.push_back("AmpPlugin.so");
  73. PLUGINVEC.push_back("RingModPlugin.so");
  74. PLUGINVEC.push_back("FilterPlugin.so");
  75. PLUGINVEC.push_back("SVFilterPlugin.so");
  76. PLUGINVEC.push_back("MoogFilterPlugin.so");
  77. PLUGINVEC.push_back("WaveShaperPlugin.so");
  78. PLUGINVEC.push_back("EchoPlugin.so");
  79. PLUGINVEC.push_back("DelayPlugin.so");
  80. PLUGINVEC.push_back("SamplerPlugin.so");
  81. PLUGINVEC.push_back("SeqPlugin.so");
  82. PLUGINVEC.push_back("MatrixPlugin.so");
  83. PLUGINVEC.push_back("SeqSelectorPlugin.so");
  84. PLUGINVEC.push_back("EnvFollowerPlugin.so");
  85. PLUGINVEC.push_back("SmoothPlugin.so");
  86. PLUGINVEC.push_back("LADSPAPlugin.so");
  87. PLUGINVEC.push_back("XFadePlugin.so");
  88. PLUGINVEC.push_back("StreamPlugin.so");
  89. PLUGINVEC.push_back("SpiralLoopPlugin.so");
  90. PLUGINVEC.push_back("PoshSamplerPlugin.so");
  91. PLUGINVEC.push_back("ComplexEnvelopePlugin.so");
  92. PLUGINVEC.push_back("DistributorPlugin.so");
  93. PLUGINVEC.push_back("JoystickPlugin.so");
  94. PLUGINVEC.push_back("LFOPlugin.so");
  95. PLUGINVEC.push_back("MeterPlugin.so");
  96. }
  97. void SpiralSynthModularInfo::StreamInPrefs(istream &s)
  98. {
  99. // call base class
  100. SpiralInfo::StreamInPrefs(s);
  101. char temp[256];
  102. s>>temp>>temp;
  103. s>>temp>>temp>>GUICOL_Tool;
  104. s>>temp>>temp>>GUICOL_Button;
  105. s>>temp>>temp>>GUICOL_Canvas;
  106. s>>temp>>temp>>GUICOL_Device;
  107. s>>temp>>temp>>BGIMG;
  108. s>>temp>>temp>>PLUGIN_PATH;
  109. s>>temp>>temp;
  110. string st;
  111. PLUGINVEC.clear();
  112. while(st!="end" && !s.eof())
  113. {
  114. s>>st;
  115. if (st!="end") PLUGINVEC.push_back(st);
  116. }
  117. }
  118. void SpiralSynthModularInfo::StreamOutPrefs(ostream &s)
  119. {
  120. // call base class
  121. SpiralInfo::StreamOutPrefs(s);
  122. s<<endl<<"SpiralSynthModular Info:"<<endl<<endl;
  123. s<<"ToolBoxColour = "<<GUICOL_Tool<<endl;
  124. s<<"ButtonColour = "<<GUICOL_Button<<endl;
  125. s<<"CanvasColour = "<<GUICOL_Canvas<<endl;
  126. s<<"DeviceColour = "<<GUICOL_Device<<endl;
  127. s<<"BGImagePNG = "<<BGIMG<<endl<<endl;
  128. s<<"PluginPath = "<<PLUGIN_PATH<<endl<<endl;
  129. s<<"PluginList = "<<endl;
  130. for (vector<string>::iterator i=PLUGINVEC.begin();
  131. i!=PLUGINVEC.end(); i++)
  132. {
  133. s<<*i<<endl;
  134. }
  135. s<<"end"<<endl;
  136. }