f@0
|
1 #pragma once
|
f@0
|
2
|
f@0
|
3 #include <string>
|
f@0
|
4 #include <array>
|
f@0
|
5 #include "cinder/Color.h"
|
f@0
|
6 #include "cinder/Xml.h"
|
f@0
|
7
|
f@0
|
8
|
f@0
|
9 class Config
|
f@0
|
10 {
|
f@0
|
11 public:
|
f@0
|
12
|
f@0
|
13 Config();
|
f@0
|
14
|
f@0
|
15 // no copies
|
f@0
|
16 Config( const Config © ) = delete;
|
f@0
|
17 Config & operator=(const Config ©) = delete;
|
f@0
|
18
|
f@0
|
19 /* load values for internal field from configuration file. Throws ci::Exception */
|
f@0
|
20 void loadFromFile( std::string&& path );
|
f@0
|
21
|
f@0
|
22 std::string getInputDeviceKey() const
|
f@0
|
23 {
|
f@0
|
24 return mAudioInputDeviceKey; // Komplete 1/2
|
f@0
|
25 //return "{0.0.1.00000000}.{a043bc8c-1dd1-4c94-82b4-ad8320cac5a5}"; // Komplete 3/4
|
f@0
|
26 //return "{0.0.1.00000000}.{828b681b-cc0c-44e1-93c9-5f1f46f5926f}"; // Realtek
|
f@0
|
27 }
|
f@0
|
28
|
f@0
|
29 std::size_t getNumChunks() const
|
f@0
|
30 {
|
f@0
|
31 return mNumChunks;
|
f@0
|
32 }
|
f@0
|
33
|
f@0
|
34 /* return wave lenght in seconds */
|
f@0
|
35 double getWaveLen() const
|
f@0
|
36 {
|
f@0
|
37 return mWaveLen;
|
f@0
|
38 }
|
f@0
|
39
|
f@0
|
40 ci::Color getWaveSelectionColor(size_t waveIdx) const
|
f@0
|
41 {
|
f@0
|
42 if (waveIdx == 0){
|
f@0
|
43 return cinder::Color(243.0f / 255.0f, 6.0f / 255.0f, 62.0f / 255.0f);
|
f@0
|
44 }
|
f@0
|
45 else{
|
f@0
|
46 return cinder::Color(255.0f / 255.0f, 204.0f / 255.0f, 0.0f / 255.0f);
|
f@0
|
47 }
|
f@0
|
48 }
|
f@0
|
49
|
f@0
|
50 std::size_t getCursorTriggerMessageBufSize() const
|
f@0
|
51 {
|
f@0
|
52 return 512;
|
f@0
|
53 }
|
f@0
|
54
|
f@0
|
55 // returns the index of the wave associated to the MIDI channel passed as argument
|
f@0
|
56 size_t getWaveForMIDIChannel( unsigned char channelIdx )
|
f@0
|
57 {
|
f@0
|
58 return channelIdx;
|
f@0
|
59 /*for ( int i = 0; i < NUM_WAVES; i++ ){
|
f@0
|
60 if ( channelIdx == mMidiChannels[i] )
|
f@0
|
61 return i;
|
f@0
|
62 }*/
|
f@0
|
63 }
|
f@0
|
64
|
f@0
|
65 double getMaxGrainDurationCoeff() const
|
f@0
|
66 {
|
f@0
|
67 return 8.0;
|
f@0
|
68 }
|
f@0
|
69
|
f@0
|
70 double getMaxFilterCutoffFreq() const
|
f@0
|
71 {
|
f@0
|
72 return 22050.;
|
f@0
|
73 }
|
f@0
|
74
|
f@0
|
75 double getMinFilterCutoffFreq() const
|
f@0
|
76 {
|
f@0
|
77 return 200.;
|
f@0
|
78 }
|
f@0
|
79
|
f@0
|
80 size_t getMaxKeyboardVoices() const
|
f@0
|
81 {
|
f@0
|
82 return 6;
|
f@0
|
83 }
|
f@0
|
84
|
f@0
|
85 size_t getMaxSelectionNumChunks() const
|
f@0
|
86 {
|
f@0
|
87 return 37;
|
f@0
|
88 }
|
f@0
|
89
|
f@0
|
90 size_t getOscilloscopeNumPointsDivider() const
|
f@0
|
91 {
|
f@0
|
92 return 4;
|
f@0
|
93 }
|
f@0
|
94
|
f@0
|
95 private:
|
f@0
|
96
|
f@0
|
97 void parseWave( const ci::XmlTree &wave, int id );
|
f@0
|
98
|
f@0
|
99 std::string mAudioInputDeviceKey;
|
f@0
|
100 std::size_t mNumChunks;
|
f@0
|
101 double mWaveLen;
|
f@0
|
102 std::array< size_t, NUM_WAVES > mMidiChannels;
|
f@0
|
103
|
f@0
|
104 };
|