1 /* SpiralSpiral 2 * Copyleft (C) 2000 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 19 #include <iostream> 20 #include <string> 21 #include <stdlib.h> 22 using namespace std; 23 24 #ifndef SpiralINFO 25 #define SpiralINFO 26 27 // todo: better place for these util funcs 28 float RandFloat(float s=0.0f, float e=1.0f); 29 // make a buffer class with operators 30 void CopyBuffer(short *from, short *to); 31 32 class SpiralInfo 33 { 34 public: 35 36 static SpiralInfo* Get(); 37 void LoadPrefs(); 38 void SavePrefs(); 39 40 static int BUFSIZE; 41 static int SAMPLERATE; 42 static long MAXSAMPLE; 43 static float VALUECONV; 44 static bool WANTMIDI; 45 static int FILTERGRAN; 46 static string OUTPUTFILE; 47 static string MIDIFILE; 48 static int POLY; 49 static bool REALTIMEOUT; 50 static string KEYMAP; 51 static int NKEYS; 52 53 static int GUI_COLOUR; 54 static int GUIBG_COLOUR; 55 GetHomeDir()56 string GetHomeDir() {return m_HomeDir;} 57 58 protected: 59 SpiralInfo()60 SpiralInfo() : m_HomeDir(getenv("HOME")) {} ~SpiralInfo()61 ~SpiralInfo() {} 62 63 string m_HomeDir; 64 65 static SpiralInfo *m_SpiralInfo; 66 }; 67 68 #endif 69