diff options
author | Robert Jonsson <spamatica@gmail.com> | 2010-07-15 21:07:16 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2010-07-15 21:07:16 +0000 |
commit | 296d5ed159e36041cd863563c1f53ed812e719da (patch) | |
tree | 382713f5240fadc9bf4356f0020495c1bc6ca510 | |
parent | b2c20164e33a20c600a60dc1f21464c6a13e4afe (diff) |
volume for audio metronome
-rw-r--r-- | muse/ChangeLog | 2 | ||||
-rw-r--r-- | muse/muse/conf.cpp | 3 | ||||
-rw-r--r-- | muse/muse/globals.cpp | 2 | ||||
-rw-r--r-- | muse/muse/widgets/metronome.cpp | 10 | ||||
-rw-r--r-- | muse/muse/widgets/metronome.h | 1 | ||||
-rw-r--r-- | muse/muse/widgets/metronomebase.ui | 507 |
6 files changed, 305 insertions, 220 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog index d65eb8da..d829a6e4 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,5 @@ +15.07.2010 + * Added: Volume control for audio metronome (rj) 12.07.2010 * Fixed: When wave files were edited allocation was on stack which caused crashes for larger selections, now done on heap (rj) * Added: Print svn version in -v and About box. (rj) diff --git a/muse/muse/conf.cpp b/muse/muse/conf.cpp index 983c58f7..fa11d440 100644 --- a/muse/muse/conf.cpp +++ b/muse/muse/conf.cpp @@ -416,6 +416,8 @@ static void loadConfigMetronom(Xml& xml) midiClickFlag = xml.parseInt(); else if (tag == "audioClickEnable") audioClickFlag = xml.parseInt(); + else if (tag == "audioClickVolume") + audioClickVolume = xml.parseFloat(); else xml.unknown("Metronome"); break; @@ -932,6 +934,7 @@ static void writeSeqConfiguration(int level, Xml& xml, bool writePortInfo) xml.intTag(level, "preroll", precountPreroll); xml.intTag(level, "midiClickEnable", midiClickFlag); xml.intTag(level, "audioClickEnable", audioClickFlag); + xml.floatTag(level, "audioClickVolume", audioClickVolume); xml.tag(level--, "/metronom"); xml.intTag(level, "rcEnable", rcEnable); diff --git a/muse/muse/globals.cpp b/muse/muse/globals.cpp index 9c48826f..0c6c1dfa 100644 --- a/muse/muse/globals.cpp +++ b/muse/muse/globals.cpp @@ -330,7 +330,7 @@ bool precountPrerecord = false; bool precountPreroll = false; bool midiClickFlag = true; bool audioClickFlag = true; -float audioClickVolume = 0.1f; +float audioClickVolume = 0.5f; bool rcEnable = false; unsigned char rcStopNote = 28; diff --git a/muse/muse/widgets/metronome.cpp b/muse/muse/widgets/metronome.cpp index 988805f5..5de57ee3 100644 --- a/muse/muse/widgets/metronome.cpp +++ b/muse/muse/widgets/metronome.cpp @@ -30,7 +30,8 @@ MetronomeConfig::MetronomeConfig(QWidget* parent, const char* name) connect(precountFromMastertrack, SIGNAL(toggled(bool)), SLOT(precountFromMastertrackChanged(bool))); connect(audioBeepRoutesButton, SIGNAL(clicked()), SLOT(audioBeepRoutesClicked())); - + connect(volumeSlider, SIGNAL(valueChanged(int)), SLOT(beepVolumeChanged(int))); + measureNote->setValue(measureClickNote); measureVelocity->setValue(measureClickVelo); beatNote->setValue(beatClickNote); @@ -126,6 +127,7 @@ void MetronomeConfig::apply() ::precountPreroll = precountPreroll->isChecked(); midiClickFlag = midiClick->isChecked(); audioClickFlag = audioBeep->isChecked(); + //audioVolumeChanged = volumeSlider->value(); } //--------------------------------------------------------- @@ -165,4 +167,8 @@ void MetronomeConfig::precountFromMastertrackChanged(bool flag) precountSigN->setEnabled(!flag); } - +void MetronomeConfig::beepVolumeChanged(int volume) + { + // this value is directly applied, not using th Apply button, it just seems more usable this way. + audioClickVolume=volume/100.0; + } diff --git a/muse/muse/widgets/metronome.h b/muse/muse/widgets/metronome.h index 03b7b0c2..200d1875 100644 --- a/muse/muse/widgets/metronome.h +++ b/muse/muse/widgets/metronome.h @@ -26,6 +26,7 @@ class MetronomeConfig : public MetronomeConfigBase { void midiClickChanged(bool); void precountEnableChanged(bool); void precountFromMastertrackChanged(bool); + void beepVolumeChanged(int); public: MetronomeConfig(QWidget* parent, const char* name = 0); diff --git a/muse/muse/widgets/metronomebase.ui b/muse/muse/widgets/metronomebase.ui index 9e50ae41..31e6597a 100644 --- a/muse/muse/widgets/metronomebase.ui +++ b/muse/muse/widgets/metronomebase.ui @@ -1,4 +1,4 @@ -<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>MetronomeConfigBase</class> <widget class="QDialog"> <property name="name"> @@ -8,8 +8,8 @@ <rect> <x>0</x> <y>0</y> - <width>508</width> - <height>352</height> + <width>517</width> + <height>347</height> </rect> </property> <property name="caption"> @@ -18,7 +18,7 @@ <property name="sizeGripEnabled"> <bool>true</bool> </property> - <vbox> + <grid> <property name="name"> <cstring>unnamed</cstring> </property> @@ -28,28 +28,22 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget"> + <widget class="QLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>Layout12</cstring> + <cstring>layout20</cstring> </property> - <hbox> + <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="QGroupBox"> + <widget class="QGroupBox" row="0" column="0"> <property name="name"> <cstring>GroupBox1</cstring> </property> <property name="title"> <string>Metronome</string> </property> - <vbox> + <grid> <property name="name"> <cstring>unnamed</cstring> </property> @@ -59,191 +53,253 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget"> - <property name="name"> - <cstring>audioBeepLayout</cstring> - </property> - <hbox> - <widget class="QCheckBox"> - <property name="name"> - <cstring>audioBeep</cstring> - </property> - <property name="text"> - <string>Audio Beep</string> - </property> - </widget> - <widget class="QPushButton"> - <property name="name"> - <cstring>audioBeepRoutesButton</cstring> - </property> - <property name="text"> - <string>Choose outputs...</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - </widget> - </hbox> - </widget> - <widget class="QCheckBox"> + <widget class="QLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>midiClick</cstring> + <cstring>layout18</cstring> </property> - <property name="text"> - <string>MIDI Click</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - <widget class="QLayoutWidget"> - <property name="name"> - <cstring>Layout11</cstring> - </property> - <hbox> + <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> <widget class="QLayoutWidget"> <property name="name"> - <cstring>Layout10</cstring> + <cstring>audioBeepLayout</cstring> </property> - <grid> + <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <widget class="QLabel" row="4" column="1"> + <widget class="QCheckBox"> <property name="name"> - <cstring>TextLabel5</cstring> + <cstring>audioBeep</cstring> </property> <property name="text"> - <string>Midi Channel</string> + <string>Audio Beep</string> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="QPushButton"> <property name="name"> - <cstring>TextLabel1</cstring> + <cstring>audioBeepRoutesButton</cstring> </property> <property name="text"> - <string>Measure Note</string> - </property> - </widget> - <widget class="QSpinBox" row="4" column="0"> - <property name="name"> - <cstring>midiChannel</cstring> - </property> - <property name="maxValue"> - <number>16</number> + <string>Choose outputs...</string> </property> - <property name="minValue"> - <number>1</number> + <property name="autoDefault"> + <bool>true</bool> </property> </widget> - <widget class="QLabel" row="1" column="1"> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout17</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QSlider"> <property name="name"> - <cstring>TextLabel2</cstring> + <cstring>volumeSlider</cstring> </property> - <property name="text"> - <string>Measure Velocity</string> + <property name="minValue"> + <number>0</number> </property> - </widget> - <widget class="QLabel" row="3" column="1"> - <property name="name"> - <cstring>TextLabel4</cstring> + <property name="maxValue"> + <number>100</number> </property> - <property name="text"> - <string>Beat Velocity</string> + <property name="lineStep"> + <number>1</number> </property> - </widget> - <widget class="QSpinBox" row="5" column="0"> - <property name="name"> - <cstring>midiPort</cstring> + <property name="pageStep"> + <number>10</number> </property> - <property name="maxValue"> - <number>16</number> + <property name="value"> + <number>50</number> </property> - <property name="minValue"> - <number>1</number> + <property name="orientation"> + <enum>Horizontal</enum> </property> </widget> - <widget class="QLabel" row="2" column="1"> + <widget class="QLabel"> <property name="name"> - <cstring>TextLabel3</cstring> + <cstring>volumeLabel</cstring> </property> <property name="text"> - <string>Beat Note</string> - </property> - </widget> - <widget class="QSpinBox" row="2" column="0"> - <property name="name"> - <cstring>beatNote</cstring> + <string>50</string> </property> </widget> - <widget class="QSpinBox" row="1" column="0"> + <widget class="QLabel"> <property name="name"> - <cstring>measureVelocity</cstring> + <cstring>textLabel1</cstring> </property> - <property name="maxValue"> - <number>127</number> + <property name="text"> + <string>% Audio volume</string> </property> </widget> - <widget class="QSpinBox" row="0" column="0"> + </hbox> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>midiClick</cstring> + </property> + <property name="text"> + <string>MIDI Click</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout11</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget"> <property name="name"> - <cstring>measureNote</cstring> + <cstring>Layout10</cstring> </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="4" column="1"> + <property name="name"> + <cstring>TextLabel5</cstring> + </property> + <property name="text"> + <string>Midi Channel</string> + </property> + </widget> + <widget class="QLabel" row="0" column="1"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Measure Note</string> + </property> + </widget> + <widget class="QSpinBox" row="4" column="0"> + <property name="name"> + <cstring>midiChannel</cstring> + </property> + <property name="maxValue"> + <number>16</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + </widget> + <widget class="QLabel" row="1" column="1"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>Measure Velocity</string> + </property> + </widget> + <widget class="QLabel" row="3" column="1"> + <property name="name"> + <cstring>TextLabel4</cstring> + </property> + <property name="text"> + <string>Beat Velocity</string> + </property> + </widget> + <widget class="QSpinBox" row="5" column="0"> + <property name="name"> + <cstring>midiPort</cstring> + </property> + <property name="maxValue"> + <number>16</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + </widget> + <widget class="QLabel" row="2" column="1"> + <property name="name"> + <cstring>TextLabel3</cstring> + </property> + <property name="text"> + <string>Beat Note</string> + </property> + </widget> + <widget class="QSpinBox" row="2" column="0"> + <property name="name"> + <cstring>beatNote</cstring> + </property> + </widget> + <widget class="QSpinBox" row="1" column="0"> + <property name="name"> + <cstring>measureVelocity</cstring> + </property> + <property name="maxValue"> + <number>127</number> + </property> + </widget> + <widget class="QSpinBox" row="0" column="0"> + <property name="name"> + <cstring>measureNote</cstring> + </property> + </widget> + <widget class="QLabel" row="5" column="1"> + <property name="name"> + <cstring>TextLabel6</cstring> + </property> + <property name="text"> + <string>Midi Port</string> + </property> + </widget> + <widget class="QSpinBox" row="3" column="0"> + <property name="name"> + <cstring>beatVelocity</cstring> + </property> + <property name="maxValue"> + <number>127</number> + </property> + </widget> + </grid> </widget> - <widget class="QLabel" row="5" column="1"> + <spacer> <property name="name"> - <cstring>TextLabel6</cstring> + <cstring>Spacer10</cstring> </property> - <property name="text"> - <string>Midi Port</string> + <property name="orientation"> + <enum>Horizontal</enum> </property> - </widget> - <widget class="QSpinBox" row="3" column="0"> - <property name="name"> - <cstring>beatVelocity</cstring> + <property name="sizeType"> + <enum>Expanding</enum> </property> - <property name="maxValue"> - <number>127</number> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> </property> - </widget> - </grid> + </spacer> + </hbox> </widget> - <spacer> - <property name="name"> - <cstring>Spacer10</cstring> - </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </hbox> + </vbox> </widget> - </vbox> + </grid> </widget> - <widget class="QGroupBox"> + <widget class="QGroupBox" row="0" column="1"> <property name="name"> <cstring>GroupBox2</cstring> </property> @@ -410,78 +466,89 @@ </widget> </vbox> </widget> - </hbox> - </widget> - <widget class="QLayoutWidget"> - <property name="name"> - <cstring>Layout1</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <spacer> - <property name="name"> - <cstring>Horizontal Spacing2</cstring> - </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - <widget class="QPushButton"> - <property name="name"> - <cstring>buttonApply</cstring> - </property> - <property name="text"> - <string>&Apply</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - </widget> - <widget class="QPushButton"> - <property name="name"> - <cstring>buttonOk</cstring> - </property> - <property name="text"> - <string>&OK</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - <widget class="QPushButton"> + <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>buttonCancel</cstring> - </property> - <property name="text"> - <string>&Cancel</string> - </property> - <property name="autoDefault"> - <bool>true</bool> + <cstring>layout19</cstring> </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Hint: Enable metronome in Transportpanel</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Horizontal Spacing2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>8</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonApply</cstring> + </property> + <property name="text"> + <string>&Apply</string> + </property> + <property name="accel"> + <string>Alt+A</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonOk</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="accel"> + <string>Alt+O</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonCancel</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + <property name="accel"> + <string>Alt+C</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + </widget> + </hbox> </widget> - </hbox> + </grid> </widget> - </vbox> + </grid> </widget> <connections> <connection> @@ -496,6 +563,12 @@ <receiver>MetronomeConfigBase</receiver> <slot>reject()</slot> </connection> + <connection> + <sender>volumeSlider</sender> + <signal>valueChanged(int)</signal> + <receiver>volumeLabel</receiver> + <slot>setNum(int)</slot> + </connection> </connections> <tabstops> <tabstop>audioBeep</tabstop> |