diff options
author | Florian Jung <flo@windfisch.org> | 2011-08-15 12:37:39 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-08-15 12:37:39 +0000 |
commit | 23f3026199641b6e2a2af69e10353cbe304e5649 (patch) | |
tree | e6cd69a129b10ec59ba96b4fa01fc9c5875e0be1 /muse2 | |
parent | 078e927639369928a6fa0483c82867dae6cbf9a2 (diff) |
added transport and panic toolbars to all TopWins
removed the Toplevel class, as the TopWin::type() function replaces it
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/muse/app.cpp | 76 | ||||
-rw-r--r-- | muse2/muse/arranger/arrangerview.cpp | 7 | ||||
-rw-r--r-- | muse2/muse/cliplist/cliplist.cpp | 17 | ||||
-rw-r--r-- | muse2/muse/cobject.cpp | 4 | ||||
-rw-r--r-- | muse2/muse/cobject.h | 41 | ||||
-rw-r--r-- | muse2/muse/liste/listedit.cpp | 21 | ||||
-rw-r--r-- | muse2/muse/marker/markerview.cpp | 18 | ||||
-rw-r--r-- | muse2/muse/master/lmaster.cpp | 18 | ||||
-rw-r--r-- | muse2/muse/master/masteredit.cpp | 19 | ||||
-rw-r--r-- | muse2/muse/midiedit/drumedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/pianoroll.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midieditor.cpp | 4 | ||||
-rw-r--r-- | muse2/muse/midieditor.h | 2 | ||||
-rw-r--r-- | muse2/muse/songfile.cpp | 22 | ||||
-rw-r--r-- | muse2/muse/waveedit/waveedit.cpp | 2 |
16 files changed, 153 insertions, 104 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 29f2dbc1..fe3b987e 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -874,7 +874,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() arrangerView = new ArrangerView(this); arrangerView->shareToolsAndMenu(true); connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed())); - toplevels.push_back(Toplevel(Toplevel::ARRANGER, arrangerView)); + toplevels.push_back(arrangerView); arrangerView->hide(); arranger=arrangerView->getArranger(); @@ -1549,7 +1549,7 @@ void MusE::showMarker(bool flag) markerView = new MarkerView(this); connect(markerView, SIGNAL(closed()), SLOT(markerClosed())); - toplevels.push_back(Toplevel(Toplevel::MARKER, markerView)); + toplevels.push_back(markerView); markerView->show(); } markerView->setVisible(flag); @@ -1747,7 +1747,7 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) { destination = new ScoreEdit(this, 0, arranger->cursorValue()); destination->show(); - toplevels.push_back(Toplevel(Toplevel::SCORE, destination)); + toplevels.push_back(destination); connect(destination, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(destination, SIGNAL(name_changed()), arrangerView, SLOT(scoreNamingChanged())); //connect(muse, SIGNAL(configChanged()), destination, SLOT(config_changed())); @@ -1785,7 +1785,7 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) if(showDefaultCtrls) // p4.0.12 pianoroll->addCtrl(); pianoroll->show(); - toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, pianoroll)); + toplevels.push_back(pianoroll); connect(pianoroll, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged())); } @@ -1806,7 +1806,7 @@ void MusE::startListEditor(PartList* pl) { ListEdit* listEditor = new ListEdit(pl); listEditor->show(); - toplevels.push_back(Toplevel(Toplevel::LISTE, listEditor)); + toplevels.push_back(listEditor); connect(listEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged())); } @@ -1819,7 +1819,7 @@ void MusE::startMasterEditor() { MasterEdit* masterEditor = new MasterEdit(); masterEditor->show(); - toplevels.push_back(Toplevel(Toplevel::MASTER, masterEditor)); + toplevels.push_back(masterEditor); connect(masterEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } @@ -1831,7 +1831,7 @@ void MusE::startLMasterEditor() { LMaster* lmaster = new LMaster(); lmaster->show(); - toplevels.push_back(Toplevel(Toplevel::LMASTER, lmaster)); + toplevels.push_back(lmaster); connect(lmaster, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged())); } @@ -1855,7 +1855,7 @@ void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls) if(showDefaultCtrls) // p4.0.12 drumEditor->addCtrl(); drumEditor->show(); - toplevels.push_back(Toplevel(Toplevel::DRUM, drumEditor)); + toplevels.push_back(drumEditor); connect(drumEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged())); } @@ -1879,7 +1879,7 @@ void MusE::startWaveEditor(PartList* pl) WaveEdit* waveEditor = new WaveEdit(pl); waveEditor->show(); connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged())); - toplevels.push_back(Toplevel(Toplevel::WAVE, waveEditor)); + toplevels.push_back(waveEditor); connect(waveEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } @@ -1936,7 +1936,7 @@ void MusE::startClipList(bool checked) if (clipListEdit == 0) { //clipListEdit = new ClipListEdit(); clipListEdit = new ClipListEdit(this); - toplevels.push_back(Toplevel(Toplevel::CLIPLIST, clipListEdit)); + toplevels.push_back(clipListEdit); connect(clipListEdit, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } clipListEdit->show(); @@ -1988,18 +1988,18 @@ void MusE::selectProject(QAction* act) void MusE::toplevelDeleted(TopWin* tl) { for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { - if (i->object() == tl) { + if (*i == tl) { if (tl == currentMenuSharingTopwin) setCurrentMenuSharingTopwin(NULL); bool mustUpdateScoreMenus=false; - switch(i->type()) { - case Toplevel::MARKER: - case Toplevel::ARRANGER: + switch(tl->type()) { + case TopWin::MARKER: + case TopWin::ARRANGER: break; - case Toplevel::CLIPLIST: + case TopWin::CLIPLIST: // ORCAN: This needs to be verified. aid2 used to correspond to Cliplist: //menu_audio->setItemChecked(aid2, false); viewCliplistAction->setChecked(false); @@ -2008,15 +2008,18 @@ void MusE::toplevelDeleted(TopWin* tl) // the following editors can exist in more than // one instantiation: - case Toplevel::PIANO_ROLL: - case Toplevel::LISTE: - case Toplevel::DRUM: - case Toplevel::MASTER: - case Toplevel::WAVE: - case Toplevel::LMASTER: + case TopWin::PIANO_ROLL: + case TopWin::LISTE: + case TopWin::DRUM: + case TopWin::MASTER: + case TopWin::WAVE: + case TopWin::LMASTER: break; - case Toplevel::SCORE: + case TopWin::SCORE: mustUpdateScoreMenus=true; + + case TopWin::LAST_ENTRY: //to avoid a warning + break; } toplevels.erase(i); if (mustUpdateScoreMenus) @@ -2622,21 +2625,24 @@ bool MusE::clearSong(bool clear_all) again: for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { - Toplevel tl = *i; - switch (tl.type()) { - case Toplevel::CLIPLIST: - case Toplevel::MARKER: - case Toplevel::ARRANGER: + TopWin* tl = *i; + switch (tl->type()) { + case TopWin::CLIPLIST: + case TopWin::MARKER: + case TopWin::ARRANGER: break; - case Toplevel::PIANO_ROLL: - case Toplevel::SCORE: - case Toplevel::LISTE: - case Toplevel::DRUM: - case Toplevel::MASTER: - case Toplevel::WAVE: - case Toplevel::LMASTER: - tl.object()->close(); + case TopWin::PIANO_ROLL: + case TopWin::SCORE: + case TopWin::LISTE: + case TopWin::DRUM: + case TopWin::MASTER: + case TopWin::WAVE: + case TopWin::LMASTER: + tl->close(); goto again; + + case TopWin::LAST_ENTRY: //to avoid a warning + break; } } microSleep(100000); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 576cd7eb..9e6b5c11 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -310,7 +310,7 @@ QActionGroup* populateAddTrack(QMenu* addTrack) //--------------------------------------------------------- ArrangerView::ArrangerView(QWidget* parent) - : TopWin(parent, "arrangerview", Qt::Window) + : TopWin(TopWin::ARRANGER, parent, "arrangerview", Qt::Window) { //setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("MusE: Arranger")); @@ -333,7 +333,6 @@ ArrangerView::ArrangerView(QWidget* parent) QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); undo_tools->setObjectName("Undo/Redo tools"); undo_tools->addActions(undoRedo->actions()); - addToolBar(undo_tools); QToolBar* panic_toolbar = addToolBar(tr("panic")); @@ -759,9 +758,9 @@ void ArrangerView::updateScoreMenus() const ToplevelList* toplevels=muse->getToplevels(); for (ToplevelList::const_iterator it=toplevels->begin(); it!=toplevels->end(); it++) - if (it->type()==Toplevel::SCORE) + if ((*it)->type()==TopWin::SCORE) { - ScoreEdit* score = (ScoreEdit*) it->object(); + ScoreEdit* score = dynamic_cast<ScoreEdit*>(*it); action=new QAction(score->get_name(), this); connect(action, SIGNAL(activated()), scoreOneStaffPerTrackMapper, SLOT(map())); diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index e0008ba1..afd843ef 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -9,6 +9,7 @@ #include <QCloseEvent> #include <QMenuBar> #include <QMenu> +#include <QToolBar> #include "cliplist.h" #include "song.h" @@ -99,7 +100,7 @@ QString ClipItem::text(int col) const //--------------------------------------------------------- ClipListEdit::ClipListEdit(QWidget* parent) - : TopWin(parent, "cliplist", Qt::Window) + : TopWin(TopWin::CLIPLIST, parent, "cliplist", Qt::Window) { //setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("MusE: Clip List Editor")); @@ -109,6 +110,20 @@ ClipListEdit::ClipListEdit(QWidget* parent) //editor->view->setColumnAlignment(COL_REFS, Qt::AlignRight); + // Toolbars --------------------------------------------------------- + QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); + undo_tools->setObjectName("Undo/Redo tools"); + undo_tools->addActions(undoRedo->actions()); + + + QToolBar* panic_toolbar = addToolBar(tr("panic")); + panic_toolbar->setObjectName("panic"); + panic_toolbar->addAction(panicAction); + + QToolBar* transport_toolbar = addToolBar(tr("transport")); + transport_toolbar->setObjectName("transport"); + transport_toolbar->addActions(transportAction->actions()); + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 8091db4b..8f3932ec 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -19,9 +19,11 @@ using std::list; -TopWin::TopWin(QWidget* parent, const char* name, Qt::WindowFlags f) +TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlags f) : QMainWindow(parent, f) { + _type=t; + setObjectName(QString(name)); //setAttribute(Qt::WA_DeleteOnClose); // Allow multiple rows. Tim. diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index f02aa4dc..a106702a 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -29,13 +29,23 @@ class TopWin : public QMainWindow Q_OBJECT public: + enum ToplevelType { PIANO_ROLL, LISTE, DRUM, MASTER, WAVE, + LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER, +#ifdef PATCHBAY + M_PATCHBAY, +#endif /* PATCHBAY */ + LAST_ENTRY + }; + + ToplevelType type() const { return _type; } + + virtual void readStatus(Xml&); virtual void writeStatus(int, Xml&) const; bool isMdiWin(); - TopWin(QWidget* parent=0, const char* name=0, - Qt::WindowFlags f = Qt::Window); + TopWin(ToplevelType t, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); bool sharesToolsAndMenu() { return _sharesToolsAndMenu; } void shareToolsAndMenu(bool); @@ -45,6 +55,8 @@ class TopWin : public QMainWindow QToolBar* addToolBar(const QString& title); private: + ToplevelType _type; + QMdiSubWindow* mdisubwin; bool _sharesToolsAndMenu; std::list<QToolBar*> _toolbars; @@ -70,31 +82,8 @@ class TopWin : public QMainWindow void toolsAndMenuSharingChanged(bool); }; -//--------------------------------------------------------- -// Toplevel -//--------------------------------------------------------- - -class Toplevel { - public: - enum ToplevelType { PIANO_ROLL, LISTE, DRUM, MASTER, WAVE, - LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER -#ifdef PATCHBAY - , M_PATCHBAY -#endif /* PATCHBAY */ - }; - Toplevel(ToplevelType t, TopWin* obj) { - _type = t; - _object = obj; - } - ToplevelType type() const { return _type; } - TopWin* object() const { return _object; } - - private: - ToplevelType _type; - TopWin* _object; - }; -typedef std::list <Toplevel> ToplevelList; +typedef std::list <TopWin*> ToplevelList; typedef ToplevelList::iterator iToplevel; typedef ToplevelList::const_iterator ciToplevel; diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 1c7e70da..d37d80bd 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -445,7 +445,7 @@ QString EventListItem::text(int col) const //--------------------------------------------------------- ListEdit::ListEdit(PartList* pl) - : MidiEditor(0, pl) + : MidiEditor(TopWin::LISTE, 0, pl) { insertItems = new QActionGroup(this); insertItems->setExclusive(false); @@ -500,14 +500,23 @@ ListEdit::ListEdit(PartList* pl) settingsMenu->addAction(subwinAction); - //---------ToolBar---------------------------------- - - listTools = addToolBar(tr("List tools")); - listTools->addActions(undoRedo->actions()); - + // Toolbars --------------------------------------------------------- + QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); + undo_tools->setObjectName("Undo/Redo tools"); + undo_tools->addActions(undoRedo->actions()); + QToolBar* insertTools = addToolBar(tr("Insert tools")); + insertTools->setObjectName("list insert tools"); insertTools->addActions(insertItems->actions()); + QToolBar* panic_toolbar = addToolBar(tr("panic")); + panic_toolbar->setObjectName("panic"); + panic_toolbar->addAction(panicAction); + + QToolBar* transport_toolbar = addToolBar(tr("transport")); + transport_toolbar->setObjectName("transport"); + transport_toolbar->addActions(transportAction->actions()); + // //--------------------------------------------------- // liste diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index ff7c8c07..ad1e49d2 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -151,7 +151,7 @@ void MarkerView::closeEvent(QCloseEvent* e) //--------------------------------------------------------- MarkerView::MarkerView(QWidget* parent) - : TopWin(parent, "markerview", Qt::Window /*| WDestructiveClose*/) + : TopWin(TopWin::MARKER, parent, "markerview", Qt::Window /*| WDestructiveClose*/) { //setAttribute(Qt::WA_DeleteOnClose); @@ -178,14 +178,24 @@ MarkerView::MarkerView(QWidget* parent) settingsMenu->addAction(subwinAction); - //---------ToolBar---------------------------------- - tools = addToolBar(tr("marker-tools")); - tools->addActions(undoRedo->actions()); + // Toolbars --------------------------------------------------------- + QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); + undo_tools->setObjectName("Undo/Redo tools"); + undo_tools->addActions(undoRedo->actions()); QToolBar* edit = addToolBar(tr("edit tools")); + edit->setObjectName("marker edit tools"); edit->addAction(markerAdd); edit->addAction(markerDelete); + QToolBar* panic_toolbar = addToolBar(tr("panic")); + panic_toolbar->setObjectName("panic"); + panic_toolbar->addAction(panicAction); + + QToolBar* transport_toolbar = addToolBar(tr("transport")); + transport_toolbar->setObjectName("transport"); + transport_toolbar->addActions(transportAction->actions()); + //--------------------------------------------------- // master //--------------------------------------------------- diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 79762673..538a20c7 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -114,7 +114,7 @@ void LMaster::songChanged(int type) //--------------------------------------------------------- LMaster::LMaster() - : MidiEditor(0, 0, 0) + : MidiEditor(TopWin::LMASTER, 0, 0, 0) { pos_editor = 0; tempo_editor = 0; @@ -160,11 +160,13 @@ LMaster::LMaster() connect(signalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); - //---------ToolBar---------------------------------- - tools = addToolBar(tr("Master tools")); - tools->addActions(undoRedo->actions()); + // Toolbars --------------------------------------------------------- + QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); + undo_tools->setObjectName("Undo/Redo tools"); + undo_tools->addActions(undoRedo->actions()); QToolBar* edit = addToolBar(tr("Edit tools")); + edit->setObjectName("Master List Edit Tools"); QToolButton* tempoButton = new QToolButton(); QToolButton* timeSigButton = new QToolButton(); QToolButton* keyButton = new QToolButton(); @@ -178,6 +180,14 @@ LMaster::LMaster() edit->addWidget(timeSigButton); edit->addWidget(keyButton); + QToolBar* panic_toolbar = addToolBar(tr("panic")); + panic_toolbar->setObjectName("panic"); + panic_toolbar->addAction(panicAction); + + QToolBar* transport_toolbar = addToolBar(tr("transport")); + transport_toolbar->setObjectName("transport"); + transport_toolbar->addActions(transportAction->actions()); + ///Q3Accel* qa = new Q3Accel(this); ///qa->connectItem(qa->insertItem(Qt::CTRL+Qt::Key_Z), song, SLOT(undo())); ///qa->connectItem(qa->insertItem(Qt::CTRL+Qt::Key_Y), song, SLOT(redo())); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index edc1a702..30e95dbd 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -82,7 +82,7 @@ void MasterEdit::songChanged(int type) //--------------------------------------------------------- MasterEdit::MasterEdit() - : MidiEditor(_rasterInit, 0) + : MidiEditor(TopWin::MASTER, _rasterInit, 0) { setWindowTitle(tr("MusE: Mastertrack")); _raster = 0; // measure @@ -96,10 +96,19 @@ MasterEdit::MasterEdit() QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); - //---------ToolBar---------------------------------- - - tools = addToolBar(tr("Master tools")); - tools->addActions(undoRedo->actions()); + // Toolbars --------------------------------------------------------- + QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); + undo_tools->setObjectName("Undo/Redo tools"); + undo_tools->addActions(undoRedo->actions()); + + + QToolBar* panic_toolbar = addToolBar(tr("panic")); + panic_toolbar->setObjectName("panic"); + panic_toolbar->addAction(panicAction); + + QToolBar* transport_toolbar = addToolBar(tr("transport")); + transport_toolbar->setObjectName("transport"); + transport_toolbar->addActions(transportAction->actions()); EditToolBar* tools2 = new EditToolBar(this, PointerTool | PencilTool | RubberTool); addToolBar(tools2); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 4b4910dd..bf9744b6 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -156,7 +156,7 @@ void DrumEdit::closeEvent(QCloseEvent* e) //--------------------------------------------------------- DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned initPos) - : MidiEditor(_rasterInit, pl, parent, name) + : MidiEditor(TopWin::DRUM, _rasterInit, pl, parent, name) { setFocusPolicy(Qt::StrongFocus); split1w1 = 0; diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 1f20bf52..7b095713 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -69,7 +69,7 @@ static int pianorollTools = PointerTool | PencilTool | RubberTool | DrawTool; //--------------------------------------------------------- PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned initPos) - : MidiEditor(_rasterInit, pl, parent, name) + : MidiEditor(TopWin::PIANO_ROLL, _rasterInit, pl, parent, name) { deltaMode = false; resize(_widthInit, _heightInit); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 1297c395..378a7ad3 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -151,7 +151,7 @@ QByteArray ScoreEdit::default_toolbar_state; //--------------------------------------------------------- ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) - : TopWin(parent, name) + : TopWin(TopWin::SCORE, parent, name) { setAttribute(Qt::WA_DeleteOnClose); setFocusPolicy(Qt::StrongFocus); diff --git a/muse2/muse/midieditor.cpp b/muse2/muse/midieditor.cpp index f4d21320..97b22ad6 100644 --- a/muse2/muse/midieditor.cpp +++ b/muse2/muse/midieditor.cpp @@ -23,8 +23,8 @@ // MidiEditor //--------------------------------------------------------- -MidiEditor::MidiEditor(int r, PartList* pl, - QWidget* parent, const char* name) : TopWin(parent, name) +MidiEditor::MidiEditor(ToplevelType t, int r, PartList* pl, + QWidget* parent, const char* name) : TopWin(t, parent, name) { setAttribute(Qt::WA_DeleteOnClose); _pl = pl; diff --git a/muse2/muse/midieditor.h b/muse2/muse/midieditor.h index 78873a6a..41967f9c 100644 --- a/muse2/muse/midieditor.h +++ b/muse2/muse/midieditor.h @@ -63,7 +63,7 @@ class MidiEditor : public TopWin { void curDrumInstrumentChanged(int); public: - MidiEditor(int, PartList*, + MidiEditor(ToplevelType t, int, PartList*, QWidget* parent = 0, const char* name = 0); ~MidiEditor(); diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index d6c06889..d64fc6cd 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -1011,14 +1011,14 @@ void MusE::readToplevels(Xml& xml) if(!pl->empty()) { startPianoroll(pl); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); pl = new PartList; } } else if (tag == "scoreedit") { ScoreEdit* score = new ScoreEdit(this, 0, arranger->cursorValue()); score->show(); - toplevels.push_back(Toplevel(Toplevel::SCORE, score)); + toplevels.push_back(score); connect(score, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(score, SIGNAL(name_changed()), SLOT(scoreNamingChanged())); score->readStatus(xml); @@ -1027,7 +1027,7 @@ void MusE::readToplevels(Xml& xml) if(!pl->empty()) { startDrumEditor(pl); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); pl = new PartList; } } @@ -1035,33 +1035,33 @@ void MusE::readToplevels(Xml& xml) if(!pl->empty()) { startListEditor(pl); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); pl = new PartList; } } else if (tag == "master") { startMasterEditor(); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); } else if (tag == "lmaster") { startLMasterEditor(); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); } else if (tag == "marker") { showMarker(true); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); } else if (tag == "waveedit") { if(!pl->empty()) { startWaveEditor(pl); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); pl = new PartList; } } else if (tag == "cliplist") { startClipList(true); - toplevels.back().object()->readStatus(xml); + toplevels.back()->readStatus(xml); } else xml.unknown("MusE"); @@ -1531,8 +1531,8 @@ void MusE::write(Xml& xml) const if (!toplevels.empty()) { xml.tag(level++, "toplevels"); for (ciToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { - if (i->object()->isVisible()) - i->object()->writeStatus(level, xml); + if ((*i)->isVisible()) + (*i)->writeStatus(level, xml); } xml.tag(level--, "/toplevels"); } diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 6ad50c1c..d4b692fe 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -62,7 +62,7 @@ void WaveEdit::closeEvent(QCloseEvent* e) //--------------------------------------------------------- WaveEdit::WaveEdit(PartList* pl) - : MidiEditor(1, pl) + : MidiEditor(TopWin::WAVE, 1, pl) { resize(_widthInit, _heightInit); setFocusPolicy(Qt::StrongFocus); |