summaryrefslogtreecommitdiff
path: root/muse2/muse/conf.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-17 13:00:39 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-17 13:00:39 +0000
commit37b385ad3b203c90a47cd43d6d2960b201c0e3ff (patch)
treeef9c499a38f25612445cadedcce482eb1a285e64 /muse2/muse/conf.cpp
parent030457faadce72a099193617237d5b7dcc792c87 (diff)
configuration changes; topwin config isn't stored in song any more
Diffstat (limited to 'muse2/muse/conf.cpp')
-rw-r--r--muse2/muse/conf.cpp305
1 files changed, 156 insertions, 149 deletions
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp
index ac6a7de6..7cf8e680 100644
--- a/muse2/muse/conf.cpp
+++ b/muse2/muse/conf.cpp
@@ -520,7 +520,7 @@ static void readSeqConfiguration(Xml& xml)
// readConfiguration
//---------------------------------------------------------
-void readConfiguration(Xml& xml, bool readOnlySequencer)
+void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig)
{
int mixers = 0;
for (;;) {
@@ -547,8 +547,97 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
xml.skip(tag);
break;
}
+
+
+
+
+
+ else if (tag == "midiInputDevice")
+ MusEGlobal::midiInputPorts = xml.parseInt();
+ else if (tag == "midiInputChannel")
+ MusEGlobal::midiInputChannel = xml.parseInt();
+ else if (tag == "midiRecordType")
+ MusEGlobal::midiRecordType = xml.parseInt();
+ else if (tag == "midiThruType")
+ MusEGlobal::midiThruType = xml.parseInt();
+ else if (tag == "midiFilterCtrl1")
+ MusEGlobal::midiFilterCtrl1 = xml.parseInt();
+ else if (tag == "midiFilterCtrl2")
+ MusEGlobal::midiFilterCtrl2 = xml.parseInt();
+ else if (tag == "midiFilterCtrl3")
+ MusEGlobal::midiFilterCtrl3 = xml.parseInt();
+ else if (tag == "midiFilterCtrl4")
+ MusEGlobal::midiFilterCtrl4 = xml.parseInt();
+ else if (tag == "waveTracksVisible")
+ WaveTrack::setVisible((bool)xml.parseInt());
+ else if (tag == "auxTracksVisible")
+ AudioAux::setVisible((bool)xml.parseInt());
+ else if (tag == "groupTracksVisible")
+ AudioGroup::setVisible((bool)xml.parseInt());
+ else if (tag == "midiTracksVisible")
+ MidiTrack::setVisible((bool)xml.parseInt());
+ else if (tag == "inputTracksVisible")
+ AudioInput::setVisible((bool)xml.parseInt());
+ else if (tag == "outputTracksVisible")
+ AudioOutput::setVisible((bool)xml.parseInt());
+ else if (tag == "synthTracksVisible")
+ SynthI::setVisible((bool)xml.parseInt());
+ else if (tag == "bigtimeVisible")
+ MusEConfig::config.bigTimeVisible = xml.parseInt();
+ else if (tag == "transportVisible")
+ MusEConfig::config.transportVisible = xml.parseInt();
+ else if (tag == "mixer1Visible")
+ MusEConfig::config.mixer1Visible = xml.parseInt();
+ else if (tag == "mixer2Visible")
+ MusEConfig::config.mixer2Visible = xml.parseInt();
+ else if (tag == "mtctype")
+ mtcType= xml.parseInt();
+ else if (tag == "sendClockDelay")
+ syncSendFirstClockDelay = xml.parseUInt();
+ else if (tag == "extSync")
+ extSyncFlag.setValue(xml.parseInt());
+ else if (tag == "useJackTransport")
+ {
+ useJackTransport.setValue(xml.parseInt());
+ }
+ else if (tag == "jackTransportMaster")
+ {
+ jackTransportMaster = xml.parseInt();
+ if(audioDevice)
+ audioDevice->setMaster(jackTransportMaster);
+ }
+ else if (tag == "mtcoffset") {
+ QString qs(xml.parse1());
+ QByteArray ba = qs.toLatin1();
+ const char* str = ba.constData();
+ int h, m, s, f, sf;
+ sscanf(str, "%d:%d:%d:%d:%d", &h, &m, &s, &f, &sf);
+ mtcOffset = MTC(h, m, s, f, sf);
+ }
+ else if (tag == "midiTransform")
+ readMidiTransform(xml);
+ else if (tag == "midiInputTransform")
+ readMidiInputTransform(xml);
+ else if (tag == "geometryTransport")
+ MusEConfig::config.geometryTransport = readGeometry(xml, tag);
+ else if (tag == "geometryBigTime")
+ MusEConfig::config.geometryBigTime = readGeometry(xml, tag);
+
+ else if (!doReadGlobalConfig) {
+ xml.skip(tag);
+ break;
+ }
+
+ // ---- Global and/or per-song config stuff ends here ----
+
+
- if (tag == "theme")
+ // ---- Global config stuff begins here ----
+
+ else if (tag == "geometryMain")
+ MusEConfig::config.geometryMain = readGeometry(xml, tag);
+
+ else if (tag == "theme")
MusEConfig::config.style = xml.parse1();
else if (tag == "styleSheetFile")
MusEConfig::config.styleSheetFile = xml.parse1();
@@ -729,7 +818,7 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
else if (tag == "synthTrackBg")
MusEConfig::config.synthTrackBg = readColor(xml);
- else if (tag == "extendedMidi")
+ else if (tag == "extendedMidi") //FINDMICHJETZT begin
MusEConfig::config.extendedMidi = xml.parseInt();
else if (tag == "midiExportDivision")
MusEConfig::config.midiDivision = xml.parseInt();
@@ -743,50 +832,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MusEConfig::config.expOptimNoteOffs = xml.parseInt();
else if (tag == "importMidiSplitParts")
MusEConfig::config.importMidiSplitParts = xml.parseInt();
- else if (tag == "midiInputDevice")
- MusEGlobal::midiInputPorts = xml.parseInt();
- else if (tag == "midiInputChannel")
- MusEGlobal::midiInputChannel = xml.parseInt();
- else if (tag == "midiRecordType")
- MusEGlobal::midiRecordType = xml.parseInt();
- else if (tag == "midiThruType")
- MusEGlobal::midiThruType = xml.parseInt();
- else if (tag == "midiFilterCtrl1")
- MusEGlobal::midiFilterCtrl1 = xml.parseInt();
- else if (tag == "midiFilterCtrl2")
- MusEGlobal::midiFilterCtrl2 = xml.parseInt();
- else if (tag == "midiFilterCtrl3")
- MusEGlobal::midiFilterCtrl3 = xml.parseInt();
- else if (tag == "midiFilterCtrl4")
- MusEGlobal::midiFilterCtrl4 = xml.parseInt();
- else if (tag == "waveTracksVisible")
- WaveTrack::setVisible((bool)xml.parseInt());
- else if (tag == "auxTracksVisible")
- AudioAux::setVisible((bool)xml.parseInt());
- else if (tag == "groupTracksVisible")
- AudioGroup::setVisible((bool)xml.parseInt());
- else if (tag == "midiTracksVisible")
- MidiTrack::setVisible((bool)xml.parseInt());
- else if (tag == "inputTracksVisible")
- AudioInput::setVisible((bool)xml.parseInt());
- else if (tag == "outputTracksVisible")
- AudioOutput::setVisible((bool)xml.parseInt());
- else if (tag == "synthTracksVisible")
- SynthI::setVisible((bool)xml.parseInt());
- else if (tag == "bigtimeVisible")
- MusEConfig::config.bigTimeVisible = xml.parseInt();
- else if (tag == "transportVisible")
- MusEConfig::config.transportVisible = xml.parseInt();
- else if (tag == "markerVisible")
- MusEConfig::config.markerVisible = xml.parseInt();
-
- else if (tag == "mixerVisible")
- // MusEConfig::config.mixerVisible = xml.parseInt(); // Obsolete
- xml.skip(tag);
- else if (tag == "mixer1Visible")
- MusEConfig::config.mixer1Visible = xml.parseInt();
- else if (tag == "mixer2Visible")
- MusEConfig::config.mixer2Visible = xml.parseInt();
else if (tag == "showSplashScreen")
MusEConfig::config.showSplashScreen = xml.parseInt();
@@ -800,20 +845,7 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MusEConfig::config.canvasBgPixmap = xml.parse1();
else if (tag == "canvasCustomBgList")
MusEConfig::config.canvasCustomBgList = xml.parse1().split(";", QString::SkipEmptyParts);
- else if (tag == "geometryMain")
- MusEConfig::config.geometryMain = readGeometry(xml, tag);
- else if (tag == "geometryTransport")
- MusEConfig::config.geometryTransport = readGeometry(xml, tag);
- else if (tag == "geometryBigTime")
- MusEConfig::config.geometryBigTime = readGeometry(xml, tag);
- else if (tag == "geometryPianoroll")
- MusEConfig::config.geometryPianoroll = readGeometry(xml, tag);
- else if (tag == "geometryDrumedit")
- MusEConfig::config.geometryDrumedit = readGeometry(xml, tag);
- else if (tag == "geometryMixer")
- // MusEConfig::config.geometryMixer = readGeometry(xml, tag); // Obsolete
- xml.skip(tag);
//else if (tag == "mixer1")
// MusEConfig::config.mixer1.read(xml);
//else if (tag == "mixer2")
@@ -835,69 +867,16 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MusEConfig::config.transportHandleColor = readColor(xml);
else if (tag == "waveEditBackgroundColor")
MusEConfig::config.waveEditBackgroundColor = readColor(xml);
- else if (tag == "txDeviceId")
- //txDeviceId = xml.parseInt();
- xml.parseInt();
- else if (tag == "rxDeviceId")
- //rxDeviceId = xml.parseInt();
- xml.parseInt();
- else if (tag == "txSyncPort")
- //txSyncPort= xml.parseInt();
- xml.parseInt();
- else if (tag == "rxSyncPort")
- //rxSyncPort= xml.parseInt();
- xml.parseInt();
- else if (tag == "mtctype")
- mtcType= xml.parseInt();
- else if (tag == "sendClockDelay")
- syncSendFirstClockDelay = xml.parseUInt();
- else if (tag == "extSync")
- extSyncFlag.setValue(xml.parseInt());
- else if (tag == "useJackTransport")
- {
- useJackTransport.setValue(xml.parseInt());
- }
- else if (tag == "jackTransportMaster")
- {
- jackTransportMaster = xml.parseInt();
- if(audioDevice)
- audioDevice->setMaster(jackTransportMaster);
- }
- else if (tag == "syncgentype") {
- // for compatibility
- //int syncGenType= xml.parseInt();
- //genMTCSync = syncGenType == 1;
- //genMCSync = syncGenType == 2;
- xml.parseInt();
- }
- else if (tag == "genMTCSync")
- //genMTCSync = xml.parseInt();
- xml.parseInt();
- else if (tag == "genMCSync")
- //genMCSync = xml.parseInt();
- xml.parseInt();
- else if (tag == "genMMC")
- //genMMC = xml.parseInt();
- xml.parseInt();
- else if (tag == "acceptMTC")
- //acceptMTC = xml.parseInt();
- xml.parseInt();
- else if (tag == "acceptMMC")
- //acceptMMC = xml.parseInt();
- xml.parseInt();
- else if (tag == "acceptMC")
- //acceptMC = xml.parseInt();
- xml.parseInt();
- else if (tag == "mtcoffset") {
- QString qs(xml.parse1());
- QByteArray ba = qs.toLatin1();
- const char* str = ba.constData();
- int h, m, s, f, sf;
- sscanf(str, "%d:%d:%d:%d:%d", &h, &m, &s, &f, &sf);
- mtcOffset = MTC(h, m, s, f, sf);
- }
//else if (tag == "midiSyncInfo")
// readConfigMidiSyncInfo(xml);
+ /* Obsolete. FINDMICH flo93
+ else if (tag == "arranger") {
+ if (MusEGlobal::muse && MusEGlobal::muse->arranger())
+ MusEGlobal::muse->arranger()->readStatus(xml);
+ else
+ xml.skip(tag);
+ }
+ */
else if (tag == "drumedit")
DrumEdit::readConfiguration(xml);
else if (tag == "pianoroll")
@@ -918,12 +897,7 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MarkerView::readConfiguration(xml);
else if (tag == "arrangerview")
MusEArranger::ArrangerView::readConfiguration(xml);
- else if (tag == "arranger") {
- if (MusEGlobal::muse && MusEGlobal::muse->arranger())
- MusEGlobal::muse->arranger()->readStatus(xml);
- else
- xml.skip(tag);
- }
+
else if (tag == "dialogs")
read_function_dialog_config(xml);
else if (tag == "shortcuts")
@@ -932,12 +906,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MusEConfig::config.division = xml.parseInt();
else if (tag == "guiDivision")
MusEConfig::config.guiDivision = xml.parseInt();
- else if (tag == "samplerate")
- xml.parseInt();
- else if (tag == "segmentsize")
- xml.parseInt();
- else if (tag == "segmentcount")
- xml.parseInt();
else if (tag == "rtcTicks")
MusEConfig::config.rtcTicks = xml.parseInt();
else if (tag == "minMeter")
@@ -964,10 +932,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MusEConfig::config.guiRefresh = xml.parseInt();
else if (tag == "userInstrumentsDir")
MusEConfig::config.userInstrumentsDir = xml.parse1();
- else if (tag == "midiTransform")
- readMidiTransform(xml);
- else if (tag == "midiInputTransform")
- readMidiInputTransform(xml);
else if (tag == "startMode")
MusEConfig::config.startMode = xml.parseInt();
else if (tag == "startSong")
@@ -981,6 +945,57 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
else if (tag == "popupsDefaultStayOpen")
MusEConfig::config.popupsDefaultStayOpen = xml.parseInt();
+ // ---- the following only skips obsolete entries ----
+ else if ((tag == "arranger") || (tag == "geometryPianoroll") || (tag == "geometryDrumedit"))
+ xml.skip(tag);
+ else if (tag == "markerVisible")
+ //MusEConfig::config.markerVisible = xml.parseInt(); //Obsolete FINDMICH flo93
+ xml.skip(tag);
+ else if (tag == "mixerVisible")
+ // MusEConfig::config.mixerVisible = xml.parseInt(); // Obsolete
+ xml.skip(tag);
+ else if (tag == "geometryMixer")
+ // MusEConfig::config.geometryMixer = readGeometry(xml, tag); // Obsolete
+ xml.skip(tag);
+ else if (tag == "txDeviceId")
+ //txDeviceId = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "rxDeviceId")
+ //rxDeviceId = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "txSyncPort")
+ //txSyncPort= xml.parseInt();
+ xml.parseInt();
+ else if (tag == "rxSyncPort")
+ //rxSyncPort= xml.parseInt();
+ xml.parseInt();
+ else if (tag == "syncgentype") {
+ // for compatibility
+ //int syncGenType= xml.parseInt();
+ //genMTCSync = syncGenType == 1;
+ //genMCSync = syncGenType == 2;
+ xml.parseInt();
+ }
+ else if (tag == "genMTCSync")
+ //genMTCSync = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "genMCSync")
+ //genMCSync = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "genMMC")
+ //genMMC = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "acceptMTC")
+ //acceptMTC = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "acceptMMC")
+ //acceptMMC = xml.parseInt();
+ xml.parseInt();
+ else if (tag == "acceptMC")
+ //acceptMC = xml.parseInt();
+ xml.parseInt();
+ else if ((tag == "samplerate") || (tag == "segmentsize") || (tag == "segmentcount"))
+ xml.parseInt();
else
xml.unknown("configuration");
break;
@@ -1039,7 +1054,7 @@ bool readConfiguration()
else if (skipmode)
break;
else if (tag == "configuration")
- readConfiguration(xml,false);
+ readConfiguration(xml,false, true /* read global config as well */);
else
xml.unknown("muse config");
break;
@@ -1335,8 +1350,6 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
xml.qrectTag(level, "geometryMain", MusEConfig::config.geometryMain);
xml.qrectTag(level, "geometryTransport", MusEConfig::config.geometryTransport);
xml.qrectTag(level, "geometryBigTime", MusEConfig::config.geometryBigTime);
- xml.qrectTag(level, "geometryPianoroll", MusEConfig::config.geometryPianoroll);
- xml.qrectTag(level, "geometryDrumedit", MusEConfig::config.geometryDrumedit);
//xml.qrectTag(level, "geometryMixer", MusEConfig::config.geometryMixer); // Obsolete
xml.intTag(level, "bigtimeVisible", MusEConfig::config.bigTimeVisible);
@@ -1463,10 +1476,10 @@ void MusE::writeConfiguration(int level, Xml& xml) const
xml.intTag(level, "bigtimeVisible", viewBigtimeAction->isChecked());
xml.intTag(level, "transportVisible", viewTransportAction->isChecked());
- xml.intTag(level, "markerVisible", viewMarkerAction->isChecked());
+ //xml.intTag(level, "markerVisible", viewMarkerAction->isChecked()); // Obsolete. FINDMICH flo93
//xml.intTag(level, "mixerVisible", menuView->isItemChecked(aid1)); // Obsolete
- xml.geometryTag(level, "geometryMain", this);
+ // xml.geometryTag(level, "geometryMain", this); // Obsolete. FINDMICH flo93
if (transport)
xml.geometryTag(level, "geometryTransport", transport);
if (bigtime)
@@ -1483,15 +1496,9 @@ void MusE::writeConfiguration(int level, Xml& xml) const
//mixer2->write(level, xml, "mixer2");
mixer2->write(level, xml);
- _arranger->writeStatus(level, xml);
+ //_arranger->writeStatus(level, xml); // Obsolete. FINDMICH flo93
writeSeqConfiguration(level, xml, true);
- DrumEdit::writeConfiguration(level, xml);
- PianoRoll::writeConfiguration(level, xml);
- ScoreEdit::write_configuration(level, xml);
- MasterEdit::writeConfiguration(level, xml);
- WaveEdit::writeConfiguration(level, xml);
-
write_function_dialog_config(level, xml);
writeMidiTransforms(level, xml);