Audio plugin host https://kx.studio/carla
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.

85 lines
2.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Config.h - Configuration file functions
  4. Copyright (C) 2003-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  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 (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef CONFIG_H
  18. #define CONFIG_H
  19. #include <string>
  20. #define MAX_STRING_SIZE 4000
  21. #define MAX_BANK_ROOT_DIRS 100
  22. namespace rtosc
  23. {
  24. struct Ports;
  25. }
  26. class oss_devs_t
  27. {
  28. public:
  29. char *linux_wave_out, *linux_seq_in;
  30. };
  31. /**Configuration file functions*/
  32. class Config
  33. {
  34. public:
  35. Config();
  36. Config(const Config& ) = delete;
  37. ~Config();
  38. struct {
  39. oss_devs_t oss_devs;
  40. int SampleRate, SoundBufferSize, OscilSize, SwapStereo;
  41. int WindowsWaveOutId, WindowsMidiInId;
  42. int BankUIAutoClose;
  43. int GzipCompression;
  44. int Interpolation;
  45. std::string bankRootDirList[MAX_BANK_ROOT_DIRS], currentBankDir;
  46. std::string presetsDirList[MAX_BANK_ROOT_DIRS];
  47. int CheckPADsynth;
  48. int IgnoreProgramChange;
  49. int UserInterfaceMode;
  50. int VirKeybLayout;
  51. std::string LinuxALSAaudioDev;
  52. std::string nameTag;
  53. } cfg;
  54. int winwavemax, winmidimax; //number of wave/midi devices on Windows
  55. int maxstringsize;
  56. struct winmidionedevice {
  57. char *name;
  58. };
  59. winmidionedevice *winmididevices;
  60. void clearbankrootdirlist();
  61. void clearpresetsdirlist();
  62. void init();
  63. void save() const;
  64. static const rtosc::Ports &ports;
  65. private:
  66. void readConfig(const char *filename);
  67. void saveConfig(const char *filename) const;
  68. void getConfigFileName(char *name, int namesize) const;
  69. };
  70. #endif