diff options
-rw-r--r-- | muse2/muse/conf.cpp | 3 | ||||
-rw-r--r-- | muse2/muse/gconfig.cpp | 3 | ||||
-rw-r--r-- | muse2/muse/gconfig.h | 10 | ||||
-rw-r--r-- | muse2/muse/midi.cpp | 16 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 4 | ||||
-rw-r--r-- | muse2/muse/widgets/genset.cpp | 13 | ||||
-rw-r--r-- | muse2/muse/widgets/genset.h | 1 | ||||
-rw-r--r-- | muse2/muse/widgets/gensetbase.ui | 59 | ||||
-rw-r--r-- | muse2/muse/widgets/musewidgetsplug.cpp | 3 |
9 files changed, 93 insertions, 19 deletions
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 22259041..8fd2de1d 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -942,6 +942,8 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig MusEGlobal::config.startMode = xml.parseInt(); else if (tag == "startSong") MusEGlobal::config.startSong = xml.parse1(); + else if (tag == "newDrumRecordCondition") + MusEGlobal::config.newDrumRecordCondition = MusECore::newDrumRecordCondition_t(xml.parseInt()); else if (tag == "projectBaseFolder") MusEGlobal::config.projectBaseFolder = xml.parse1(); else if (tag == "projectStoreInFolder") @@ -1268,6 +1270,7 @@ void MusE::writeGlobalConfiguration(int level, MusECore::Xml& xml) const xml.intTag(level, "importMidiSplitParts", MusEGlobal::config.importMidiSplitParts); xml.intTag(level, "startMode", MusEGlobal::config.startMode); xml.strTag(level, "startSong", MusEGlobal::config.startSong); + xml.intTag(level, "newDrumRecordCondition", MusEGlobal::config.newDrumRecordCondition); xml.strTag(level, "projectBaseFolder", MusEGlobal::config.projectBaseFolder); xml.intTag(level, "projectStoreInFolder", MusEGlobal::config.projectStoreInFolder); xml.intTag(level, "useProjectSaveDialog", MusEGlobal::config.useProjectSaveDialog); diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index 8aff870d..df8742e8 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -190,7 +190,8 @@ MusEGui::GlobalConfigValues config = { 64, // minControlProcessPeriod false, // popupsDefaultStayOpen false, // leftMouseButtonCanDecrease - false // rangeMarkerWithoutMMB + false, // rangeMarkerWithoutMMB + MusECore::DONT_REC_MUTED_OR_HIDDEN }; } // namespace MusEGlobal diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index cf205eba..85eecf60 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -34,6 +34,15 @@ namespace MusECore { class Xml; + +enum newDrumRecordCondition_t +{ + REC_ALL = 0, + DONT_REC_HIDDEN = 1, + DONT_REC_MUTED = 2, + DONT_REC_MUTED_OR_HIDDEN = 3 +}; + } namespace MusEGui { @@ -168,6 +177,7 @@ struct GlobalConfigValues { bool popupsDefaultStayOpen; bool leftMouseButtonCanDecrease; bool rangeMarkerWithoutMMB; + MusECore::newDrumRecordCondition_t newDrumRecordCondition; }; } // namespace MusEGui diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp index 0138f1d8..52d6e4f8 100644 --- a/muse2/muse/midi.cpp +++ b/muse2/muse/midi.cpp @@ -257,7 +257,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track, case ME_NOTEON: e.setType(Note); - if (track->type() == Track::DRUM) { //FINDMICHJETZT + if (track->type() == Track::DRUM) { int instr = MusEGlobal::drumInmap[ev.dataA()]; e.setPitch(instr); } @@ -269,7 +269,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track, break; case ME_NOTEOFF: e.setType(Note); - if (track->type() == Track::DRUM) { //FINDMICHJETZT + if (track->type() == Track::DRUM) { int instr = MusEGlobal::drumInmap[ev.dataA()]; e.setPitch(instr); } @@ -980,7 +980,7 @@ void Audio::processMidi() // //Apply drum inkey: - if (track->type() == Track::DRUM) //FINDMICHJETZT does this work? + if (track->type() == Track::DRUM) { int pitch = event.dataA(); //Map note that is played according to MusEGlobal::drumInmap @@ -991,9 +991,17 @@ void Audio::processMidi() event.setA(MusEGlobal::drumMap[(unsigned int)MusEGlobal::drumInmap[pitch]].anote); event.setChannel(channel); } - else if (track->type() == Track::NEW_DRUM) + else if (track->type() == Track::NEW_DRUM) //FINDMICH DOES THAT WORK? { event.setA(track->map_drum_in(event.dataA())); + + if (MusEGlobal::config.newDrumRecordCondition & MusECore::DONT_REC_HIDDEN && + track->drummap_hidden()[event.dataA()] ) + continue; // skip that event, proceed with the next + + if (MusEGlobal::config.newDrumRecordCondition & MusECore::DONT_REC_MUTED && + track->drummap()[event.dataA()].mute ) + continue; // skip that event, proceed with the next } else { //Track transpose if non-drum diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 2b391461..93a24129 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4594,9 +4594,9 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo * from clipboard failed. ignoring this one... ) [ not reproducible ] * * CURRENT TODO - * o don't record muted/hidden instr.s - * o offer menu entry for hiding all unused / empty drum instruments + * x offer menu entry for hiding all unused / empty drum instruments * o my record flag handling + * x don't record muted/hidden instr.s * * o in appearance.cpp: add the new stuff for drumTrackLabelBg and drumTrackBg * o find and fix FINDMICHJETZT diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp index d7642b3b..dd91e9ec 100644 --- a/muse2/muse/widgets/genset.cpp +++ b/muse2/muse/widgets/genset.cpp @@ -61,6 +61,13 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent) startSongGroup->addButton(startLastButton, 0); startSongGroup->addButton(startEmptyButton, 1); startSongGroup->addButton(startSongButton, 2); + + recDrumGroup = new QButtonGroup(this); + recDrumGroup->addButton(recordAllButton, MusECore::REC_ALL); + recDrumGroup->addButton(dontRecHiddenButton, MusECore::DONT_REC_HIDDEN); + recDrumGroup->addButton(dontRecMutedButton, MusECore::DONT_REC_MUTED); + recDrumGroup->addButton(dontRecBothButton, MusECore::DONT_REC_MUTED_OR_HIDDEN); + for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) { if (rtcResolutions[i] == MusEGlobal::config.rtcTicks) { rtcResolutionSelect->setCurrentIndex(i); @@ -123,6 +130,8 @@ Shorter periods are desirable.</string> startSongEntry->setText(MusEGlobal::config.startSong); startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true); + recDrumGroup->button(MusEGlobal::config.newDrumRecordCondition)->setChecked(true); + showTransport->setChecked(MusEGlobal::config.transportVisible); showBigtime->setChecked(MusEGlobal::config.bigTimeVisible); //showMixer->setChecked(MusEGlobal::config.mixerVisible); @@ -261,6 +270,8 @@ void GlobalSettingsConfig::updateSettings() startSongEntry->setText(MusEGlobal::config.startSong); startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true); + recDrumGroup->button(MusEGlobal::config.newDrumRecordCondition)->setChecked(true); + showTransport->setChecked(MusEGlobal::config.transportVisible); showBigtime->setChecked(MusEGlobal::config.bigTimeVisible); //showMixer->setChecked(MusEGlobal::config.mixerVisible); @@ -353,6 +364,8 @@ void GlobalSettingsConfig::apply() MusEGlobal::config.userInstrumentsDir = userInstrumentsPath->text(); MusEGlobal::config.startSong = startSongEntry->text(); MusEGlobal::config.startMode = startSongGroup->checkedId(); + MusEGlobal::config.newDrumRecordCondition = MusECore::newDrumRecordCondition_t(recDrumGroup->checkedId()); + int das = dummyAudioSize->currentIndex(); MusEGlobal::config.dummyAudioBufSize = dummyAudioBufSizes[das]; MusEGlobal::config.dummyAudioSampleRate = dummyAudioRate->value(); diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h index 0e1697ee..92da61e3 100644 --- a/muse2/muse/widgets/genset.h +++ b/muse2/muse/widgets/genset.h @@ -62,6 +62,7 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase protected: void showEvent(QShowEvent*); QButtonGroup *startSongGroup; + QButtonGroup *recDrumGroup; std::list<MdiSettings*> mdisettings; public: diff --git a/muse2/muse/widgets/gensetbase.ui b/muse2/muse/widgets/gensetbase.ui index ba26cf38..39dcd4c3 100644 --- a/muse2/muse/widgets/gensetbase.ui +++ b/muse2/muse/widgets/gensetbase.ui @@ -23,7 +23,7 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="TabPage"> <attribute name="title"> @@ -1203,22 +1203,59 @@ Adjusts responsiveness of audio controls and </property> </widget> </item> - <item row="4" column="1"> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>Record new style drum tracks</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QRadioButton" name="recordAllButton"> + <property name="text"> + <string>Record all instruments</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="dontRecHiddenButton"> + <property name="text"> + <string>Don't record hidden instruments</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + </widget> + </item> + <item> + <widget class="QRadioButton" name="dontRecMutedButton"> + <property name="text"> + <string>Don't record muted instruments</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="dontRecBothButton"> + <property name="text"> + <string>Don't record hidden or muted instruments</string> </property> - </spacer> + </widget> </item> </layout> </widget> </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <widget class="QWidget" name="tab3"> diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp index c1674e75..64189147 100644 --- a/muse2/muse/widgets/musewidgetsplug.cpp +++ b/muse2/muse/widgets/musewidgetsplug.cpp @@ -217,7 +217,8 @@ GlobalConfigValues config = { 64, // minControlProcessPeriod false, // popupsDefaultStayOpen false, // leftMouseButtonCanDecrease - false // rangeMarkerWithoutMMBCheckBox + false, // rangeMarkerWithoutMMBCheckBox + MusECore::DONT_REC_MUTED_OR_HIDDEN }; //--------------------------------------------------------- |