f@0: #pragma once f@0: f@0: #include f@0: #include f@0: #include "cinder/Color.h" f@0: #include "cinder/Xml.h" f@0: f@0: f@0: class Config f@0: { f@0: public: f@0: f@0: Config(); f@0: f@0: // no copies f@0: Config( const Config © ) = delete; f@0: Config & operator=(const Config ©) = delete; f@0: f@0: /* load values for internal field from configuration file. Throws ci::Exception */ f@0: void loadFromFile( std::string&& path ); f@0: f@0: std::string getInputDeviceKey() const f@0: { f@0: return mAudioInputDeviceKey; // Komplete 1/2 f@0: //return "{0.0.1.00000000}.{a043bc8c-1dd1-4c94-82b4-ad8320cac5a5}"; // Komplete 3/4 f@0: //return "{0.0.1.00000000}.{828b681b-cc0c-44e1-93c9-5f1f46f5926f}"; // Realtek f@0: } f@0: f@0: std::size_t getNumChunks() const f@0: { f@0: return mNumChunks; f@0: } f@0: f@0: /* return wave lenght in seconds */ f@0: double getWaveLen() const f@0: { f@0: return mWaveLen; f@0: } f@0: f@0: ci::Color getWaveSelectionColor(size_t waveIdx) const f@0: { f@0: if (waveIdx == 0){ f@0: return cinder::Color(243.0f / 255.0f, 6.0f / 255.0f, 62.0f / 255.0f); f@0: } f@0: else{ f@0: return cinder::Color(255.0f / 255.0f, 204.0f / 255.0f, 0.0f / 255.0f); f@0: } f@0: } f@0: f@0: std::size_t getCursorTriggerMessageBufSize() const f@0: { f@0: return 512; f@0: } f@0: f@0: // returns the index of the wave associated to the MIDI channel passed as argument f@0: size_t getWaveForMIDIChannel( unsigned char channelIdx ) f@0: { f@0: return channelIdx; f@0: /*for ( int i = 0; i < NUM_WAVES; i++ ){ f@0: if ( channelIdx == mMidiChannels[i] ) f@0: return i; f@0: }*/ f@0: } f@0: f@0: double getMaxGrainDurationCoeff() const f@0: { f@0: return 8.0; f@0: } f@0: f@0: double getMaxFilterCutoffFreq() const f@0: { f@0: return 22050.; f@0: } f@0: f@0: double getMinFilterCutoffFreq() const f@0: { f@0: return 200.; f@0: } f@0: f@0: size_t getMaxKeyboardVoices() const f@0: { f@0: return 6; f@0: } f@0: f@0: size_t getMaxSelectionNumChunks() const f@0: { f@0: return 37; f@0: } f@0: f@0: size_t getOscilloscopeNumPointsDivider() const f@0: { f@0: return 4; f@0: } f@0: f@0: private: f@0: f@0: void parseWave( const ci::XmlTree &wave, int id ); f@0: f@0: std::string mAudioInputDeviceKey; f@0: std::size_t mNumChunks; f@0: double mWaveLen; f@0: std::array< size_t, NUM_WAVES > mMidiChannels; f@0: f@0: };