summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-08-16 17:03:24 +0000
committerFlorian Jung <flo@windfisch.org>2011-08-16 17:03:24 +0000
commitac7c404804691fcf7f9b36f038025ac486ffea6a (patch)
tree7d3e6276115487f5e5dcab229401402691f0b74e
parent6b5e69ff5def2c8469657e33413bec84d815df9d (diff)
half-way working version
toolbar state can be saved and restored, though this is still a bit buggy
-rw-r--r--muse2/muse/arranger/arrangerview.cpp42
-rw-r--r--muse2/muse/arranger/arrangerview.h2
-rw-r--r--muse2/muse/cliplist/cliplist.cpp39
-rw-r--r--muse2/muse/cliplist/cliplist.h2
-rw-r--r--muse2/muse/conf.cpp20
-rw-r--r--muse2/muse/liste/listedit.cpp39
-rw-r--r--muse2/muse/liste/listedit.h2
-rw-r--r--muse2/muse/marker/markerview.cpp45
-rw-r--r--muse2/muse/marker/markerview.h2
-rw-r--r--muse2/muse/master/lmaster.cpp42
-rw-r--r--muse2/muse/master/lmaster.h17
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp4
-rw-r--r--muse2/muse/songfile.cpp11
13 files changed, 252 insertions, 15 deletions
diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp
index b6a48608..ba2c5651 100644
--- a/muse2/muse/arranger/arrangerview.cpp
+++ b/muse2/muse/arranger/arrangerview.cpp
@@ -595,7 +595,6 @@ void ArrangerView::writeStatus(int level, Xml& xml) const
{
xml.tag(level++, "arrangerview");
TopWin::writeStatus(level, xml);
-
xml.intTag(level, "tool", editTools->curTool());
xml.tag(level, "/arrangerview");
}
@@ -614,6 +613,8 @@ void ArrangerView::readStatus(Xml& xml)
case Xml::TagStart:
if (tag == "tool")
editTools->set(xml.parseInt());
+ else if (tag == "topwin")
+ TopWin::readStatus(xml);
else
xml.unknown("ArrangerView");
break;
@@ -628,6 +629,45 @@ void ArrangerView::readStatus(Xml& xml)
}
}
+//---------------------------------------------------------
+// readConfiguration
+//---------------------------------------------------------
+
+void ArrangerView::readConfiguration(Xml& xml)
+ {
+ for (;;) {
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (tag == "topwin")
+ TopWin::readConfiguration(ARRANGER, xml);
+ else
+ xml.unknown("ArrangerView");
+ break;
+ case Xml::TagEnd:
+ if (tag == "arranger")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+//---------------------------------------------------------
+// writeConfiguration
+//---------------------------------------------------------
+
+void ArrangerView::writeConfiguration(int level, Xml& xml)
+ {
+ xml.tag(level++, "arranger");
+ TopWin::writeConfiguration(ARRANGER, level, xml);
+ xml.tag(level, "/arranger");
+ }
+
void ArrangerView::cmd(int cmd)
{
diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h
index dc4aa638..1666bb6c 100644
--- a/muse2/muse/arranger/arrangerview.h
+++ b/muse2/muse/arranger/arrangerview.h
@@ -111,6 +111,8 @@ class ArrangerView : public TopWin
void writeStatus(int level, Xml& xml) const;
void readStatus(Xml& xml);
+ static void readConfiguration(Xml&);
+ static void writeConfiguration(int, Xml&);
void populateAddTrack();
diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp
index e49b315d..1172919a 100644
--- a/muse2/muse/cliplist/cliplist.cpp
+++ b/muse2/muse/cliplist/cliplist.cpp
@@ -227,6 +227,45 @@ void ClipListEdit::writeStatus(int level, Xml& xml) const
}
//---------------------------------------------------------
+// readConfiguration
+//---------------------------------------------------------
+
+void ClipListEdit::readConfiguration(Xml& xml)
+ {
+ for (;;) {
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (tag == "topwin")
+ TopWin::readConfiguration(CLIPLIST, xml);
+ else
+ xml.unknown("ClipListEdit");
+ break;
+ case Xml::TagEnd:
+ if (tag == "cliplistedit")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+//---------------------------------------------------------
+// writeConfiguration
+//---------------------------------------------------------
+
+void ClipListEdit::writeConfiguration(int level, Xml& xml)
+ {
+ xml.tag(level++, "cliplistedit");
+ TopWin::writeConfiguration(CLIPLIST, level, xml);
+ xml.tag(level, "/cliplistedit");
+ }
+
+//---------------------------------------------------------
// startChanged
//---------------------------------------------------------
diff --git a/muse2/muse/cliplist/cliplist.h b/muse2/muse/cliplist/cliplist.h
index e452478a..1932e975 100644
--- a/muse2/muse/cliplist/cliplist.h
+++ b/muse2/muse/cliplist/cliplist.h
@@ -61,6 +61,8 @@ class ClipListEdit : public TopWin {
~ClipListEdit();
virtual void readStatus(Xml&);
virtual void writeStatus(int, Xml&) const;
+ static void readConfiguration(Xml&);
+ static void writeConfiguration(int, Xml&);
};
#endif
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp
index 89cdd04d..7451e22c 100644
--- a/muse2/muse/conf.cpp
+++ b/muse2/muse/conf.cpp
@@ -19,6 +19,11 @@
#include "pianoroll.h"
#include "scoreedit.h"
#include "master/masteredit.h"
+#include "listedit.h"
+#include "cliplist/cliplist.h"
+#include "arrangerview.h"
+#include "marker/markerview.h"
+#include "master/lmaster.h"
///#include "transport.h"
#include "bigtime.h"
#include "arranger.h"
@@ -894,6 +899,16 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
MasterEdit::readConfiguration(xml);
else if (tag == "waveedit")
WaveEdit::readConfiguration(xml);
+ else if (tag == "listedit")
+ ListEdit::readConfiguration(xml);
+ else if (tag == "cliplistedit")
+ ClipListEdit::readConfiguration(xml);
+ else if (tag == "lmaster")
+ LMaster::readConfiguration(xml);
+ else if (tag == "marker")
+ MarkerView::readConfiguration(xml);
+ else if (tag == "arranger")
+ ArrangerView::readConfiguration(xml);
else if (tag == "dialogs")
read_function_dialog_config(xml);
else if (tag == "shortcuts")
@@ -1338,6 +1353,11 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
ScoreEdit::write_configuration(level, xml);
MasterEdit::writeConfiguration(level, xml);
WaveEdit::writeConfiguration(level, xml);
+ ListEdit::writeConfiguration(level, xml);
+ ClipListEdit::writeConfiguration(level, xml);
+ LMaster::writeConfiguration(level, xml);
+ MarkerView::writeConfiguration(level, xml);
+ ArrangerView::writeConfiguration(level, xml);
write_function_dialog_config(level, xml);
diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp
index cd3d165e..d0a7d83c 100644
--- a/muse2/muse/liste/listedit.cpp
+++ b/muse2/muse/liste/listedit.cpp
@@ -827,6 +827,45 @@ void ListEdit::writeStatus(int level, Xml& xml) const
}
//---------------------------------------------------------
+// readConfiguration
+//---------------------------------------------------------
+
+void ListEdit::readConfiguration(Xml& xml)
+ {
+ for (;;) {
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (tag == "topwin")
+ TopWin::readConfiguration(LISTE, xml);
+ else
+ xml.unknown("ListEdit");
+ break;
+ case Xml::TagEnd:
+ if (tag == "listedit")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+//---------------------------------------------------------
+// writeConfiguration
+//---------------------------------------------------------
+
+void ListEdit::writeConfiguration(int level, Xml& xml)
+ {
+ xml.tag(level++, "listedit");
+ TopWin::writeConfiguration(LISTE, level, xml);
+ xml.tag(level, "/listedit");
+ }
+
+//---------------------------------------------------------
// selectionChanged
//---------------------------------------------------------
diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h
index 9e29035e..1b1a8ece 100644
--- a/muse2/muse/liste/listedit.h
+++ b/muse2/muse/liste/listedit.h
@@ -75,6 +75,8 @@ class ListEdit : public MidiEditor {
~ListEdit();
virtual void readStatus(Xml&);
virtual void writeStatus(int, Xml&) const;
+ static void readConfiguration(Xml&);
+ static void writeConfiguration(int, Xml&);
};
#endif
diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp
index 3c0f2267..8def5714 100644
--- a/muse2/muse/marker/markerview.cpp
+++ b/muse2/muse/marker/markerview.cpp
@@ -312,7 +312,10 @@ void MarkerView::readStatus(Xml& xml)
break;
switch (token) {
case Xml::TagStart:
- xml.unknown("Marker");
+ if (tag=="topwin")
+ TopWin::readStatus(xml);
+ else
+ xml.unknown("Marker");
break;
case Xml::TagEnd:
if (tag == "marker")
@@ -330,6 +333,46 @@ void MarkerView::readStatus(Xml& xml)
void MarkerView::writeStatus(int level, Xml& xml) const
{
xml.tag(level++, "marker");
+ TopWin::writeStatus(level, xml);
+ xml.tag(level, "/marker");
+ }
+
+//---------------------------------------------------------
+// readConfiguration
+//---------------------------------------------------------
+
+void MarkerView::readConfiguration(Xml& xml)
+ {
+ for (;;) {
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (tag == "topwin")
+ TopWin::readConfiguration(MARKER, xml);
+ else
+ xml.unknown("MarkerView");
+ break;
+ case Xml::TagEnd:
+ if (tag == "marker")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+//---------------------------------------------------------
+// writeConfiguration
+//---------------------------------------------------------
+
+void MarkerView::writeConfiguration(int level, Xml& xml)
+ {
+ xml.tag(level++, "marker");
+ TopWin::writeConfiguration(MARKER, level, xml);
xml.tag(level, "/marker");
}
diff --git a/muse2/muse/marker/markerview.h b/muse2/muse/marker/markerview.h
index 94a6314e..bab0f6e3 100644
--- a/muse2/muse/marker/markerview.h
+++ b/muse2/muse/marker/markerview.h
@@ -85,6 +85,8 @@ class MarkerView : public TopWin {
~MarkerView();
virtual void readStatus(Xml&);
virtual void writeStatus(int, Xml&) const;
+ static void readConfiguration(Xml&);
+ static void writeConfiguration(int, Xml&);
void nextMarker();
void prevMarker();
};
diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp
index f434e99a..7f5e6f75 100644
--- a/muse2/muse/master/lmaster.cpp
+++ b/muse2/muse/master/lmaster.cpp
@@ -39,6 +39,7 @@
#define LMASTER_MSGBOX_STRING "MusE: List Editor"
+
//don't remove or insert new elements in keyStrs.
//only renaming (keeping the semantic sense) is allowed! (flo(
QStringList keyStrs = QStringList()
@@ -89,6 +90,8 @@ QString keyToString(key_enum key) //flo
return keyStrs[index];
}
+
+
//---------------------------------------------------------
// closeEvent
//---------------------------------------------------------
@@ -407,6 +410,45 @@ void LMaster::writeStatus(int level, Xml& xml) const
}
//---------------------------------------------------------
+// readConfiguration
+//---------------------------------------------------------
+
+void LMaster::readConfiguration(Xml& xml)
+ {
+ for (;;) {
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (tag == "topwin")
+ TopWin::readConfiguration(LMASTER, xml);
+ else
+ xml.unknown("LMaster");
+ break;
+ case Xml::TagEnd:
+ if (tag == "lmaster")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+//---------------------------------------------------------
+// writeConfiguration
+//---------------------------------------------------------
+
+void LMaster::writeConfiguration(int level, Xml& xml)
+ {
+ xml.tag(level++, "lmaster");
+ TopWin::writeConfiguration(LMASTER, level, xml);
+ xml.tag(level, "/lmaster");
+ }
+
+//---------------------------------------------------------
// select
//---------------------------------------------------------
diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h
index a64fd49d..d79fee4d 100644
--- a/muse2/muse/master/lmaster.h
+++ b/muse2/muse/master/lmaster.h
@@ -14,15 +14,10 @@
#include "tempo.h"
#include "keyevent.h"
///#include "sig.h"
-//#include "al/sig.h"
+#include "al/sig.h"
#include <QTreeWidgetItem>
-namespace AL {
- class SigEvent;
- };
-using AL::SigEvent;
-
namespace Awl {
class PosEdit;
class SigEdit;
@@ -97,12 +92,12 @@ class LMasterKeyEventItem : public LMasterLViewItem {
class LMasterSigEventItem : public LMasterLViewItem {
private:
- const SigEvent* sigEvent;
+ const AL::SigEvent* sigEvent;
public:
- LMasterSigEventItem(QTreeWidget* parent, const SigEvent* s);
+ LMasterSigEventItem(QTreeWidget* parent, const AL::SigEvent* s);
virtual LMASTER_LVTYPE getType() { return LMASTER_SIGEVENT; }
- const SigEvent* getEvent() { return sigEvent; }
+ const AL::SigEvent* getEvent() { return sigEvent; }
virtual unsigned tick() { return sigEvent->tick; }
int z() { return sigEvent->sig.z; }
int n() { return sigEvent->sig.n; }
@@ -126,7 +121,7 @@ class LMaster : public MidiEditor {
virtual void closeEvent(QCloseEvent*);
void updateList();
void insertTempo(const TEvent*);
- void insertSig(const SigEvent*);
+ void insertSig(const AL::SigEvent*);
void insertKey(const KeyEvent&);
LMasterLViewItem* getItemAtPos(unsigned tick, LMASTER_LVTYPE t);
void initShortcuts();
@@ -164,6 +159,8 @@ class LMaster : public MidiEditor {
~LMaster();
virtual void readStatus(Xml&);
virtual void writeStatus(int, Xml&) const;
+ static void readConfiguration(Xml&);
+ static void writeConfiguration(int, Xml&);
LMasterLViewItem* getLastOfType(LMASTER_LVTYPE t);
};
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index 4623bca7..29c25937 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -4449,7 +4449,9 @@ void staff_t::update_part_indices()
* - do all signal connections work?
* - are there any segfaults?
* o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message)
- * o store window state for arranger, probably also for other stuff
+ * o store window state: does this really work? arranger seems to be buggy. maybe also marker etc?
+ * o always store marker, arranger etc state, not only when window shown!
+ * o setup for "share","don't share" etc.
*
* IMPORTANT TODO
* o redo transport menu: offer "one beat" and "one bar" steps
diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp
index d64fc6cd..fb279e92 100644
--- a/muse2/muse/songfile.cpp
+++ b/muse2/muse/songfile.cpp
@@ -1049,7 +1049,13 @@ void MusE::readToplevels(Xml& xml)
}
else if (tag == "marker") {
showMarker(true);
- toplevels.back()->readStatus(xml);
+ if (toplevels.back()->type()==TopWin::MARKER)
+ toplevels.back()->readStatus(xml);
+ }
+ else if (tag == "arrangerview") {
+ showArranger(true);
+ if (toplevels.back()->type()==TopWin::ARRANGER)
+ toplevels.back()->readStatus(xml);
}
else if (tag == "waveedit") {
if(!pl->empty())
@@ -1061,7 +1067,8 @@ void MusE::readToplevels(Xml& xml)
}
else if (tag == "cliplist") {
startClipList(true);
- toplevels.back()->readStatus(xml);
+ if (toplevels.back()->type()==TopWin::CLIPLIST)
+ toplevels.back()->readStatus(xml);
}
else
xml.unknown("MusE");