-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.h
90 lines (61 loc) · 1.95 KB
/
Settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QObject>
#include <QSize>
#include <QList>
#define SETTINGS_INIT_WITH_AUDIO true
#define SETTINGS_INIT_WITH_MIDI_IN false
#define SETTINGS_INIT_WITH_MIDI_OUT false
#define SETTINGS_START_WITH_FULL_SCREEN true
#define SETTINGS_NUMBER_OF_SUBCHANNELS 64
class Settings
{
public:
static Settings &Instance()
{
static Settings instance;
return instance;
}
int getNumberOfSubchannels(void);
int getSubchannelId(int pos);
int getSubchannelPos(int id);
int getChannelId(int pos);
int getChannelPos(int id);
QList<QString> getFavouriteMidiDeviceList(void);
QString getConnectedMidiDeviceName(void);
void setConnectedMidiDeviceName(QString name);
QString getConnectedMidiDevicePort(void);
void setConnectedMidiDevicePort(QString port);
bool initWithAudio(void);
bool initWithHwMidiIn(void);
bool initWithHwMidiOut(void);
QString getPageName(int key);
int getNumberOfPages(void);
void setScreenSize(QRect screen);
QSize getScreenSize(void);
bool startWithFullScreen(void);
protected:
Settings();
Settings(const Settings& other)
{
Q_UNUSED(other);
}
~Settings();
private:
/** sub/channels **/
QMap<int, int> *m_subchannelMap;
void loadSubchannelMap(void);
QMap<int, int> *m_channelMap;
void loadChannelMap(void);
QMap<int, QString> *m_pageMap;
QSize m_screenSize;
bool m_startWithFullScreen;
/** midi **/
QList <QString> m_midiFavList;
QString m_connectedMidiDeviceName;
QString m_connectedMidiDevicePort;
int m_numberOfSubchannels;
void loadPageIdMap(void);
};
inline Settings& settings() { return Settings::Instance(); }
#endif // SETTINGS_H