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.

131 lines
3.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. string SpiralInfo::LOCALE = "EN";
  22. int SpiralInfo::BUFSIZE = 512;
  23. int SpiralInfo::FRAGSIZE = 256;
  24. int SpiralInfo::FRAGCOUNT = 8;
  25. int SpiralInfo::SAMPLERATE = 44100;
  26. long SpiralInfo::MAXSAMPLE = 32767;
  27. float SpiralInfo::VALUECONV = 1.0f/MAXSAMPLE;
  28. bool SpiralInfo::WANTMIDI = false;
  29. int SpiralInfo::FILTERGRAN = 50;
  30. string SpiralInfo::OUTPUTFILE = "/dev/dsp";
  31. string SpiralInfo::MIDIFILE = "/dev/midi";
  32. int SpiralInfo::POLY = 1;
  33. bool SpiralInfo::USEPLUGINLIST = false;
  34. unsigned SpiralInfo::GUI_COLOUR = 179;
  35. unsigned SpiralInfo::SCOPE_BG_COLOUR = fl_rgb_color (20, 60, 20);
  36. unsigned SpiralInfo::SCOPE_FG_COLOUR = fl_rgb_color (100, 200, 100);
  37. unsigned SpiralInfo::SCOPE_SEL_COLOUR = FL_WHITE;
  38. unsigned SpiralInfo::SCOPE_IND_COLOUR = fl_rgb_color (203, 255, 0);
  39. unsigned SpiralInfo::SCOPE_MRK_COLOUR = fl_rgb_color (155, 155, 50);
  40. /*int SpiralSynthModularInfo::GUICOL_Tool=179;
  41. int SpiralSynthModularInfo::GUICOL_Button=181;
  42. int SpiralSynthModularInfo::GUICOL_Canvas=181;
  43. int SpiralSynthModularInfo::GUICOL_Device=181;
  44. int SpiralSynthModularInfo::GUIDEVICE_Box=30;*/
  45. int SpiralSynthModularInfo::GUICOL_Tool=48;
  46. int SpiralSynthModularInfo::GUICOL_Button=42;
  47. int SpiralSynthModularInfo::GUICOL_Canvas=50;
  48. int SpiralSynthModularInfo::GUICOL_Device=52;
  49. int SpiralSynthModularInfo::GUIDEVICE_Box=30;
  50. vector<string> SpiralSynthModularInfo::PLUGINVEC;
  51. string SpiralSynthModularInfo::PLUGIN_PATH;
  52. SpiralSynthModularInfo* SpiralSynthModularInfo::m_SpiralSynthModularInfo=NULL;
  53. SpiralSynthModularInfo* SpiralSynthModularInfo::Get()
  54. {
  55. if (!m_SpiralSynthModularInfo)
  56. {
  57. m_SpiralSynthModularInfo = new SpiralSynthModularInfo;
  58. }
  59. return m_SpiralSynthModularInfo;
  60. }
  61. SpiralSynthModularInfo::SpiralSynthModularInfo()
  62. {
  63. PLUGIN_PATH = PLUGIN_PATH_LOCATION;
  64. }
  65. void SpiralSynthModularInfo::StreamInPrefs(istream &s)
  66. {
  67. // call base class
  68. SpiralInfo::StreamInPrefs(s);
  69. char temp[256];
  70. s>>temp>>temp;
  71. s>>temp>>temp>>GUICOL_Tool;
  72. s>>temp>>temp>>GUICOL_Button;
  73. s>>temp>>temp>>GUICOL_Canvas;
  74. s>>temp>>temp>>GUICOL_Device;
  75. s>>temp>>temp>>GUIDEVICE_Box;
  76. s>>temp>>temp>>PLUGIN_PATH;
  77. s>>temp>>temp;
  78. string st;
  79. PLUGINVEC.clear();
  80. if (USEPLUGINLIST)
  81. {
  82. while(st!="end" && !s.eof())
  83. {
  84. s>>st;
  85. if (st!="end") PLUGINVEC.push_back(st);
  86. }
  87. }
  88. #if __APPLE__
  89. // ignore custom paths, plugins are encapsulated in the app anyway
  90. // this prevents the program to fail if the user move the application icon
  91. PLUGIN_PATH = PLUGIN_PATH_LOCATION;
  92. #endif
  93. }
  94. void SpiralSynthModularInfo::StreamOutPrefs(ostream &s)
  95. {
  96. // call base class
  97. SpiralInfo::StreamOutPrefs(s);
  98. s<<endl<<"SpiralSynthModular Info:"<<endl<<endl;
  99. s<<"ToolBoxColour = "<<GUICOL_Tool<<endl;
  100. s<<"ButtonColour = "<<GUICOL_Button<<endl;
  101. s<<"CanvasColour = "<<GUICOL_Canvas<<endl;
  102. s<<"DeviceColour = "<<GUICOL_Device<<endl;
  103. s<<"DeviceBoxType = "<<GUIDEVICE_Box<<endl<<endl;
  104. s<<"PluginPath = "<<PLUGIN_PATH<<endl<<endl;
  105. s<<"PluginList = "<<endl;
  106. for (vector<string>::iterator i=PLUGINVEC.begin();
  107. i!=PLUGINVEC.end(); i++)
  108. {
  109. s<<*i<<endl;
  110. }
  111. s<<"end"<<endl;
  112. }