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.

124 lines
3.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. 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. //int SpiralInfo::GUI_COLOUR = 139;
  35. //int SpiralInfo::GUIBG_COLOUR = 0;
  36. //int SpiralInfo::GUIBG2_COLOUR = 49;//45;
  37. int SpiralSynthModularInfo::GUICOL_Tool=179;
  38. int SpiralSynthModularInfo::GUICOL_Button=181;
  39. int SpiralSynthModularInfo::GUICOL_Canvas=181;
  40. int SpiralSynthModularInfo::GUICOL_Device=181;
  41. string SpiralSynthModularInfo::BGIMG;
  42. vector<string> SpiralSynthModularInfo::PLUGINVEC;
  43. string SpiralSynthModularInfo::PLUGIN_PATH;
  44. SpiralSynthModularInfo* SpiralSynthModularInfo::m_SpiralSynthModularInfo=NULL;
  45. SpiralSynthModularInfo* SpiralSynthModularInfo::Get()
  46. {
  47. if (!m_SpiralSynthModularInfo)
  48. {
  49. m_SpiralSynthModularInfo = new SpiralSynthModularInfo;
  50. }
  51. return m_SpiralSynthModularInfo;
  52. }
  53. SpiralSynthModularInfo::SpiralSynthModularInfo()
  54. {
  55. BGIMG="None";
  56. PLUGIN_PATH = PLUGIN_PATH_LOCATION;
  57. }
  58. void SpiralSynthModularInfo::StreamInPrefs(istream &s)
  59. {
  60. // call base class
  61. SpiralInfo::StreamInPrefs(s);
  62. char temp[256];
  63. s>>temp>>temp;
  64. s>>temp>>temp>>GUICOL_Tool;
  65. s>>temp>>temp>>GUICOL_Button;
  66. s>>temp>>temp>>GUICOL_Canvas;
  67. s>>temp>>temp>>GUICOL_Device;
  68. s>>temp>>temp>>BGIMG;
  69. s>>temp>>temp>>PLUGIN_PATH;
  70. s>>temp>>temp;
  71. string st;
  72. PLUGINVEC.clear();
  73. if (USEPLUGINLIST)
  74. {
  75. while(st!="end" && !s.eof())
  76. {
  77. s>>st;
  78. if (st!="end") PLUGINVEC.push_back(st);
  79. }
  80. }
  81. #if __APPLE__
  82. // ignore custom paths, plugins are encapsulated in the app anyway
  83. // this prevents the program to fail if the user move the application icon
  84. PLUGIN_PATH = PLUGIN_PATH_LOCATION;
  85. #endif
  86. }
  87. void SpiralSynthModularInfo::StreamOutPrefs(ostream &s)
  88. {
  89. // call base class
  90. SpiralInfo::StreamOutPrefs(s);
  91. s<<endl<<"SpiralSynthModular Info:"<<endl<<endl;
  92. s<<"ToolBoxColour = "<<GUICOL_Tool<<endl;
  93. s<<"ButtonColour = "<<GUICOL_Button<<endl;
  94. s<<"CanvasColour = "<<GUICOL_Canvas<<endl;
  95. s<<"DeviceColour = "<<GUICOL_Device<<endl;
  96. s<<"BGImagePNG = "<<BGIMG<<endl<<endl;
  97. s<<"PluginPath = "<<PLUGIN_PATH<<endl<<endl;
  98. s<<"PluginList = "<<endl;
  99. for (vector<string>::iterator i=PLUGINVEC.begin();
  100. i!=PLUGINVEC.end(); i++)
  101. {
  102. s<<*i<<endl;
  103. }
  104. s<<"end"<<endl;
  105. }