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.

147 lines
4.5KB

  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("EchoPlugin.so");
  78. PLUGINVEC.push_back("DelayPlugin.so");
  79. PLUGINVEC.push_back("MatrixPlugin.so");
  80. PLUGINVEC.push_back("EnvFollowerPlugin.so");
  81. PLUGINVEC.push_back("SmoothPlugin.so");
  82. PLUGINVEC.push_back("LADSPAPlugin.so");
  83. PLUGINVEC.push_back("XFadePlugin.so");
  84. PLUGINVEC.push_back("DistributorPlugin.so");
  85. PLUGINVEC.push_back("LFOPlugin.so");
  86. }
  87. void SpiralSynthModularInfo::StreamInPrefs(istream &s)
  88. {
  89. // call base class
  90. SpiralInfo::StreamInPrefs(s);
  91. char temp[256];
  92. s>>temp>>temp;
  93. s>>temp>>temp>>GUICOL_Tool;
  94. s>>temp>>temp>>GUICOL_Button;
  95. s>>temp>>temp>>GUICOL_Canvas;
  96. s>>temp>>temp>>GUICOL_Device;
  97. s>>temp>>temp>>BGIMG;
  98. s>>temp>>temp>>PLUGIN_PATH;
  99. s>>temp>>temp;
  100. string st;
  101. PLUGINVEC.clear();
  102. while(st!="end" && !s.eof())
  103. {
  104. s>>st;
  105. if (st!="end") PLUGINVEC.push_back(st);
  106. }
  107. }
  108. void SpiralSynthModularInfo::StreamOutPrefs(ostream &s)
  109. {
  110. // call base class
  111. SpiralInfo::StreamOutPrefs(s);
  112. s<<endl<<"SpiralSynthModular Info:"<<endl<<endl;
  113. s<<"ToolBoxColour = "<<GUICOL_Tool<<endl;
  114. s<<"ButtonColour = "<<GUICOL_Button<<endl;
  115. s<<"CanvasColour = "<<GUICOL_Canvas<<endl;
  116. s<<"DeviceColour = "<<GUICOL_Device<<endl;
  117. s<<"BGImagePNG = "<<BGIMG<<endl<<endl;
  118. s<<"PluginPath = "<<PLUGIN_PATH<<endl<<endl;
  119. s<<"PluginList = "<<endl;
  120. for (vector<string>::iterator i=PLUGINVEC.begin();
  121. i!=PLUGINVEC.end(); i++)
  122. {
  123. s<<*i<<endl;
  124. }
  125. s<<"end"<<endl;
  126. }