zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

Config.h (2221B)


      1 /*
      2   ZynAddSubFX - a software synthesizer
      3 
      4   Config.h - Configuration file functions
      5   Copyright (C) 2003-2005 Nasca Octavian Paul
      6   Author: Nasca Octavian Paul
      7 
      8   This program is free software; you can redistribute it and/or
      9   modify it under the terms of the GNU General Public License
     10   as published by the Free Software Foundation; either version 2
     11   of the License, or (at your option) any later version.
     12 */
     13 
     14 #ifndef CONFIG_H
     15 #define CONFIG_H
     16 
     17 #include <string>
     18 #define MAX_STRING_SIZE 4000
     19 #define MAX_BANK_ROOT_DIRS 100
     20 
     21 namespace rtosc
     22 {
     23     struct Ports;
     24 }
     25 
     26 namespace zyn {
     27 
     28 class oss_devs_t
     29 {
     30     public:
     31         char *linux_wave_out, *linux_seq_in;
     32 };
     33 
     34 /**Configuration file functions*/
     35 class Config
     36 {
     37     public:
     38         Config();
     39         Config(const Config& ) = delete;
     40         ~Config();
     41 
     42         struct {
     43             oss_devs_t oss_devs;
     44             int   SampleRate, SoundBufferSize, OscilSize, SwapStereo;
     45             bool  AudioOutputCompressor;
     46             int   WindowsWaveOutId, WindowsMidiInId;
     47             int   BankUIAutoClose;
     48             int   GzipCompression;
     49             int   Interpolation;
     50             int   SaveFullXml; // when saving to a file save entire tree including disabled parts (Zynmuse)
     51             std::string bankRootDirList[MAX_BANK_ROOT_DIRS], currentBankDir;
     52             std::string presetsDirList[MAX_BANK_ROOT_DIRS];
     53             std::string favoriteList[MAX_BANK_ROOT_DIRS];
     54             int CheckPADsynth;
     55             int IgnoreProgramChange;
     56             int UserInterfaceMode;
     57             int VirKeybLayout;
     58             std::string LinuxALSAaudioDev;
     59             std::string nameTag;
     60         } cfg;
     61         int winwavemax, winmidimax; //number of wave/midi devices on Windows
     62         int maxstringsize;
     63 
     64         struct winmidionedevice {
     65             char *name;
     66         };
     67         winmidionedevice *winmididevices;
     68 
     69         void clearbankrootdirlist();
     70         void clearpresetsdirlist();
     71         void init();
     72         void save() const;
     73 
     74         static const rtosc::Ports &ports;
     75     private:
     76         void readConfig(const char *filename);
     77         void saveConfig(const char *filename) const;
     78         void getConfigFileName(char *name, int namesize) const;
     79 };
     80 
     81 }
     82 
     83 #endif