From bcc4a8edf89457a6e0f15c14970202ca7c05b6e0 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 6 Jan 2012 15:37:19 +0000 Subject: merged with release_2_0 --- muse2/muse/app.cpp | 123 +++++++++-------------------------- muse2/muse/app.h | 10 +-- muse2/muse/conf.cpp | 116 ++++++++++++++++++--------------- muse2/muse/conf.h | 2 +- muse2/muse/ctrl/ctrlpanel.cpp | 4 +- muse2/muse/midiedit/scoreedit.cpp | 23 ++++++- muse2/muse/songfile.cpp | 9 +-- muse2/muse/widgets/fdialogbuttons.ui | 19 ++---- muse2/muse/widgets/filedialog.cpp | 26 ++++---- muse2/muse/widgets/filedialog.h | 2 +- muse2/share/templates/audio.med | 24 ------- muse2/share/templates/default.med | 26 +------- muse2/share/templates/midiGM.med | 24 ------- muse2/share/templates/monorecord.med | 24 ------- muse2/share/templates/synti.med | 24 ------- 15 files changed, 147 insertions(+), 309 deletions(-) diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 21426979..3dfba915 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -964,77 +964,17 @@ MusE::MusE(int /*argc*/, char** /*argv*/) : QMainWindow() MusEGlobal::song->blockSignals(false); // Load start song moved to main.cpp p4.0.41 REMOVE Tim. - /* - - //--------------------------------------------------- - // load project - // if no songname entered on command line: - // startMode: 0 - load last song - // 1 - load default template - // 2 - load configured start song - //--------------------------------------------------- - - QString name; - bool useTemplate = false; - if (argc >= 2) - name = argv[0]; - else if (MusEGlobal::config.startMode == 0) { - if (argc < 2) - //name = projectList[0] ? *projectList[0] : QString("untitled"); - name = projectList[0] ? *projectList[0] : MusEGui::getUniqueUntitledName(); // p4.0.40 - else - name = argv[0]; - printf("starting with selected song %s\n", MusEGlobal::config.startSong.toLatin1().constData()); - } - else if (MusEGlobal::config.startMode == 1) { - printf("starting with default template\n"); - name = MusEGlobal::museGlobalShare + QString("/templates/default.med"); - useTemplate = true; - } - else if (MusEGlobal::config.startMode == 2) { - printf("starting with pre configured song %s\n", MusEGlobal::config.startSong.toLatin1().constData()); - name = MusEGlobal::config.startSong; - } - - // loadProjectFile(name, useTemplate, true); //commented out by flo: see below (*) - */ changeConfig(false); QSettings settings("MusE", "MusE-qt"); restoreGeometry(settings.value("MusE/geometry").toByteArray()); - //restoreState(settings.value("MusE/windowState").toByteArray()); - MusEGlobal::song->update(); // commented out by flo: will be done by the below (*) - updateWindowMenu(); // same here + MusEGlobal::song->update(); + updateWindowMenu(); // Load start song moved to main.cpp p4.0.41 REMOVE Tim. - /* - - // this is (*). - // this is a really hackish workaround for the loading-on-startup problem. - // i have absolutely no idea WHY it breaks when using loadProjectFile() - // above, but it does on my machine (it doesn't on others!). - // the problem can be worked around by delaying loading the song file. - // i use hackishSongOpenTimer for this, which calls after 10ms a slot - // which then does the actual loadProjectFile() call. - // FIXME: please, if anyone finds the real problem, FIX it and - // remove that dirty, dirty workaround! - hackishSongOpenFilename=name; - hackishSongOpenUseTemplate=useTemplate; - hackishSongOpenTimer=new QTimer(this); - hackishSongOpenTimer->setInterval(10); - hackishSongOpenTimer->setSingleShot(true); - connect(hackishSongOpenTimer, SIGNAL(timeout()), this, SLOT(hackishSongOpenTimerTimeout())); - hackishSongOpenTimer->start(); - */ } -// Load start song moved to main.cpp p4.0.41 REMOVE Tim. -//void MusE::hackishSongOpenTimerTimeout() -//{ - ///loadProjectFile(hackishSongOpenFilename, hackishSongOpenUseTemplate, true); - //loadProjectFile(hackishSongOpenFilename, hackishSongOpenUseTemplate, !hackishSongOpenUseTemplate); -//} MusE::~MusE() { @@ -1133,7 +1073,7 @@ void MusE::loadProjectFile(const QString& name) loadProjectFile(name, false, false); } -void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) +void MusE::loadProjectFile(const QString& name, bool songTemplate, bool doReadMidiPorts) { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -1179,7 +1119,7 @@ void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) } microSleep(100000); progress->setValue(10); - loadProjectFile1(name, songTemplate, loadAll); + loadProjectFile1(name, songTemplate, doReadMidiPorts); microSleep(100000); progress->setValue(90); if (restartSequencer) @@ -1203,10 +1143,10 @@ void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) // // template - if true, load file but do not change // project name -// loadAll - load song data + configuration data +// doReadMidiPorts - also read midi port configuration //--------------------------------------------------------- -void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll) +void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool doReadMidiPorts) { //if (audioMixer) // audioMixer->clear(); @@ -1216,7 +1156,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll mixer2->clear(); _arranger->clear(); // clear track info //if (clearSong()) - if (clearSong(loadAll)) // Allow not touching things like midi ports. p4.0.17 TESTING: Maybe some problems... + if (clearSong(doReadMidiPorts)) // Allow not touching things like midi ports. p4.0.17 TESTING: Maybe some problems... return; progress->setValue(20); @@ -1264,7 +1204,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll } else { MusECore::Xml xml(f); - read(xml, !loadAll, songTemplate); + read(xml, doReadMidiPorts, songTemplate); bool fileError = ferror(f); popenFlag ? pclose(f) : fclose(f); if (fileError) { @@ -1274,7 +1214,6 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll } } } - //else if (ex == "mid." || ex == "kar.") { else if (mex == "mid" || mex == "kar") { setConfigDefaults(); if (!importMidi(name, false)) @@ -1300,7 +1239,8 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll autoMixerAction->setChecked(MusEGlobal::automation); - if (loadAll) { + //FINDMICHJETZT does this work? + { showBigtime(MusEGlobal::config.bigTimeVisible); //showMixer(MusEGlobal::config.mixerVisible); showMixer1(MusEGlobal::config.mixer1Visible); @@ -1333,7 +1273,8 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll transport->show(); transport->move(MusEGlobal::config.geometryTransport.topLeft()); showTransport(MusEGlobal::config.transportVisible); - } + } + progress->setValue(40); transport->setMasterFlag(MusEGlobal::song->masterFlag()); @@ -1348,7 +1289,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll progress->setValue(50); // Try this AFTER the song update above which does a mixer update... Tested OK - mixers resize properly now. - if (loadAll) + //FINDMICHJETZT does this work? { if(mixer1) { @@ -1382,7 +1323,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll if (songTemplate) { - // maximize the arranger in traditional SDI mode + // maximize the arranger when in traditional SDI mode if (MusEGui::TopWin::_defaultSubwin[MusEGui::TopWin::ARRANGER]) { bool maximizeArranger=true; @@ -1448,12 +1389,12 @@ void MusE::setFollow() void MusE::loadProject() { - bool loadAll; + bool doReadMidiPorts; QString fn = MusEGui::getOpenFileName(QString(""), MusEGlobal::med_file_pattern, this, - tr("MusE: load project"), &loadAll); + tr("MusE: load project"), &doReadMidiPorts); if (!fn.isEmpty()) { MusEGlobal::museProject = QFileInfo(fn).absolutePath(); - loadProjectFile(fn, false, loadAll); + loadProjectFile(fn, false, doReadMidiPorts); } } @@ -2757,11 +2698,11 @@ MusE::lash_idle_cb () return; while ( (event = lash_get_event (lash_client)) ) - { + { switch (lash_event_get_type (event)) - { + { case LASH_Save_File: - { + { /* save file */ QString ss = QString(lash_event_get_string(event)) + QString("/lash-project-muse.med"); int ok = save (ss.toAscii(), false); @@ -2773,37 +2714,37 @@ MusE::lash_idle_cb () MusEGlobal::museProject = QFileInfo(ss.toAscii()).absolutePath(); } lash_send_event (lash_client, event); - } - break; + } + break; case LASH_Restore_File: - { + { /* load file */ QString sr = QString(lash_event_get_string(event)) + QString("/lash-project-muse.med"); loadProjectFile(sr.toAscii(), false, true); lash_send_event (lash_client, event); - } - break; + } + break; case LASH_Quit: - { + { /* quit muse */ std::cout << "MusE::lash_idle_cb Received LASH_Quit" << std::endl; lash_event_destroy (event); - } - break; + } + break; default: - { + { std::cout << "MusE::lash_idle_cb Received unknown LASH event of type " << lash_event_get_type (event) << std::endl; lash_event_destroy (event); - } - break; } - } + break; + } + } } #endif /* HAVE_LASH */ diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 5dad1ff5..2e62db1a 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -211,12 +211,8 @@ class MusE : public QMainWindow MidiTransformerDialog* midiTransformerDialog; QMenu* openRecent; - //QTimer* hackishSongOpenTimer; - //QString hackishSongOpenFilename; - //bool hackishSongOpenUseTemplate; - bool readMidi(FILE*); - void read(MusECore::Xml& xml, bool skipConfig, bool isTemplate); + void read(MusECore::Xml& xml, bool doReadMidiPorts, bool isTemplate); void processTrack(MusECore::MidiTrack* track); void write(MusECore::Xml& xml) const; @@ -235,7 +231,7 @@ class MusE : public QMainWindow MusECore::PartList* getMidiPartsToEdit(); MusECore::Part* readPart(MusECore::Xml& xml); bool checkRegionNotNull(); - void loadProjectFile1(const QString&, bool songTemplate, bool loadAll); + void loadProjectFile1(const QString&, bool songTemplate, bool doReadMidiPorts); void writeGlobalConfiguration(int level, MusECore::Xml&) const; void writeConfiguration(int level, MusECore::Xml&) const; void updateConfiguration(); @@ -336,7 +332,7 @@ class MusE : public QMainWindow void bounceToFile(MusECore::AudioOutput* ao = 0); void closeEvent(QCloseEvent*e); void loadProjectFile(const QString&); - void loadProjectFile(const QString&, bool songTemplate, bool loadAll); + void loadProjectFile(const QString&, bool songTemplate, bool doReadMidiPorts); void toplevelDeleting(MusEGui::TopWin* tl); void loadTheme(const QString&); void loadStyleSheetFile(const QString&); diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index e9ec1396..b1481f60 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -220,7 +220,7 @@ static void readPortChannel(Xml& xml, int midiPort) // readConfigMidiPort //--------------------------------------------------------- -static void readConfigMidiPort(Xml& xml, bool skipConfig) +static void readConfigMidiPort(Xml& xml, bool onlyReadChannelState) { int idx = 0; QString device; @@ -250,14 +250,14 @@ static void readConfigMidiPort(Xml& xml, bool skipConfig) switch (token) { case Xml::TagStart: - // skipConfig added so it doesn't overwrite midi ports. p4.0.41 Tim. + // onlyReadChannelState added so it doesn't overwrite midi ports. p4.0.41 Tim. // Try to keep the controller information. But, this may need to be moved below. // Also may want to try to keep sync info, but that's a bit risky, so let's not for now. if (tag == "channel") { readPortChannel(xml, idx); break; } - else if (skipConfig){ + else if (onlyReadChannelState){ xml.skip(tag); break; } @@ -303,7 +303,7 @@ static void readConfigMidiPort(Xml& xml, bool skipConfig) case Xml::TagEnd: if (tag == "midiport") { - if(skipConfig) // p4.0.41 + if(onlyReadChannelState) // p4.0.41 return; //if (idx > MIDI_PORTS) { @@ -495,7 +495,7 @@ static void loadConfigMetronom(Xml& xml) // readSeqConfiguration //--------------------------------------------------------- -static void readSeqConfiguration(Xml& xml, bool skipConfig) +static void readSeqConfiguration(Xml& xml, bool skipMidiPorts) { for (;;) { Xml::Token token = xml.parse(); @@ -507,7 +507,7 @@ static void readSeqConfiguration(Xml& xml, bool skipConfig) if (tag == "metronom") loadConfigMetronom(xml); else if (tag == "midiport") - readConfigMidiPort(xml, skipConfig); + readConfigMidiPort(xml, skipMidiPorts); else if (tag == "rcStop") MusEGlobal::rcStopNote = xml.parseInt(); else if (tag == "rcEnable") @@ -537,8 +537,10 @@ static void readSeqConfiguration(Xml& xml, bool skipConfig) // readConfiguration //--------------------------------------------------------- -void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig) +void readConfiguration(Xml& xml, bool doReadMidiPortConfig, bool doReadGlobalConfig) { + if (doReadGlobalConfig) doReadMidiPortConfig=true; + int mixers = 0; for (;;) { Xml::Token token = xml.parse(); @@ -557,10 +559,54 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig midiport configuration and VOLUME. */ if (tag == "sequencer") { - readSeqConfiguration(xml, readOnlySequencer); + readSeqConfiguration(xml, !doReadMidiPortConfig); break; } - else if (readOnlySequencer) { + 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") + MusEGlobal::config.bigTimeVisible = xml.parseInt(); + else if (tag == "transportVisible") + MusEGlobal::config.transportVisible = xml.parseInt(); + else if (tag == "mixer1Visible") + MusEGlobal::config.mixer1Visible = xml.parseInt(); + else if (tag == "mixer2Visible") + MusEGlobal::config.mixer2Visible = xml.parseInt(); + else if (tag == "markerVisible") + // I thought this was obsolete (done by song's toplevel list), but + // it's obviously needed. (flo) + MusEGlobal::config.markerVisible = xml.parseInt(); + else if (tag == "arrangerVisible") + // same here. + MusEGlobal::config.arrangerVisible = xml.parseInt(); + else if (tag == "geometryTransport") + MusEGlobal::config.geometryTransport = readGeometry(xml, tag); + else if (tag == "geometryBigTime") + MusEGlobal::config.geometryBigTime = readGeometry(xml, tag); + else if (tag == "Mixer") { + if(mixers == 0) + MusEGlobal::config.mixer1.read(xml); + else + MusEGlobal::config.mixer2.read(xml); + ++mixers; + } + else if (tag == "geometryMain") + MusEGlobal::config.geometryMain = readGeometry(xml, tag); + + + else if (doReadMidiPortConfig==false) { xml.skip(tag); break; } @@ -585,30 +631,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig 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") { - printf("output track set from config!\n"); - AudioOutput::setVisible((bool)xml.parseInt()); - } - else if (tag == "synthTracksVisible") - SynthI::setVisible((bool)xml.parseInt()); - else if (tag == "bigtimeVisible") - MusEGlobal::config.bigTimeVisible = xml.parseInt(); - else if (tag == "transportVisible") - MusEGlobal::config.transportVisible = xml.parseInt(); - else if (tag == "mixer1Visible") - MusEGlobal::config.mixer1Visible = xml.parseInt(); - else if (tag == "mixer2Visible") - MusEGlobal::config.mixer2Visible = xml.parseInt(); else if (tag == "mtctype") MusEGlobal::mtcType= xml.parseInt(); else if (tag == "sendClockDelay") @@ -637,19 +659,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig readMidiTransform(xml); else if (tag == "midiInputTransform") readMidiInputTransform(xml); - else if (tag == "geometryTransport") - MusEGlobal::config.geometryTransport = readGeometry(xml, tag); - else if (tag == "geometryBigTime") - MusEGlobal::config.geometryBigTime = readGeometry(xml, tag); - else if (tag == "Mixer") { - if(mixers == 0) - MusEGlobal::config.mixer1.read(xml); - else - MusEGlobal::config.mixer2.read(xml); - ++mixers; - } - else if (tag == "geometryMain") - MusEGlobal::config.geometryMain = readGeometry(xml, tag); // don't insert else if(...) clauses between // this line and "Global config stuff begins here". @@ -977,9 +986,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig // ---- the following only skips obsolete entries ---- else if ((tag == "arranger") || (tag == "geometryPianoroll") || (tag == "geometryDrumedit")) xml.skip(tag); - else if (tag == "markerVisible") - //MusEGlobal::config.markerVisible = xml.parseInt(); //Obsolete (done by song's toplevel list) - xml.skip(tag); else if (tag == "mixerVisible") // MusEGlobal::config.mixerVisible = xml.parseInt(); // Obsolete xml.skip(tag); @@ -1032,9 +1038,9 @@ void readConfiguration(Xml& xml, bool readOnlySequencer, bool doReadGlobalConfig printf("text <%s>\n", xml.s1().toLatin1().constData()); break; case Xml::Attribut: - if (readOnlySequencer) + if (doReadMidiPortConfig==false) break; - if (tag == "version") { + else if (tag == "version") { int major = xml.s2().section('.', 0, 0).toInt(); int minor = xml.s2().section('.', 1, 1).toInt(); xml.setVersion(major, minor); @@ -1083,7 +1089,7 @@ bool readConfiguration() else if (skipmode) break; else if (tag == "configuration") - readConfiguration(xml,false, true /* read global config as well */); + readConfiguration(xml,true, true /* read global config as well */); else xml.unknown("muse config"); break; @@ -1517,6 +1523,12 @@ void MusE::writeConfiguration(int level, MusECore::Xml& xml) const if (bigtime) xml.geometryTag(level, "geometryBigTime", bigtime); + // i thought this was obsolete, but it seems to be necessary (flo) + xml.intTag(level, "arrangerVisible", viewArrangerAction->isChecked()); + xml.intTag(level, "markerVisible", viewMarkerAction->isChecked()); + // but storing the geometry IS obsolete. this is really + // done by TopLevel::writeConfiguration + xml.intTag(level, "mixer1Visible", viewMixerAAction->isChecked()); xml.intTag(level, "mixer2Visible", viewMixerBAction->isChecked()); if (mixer1) diff --git a/muse2/muse/conf.h b/muse2/muse/conf.h index f3f4753c..0813ed3e 100644 --- a/muse2/muse/conf.h +++ b/muse2/muse/conf.h @@ -54,7 +54,7 @@ class MidiFileConfig : public QDialog, public Ui::ConfigMidiFileBase { namespace MusECore { class Xml; extern bool readConfiguration(); -extern void readConfiguration(Xml&, bool readOnlySequencer, bool doReadGlobalConfig); +extern void readConfiguration(Xml&, bool doReadMidiPorts, bool doReadGlobalConfig); } #endif diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp index e46f949c..2de234b8 100644 --- a/muse2/muse/ctrl/ctrlpanel.cpp +++ b/muse2/muse/ctrl/ctrlpanel.cpp @@ -770,8 +770,8 @@ void CtrlPanel::ctrlPopup() std::list sList; typedef std::list::iterator isList; - for (MusECore::iMidiCtrlValList i = cll->lower_bound(min); i != cll->lower_bound(max); ++i) { - MusECore::MidiCtrlValList* cl = i->second; + for (MusECore::iMidiCtrlValList it = cll->lower_bound(min); it != cll->lower_bound(max); ++it) { + MusECore::MidiCtrlValList* cl = it->second; MusECore::MidiController* c = port->midiController(cl->num()); // dont show drum specific controller if not a drum track if ((c->num() & 0xff) == 0xff) { diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 7e40a41f..46ce8e60 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4668,12 +4668,33 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set o fix valgrind problems (the two "FINDMICHJETZT" lines in scoreedit.cpp) * > o add a songposition scrollbar-toolbar (in different sizes) * this might be equivalent to "redo transport menu" (below). * > o add toolbar(s) for tempo- etc spinboxes from the transport window + * o add controller editor "like search-and-replace": + * acts on all specified type's events, and edits the value: + * - apply some MIN or MAX on it + * - scale it + * - offset it + * - only act on values in a certain value range + * - maybe do curve-mapping + * o add "volume", "pan", "prog" etc columns to the arranger. + * ideally make them fully configurable: let the user add any + * controller together with any column label to the list. + * these will just set the controller at the very first tick. + * o remove the silly song type! + * o remove the song length spinbox + * o logical/physical device mapping: + * song only contains logical information: not some "synth port", + * but a "synth name", like "Yamaha DX7" or "TR-808". + * the global config contains physical information, like + * "'Yamaha DX7' is on 'USB Midi Bridge, Output two'", + * "'TR-808' is on 'jack-midi port foo, connected to bar'" + * if loading a song with unknown synth name, ask the user. + * o prerecord feature. * * o find and fix FINDMICHJETZT + * o fix valgrind problems (the two "FINDMICHJETZT" lines in scoreedit.cpp) * * IMPORTANT TODO * o allow steprec-insert-rest-note to be set to "off" / "unused" diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 5726345e..f76c16f9 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -1504,7 +1504,7 @@ void MusE::readMidiport(MusECore::Xml& xml) // read song //--------------------------------------------------------- -void MusE::read(MusECore::Xml& xml, bool skipConfig, bool isTemplate) +void MusE::read(MusECore::Xml& xml, bool doReadMidiPorts, bool isTemplate) { bool skipmode = true; for (;;) { @@ -1522,12 +1522,7 @@ void MusE::read(MusECore::Xml& xml, bool skipConfig, bool isTemplate) else if (skipmode) break; else if (tag == "configuration") - if (skipConfig) - //xml.skip(tag); - readConfiguration(xml,true /* only read sequencer settings */, false /* do NOT read global settings, see below */); - // see even more below! - else - readConfiguration(xml, false, false /* do NOT read global settings, see below */); + readConfiguration(xml, doReadMidiPorts, false /* do NOT read global settings, see below */); /* Explanation for why "do NOT read global settings": * if you would use true here, then muse would overwrite certain global config stuff * by the settings stored in the song. but you don't want this. imagine that you diff --git a/muse2/muse/widgets/fdialogbuttons.ui b/muse2/muse/widgets/fdialogbuttons.ui index 09f9e52d..a2196b66 100644 --- a/muse2/muse/widgets/fdialogbuttons.ui +++ b/muse2/muse/widgets/fdialogbuttons.ui @@ -6,7 +6,7 @@ 0 0 - 145 + 150 438 @@ -121,7 +121,7 @@ - + QFrame::StyledPanel @@ -130,21 +130,16 @@ - + - Songdata + + read Midi Port Configuration - + true - - - - - - only -Songdata + + true diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index 7f2c1681..5fbae28b 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -239,7 +239,7 @@ MFileDialog::MFileDialog(const QString& dir, } } - buttons.loadAllGroup->setVisible(false); + buttons.readMidiPortsGroup->setVisible(false); } } @@ -276,7 +276,7 @@ void MFileDialog::directoryChanged(const QString&) // getOpenFileName //--------------------------------------------------------- QString getOpenFileName(const QString &startWith, const char** filters_chararray, - QWidget* parent, const QString& name, bool* all, MFileDialog::ViewType viewType) + QWidget* parent, const QString& name, bool* doReadMidiPorts, MFileDialog::ViewType viewType) { QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); @@ -290,26 +290,24 @@ QString getOpenFileName(const QString &startWith, const char** filters_chararray dlg->projectToggled(true); else if (viewType == MFileDialog::USER_VIEW) dlg->userToggled(true); - if (all) { - dlg->buttons.loadAllGroup->setVisible(true); - //dlg->buttons.globalButton->setVisible(false); - } + if (doReadMidiPorts) + dlg->buttons.readMidiPortsGroup->setVisible(true); + if (!initialSelection.isEmpty()) dlg->selectFile(initialSelection); dlg->setFileMode(QFileDialog::ExistingFile); QStringList files; QString result; if (dlg->exec() == QDialog::Accepted) { - files = dlg->selectedFiles(); - if (!files.isEmpty()) - result = files[0]; - if (all) { - *all = dlg->buttons.loadAllButton->isChecked(); - } - } + files = dlg->selectedFiles(); + if (!files.isEmpty()) + result = files[0]; + if (doReadMidiPorts) + *doReadMidiPorts = dlg->buttons.readMidiPortsButton->isChecked(); + } delete dlg; return result; - } +} //--------------------------------------------------------- // getSaveFileName diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h index b4e21e2c..c9ab8e09 100644 --- a/muse2/muse/widgets/filedialog.h +++ b/muse2/muse/widgets/filedialog.h @@ -93,7 +93,7 @@ class ContentsPreview : public QWidget, public Q3FilePreview { QString getSaveFileName(const QString& startWidth, const char** filters, QWidget* parent, const QString& name); QString getOpenFileName(const QString& startWidth, const char** filters, - QWidget* parent, const QString& name, bool* openAll, MFileDialog::ViewType viewType = MFileDialog::PROJECT_VIEW); + QWidget* parent, const QString& name, bool* doReadMidiPorts, MFileDialog::ViewType viewType = MFileDialog::PROJECT_VIEW); QString getImageFileName(const QString& startWith, const char** filters, QWidget* parent, const QString& name); diff --git a/muse2/share/templates/audio.med b/muse2/share/templates/audio.med index df4463ff..0e0abd55 100644 --- a/muse2/share/templates/audio.med +++ b/muse2/share/templates/audio.med @@ -647,28 +647,4 @@ - - - - 1 - 0 - 0 - 850 - 382 - 1 - 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 - - 1 - - 1 - 370 477 - -
7 9 8 6 5 4 3 2 1 0
-
- 0 - 266 - 0 -
-
-
diff --git a/muse2/share/templates/default.med b/muse2/share/templates/default.med index 49ccbc02..a33ffc3d 100644 --- a/muse2/share/templates/default.med +++ b/muse2/share/templates/default.med @@ -412,29 +412,5 @@ - - - - 1 - 0 - 0 - 850 - 382 - 1 - 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 - - 1 - - 1 - 440 407 - -
7 9 8 6 5 4 3 2 1 0
-
- 0 - 266 - 0 -
-
-
- \ No newline at end of file + diff --git a/muse2/share/templates/midiGM.med b/muse2/share/templates/midiGM.med index 54ec99a0..19b74dff 100644 --- a/muse2/share/templates/midiGM.med +++ b/muse2/share/templates/midiGM.med @@ -560,28 +560,4 @@ - - - - 1 - 0 - 0 - 850 - 382 - 1 - 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 - - 1 - - 1 - 557 290 - -
7 9 8 6 5 4 3 2 1 0
-
- 0 - 266 - 0 -
-
-
diff --git a/muse2/share/templates/monorecord.med b/muse2/share/templates/monorecord.med index 4651a7eb..738cab17 100644 --- a/muse2/share/templates/monorecord.med +++ b/muse2/share/templates/monorecord.med @@ -853,28 +853,4 @@ - - - - 1 - 0 - 0 - 850 - 382 - 1 - 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 - - 1 - - 1 - 557 290 - -
7 9 8 6 5 4 3 2 1 0
-
- 0 - 266 - 0 -
-
-
diff --git a/muse2/share/templates/synti.med b/muse2/share/templates/synti.med index e242e775..461e315a 100644 --- a/muse2/share/templates/synti.med +++ b/muse2/share/templates/synti.med @@ -971,28 +971,4 @@ - - - - 1 - 0 - 0 - 850 - 382 - 1 - 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 - - 1 - - 1 - 370 477 - -
7 9 8 6 5 4 3 2 1 0
-
- 0 - 266 - 0 -
-
-
-- cgit v1.2.3