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.

Config.h 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. */
  11. #ifndef CONFIG_H
  12. #define CONFIG_H
  13. #include <string>
  14. #define MAX_STRING_SIZE 4000
  15. #define MAX_BANK_ROOT_DIRS 100
  16. namespace rtosc
  17. {
  18. struct Ports;
  19. }
  20. namespace zyncarla {
  21. class oss_devs_t
  22. {
  23. public:
  24. char *linux_wave_out, *linux_seq_in;
  25. };
  26. /**Configuration file functions*/
  27. class Config
  28. {
  29. public:
  30. Config();
  31. Config(const Config& ) = delete;
  32. ~Config();
  33. struct {
  34. oss_devs_t oss_devs;
  35. int SampleRate, SoundBufferSize, OscilSize, SwapStereo;
  36. int WindowsWaveOutId, WindowsMidiInId;
  37. int BankUIAutoClose;
  38. int GzipCompression;
  39. int Interpolation;
  40. std::string bankRootDirList[MAX_BANK_ROOT_DIRS], currentBankDir;
  41. std::string presetsDirList[MAX_BANK_ROOT_DIRS];
  42. std::string favoriteList[MAX_BANK_ROOT_DIRS];
  43. int CheckPADsynth;
  44. int IgnoreProgramChange;
  45. int UserInterfaceMode;
  46. int VirKeybLayout;
  47. std::string LinuxALSAaudioDev;
  48. std::string nameTag;
  49. } cfg;
  50. int winwavemax, winmidimax; //number of wave/midi devices on Windows
  51. int maxstringsize;
  52. struct winmidionedevice {
  53. char *name;
  54. };
  55. winmidionedevice *winmididevices;
  56. void clearbankrootdirlist();
  57. void clearpresetsdirlist();
  58. void init();
  59. void save() const;
  60. static const rtosc::Ports &ports;
  61. private:
  62. void readConfig(const char *filename);
  63. void saveConfig(const char *filename) const;
  64. void getConfigFileName(char *name, int namesize) const;
  65. };
  66. }
  67. #endif