diff options
author | Florian Jung <flo@windfisch.org> | 2011-10-12 16:48:45 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-10-12 16:48:45 +0000 |
commit | d3a9aa4568b325c183b758f6d05a1af4a457b245 (patch) | |
tree | d5729caa861b69b6cbae881c4f9f14f20961b88a /muse2 | |
parent | 784df1e40bbd403c34850c62c8fda3452d4f372b (diff) |
drum map saving/loading only shown when appropriate, and moved
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/muse/midiedit/drumedit.cpp | 70 | ||||
-rw-r--r-- | muse2/muse/midiedit/drumedit.h | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 3 |
3 files changed, 40 insertions, 35 deletions
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index e7e517ff..58875b4d 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -170,20 +170,6 @@ DrumEdit::DrumEdit(MusECore::PartList* pl, QWidget* parent, const char* name, un _ignore_hide = _ignore_hide_init; //---------Pulldown Menu---------------------------- - menuFile = menuBar()->addMenu(tr("&File")); - - loadAction = menuFile->addAction(QIcon(*openIcon), tr("Load Map")); - saveAction = menuFile->addAction(QIcon(*saveIcon), tr("Save Map")); - resetAction = menuFile->addAction(tr("Reset GM Map")); - - connect(loadAction, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(saveAction, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(resetAction, SIGNAL(triggered()), signalMapper, SLOT(map())); - - signalMapper->setMapping(loadAction, DrumCanvas::CMD_LOAD); - signalMapper->setMapping(saveAction, DrumCanvas::CMD_SAVE); - signalMapper->setMapping(resetAction, DrumCanvas::CMD_RESET); - menuEdit = menuBar()->addMenu(tr("&Edit")); menuEdit->addActions(MusEGlobal::undoRedo->actions()); @@ -247,11 +233,25 @@ DrumEdit::DrumEdit(MusECore::PartList* pl, QWidget* parent, const char* name, un if (old_style_drummap_mode()) { - QAction* reorderListAction = menuFunctions->addAction(tr("Re-order list")); + loadAction = menuFunctions->addAction(QIcon(*openIcon), tr("Load Map")); + saveAction = menuFunctions->addAction(QIcon(*saveIcon), tr("Save Map")); + resetAction = menuFunctions->addAction(tr("Reset GM Map")); + + connect(loadAction, SIGNAL(triggered()), signalMapper, SLOT(map())); + connect(saveAction, SIGNAL(triggered()), signalMapper, SLOT(map())); + connect(resetAction, SIGNAL(triggered()), signalMapper, SLOT(map())); + + signalMapper->setMapping(loadAction, DrumCanvas::CMD_LOAD); + signalMapper->setMapping(saveAction, DrumCanvas::CMD_SAVE); + signalMapper->setMapping(resetAction, DrumCanvas::CMD_RESET); + + QAction* reorderListAction = menuFunctions->addAction(tr("Re-order map")); connect(reorderListAction, SIGNAL(triggered()), signalMapper, SLOT(map())); signalMapper->setMapping(reorderListAction, DrumCanvas::CMD_REORDER_LIST); menuFunctions->addSeparator(); } + else + loadAction=saveAction=resetAction=NULL; fixedAction = menuFunctions->addAction(tr("Set Fixed Length")); veloAction = menuFunctions->addAction(tr("Modify Velocity")); @@ -334,25 +334,31 @@ DrumEdit::DrumEdit(MusECore::PartList* pl, QWidget* parent, const char* name, un //--------------------------------------------------- // Toolbars //--------------------------------------------------- + + if (old_style_drummap_mode()) + { + QToolBar* maptools = addToolBar(tr("Drum map tools")); + maptools->setObjectName("Drum map tools"); + + QToolButton *ldm = new QToolButton(); + ldm->setToolTip(tr("Load Drummap")); + ldm->setIcon(*openIcon); + connect(ldm, SIGNAL(clicked()), SLOT(load())); + maptools->addWidget(ldm); + + QToolButton *sdm = new QToolButton(); + sdm->setToolTip(tr("Store Drummap")); + sdm->setIcon(*saveIcon); + connect(sdm, SIGNAL(clicked()), SLOT(save())); + maptools->addWidget(sdm); + + maptools->addAction(QWhatsThis::createAction()); + } + tools = addToolBar(tr("Drum tools")); tools->setObjectName("Drum tools"); - - QToolButton *ldm = new QToolButton(); - ldm->setToolTip(tr("Load Drummap")); - ldm->setIcon(*openIcon); - connect(ldm, SIGNAL(clicked()), SLOT(load())); - tools->addWidget(ldm); - - QToolButton *sdm = new QToolButton(); - sdm->setToolTip(tr("Store Drummap")); - sdm->setIcon(*saveIcon); - connect(sdm, SIGNAL(clicked()), SLOT(save())); - tools->addWidget(sdm); - - tools->addAction(QWhatsThis::createAction()); - tools->addSeparator(); tools->addActions(MusEGlobal::undoRedo->actions()); tools->addSeparator(); @@ -1341,8 +1347,8 @@ void DrumEdit::keyPressEvent(QKeyEvent* event) void DrumEdit::initShortcuts() { - loadAction->setShortcut(shortcuts[SHRT_OPEN].key); - saveAction->setShortcut(shortcuts[SHRT_SAVE].key); + if (loadAction) loadAction->setShortcut(shortcuts[SHRT_OPEN].key); + if (saveAction) saveAction->setShortcut(shortcuts[SHRT_SAVE].key); cutAction->setShortcut(shortcuts[SHRT_CUT].key); copyAction->setShortcut(shortcuts[SHRT_COPY].key); diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index 2c1f3060..b860da80 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -99,7 +99,7 @@ class DrumEdit : public MidiEditor { MusECore::Event selEvent; MusECore::MidiPart* selPart; int selTick; - QMenu* menuEdit, *menuFunctions, *menuFile, *menuSelect; + QMenu* menuEdit, *menuFunctions, *menuSelect; MusEGui::NoteInfo* info; QToolButton* srec; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index a7b848f5..6957e9c1 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4594,10 +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 drum controllers * o my record flag handling * o option for disabling old-style / new-style drum tracks? - * o steprec and mouse-inserting notes should automatically find out - * the proper destination part, or create a new one in dcanvas.cpp * * > o drum editor: channel-stuff * o clearly state in the changelog: when having multiple drumeditors open, |