From c95feff1f178ec0d89ea21abf5d7e6294c0d0132 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 7 Aug 2011 15:15:12 +0000 Subject: moved the arranger out to its own window --- muse2/muse/app.cpp | 830 ++++------------------------------------------------- 1 file changed, 60 insertions(+), 770 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 3abb116f..53078d44 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -21,6 +21,7 @@ #include "amixer.h" #include "appearance.h" #include "arranger.h" +#include "arrangerview.h" #include "audio.h" #include "audiodev.h" #include "audioprefetch.h" @@ -52,17 +53,9 @@ #include "widgets/projectcreateimpl.h" #include "widgets/menutitleitem.h" #include "tools.h" -#include "visibletracks.h" #include "widgets/unusedwavefiles.h" #include "functions.h" -#ifdef DSSI_SUPPORT -#include "dssihost.h" -#endif - -#ifdef VST_SUPPORT -#include "vst.h" -#endif //extern void cacheJackRouteNames(); @@ -107,17 +100,6 @@ pthread_t splashThread; -void MusE::clearScoreMenuMappers() -{ - delete scoreOneStaffPerTrackMapper; - delete scoreAllInOneMapper; - - scoreOneStaffPerTrackMapper = new QSignalMapper(this); - scoreAllInOneMapper = new QSignalMapper(this); - - connect(scoreOneStaffPerTrackMapper, SIGNAL(mapped(QWidget*)), this, SLOT(openInScoreEdit_oneStaffPerTrack(QWidget*))); - connect(scoreAllInOneMapper, SIGNAL(mapped(QWidget*)), this, SLOT(openInScoreEdit_allInOne(QWidget*))); -} //--------------------------------------------------------- @@ -303,235 +285,6 @@ void addProject(const QString& name) projectList[0] = new QString(name); } -//--------------------------------------------------------- -// populateAddSynth -//--------------------------------------------------------- - -// ORCAN - CHECK -QMenu* populateAddSynth(QWidget* parent) -{ - QMenu* synp = new QMenu(parent); - - //typedef std::multimap asmap; - typedef std::multimap asmap; - - //typedef std::multimap::iterator imap; - typedef std::multimap::iterator imap; - - MessSynth* synMESS = 0; - QMenu* synpMESS = 0; - asmap mapMESS; - - #ifdef DSSI_SUPPORT - DssiSynth* synDSSI = 0; - QMenu* synpDSSI = 0; - asmap mapDSSI; - #endif - - #ifdef VST_SUPPORT - VstSynth* synVST = 0; - QMenu* synpVST = 0; - asmap mapVST; - #endif - - // Not necessary, but what the heck. - QMenu* synpOther = 0; - asmap mapOther; - - //const int synth_base_id = 0x1000; - int ii = 0; - for(std::vector::iterator i = synthis.begin(); i != synthis.end(); ++i) - { - synMESS = dynamic_cast(*i); - if(synMESS) - { - mapMESS.insert( std::pair (std::string(synMESS->description().toLower().toLatin1().constData()), ii) ); - } - else - { - - #ifdef DSSI_SUPPORT - synDSSI = dynamic_cast(*i); - if(synDSSI) - { - mapDSSI.insert( std::pair (std::string(synDSSI->description().toLower().toLatin1().constData()), ii) ); - } - else - #endif - - { - #ifdef VST_SUPPORT - synVST = dynamic_cast(*i); - if(synVST) - { - mapVST.insert( std::pair (std::string(synVST->description().toLower().toLatin1().constData()), ii) ); - } - else - #endif - - { - mapOther.insert( std::pair (std::string((*i)->description().toLower().toLatin1().constData()), ii) ); - } - } - } - - ++ii; - } - - int sz = synthis.size(); - for(imap i = mapMESS.begin(); i != mapMESS.end(); ++i) - { - int idx = i->second; - if(idx > sz) // Sanity check - continue; - Synth* s = synthis[idx]; - if(s) - { - // No MESS sub-menu yet? Create it now. - if(!synpMESS) - synpMESS = new QMenu(parent); - QAction* sM = synpMESS->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); - sM->setData(MENU_ADD_SYNTH_ID_BASE + idx); - } - } - - #ifdef DSSI_SUPPORT - for(imap i = mapDSSI.begin(); i != mapDSSI.end(); ++i) - { - int idx = i->second; - if(idx > sz) - continue; - Synth* s = synthis[idx]; - if(s) - { - // No DSSI sub-menu yet? Create it now. - if(!synpDSSI) - synpDSSI = new QMenu(parent); - //synpDSSI->insertItem(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); - QAction* sD = synpDSSI->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); - sD->setData(MENU_ADD_SYNTH_ID_BASE + idx); - } - } - #endif - - #ifdef VST_SUPPORT - for(imap i = mapVST.begin(); i != mapVST.end(); ++i) - { - int idx = i->second; - if(idx > sz) - continue; - Synth* s = synthis[idx]; - if(s) - { - // No VST sub-menu yet? Create it now. - if(!synpVST) - synpVST = new QMenu(parent); - QAction* sV = synpVST->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); - sV->setData(MENU_ADD_SYNTH_ID_BASE + idx); - } - } - #endif - - for(imap i = mapOther.begin(); i != mapOther.end(); ++i) - { - int idx = i->second; - if(idx > sz) - continue; - Synth* s = synthis[idx]; - // No Other sub-menu yet? Create it now. - if(!synpOther) - synpOther = new QMenu(parent); - //synpOther->insertItem(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); - QAction* sO = synpOther->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); - sO->setData(MENU_ADD_SYNTH_ID_BASE + idx); - } - - if(synpMESS) - { - synpMESS->setIcon(*synthIcon); - synpMESS->setTitle(QT_TRANSLATE_NOOP("@default", "MESS")); - synp->addMenu(synpMESS); - } - - #ifdef DSSI_SUPPORT - if(synpDSSI) - { - synpDSSI->setIcon(*synthIcon); - synpDSSI->setTitle(QT_TRANSLATE_NOOP("@default", "DSSI")); - synp->addMenu(synpDSSI); - } - #endif - - #ifdef VST_SUPPORT - if(synpVST) - { - synpVST->setIcon(*synthIcon); - synpVST->setTitle(QT_TRANSLATE_NOOP("@default", "FST")); - synp->addMenu(synpVST); - } - #endif - - if(synpOther) - { - synpOther->setIcon(*synthIcon); - synpOther->setTitle(QObject::tr("Other")); - synp->addMenu(synpOther); - } - - return synp; -} - -//--------------------------------------------------------- -// populateAddTrack -// this is also used in "mixer" -//--------------------------------------------------------- - -QActionGroup* populateAddTrack(QMenu* addTrack) - { - QActionGroup* grp = new QActionGroup(addTrack); - - QAction* midi = addTrack->addAction(QIcon(*addtrack_addmiditrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Midi Track")); - midi->setData(Track::MIDI); - grp->addAction(midi); - QAction* drum = addTrack->addAction(QIcon(*addtrack_drumtrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Drum Track")); - drum->setData(Track::DRUM); - grp->addAction(drum); - QAction* wave = addTrack->addAction(QIcon(*addtrack_wavetrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Wave Track")); - wave->setData(Track::WAVE); - grp->addAction(wave); - QAction* aoutput = addTrack->addAction(QIcon(*addtrack_audiooutputIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Output")); - aoutput->setData(Track::AUDIO_OUTPUT); - grp->addAction(aoutput); - QAction* agroup = addTrack->addAction(QIcon(*addtrack_audiogroupIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Group")); - agroup->setData(Track::AUDIO_GROUP); - grp->addAction(agroup); - QAction* ainput = addTrack->addAction(QIcon(*addtrack_audioinputIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Input")); - ainput->setData(Track::AUDIO_INPUT); - grp->addAction(ainput); - QAction* aaux = addTrack->addAction(QIcon(*addtrack_auxsendIcon), - QT_TRANSLATE_NOOP("@default", "Add Aux Send")); - aaux->setData(Track::AUDIO_AUX); - grp->addAction(aaux); - - // Create a sub-menu and fill it with found synth types. Make addTrack the owner. - QMenu* synp = populateAddSynth(addTrack); - synp->setIcon(*synthIcon); - synp->setTitle(QT_TRANSLATE_NOOP("@default", "Add Synth")); - - // Add the sub-menu to the given menu. - addTrack->addMenu(synp); - - QObject::connect(addTrack, SIGNAL(triggered(QAction *)), song, SLOT(addNewTrack(QAction *))); - - return grp; - } - //--------------------------------------------------------- // MusE //--------------------------------------------------------- @@ -558,6 +311,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() midiRhythmGenerator = 0; globalSettingsConfig = 0; markerView = 0; + arrangerView = 0; softSynthesizerConfig = 0; midiTransformerDialog = 0; shortcutConfig = 0; @@ -572,11 +326,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() appName = QString("MusE"); setWindowTitle(appName); - editSignalMapper = new QSignalMapper(this); midiPluginSignalMapper = new QSignalMapper(this); followSignalMapper = new QSignalMapper(this); - scoreOneStaffPerTrackMapper = new QSignalMapper(this); - scoreAllInOneMapper = new QSignalMapper(this); song = new Song("song"); song->blockSignals(true); @@ -728,61 +479,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() quitAction = new QAction(tr("&Quit"), this); - //-------- Edit Actions - editCutAction = new QAction(QIcon(*editcutIconSet), tr("C&ut"), this); - editCopyAction = new QAction(QIcon(*editcopyIconSet), tr("&Copy"), this); - editPasteAction = new QAction(QIcon(*editpasteIconSet), tr("&Paste"), this); - editInsertAction = new QAction(QIcon(*editpasteIconSet), tr("&Insert"), this); - editInsertEMAction = new QAction(QIcon(*editpasteIconSet), tr("&Insert Empty Measure"), this); - editPasteCloneAction = new QAction(QIcon(*editpasteCloneIconSet), tr("Paste c&lone"), this); - editPaste2TrackAction = new QAction(QIcon(*editpaste2TrackIconSet), tr("Paste to &track"), this); - editPasteC2TAction = new QAction(QIcon(*editpasteClone2TrackIconSet), tr("Paste clone to trac&k"), this); - editDeleteSelectedAction = new QAction(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), this); - - editShrinkPartsAction = new QAction(tr("Shrink selected parts"), this); //FINDMICH TODO tooltips! - editExpandPartsAction = new QAction(tr("Expand selected parts"), this); - editCleanPartsAction = new QAction(tr("Clean selected parts"), this); - - - addTrack = new QMenu(tr("Add Track"), this); - addTrack->setIcon(QIcon(*edit_track_addIcon)); - select = new QMenu(tr("Select"), this); - select->setIcon(QIcon(*selectIcon)); - - editSelectAllAction = new QAction(QIcon(*select_allIcon), tr("Select &All"), this); - editDeselectAllAction = new QAction(QIcon(*select_deselect_allIcon), tr("&Deselect All"), this); - editInvertSelectionAction = new QAction(QIcon(*select_invert_selectionIcon), tr("Invert &Selection"), this); - editInsideLoopAction = new QAction(QIcon(*select_inside_loopIcon), tr("&Inside Loop"), this); - editOutsideLoopAction = new QAction(QIcon(*select_outside_loopIcon), tr("&Outside Loop"), this); - editAllPartsAction = new QAction( QIcon(*select_all_parts_on_trackIcon), tr("All &Parts on Track"), this); - - - scoreSubmenu = new QMenu(tr("Score"), this); - scoreSubmenu->setIcon(QIcon(*scoreIconSet)); - - scoreAllInOneSubsubmenu = new QMenu(tr("all parts in one staff"), this); - scoreOneStaffPerTrackSubsubmenu = new QMenu(tr("one staff per part"), this); - - scoreSubmenu->addMenu(scoreAllInOneSubsubmenu); - scoreSubmenu->addMenu(scoreOneStaffPerTrackSubsubmenu); - updateScoreMenus(); - - startScoreEditAction = new QAction(*scoreIconSet, tr("New score window"), this); - startPianoEditAction = new QAction(*pianoIconSet, tr("Pianoroll"), this); - startDrumEditAction = new QAction(QIcon(*edit_drummsIcon), tr("Drums"), this); - startListEditAction = new QAction(QIcon(*edit_listIcon), tr("List"), this); - startWaveEditAction = new QAction(QIcon(*edit_waveIcon), tr("Wave"), this); - - master = new QMenu(tr("Mastertrack"), this); - master->setIcon(QIcon(*edit_mastertrackIcon)); - masterGraphicAction = new QAction(QIcon(*mastertrack_graphicIcon),tr("Graphic"), this); - masterListAction = new QAction(QIcon(*mastertrack_listIcon),tr("List"), this); - - midiEdit = new QMenu(tr("Midi"), this); - midiEdit->setIcon(QIcon(*edit_midiIcon)); - - midiTransformerAction = new QAction(QIcon(*midi_transformIcon), tr("Midi &Transform"), this); - editSongInfoAction = new QAction(QIcon(*edit_listIcon), tr("Song Info"), this); //-------- View Actions @@ -798,15 +494,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() viewCliplistAction->setCheckable(true); viewMarkerAction = new QAction(QIcon(*view_markerIcon), tr("Marker View"), this); viewMarkerAction->setCheckable(true); - - //-------- Structure Actions - strGlobalCutAction = new QAction(tr("Global Cut"), this); - strGlobalInsertAction = new QAction(tr("Global Insert"), this); - strGlobalSplitAction = new QAction(tr("Global Split"), this); - strCopyRangeAction = new QAction(tr("Copy Range"), this); - strCopyRangeAction->setEnabled(false); - strCutEventsAction = new QAction(tr("Cut Events"), this); - strCutEventsAction->setEnabled(false); + viewArrangerAction = new QAction(tr("Arranger View"), this); + viewArrangerAction->setCheckable(true); //-------- Midi Actions menuScriptPlugins = new QMenu(tr("&Plugins"), this); @@ -881,63 +570,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() connect(fileMoveWaveFiles, SIGNAL(activated()), SLOT(findUnusedWaveFiles())); connect(quitAction, SIGNAL(activated()), SLOT(quitDoc())); - //-------- Edit connections - connect(editCutAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editCopyAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editPasteAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editInsertAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editInsertEMAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editPasteCloneAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editPaste2TrackAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editPasteC2TAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editDeleteSelectedAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - - connect(editShrinkPartsAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editExpandPartsAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editCleanPartsAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - - connect(editSelectAllAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editDeselectAllAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editInvertSelectionAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editInsideLoopAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editOutsideLoopAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editAllPartsAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - - editSignalMapper->setMapping(editCutAction, CMD_CUT); - editSignalMapper->setMapping(editCopyAction, CMD_COPY); - editSignalMapper->setMapping(editPasteAction, CMD_PASTE); - editSignalMapper->setMapping(editInsertAction, CMD_INSERT); - editSignalMapper->setMapping(editPasteCloneAction, CMD_PASTE_CLONE); - editSignalMapper->setMapping(editPaste2TrackAction, CMD_PASTE_TO_TRACK); - editSignalMapper->setMapping(editPasteC2TAction, CMD_PASTE_CLONE_TO_TRACK); - editSignalMapper->setMapping(editInsertEMAction, CMD_INSERTMEAS); - editSignalMapper->setMapping(editDeleteSelectedAction, CMD_DELETE_TRACK); - editSignalMapper->setMapping(editShrinkPartsAction, CMD_SHRINK_PART); - editSignalMapper->setMapping(editExpandPartsAction, CMD_EXPAND_PART); - editSignalMapper->setMapping(editCleanPartsAction, CMD_CLEAN_PART); - editSignalMapper->setMapping(editSelectAllAction, CMD_SELECT_ALL); - editSignalMapper->setMapping(editDeselectAllAction, CMD_SELECT_NONE); - editSignalMapper->setMapping(editInvertSelectionAction, CMD_SELECT_INVERT); - editSignalMapper->setMapping(editInsideLoopAction, CMD_SELECT_ILOOP); - editSignalMapper->setMapping(editOutsideLoopAction, CMD_SELECT_OLOOP); - editSignalMapper->setMapping(editAllPartsAction, CMD_SELECT_PARTS); - - connect(editSignalMapper, SIGNAL(mapped(int)), this, SLOT(cmd(int))); - - connect(startPianoEditAction, SIGNAL(activated()), SLOT(startPianoroll())); - connect(startScoreEditAction, SIGNAL(activated()), SLOT(startScoreQuickly())); - connect(startDrumEditAction, SIGNAL(activated()), SLOT(startDrumEditor())); - connect(startListEditAction, SIGNAL(activated()), SLOT(startListEditor())); - connect(startWaveEditAction, SIGNAL(activated()), SLOT(startWaveEditor())); - connect(scoreOneStaffPerTrackMapper, SIGNAL(mapped(QWidget*)), this, SLOT(openInScoreEdit_oneStaffPerTrack(QWidget*))); - connect(scoreAllInOneMapper, SIGNAL(mapped(QWidget*)), this, SLOT(openInScoreEdit_allInOne(QWidget*))); - - - connect(masterGraphicAction, SIGNAL(activated()), SLOT(startMasterEditor())); - connect(masterListAction, SIGNAL(activated()), SLOT(startLMasterEditor())); - - connect(midiTransformerAction, SIGNAL(activated()), SLOT(startMidiTransformer())); - connect(editSongInfoAction, SIGNAL(activated()), SLOT(startSongInfo())); //-------- View connections @@ -947,13 +579,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() connect(viewMixerBAction, SIGNAL(toggled(bool)), SLOT(toggleMixer2(bool))); connect(viewCliplistAction, SIGNAL(toggled(bool)), SLOT(startClipList(bool))); connect(viewMarkerAction, SIGNAL(toggled(bool)), SLOT(toggleMarker(bool))); - - //-------- Structure connections - connect(strGlobalCutAction, SIGNAL(activated()), SLOT(globalCut())); - connect(strGlobalInsertAction, SIGNAL(activated()), SLOT(globalInsert())); - connect(strGlobalSplitAction, SIGNAL(activated()), SLOT(globalSplit())); - connect(strCopyRangeAction, SIGNAL(activated()), SLOT(copyRange())); - connect(strCutEventsAction, SIGNAL(activated()), SLOT(cutEvents())); + connect(viewArrangerAction, SIGNAL(toggled(bool)), SLOT(toggleArranger(bool))); //-------- Midi connections connect(midiEditInstAction, SIGNAL(activated()), SLOT(startEditInstrument())); @@ -1013,15 +639,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() connect(helpReportAction, SIGNAL(activated()), SLOT(startBugBrowser())); connect(helpAboutAction, SIGNAL(activated()), SLOT(about())); - //-------------------------------------------------- - // Miscellaneous shortcuts - //-------------------------------------------------- - - QShortcut* sc = new QShortcut(shortcuts[SHRT_DELETE].key, this); - sc->setContext(Qt::WindowShortcut); - connect(sc, SIGNAL(activated()), editSignalMapper, SLOT(map())); - editSignalMapper->setMapping(sc, CMD_DELETE); - //-------------------------------------------------- // Toolbar //-------------------------------------------------- @@ -1041,10 +658,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() tools->addSeparator(); tools->addActions(undoRedo->actions()); - tools1 = new EditToolBar(this, arrangerTools); - addToolBar(tools1); - tools1->setObjectName("arrangerTools"); - QToolBar* transportToolbar = addToolBar(tr("Transport")); transportToolbar->setObjectName("Transport"); transportToolbar->addActions(transportAction->actions()); @@ -1053,8 +666,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() panicToolbar->setObjectName("Panic"); panicToolbar->addAction(panicAction); - visTracks = new VisibleTracks(this); - addToolBar(visTracks); //rlimit lim; @@ -1099,6 +710,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menu_file->addAction(fileSaveAction); menu_file->addAction(fileSaveAsAction); menu_file->addSeparator(); + menu_file->addAction(editSongInfoAction); + menu_file->addSeparator(); menu_file->addAction(fileImportMidiAction); menu_file->addAction(fileExportMidiAction); menu_file->addAction(fileImportPartAction); @@ -1110,66 +723,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menu_file->addAction(quitAction); menu_file->addSeparator(); - //------------------------------------------------------------- - // popup Edit - //------------------------------------------------------------- - menuEdit = menuBar()->addMenu(tr("&Edit")); - menuEdit->addActions(undoRedo->actions()); - menuEdit->addSeparator(); - - menuEdit->addAction(editCutAction); - menuEdit->addAction(editCopyAction); - menuEdit->addAction(editPasteAction); - menuEdit->addAction(editInsertAction); - menuEdit->addAction(editInsertEMAction); - menuEdit->addAction(editPasteCloneAction); - menuEdit->addAction(editPaste2TrackAction); - menuEdit->addAction(editPasteC2TAction); - menuEdit->addSeparator(); - menuEdit->addAction(editShrinkPartsAction); - menuEdit->addAction(editExpandPartsAction); - menuEdit->addAction(editCleanPartsAction); - menuEdit->addSeparator(); - menuEdit->addAction(editDeleteSelectedAction); - - // Moved below. Have to wait until synths are available... - //populateAddTrack(addTrack); - menuEdit->addMenu(addTrack); - menuEdit->addMenu(select); - select->addAction(editSelectAllAction); - select->addAction(editDeselectAllAction); - select->addAction(editInvertSelectionAction); - select->addAction(editInsideLoopAction); - select->addAction(editOutsideLoopAction); - select->addAction(editAllPartsAction); - menuEdit->addSeparator(); - - menuEdit->addAction(startPianoEditAction); - menuEdit->addMenu(scoreSubmenu); - menuEdit->addAction(startScoreEditAction); - menuEdit->addAction(startDrumEditAction); - menuEdit->addAction(startListEditAction); - menuEdit->addAction(startWaveEditAction); - - menuEdit->addMenu(master); - master->addAction(masterGraphicAction); - master->addAction(masterListAction); - menuEdit->addSeparator(); - - - menuEdit->addMenu(midiEdit); -/* commented out by flo: these are not implemented, - but maybe will be in future (state: revision 988) - midiEdit->insertItem(tr("Copy Measure"), this, SLOT(copyMeasure())); - midiEdit->insertItem(tr("Erase Measure"), this, SLOT(eraseMeasure())); - midiEdit->insertItem(tr("Delete Measure"), this, SLOT(deleteMeasure())); - midiEdit->insertItem(tr("Create Measure"), this, SLOT(createMeasure())); - midiEdit->insertItem(tr("Mix Track"), this, SLOT(mixTrack())); -*/ - midiEdit->addAction(midiTransformerAction); - - menuEdit->addAction(editSongInfoAction); //------------------------------------------------------------- // popup View @@ -1183,20 +737,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menuView->addAction(viewMixerBAction); menuView->addAction(viewCliplistAction); menuView->addAction(viewMarkerAction); + menuView->addAction(viewArrangerAction); - //------------------------------------------------------------- - // popup Structure - //------------------------------------------------------------- - - menuStructure = menuBar()->addMenu(tr("&Structure")); - menuStructure->addAction(strGlobalCutAction); - menuStructure->addAction(strGlobalInsertAction); - menuStructure->addAction(strGlobalSplitAction); - menuStructure->addAction(strCopyRangeAction); - menuStructure->addSeparator(); - menuStructure->addAction(strCutEventsAction); - //------------------------------------------------------------- // popup Midi //------------------------------------------------------------- @@ -1280,24 +823,19 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //menu_help->addSeparator(); //menu_ids[CMD_START_WHATSTHIS] = menu_help->insertItem(tr("What's &This?"), this, SLOT(whatsThis()), 0); + + arrangerView = new ArrangerView(this); + connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed())); + toplevels.push_back(Toplevel(Toplevel::ARRANGER, (unsigned long)(arrangerView), arrangerView)); + arrangerView->hide(); + arranger=arrangerView->getArranger(); + + //--------------------------------------------------- // Central Widget //--------------------------------------------------- - arranger = new Arranger(this, "arranger"); - setCentralWidget(arranger); - - connect(tools1, SIGNAL(toolChanged(int)), arranger, SLOT(setTool(int))); - connect(visTracks, SIGNAL(visibilityChanged()), song, SLOT(update()) ); - connect(arranger, SIGNAL(editPart(Track*)), SLOT(startEditor(Track*))); - connect(arranger, SIGNAL(dropSongFile(const QString&)), SLOT(loadProjectFile(const QString&))); - connect(arranger, SIGNAL(dropMidiFile(const QString&)), SLOT(importMidi(const QString&))); - connect(arranger, SIGNAL(startEditor(PartList*,int)), SLOT(startEditor(PartList*,int))); - connect(arranger, SIGNAL(toolChanged(int)), tools1, SLOT(set(int))); - connect(this, SIGNAL(configChanged()), arranger, SLOT(configChanged())); - - connect(arranger, SIGNAL(setUsedTool(int)), SLOT(setUsedTool(int))); - + //TODO FINDMICHJETZT mdiarea erstellen und als central widget setzen! //--------------------------------------------------- // read list of "Recent Projects" //--------------------------------------------------- @@ -1327,24 +865,12 @@ MusE::MusE(int argc, char** argv) : QMainWindow() initMidiSynth(); - QActionGroup *grp = populateAddTrack(addTrack); - - trackMidiAction = grp->actions()[0]; - trackDrumAction = grp->actions()[1]; - trackWaveAction = grp->actions()[2]; - trackAOutputAction = grp->actions()[3]; - trackAGroupAction = grp->actions()[4]; - trackAInputAction = grp->actions()[5]; - trackAAuxAction = grp->actions()[6]; + arrangerView->populateAddTrack(); + arrangerView->updateShortcuts(); transport = new Transport(this, "transport"); bigtime = 0; - QClipboard* cb = QApplication::clipboard(); - connect(cb, SIGNAL(dataChanged()), SLOT(clipboardChanged())); - connect(cb, SIGNAL(selectionChanged()), SLOT(clipboardChanged())); - connect(arranger, SIGNAL(selectionChanged()), SLOT(selectionChanged())); - //--------------------------------------------------- // load project // if no songname entered on command line: @@ -1495,7 +1021,7 @@ void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) if (restartSequencer) seqStart(); - visTracks->updateVisibleTracksButtons(); + //visTracks->updateVisibleTracksButtons(); //TODO FINDMICHJETZT progress->setValue(100); delete progress; progress=0; @@ -1604,6 +1130,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll viewTransportAction->setChecked(config.transportVisible); viewBigtimeAction->setChecked(config.bigTimeVisible); viewMarkerAction->setChecked(config.markerVisible); + viewArrangerAction->setChecked(config.arrangerVisible); autoMixerAction->setChecked(automation); @@ -1649,9 +1176,9 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll loopAction->setChecked(song->loop()); song->update(); song->updatePos(); - clipboardChanged(); // enable/disable "Paste" - selectionChanged(); // enable/disable "Copy" & "Paste" - scoreNamingChanged(); // inform the score menus about the new scores and their names + arrangerView->clipboardChanged(); // enable/disable "Paste" + arrangerView->selectionChanged(); // enable/disable "Copy" & "Paste" + arrangerView->scoreNamingChanged(); // inform the score menus about the new scores and their names progress->setValue(50); // p3.3.53 Try this AFTER the song update above which does a mixer update... Tested OK - mixers resize properly now. @@ -1975,10 +1502,6 @@ void MusE::showMarker(bool flag) if (markerView == 0) { markerView = new MarkerView(this); - // Removed p3.3.43 - // Song::addMarker() already emits a 'markerChanged'. - //connect(arranger, SIGNAL(addMarker(int)), markerView, SLOT(addMarker(int))); - connect(markerView, SIGNAL(closed()), SLOT(markerClosed())); toplevels.push_back(Toplevel(Toplevel::MARKER, (unsigned long)(markerView), markerView)); markerView->show(); @@ -1996,6 +1519,34 @@ void MusE::markerClosed() viewMarkerAction->setChecked(false); } +//--------------------------------------------------------- +// toggleArranger +//--------------------------------------------------------- + +void MusE::toggleArranger(bool checked) + { + showArranger(checked); + } + +//--------------------------------------------------------- +// showArranger +//--------------------------------------------------------- + +void MusE::showArranger(bool flag) + { + arrangerView->setVisible(flag); + viewArrangerAction->setChecked(flag); + } + +//--------------------------------------------------------- +// arrangerClosed +//--------------------------------------------------------- + +void MusE::arrangerClosed() + { + viewArrangerAction->setChecked(false); + } + //--------------------------------------------------------- // toggleTransport //--------------------------------------------------------- @@ -2121,48 +1672,6 @@ PartList* MusE::getMidiPartsToEdit() return pl; } -void MusE::scoreNamingChanged() -{ - updateScoreMenus(); -} - -void MusE::updateScoreMenus() -{ - QAction* action; - - - scoreOneStaffPerTrackSubsubmenu->clear(); - scoreAllInOneSubsubmenu->clear(); - - - action=new QAction(tr("New"), this); - connect(action, SIGNAL(activated()), scoreOneStaffPerTrackMapper, SLOT(map())); - scoreOneStaffPerTrackMapper->setMapping(action, (QWidget*)NULL); - scoreOneStaffPerTrackSubsubmenu->addAction(action); - - - action=new QAction(tr("New"), this); //the above action may NOT be reused! - connect(action, SIGNAL(activated()), scoreAllInOneMapper, SLOT(map())); - scoreAllInOneMapper->setMapping(action, (QWidget*)NULL); - scoreAllInOneSubsubmenu->addAction(action); - - for (ToplevelList::iterator it=toplevels.begin(); it!=toplevels.end(); it++) - if (it->type()==Toplevel::SCORE) - { - ScoreEdit* score = (ScoreEdit*) it->cobject(); - - action=new QAction(score->get_name(), this); - connect(action, SIGNAL(activated()), scoreOneStaffPerTrackMapper, SLOT(map())); - scoreOneStaffPerTrackMapper->setMapping(action, (QWidget*)score); - scoreOneStaffPerTrackSubsubmenu->addAction(action); - - - action=new QAction(score->get_name(), this); //the above action may NOT be reused! - connect(action, SIGNAL(activated()), scoreAllInOneMapper, SLOT(map())); - scoreAllInOneMapper->setMapping(action, (QWidget*)score); - scoreAllInOneSubsubmenu->addAction(action); - } -} //--------------------------------------------------------- // startScoreEdit @@ -2194,12 +1703,12 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) destination->show(); toplevels.push_back(Toplevel(Toplevel::SCORE, (unsigned long)(destination), destination)); connect(destination, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); - connect(destination, SIGNAL(name_changed()), SLOT(scoreNamingChanged())); + connect(destination, SIGNAL(name_changed()), arrangerView, SLOT(scoreNamingChanged())); //connect(muse, SIGNAL(configChanged()), destination, SLOT(config_changed())); //commented out by flo, because the ScoreEditor connects to all //relevant signals on his own - updateScoreMenus(); + arrangerView->updateScoreMenus(); } destination->add_parts(pl, allInOne); @@ -2436,6 +1945,7 @@ void MusE::toplevelDeleted(unsigned long tl) bool mustUpdateScoreMenus=false; switch(i->type()) { case Toplevel::MARKER: + case Toplevel::ARRANGER: break; case Toplevel::CLIPLIST: // ORCAN: This needs to be verified. aid2 used to correspond to Cliplist: @@ -2457,7 +1967,7 @@ void MusE::toplevelDeleted(unsigned long tl) } toplevels.erase(i); if (mustUpdateScoreMenus) - updateScoreMenus(); + arrangerView->updateScoreMenus(); return; } } @@ -2465,27 +1975,7 @@ void MusE::toplevelDeleted(unsigned long tl) //assert(false); } -//--------------------------------------------------------- -// ctrlChanged -// midi ctrl value changed -//--------------------------------------------------------- -#if 0 -void MusE::ctrlChanged() - { - arranger->updateInspector(); - } -#endif - -//--------------------------------------------------------- -// keyPressEvent -//--------------------------------------------------------- - -void MusE::keyPressEvent(QKeyEvent* event) - { - // Pass it on to arranger part canvas. - arranger->getCanvas()->redirKeypress(event); - } //--------------------------------------------------------- // kbAccel @@ -2633,137 +2123,14 @@ static void catchSignal(int sig) } #endif -#if 0 -//--------------------------------------------------------- -// configPart -//--------------------------------------------------------- - -void MusE::configPart(int id) - { - if (id < 3) { - partConfig->setItemChecked(0, id == 0); - partConfig->setItemChecked(1, id == 1); - partConfig->setItemChecked(2, id == 2); - arranger->setShowPartType(id); - for (int i = 3; i < 10; ++i) { - partConfig->setItemEnabled(i, id == 2); - } - } - else { - bool flag = !partConfig->isItemChecked(id); - partConfig->setItemChecked(id, flag); - int val = arranger->showPartEvent(); - if (flag) { - val |= 1 << (id-3); - } - else { - val &= ~(1 << (id-3)); - } - arranger->setShowPartEvent(val); - } - } -#endif - //--------------------------------------------------------- // cmd // some cmd's from pulldown menu //--------------------------------------------------------- -void MusE::cmd(int cmd) +void MusE::cmd(int cmd) //FINDMICHJETZT { - TrackList* tracks = song->tracks(); - int l = song->lpos(); - int r = song->rpos(); - switch(cmd) { - case CMD_CUT: - arranger->cmd(Arranger::CMD_CUT_PART); - break; - case CMD_COPY: - arranger->cmd(Arranger::CMD_COPY_PART); - break; - case CMD_PASTE: - arranger->cmd(Arranger::CMD_PASTE_PART); - break; - case CMD_PASTE_CLONE: - arranger->cmd(Arranger::CMD_PASTE_CLONE_PART); - break; - case CMD_PASTE_TO_TRACK: - arranger->cmd(Arranger::CMD_PASTE_PART_TO_TRACK); - break; - case CMD_PASTE_CLONE_TO_TRACK: - arranger->cmd(Arranger::CMD_PASTE_CLONE_PART_TO_TRACK); - break; - case CMD_INSERT: - arranger->cmd(Arranger::CMD_INSERT_PART); - break; - case CMD_INSERTMEAS: - arranger->cmd(Arranger::CMD_INSERT_EMPTYMEAS); - break; - case CMD_DELETE: - if (!song->msgRemoveParts()) //automatically does undo if neccessary and returns true then - { - //msgRemoveParts() returned false -> no parts to remove? - song->startUndo(); - audio->msgRemoveTracks(); //TODO FINDME this could still be speeded up! - song->endUndo(SC_TRACK_REMOVED); - } - break; - case CMD_DELETE_TRACK: - song->startUndo(); - audio->msgRemoveTracks(); - song->endUndo(SC_TRACK_REMOVED); - audio->msgUpdateSoloStates(); - break; - - case CMD_SELECT_ALL: - case CMD_SELECT_NONE: - case CMD_SELECT_INVERT: - case CMD_SELECT_ILOOP: - case CMD_SELECT_OLOOP: - for (iTrack i = tracks->begin(); i != tracks->end(); ++i) { - PartList* parts = (*i)->parts(); - for (iPart p = parts->begin(); p != parts->end(); ++p) { - bool f = false; - int t1 = p->second->tick(); - int t2 = t1 + p->second->lenTick(); - bool inside = - ((t1 >= l) && (t1 < r)) - || ((t2 > l) && (t2 < r)) - || ((t1 <= l) && (t2 > r)); - switch(cmd) { - case CMD_SELECT_INVERT: - f = !p->second->selected(); - break; - case CMD_SELECT_NONE: - f = false; - break; - case CMD_SELECT_ALL: - f = true; - break; - case CMD_SELECT_ILOOP: - f = inside; - break; - case CMD_SELECT_OLOOP: - f = !inside; - break; - } - p->second->setSelected(f); - } - } - song->update(); - break; - - case CMD_SELECT_PARTS: - for (iTrack i = tracks->begin(); i != tracks->end(); ++i) { - if (!(*i)->selected()) - continue; - PartList* parts = (*i)->parts(); - for (iPart p = parts->begin(); p != parts->end(); ++p) - p->second->setSelected(true); - } - song->update(); - break; case CMD_FOLLOW_NO: song->setFollow(Song::NO); setFollow(); @@ -2776,43 +2143,10 @@ void MusE::cmd(int cmd) song->setFollow(Song::CONTINUOUS); setFollow(); break; - - case CMD_SHRINK_PART: shrink_parts(); break; - case CMD_EXPAND_PART: expand_parts(); break; - case CMD_CLEAN_PART: clean_parts(); break; } } -//--------------------------------------------------------- -// clipboardChanged -//--------------------------------------------------------- -void MusE::clipboardChanged() - { - bool flag = false; - if(QApplication::clipboard()->mimeData()->hasFormat(QString("text/x-muse-midipartlist")) || - QApplication::clipboard()->mimeData()->hasFormat(QString("text/x-muse-wavepartlist")) || - QApplication::clipboard()->mimeData()->hasFormat(QString("text/x-muse-mixedpartlist"))) - flag = true; - - editPasteAction->setEnabled(flag); - editInsertAction->setEnabled(flag); - editPasteCloneAction->setEnabled(flag); - editPaste2TrackAction->setEnabled(flag); - editPasteC2TAction->setEnabled(flag); - } - -//--------------------------------------------------------- -// selectionChanged -//--------------------------------------------------------- - -void MusE::selectionChanged() - { - //bool flag = arranger->isSingleSelection(); // -- Hmm, why only single? - bool flag = arranger->selectionSize() > 0; // -- Test OK cut and copy. For muse2. Tim. - editCutAction->setEnabled(flag); - editCopyAction->setEnabled(flag); - } @@ -3240,6 +2574,7 @@ again: switch (tl.type()) { case Toplevel::CLIPLIST: case Toplevel::MARKER: + case Toplevel::ARRANGER: break; case Toplevel::PIANO_ROLL: case Toplevel::SCORE: @@ -3346,41 +2681,7 @@ void MusE::updateConfiguration() undoAction->setShortcut(shortcuts[SHRT_UNDO].key); redoAction->setShortcut(shortcuts[SHRT_REDO].key); - editCutAction->setShortcut(shortcuts[SHRT_CUT].key); - editCopyAction->setShortcut(shortcuts[SHRT_COPY].key); - editPasteAction->setShortcut(shortcuts[SHRT_PASTE].key); - editInsertAction->setShortcut(shortcuts[SHRT_INSERT].key); - editInsertEMAction->setShortcut(shortcuts[SHRT_INSERTMEAS].key); - editPasteCloneAction->setShortcut(shortcuts[SHRT_PASTE_CLONE].key); - editPaste2TrackAction->setShortcut(shortcuts[SHRT_PASTE_TO_TRACK].key); - editPasteC2TAction->setShortcut(shortcuts[SHRT_PASTE_CLONE_TO_TRACK].key); - //editDeleteSelectedAction has no acceleration - - trackMidiAction->setShortcut(shortcuts[SHRT_ADD_MIDI_TRACK].key); - trackDrumAction->setShortcut(shortcuts[SHRT_ADD_DRUM_TRACK].key); - trackWaveAction->setShortcut(shortcuts[SHRT_ADD_WAVE_TRACK].key); - trackAOutputAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_OUTPUT].key); - trackAGroupAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_GROUP].key); - trackAInputAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_INPUT].key); - trackAAuxAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_AUX].key); - - editSelectAllAction->setShortcut(shortcuts[SHRT_SELECT_ALL].key); - editDeselectAllAction->setShortcut(shortcuts[SHRT_SELECT_NONE].key); - editInvertSelectionAction->setShortcut(shortcuts[SHRT_SELECT_INVERT].key); - editInsideLoopAction->setShortcut(shortcuts[SHRT_SELECT_OLOOP].key); - editOutsideLoopAction->setShortcut(shortcuts[SHRT_SELECT_OLOOP].key); - editAllPartsAction->setShortcut(shortcuts[SHRT_SELECT_PRTSTRACK].key); - - startPianoEditAction->setShortcut(shortcuts[SHRT_OPEN_PIANO].key); - startDrumEditAction->setShortcut(shortcuts[SHRT_OPEN_DRUMS].key); - startListEditAction->setShortcut(shortcuts[SHRT_OPEN_LIST].key); - startWaveEditAction->setShortcut(shortcuts[SHRT_OPEN_WAVE].key); - - masterGraphicAction->setShortcut(shortcuts[SHRT_OPEN_GRAPHIC_MASTER].key); - masterListAction->setShortcut(shortcuts[SHRT_OPEN_LIST_MASTER].key); - - midiTransformerAction->setShortcut(shortcuts[SHRT_OPEN_MIDI_TRANSFORM].key); //editSongInfoAction has no acceleration viewTransportAction->setShortcut(shortcuts[SHRT_OPEN_TRANSPORT].key); @@ -3390,11 +2691,6 @@ void MusE::updateConfiguration() //viewCliplistAction has no acceleration viewMarkerAction->setShortcut(shortcuts[SHRT_OPEN_MARKER].key); - strGlobalCutAction->setShortcut(shortcuts[SHRT_GLOBAL_CUT].key); - strGlobalInsertAction->setShortcut(shortcuts[SHRT_GLOBAL_INSERT].key); - strGlobalSplitAction->setShortcut(shortcuts[SHRT_GLOBAL_SPLIT].key); - strCopyRangeAction->setShortcut(shortcuts[SHRT_COPY_RANGE].key); - strCutEventsAction->setShortcut(shortcuts[SHRT_CUT_EVENTS].key); // midiEditInstAction does not have acceleration midiResetInstAction->setShortcut(shortcuts[SHRT_MIDI_RESET].key); @@ -3435,6 +2731,8 @@ void MusE::updateConfiguration() //menuSettings->setAccel(shortcuts[SHRT_CONFIG_AUDIO_PORTS].key, menu_ids[CMD_CONFIG_AUDIO_PORTS]); //menu_help->setAccel(menu_ids[CMD_START_WHATSTHIS], shortcuts[SHRT_START_WHATSTHIS].key); + //arrangerView->updateShortcuts(); //FINDMICHJETZT is done via signal + } //--------------------------------------------------------- @@ -3569,14 +2867,6 @@ void MusE::focusInEvent(QFocusEvent* ev) QMainWindow::focusInEvent(ev); } -//--------------------------------------------------------- -// setUsedTool -//--------------------------------------------------------- - -void MusE::setUsedTool(int tool) - { - tools1->set(tool); - } //--------------------------------------------------------- -- cgit v1.2.3 From 55d5f2d38bfe7c9673a315bb5597c20675bfde99 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 10 Aug 2011 17:53:12 +0000 Subject: THIS IS JUST A PROOF OF CONCEPT arranger is now a MdiSubWin --- muse2/muse/app.cpp | 30 ++++++++++++------ muse2/muse/app.h | 4 +++ muse2/muse/arranger/arrangerview.cpp | 10 ++++-- muse2/muse/arranger/arrangerview.h | 1 + muse2/muse/cobject.cpp | 60 ++++++++++++++++++++++++++++++++++++ muse2/muse/cobject.h | 16 +++++++++- muse2/muse/midiedit/scoreedit.cpp | 1 + 7 files changed, 109 insertions(+), 13 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 53078d44..8f60cff5 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "app.h" #include "master/lmaster.h" @@ -824,18 +826,26 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //menu_ids[CMD_START_WHATSTHIS] = menu_help->insertItem(tr("What's &This?"), this, SLOT(whatsThis()), 0); + //--------------------------------------------------- + // Central Widget + //--------------------------------------------------- + + + mdiArea=new QMdiArea(this); + setCentralWidget(mdiArea); + + arrangerView = new ArrangerView(this); connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed())); toplevels.push_back(Toplevel(Toplevel::ARRANGER, (unsigned long)(arrangerView), arrangerView)); arrangerView->hide(); arranger=arrangerView->getArranger(); - - - //--------------------------------------------------- - // Central Widget - //--------------------------------------------------- - - //TODO FINDMICHJETZT mdiarea erstellen und als central widget setzen! + + //QMdiSubWindow* subwin=new QMdiSubWindow(this); //FINDMICHJETZT + //subwin->setWidget(arrangerView); + //mdiArea->addSubWindow(subwin); + mdiArea->addSubWindow(arrangerView->createMdiWrapper()); + //--------------------------------------------------- // read list of "Recent Projects" //--------------------------------------------------- @@ -1021,7 +1031,7 @@ void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) if (restartSequencer) seqStart(); - //visTracks->updateVisibleTracksButtons(); //TODO FINDMICHJETZT + arrangerView->updateVisibleTracksButtons(); progress->setValue(100); delete progress; progress=0; @@ -2128,7 +2138,7 @@ static void catchSignal(int sig) // some cmd's from pulldown menu //--------------------------------------------------------- -void MusE::cmd(int cmd) //FINDMICHJETZT +void MusE::cmd(int cmd) { switch(cmd) { case CMD_FOLLOW_NO: @@ -2731,7 +2741,7 @@ void MusE::updateConfiguration() //menuSettings->setAccel(shortcuts[SHRT_CONFIG_AUDIO_PORTS].key, menu_ids[CMD_CONFIG_AUDIO_PORTS]); //menu_help->setAccel(menu_ids[CMD_START_WHATSTHIS], shortcuts[SHRT_START_WHATSTHIS].key); - //arrangerView->updateShortcuts(); //FINDMICHJETZT is done via signal + //arrangerView->updateShortcuts(); //commented out by flo: is done via signal } diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 9b46d6f7..51a494bf 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -14,6 +14,7 @@ #include + class QCloseEvent; class QFocusEvent; class QMainWindow; @@ -27,6 +28,7 @@ class QToolBar; class QToolButton; class QProgressDialog; class EditToolBar; +class QMdiArea; class Part; class PartList; @@ -98,6 +100,8 @@ class MusE : public QMainWindow QAction *editSongInfoAction; private: + QMdiArea* mdiArea; + // View Menu actions QAction *viewTransportAction, *viewBigtimeAction, *viewMixerAAction, *viewMixerBAction, *viewCliplistAction, *viewMarkerAction, *viewArrangerAction; diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 46685ce6..e9ace563 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -626,7 +626,7 @@ void ArrangerView::readStatus(Xml& xml) } -void ArrangerView::cmd(int cmd) //FINDMICHJETZT +void ArrangerView::cmd(int cmd) { TrackList* tracks = song->tracks(); int l = song->lpos(); @@ -866,10 +866,16 @@ void ArrangerView::clipboardChanged() // selectionChanged //--------------------------------------------------------- -void ArrangerView::selectionChanged() //FINDMICHJETZT +void ArrangerView::selectionChanged() { //bool flag = arranger->isSingleSelection(); // -- Hmm, why only single? bool flag = arranger->selectionSize() > 0; // -- Test OK cut and copy. For muse2. Tim. editCutAction->setEnabled(flag); editCopyAction->setEnabled(flag); } + + +void ArrangerView::updateVisibleTracksButtons() +{ + visTracks->updateVisibleTracksButtons(); +} diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index 9c19a731..9f869402 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -122,6 +122,7 @@ class ArrangerView : public TopWin void clipboardChanged(); void selectionChanged(); void updateShortcuts(); + void updateVisibleTracksButtons(); }; diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 22f675a3..d486abf0 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -10,6 +10,8 @@ #include "xml.h" #include "gui.h" +#include + //--------------------------------------------------------- // readStatus //--------------------------------------------------------- @@ -71,5 +73,63 @@ TopWin::TopWin(QWidget* parent, const char* name, // Allow multiple rows. Tim. //setDockNestingEnabled(true); setIconSize(ICON_SIZE); + + mdisubwin=NULL; } +void TopWin::hide() +{ + printf("HIDE SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH + if (mdisubwin) + mdisubwin->close(); + + QMainWindow::hide(); +} + +void TopWin::show() +{ + printf("SHOW SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH + if (mdisubwin) + mdisubwin->show(); + + QMainWindow::show(); +} + +void TopWin::setVisible(bool param) +{ + printf("SETVISIBLE SLOT (%i): mdisubwin is %p\n",(int)param, mdisubwin); //FINDMICH + if (mdisubwin) + { + if (param) + mdisubwin->show(); + else + mdisubwin->close(); + } + QMainWindow::setVisible(param); +} + +QMdiSubWindow* TopWin::createMdiWrapper() +{ + if (mdisubwin==NULL) + { + mdisubwin = new QMdiSubWindow(); + mdisubwin->setWidget(this); + } + + return mdisubwin; +} + +void TopWin::setFree() +{ + if (mdisubwin) + { + setParent(0); + mdisubwin->hide(); + delete mdisubwin; + } +} + +bool TopWin::isMdiWin() +{ + return (mdisubwin!=NULL); +} diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 0ab509e8..3788fb8f 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -14,6 +14,7 @@ #include #include +class QMdiSubWindow; class Xml; //--------------------------------------------------------- @@ -27,8 +28,21 @@ class TopWin : public QMainWindow public: virtual void readStatus(Xml&); virtual void writeStatus(int, Xml&) const; + + virtual QMdiSubWindow* createMdiWrapper(); + bool isMdiWin(); + void setFree(); + TopWin(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); + + private: + QMdiSubWindow* mdisubwin; + + public slots: + virtual void hide(); + virtual void show(); + virtual void setVisible(bool); }; //--------------------------------------------------------- @@ -51,7 +65,7 @@ class Toplevel { ToplevelType type() const { return _type; } unsigned long object() const { return _object; } TopWin* cobject() const { return _cobject; } - + private: ToplevelType _type; unsigned long _object; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 1636cc5d..cc581965 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4473,6 +4473,7 @@ void staff_t::update_part_indices() * o IMPORTANT: check new windowed arranger! * - do all signal connections work? * - are there any segfaults? + * o store window state for arranger, probably also for other stuff * * IMPORTANT TODO * o redo transport menu: offer "one beat" and "one bar" steps -- cgit v1.2.3 From 238b1b82799a26b73384bb9d712656c39a822a99 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 13 Aug 2011 15:15:27 +0000 Subject: main work for sharing menus and toolbars done this is only a "safety commit", it doesn't really work yet. but it also doesn't segfault :) --- muse2/muse/app.cpp | 224 +++++++++++++++++++++++++++++++++++++++++++++---- muse2/muse/app.h | 22 ++++- muse2/muse/cobject.cpp | 82 ++++++++++++++---- muse2/muse/cobject.h | 20 +++++ muse2/muse/main.cpp | 2 + 5 files changed, 316 insertions(+), 34 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 8f60cff5..c7636c12 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -6,6 +6,8 @@ // (C) Copyright 1999-2004 Werner Schweer (ws@seh.de) //========================================================= +#include + #include #include #include @@ -325,6 +327,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() editInstrument = 0; routingPopupMenu = 0; progress = 0; + activeTopWin = NULL; + currentMenuSharingTopwin = NULL; appName = QString("MusE"); setWindowTitle(appName); @@ -336,7 +340,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() heartBeatTimer = new QTimer(this); heartBeatTimer->setObjectName("timer"); connect(heartBeatTimer, SIGNAL(timeout()), song, SLOT(beat())); - + + + connect(this, SIGNAL(activeTopWinChanged(TopWin*)), SLOT(activeTopWinChangedSlot(TopWin*))); + #ifdef ENABLE_PYTHON //--------------------------------------------------- // Python bridge @@ -645,29 +652,32 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // Toolbar //-------------------------------------------------- + // when adding a toolbar to the main window, remember adding it to + // either the requiredToolbars or optionalToolbars list! + tools = addToolBar(tr("File Buttons")); tools->setObjectName("File Buttons"); tools->addAction(fileNewAction); tools->addAction(fileOpenAction); tools->addAction(fileSaveAction); - - - // - // Whats This - // tools->addAction(QWhatsThis::createAction(this)); - tools->addSeparator(); - tools->addActions(undoRedo->actions()); + QToolBar* undoToolbar = addToolBar(tr("Undo/Redo")); + undoToolbar->setObjectName("Undo/Redo (global)"); + undoToolbar->addActions(undoRedo->actions()); QToolBar* transportToolbar = addToolBar(tr("Transport")); - transportToolbar->setObjectName("Transport"); + transportToolbar->setObjectName("Transport (global)"); transportToolbar->addActions(transportAction->actions()); QToolBar* panicToolbar = addToolBar(tr("Panic")); - panicToolbar->setObjectName("Panic"); + panicToolbar->setObjectName("Panic (global)"); panicToolbar->addAction(panicAction); + requiredToolbars.push_back(tools); + optionalToolbars.push_back(undoToolbar); + optionalToolbars.push_back(transportToolbar); + optionalToolbars.push_back(panicToolbar); //rlimit lim; @@ -700,11 +710,19 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //--------------------------------------------------- + // when adding a menu to the main window, remember adding it to + // either the leadingMenus or trailingMenus list! + // also do NOT use menuBar()->addMenu(QString&), but ALWAYS + // create the menu with new QMenu and add it afterwards. + // the menu's owner must be this and not this->menuBar()! + //------------------------------------------------------------- // popup File //------------------------------------------------------------- - menu_file = menuBar()->addMenu(tr("&File")); + menu_file = new QMenu(tr("&File"), this); + menuBar()->addMenu(menu_file); + leadingMenus.push_back(menu_file); menu_file->addAction(fileNewAction); menu_file->addAction(fileOpenAction); menu_file->addMenu(openRecent); @@ -731,7 +749,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup View //------------------------------------------------------------- - menuView = menuBar()->addMenu(tr("&View")); + menuView = new QMenu(tr("&View"), this); + menuBar()->addMenu(menuView); + trailingMenus.push_back(menuView); menuView->addAction(viewTransportAction); menuView->addAction(viewBigtimeAction); @@ -746,7 +766,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Midi //------------------------------------------------------------- - menu_functions = menuBar()->addMenu(tr("&Midi")); + menu_functions = new QMenu(tr("&Midi"), this); + menuBar()->addMenu(menu_functions); + trailingMenus.push_back(menu_functions); + song->populateScriptMenu(menuScriptPlugins, this); menu_functions->addMenu(menuScriptPlugins); menu_functions->addAction(midiEditInstAction); @@ -772,7 +795,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Audio //------------------------------------------------------------- - menu_audio = menuBar()->addMenu(tr("&Audio")); + menu_audio = new QMenu(tr("&Audio"), this); + menuBar()->addMenu(menu_audio); + trailingMenus.push_back(menu_audio); + menu_audio->addAction(audioBounce2TrackAction); menu_audio->addAction(audioBounce2FileAction); menu_audio->addSeparator(); @@ -783,7 +809,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Automation //------------------------------------------------------------- - menuAutomation = menuBar()->addMenu(tr("A&utomation")); + menuAutomation = new QMenu(tr("A&utomation"), this); + menuBar()->addMenu(menuAutomation); + trailingMenus.push_back(menuAutomation); + menuAutomation->addAction(autoMixerAction); menuAutomation->addSeparator(); menuAutomation->addAction(autoSnapshotAction); @@ -793,7 +822,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Settings //------------------------------------------------------------- - menuSettings = menuBar()->addMenu(tr("Se&ttings")); + menuSettings = new QMenu(tr("Se&ttings"), this); + menuBar()->addMenu(menuSettings); + trailingMenus.push_back(menuSettings); + menuSettings->addAction(settingsGlobalAction); menuSettings->addAction(settingsShortcutsAction); menuSettings->addMenu(follow); @@ -813,7 +845,10 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Help //--------------------------------------------------- - menu_help = menuBar()->addMenu(tr("&Help")); + menu_help = new QMenu(tr("&Help"), this); + menuBar()->addMenu(menu_help); + trailingMenus.push_back(menu_help); + menu_help->addAction(helpManualAction); menu_help->addAction(helpHomepageAction); menu_help->addSeparator(); @@ -836,6 +871,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, (unsigned long)(arrangerView), arrangerView)); arrangerView->hide(); @@ -1745,6 +1781,7 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) { PianoRoll* pianoroll = new PianoRoll(pl, this, 0, arranger->cursorValue()); + pianoroll->shareToolsAndMenu(true); //FINDMICHJETZT if(showDefaultCtrls) // p4.0.12 pianoroll->addCtrl(); pianoroll->show(); @@ -1952,6 +1989,11 @@ void MusE::toplevelDeleted(unsigned long tl) { for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { if (i->object() == tl) { + + if (i->cobject() == currentMenuSharingTopwin) + setCurrentMenuSharingTopwin(NULL); + + bool mustUpdateScoreMenus=false; switch(i->type()) { case Toplevel::MARKER: @@ -1963,7 +2005,8 @@ void MusE::toplevelDeleted(unsigned long tl) viewCliplistAction->setChecked(false); return; //break; - // the followin editors can exist in more than + + // the following editors can exist in more than // one instantiation: case Toplevel::PIANO_ROLL: case Toplevel::LISTE: @@ -2904,3 +2947,148 @@ void MusE::findUnusedWaveFiles() UnusedWaveFiles unused(muse); unused.exec(); } + +void MusE::focusChanged(QWidget*, QWidget* now) +{ + QWidget* ptr=now; + + while (ptr) + { + if ( (dynamic_cast(ptr)!=0) || // *ptr is a TopWin or a derived class + (ptr==this) ) // the main window is selected + break; + ptr=dynamic_cast(ptr->parent()); //in the unlikely case that ptr is a QObject, this returns NULL, which stops the loop + } + + // ptr is either NULL, this or the pointer to a TopWin + if (ptr==this) + { + QMdiSubWindow* subwin=mdiArea->currentSubWindow(); + if (subwin) + { + ptr=subwin->widget(); + if (dynamic_cast(ptr)==NULL) + { + printf("ERROR: THIS SHOULD NEVER HAPPEN: The currently active MdiSubWindow (%s) does not wrap a TopWin but a %s\n",subwin->windowTitle().toAscii().data(),typeid(*ptr).name()); + ptr=NULL; + } + } + else + ptr=NULL; + } + + TopWin* win=dynamic_cast(ptr); + + // now 'win' is either NULL or the pointer to the active TopWin + if (win!=activeTopWin) + { + activeTopWin=win; + emit activeTopWinChanged(activeTopWin); + } +} + +/* FINDMICHJETZT +void MusE::focusChanged(QWidget* old, QWidget* now) +{ + if (now) + { + QWidget* ptr=now; + while (ptr) + { + if (dynamic_cast(ptr)!=0) break; + ptr=dynamic_cast(ptr->parent()); //in the unlikely case that ptr is a QObject, this returns NULL, which stops the loop + } + + if (ptr) + printf("focus changed to MainWin %p (%s)\n",ptr,ptr->windowTitle().toAscii().data()); + else + printf("focus changed to something which has no MainWin: %p (%s)\n",now, typeid(*now).name()); + } + else + printf("focus lost\n"); +} +*/ + + +void MusE::activeTopWinChangedSlot(TopWin* win) +{ + if (debugMsg) printf("ACTIVE TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "", win); + + if (win && (win->sharesToolsAndMenu())) + setCurrentMenuSharingTopwin(win); +} + + + +void MusE::setCurrentMenuSharingTopwin(TopWin* win) +{ + if (win && (win->sharesToolsAndMenu()==false)) + { + printf("WARNING: THIS SHOULD NEVER HAPPEN: MusE::setCurrentMenuSharingTopwin() called with a win which does not share (%s)! ignoring...\n", win->windowTitle().toAscii().data()); + return; + } + + if (win!=currentMenuSharingTopwin) + { + if (debugMsg) printf("MENU SHARING TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "", win); + + // empty our toolbars + if (currentMenuSharingTopwin) + { + for (list::iterator it = foreignToolbars.begin(); it!=foreignToolbars.end(); it++) + if (*it) removeToolBar(*it); // this does not delete *it, which is good + + foreignToolbars.clear(); + } + else + { + for (list::iterator it = optionalToolbars.begin(); it!=optionalToolbars.end(); it++) + if (*it) removeToolBar(*it); // this does not delete *it, which is good + } + + //empty our menu + menuBar()->clear(); + + currentMenuSharingTopwin=win; + + + + + if (win) + { + for (list::iterator it = leadingMenus.begin(); it!=leadingMenus.end(); it++) + menuBar()->addMenu(*it); + + const QList& actions=win->menuBar()->actions(); + for (QList::const_iterator it=actions.begin(); it!=actions.end(); it++) + { + if (debugMsg) printf(" menu entry '%s'\n", (*it)->text().toAscii().data()); + + menuBar()->addAction(*it); + } + + for (list::iterator it = trailingMenus.begin(); it!=trailingMenus.end(); it++) + menuBar()->addMenu(*it); + + + + const list& toolbars=win->toolbars(); + for (list::const_iterator it=toolbars.begin(); it!=toolbars.end(); it++) + if (*it) + { + if (debugMsg) printf(" toolbar '%s'\n", (*it)->windowTitle().toAscii().data()); + + addToolBar(*it); + foreignToolbars.push_back(*it); + } + else + { + if (debugMsg) printf(" toolbar break\n"); + + addToolBarBreak(); + foreignToolbars.push_back(NULL); + } + } + //TODO FINDMICHJETZT + } +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 51a494bf..f1d112e9 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -13,8 +13,9 @@ #include "cobject.h" #include +#include - +class TopWin; class QCloseEvent; class QFocusEvent; class QMainWindow; @@ -101,6 +102,15 @@ class MusE : public QMainWindow private: QMdiArea* mdiArea; + + TopWin* activeTopWin; + TopWin* currentMenuSharingTopwin; + + std::list requiredToolbars; //always displayed + std::list optionalToolbars; //only displayed when no toolbar-sharing window is active + std::list foreignToolbars; //holds a temporary list of the toolbars of a toolbar-sharer + std::list leadingMenus; + std::list trailingMenus; // View Menu actions QAction *viewTransportAction, *viewBigtimeAction, *viewMixerAAction, *viewMixerBAction, *viewCliplistAction, *viewMarkerAction, *viewArrangerAction; @@ -130,11 +140,15 @@ class MusE : public QMainWindow QFileInfo project; QToolBar *tools; + // when adding a toolbar to the main window, remember adding it to + // either the requiredToolbars or optionalToolbars list! Transport* transport; BigTime* bigtime; EditInstrument* editInstrument; + // when adding a menu to the main window, remember adding it to + // either the leadingMenus or trailingMenus list! QMenu *menu_file, *menuView, *menuSettings, *menu_help; QMenu* menu_audio, *menuAutomation, *menuUtils; QMenu* menu_functions, *menuScriptPlugins; @@ -200,6 +214,7 @@ class MusE : public QMainWindow signals: void configChanged(); + void activeTopWinChanged(TopWin*); private slots: void loadProject(); @@ -269,6 +284,9 @@ class MusE : public QMainWindow void execDeliveredScript(int); void execUserScript(int); + + void activeTopWinChangedSlot(TopWin*); + void setCurrentMenuSharingTopwin(TopWin*); public slots: bool saveAs(); @@ -309,6 +327,8 @@ class MusE : public QMainWindow void startDrumEditor(PartList* /*pl*/, bool /*showDefaultCtrls*/ = false); void startEditor(Track*); void startMidiTransformer(); + + void focusChanged(QWidget* old, QWidget* now); public: MusE(int argc, char** argv); diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index d486abf0..c8ab1b08 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -11,6 +11,25 @@ #include "gui.h" #include +#include +#include + +using std::list; + +TopWin::TopWin(QWidget* parent, const char* name, Qt::WindowFlags f) + : QMainWindow(parent, f) + { + setObjectName(QString(name)); + //setAttribute(Qt::WA_DeleteOnClose); + // Allow multiple rows. Tim. + //setDockNestingEnabled(true); + setIconSize(ICON_SIZE); + + mdisubwin=NULL; + _sharesToolsAndMenu=false; + } + + //--------------------------------------------------------- // readStatus @@ -65,21 +84,8 @@ void TopWin::writeStatus(int level, Xml& xml) const xml.tag(level, "/topwin"); } -TopWin::TopWin(QWidget* parent, const char* name, - Qt::WindowFlags f) : QMainWindow(parent, f) - { - setObjectName(QString(name)); - //setAttribute(Qt::WA_DeleteOnClose); - // Allow multiple rows. Tim. - //setDockNestingEnabled(true); - setIconSize(ICON_SIZE); - - mdisubwin=NULL; - } - void TopWin::hide() { - printf("HIDE SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH if (mdisubwin) mdisubwin->close(); @@ -88,7 +94,6 @@ void TopWin::hide() void TopWin::show() { - printf("SHOW SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH if (mdisubwin) mdisubwin->show(); @@ -97,7 +102,6 @@ void TopWin::show() void TopWin::setVisible(bool param) { - printf("SETVISIBLE SLOT (%i): mdisubwin is %p\n",(int)param, mdisubwin); //FINDMICH if (mdisubwin) { if (param) @@ -133,3 +137,51 @@ bool TopWin::isMdiWin() { return (mdisubwin!=NULL); } + +void TopWin::insertToolBar(QToolBar*, QToolBar*) { printf("ERROR: THIS SHOULD NEVER HAPPEN: TopWin::insertToolBar called, but it's not implemented! ignoring it\n"); } +void TopWin::insertToolBarBreak(QToolBar*) { printf("ERROR: THIS SHOULD NEVER HAPPEN: TopWin::insertToolBarBreak called, but it's not implemented! ignoring it\n"); } +void TopWin::removeToolBar(QToolBar*) { printf("ERROR: THIS SHOULD NEVER HAPPEN: TopWin::removeToolBar called, but it's not implemented! ignoring it\n"); } +void TopWin::removeToolBarBreak(QToolBar*) { printf("ERROR: THIS SHOULD NEVER HAPPEN: TopWin::removeToolBarBreak called, but it's not implemented! ignoring it\n"); } +void TopWin::addToolBar(Qt::ToolBarArea, QToolBar* tb) { printf("ERROR: THIS SHOULD NEVER HAPPEN: TopWin::addToolBar(Qt::ToolBarArea, QToolBar*) called, but it's not implemented!\nusing addToolBar(QToolBar*) instead\n"); addToolBar(tb);} + +void TopWin::addToolBar(QToolBar* toolbar) +{ + _toolbars.push_back(toolbar); + + if (!_sharesToolsAndMenu) + QMainWindow::addToolBar(toolbar); +} + +QToolBar* TopWin::addToolBar(const QString& title) +{ + QToolBar* toolbar = new QToolBar(title, this); + addToolBar(toolbar); + return toolbar; +} + + +void TopWin::shareToolsAndMenu(bool val) +{ + _sharesToolsAndMenu = val; + + if (!val) + { + for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) + if (*it != NULL) + QMainWindow::addToolBar(*it); + else + QMainWindow::addToolBarBreak(); + + menuBar()->show(); + } + else + { + for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) + if (*it != NULL) + QMainWindow::removeToolBar(*it); // this does NOT delete the toolbar, which is good + + menuBar()->hide(); + } + + emit toolsAndMenuSharingChanged(val); +} diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 3788fb8f..6244e876 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -15,6 +15,8 @@ #include class QMdiSubWindow; +class QFocusEvent; +class QToolBar; class Xml; //--------------------------------------------------------- @@ -36,13 +38,31 @@ class TopWin : public QMainWindow TopWin(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); + bool sharesToolsAndMenu() { return _sharesToolsAndMenu; } + void shareToolsAndMenu(bool); + const std::list& toolbars() { return _toolbars; } + + void addToolBar(QToolBar* toolbar); + QToolBar* addToolBar(const QString& title); + private: QMdiSubWindow* mdisubwin; + bool _sharesToolsAndMenu; + std::list _toolbars; + + void insertToolBar(QToolBar*, QToolBar*); + void insertToolBarBreak(QToolBar*); + void removeToolBar(QToolBar*); + void removeToolBarBreak(QToolBar*); + void addToolBar(Qt::ToolBarArea, QToolBar*); public slots: virtual void hide(); virtual void show(); virtual void setVisible(bool); + + signals: + void toolsAndMenuSharingChanged(bool); }; //--------------------------------------------------------- diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp index 192c0bd3..ebdf7b5d 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -101,6 +101,8 @@ class MuseApplication : public QApplication { void setMuse(MusE* m) { muse = m; + + connect(this,SIGNAL(focusChanged(QWidget*,QWidget*)),muse,SLOT(focusChanged(QWidget*,QWidget*))); #ifdef HAVE_LASH if(useLASH) startTimer (300); -- cgit v1.2.3 From 6898f640d5a95ab9c175388f22c4c846b8dbe5ab Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 14 Aug 2011 17:55:45 +0000 Subject: fixed "subwins steal focus" bug this can be seen as an incomplete POC again :) TODO: - save and restore toolbar positions - handle closing windows --- muse2/muse/app.cpp | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index c7636c12..74eda773 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -716,6 +716,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // create the menu with new QMenu and add it afterwards. // the menu's owner must be this and not this->menuBar()! + //------------------------------------------------------------- // popup File //------------------------------------------------------------- @@ -2961,7 +2962,7 @@ void MusE::focusChanged(QWidget*, QWidget* now) } // ptr is either NULL, this or the pointer to a TopWin - if (ptr==this) + /*if (ptr==this) FINDMICHJETZT { QMdiSubWindow* subwin=mdiArea->currentSubWindow(); if (subwin) @@ -2975,15 +2976,17 @@ void MusE::focusChanged(QWidget*, QWidget* now) } else ptr=NULL; - } - - TopWin* win=dynamic_cast(ptr); - - // now 'win' is either NULL or the pointer to the active TopWin - if (win!=activeTopWin) + }*/ + if (ptr!=this) // if the main win is selected, don't treat that as "none", but also don't handle it { - activeTopWin=win; - emit activeTopWinChanged(activeTopWin); + TopWin* win=dynamic_cast(ptr); + + // now 'win' is either NULL or the pointer to the active TopWin + if (win!=activeTopWin) + { + activeTopWin=win; + emit activeTopWinChanged(activeTopWin); + } } } @@ -3014,6 +3017,25 @@ void MusE::activeTopWinChangedSlot(TopWin* win) { if (debugMsg) printf("ACTIVE TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "", win); + if ((win==NULL) || (win->isMdiWin()==false)) + { + if (debugMsg) printf(" that's out of the MDI area\n"); + menuBar()->setFocus(Qt::MenuBarFocusReason); + } + if (win && false) //FINDMICHJETZT + { + if (win->isMdiWin()) + { + if (debugMsg) printf(" that's a mdiSubWin\n"); + } + else + { + if (debugMsg) printf(" that's a free floating window\n"); + mdiArea->setActiveSubWindow(NULL); + mdiArea->clearFocus(); + } + } + if (win && (win->sharesToolsAndMenu())) setCurrentMenuSharingTopwin(win); } @@ -3080,6 +3102,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) addToolBar(*it); foreignToolbars.push_back(*it); + (*it)->show(); //FINDMICHJETZT } else { -- cgit v1.2.3 From 01d2680f0d18f7783ca1e1f48098590cd0317284 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 14 Aug 2011 18:24:47 +0000 Subject: removed the senseless (unsigned long)(some_pointer) stuff, as some_pointer was stored as "real" (uncasted) pointer in the same struct --- muse2/muse/app.cpp | 45 ++++++++++++++++++------------------ muse2/muse/app.h | 2 +- muse2/muse/arranger/arrangerview.cpp | 4 ++-- muse2/muse/arranger/arrangerview.h | 2 +- muse2/muse/cliplist/cliplist.cpp | 2 +- muse2/muse/cliplist/cliplist.h | 2 +- muse2/muse/cobject.h | 9 +++----- muse2/muse/liste/listedit.cpp | 2 +- muse2/muse/liste/listedit.h | 2 +- muse2/muse/marker/markerview.cpp | 2 +- muse2/muse/marker/markerview.h | 2 +- muse2/muse/master/lmaster.cpp | 2 +- muse2/muse/master/lmaster.h | 2 +- muse2/muse/master/masteredit.cpp | 2 +- muse2/muse/master/masteredit.h | 2 +- muse2/muse/midiedit/drumedit.cpp | 2 +- muse2/muse/midiedit/drumedit.h | 2 +- muse2/muse/midiedit/pianoroll.cpp | 2 +- muse2/muse/midiedit/pianoroll.h | 2 +- muse2/muse/midiedit/scoreedit.cpp | 2 +- muse2/muse/midiedit/scoreedit.h | 2 +- muse2/muse/songfile.cpp | 24 +++++++++---------- muse2/muse/waveedit/waveedit.cpp | 2 +- muse2/muse/waveedit/waveedit.h | 2 +- muse2/muse/widgets/midisyncimpl.cpp | 2 -- muse2/muse/widgets/midisyncimpl.h | 3 --- 26 files changed, 59 insertions(+), 68 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 74eda773..cb1b9363 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, (unsigned long)(arrangerView), arrangerView)); + toplevels.push_back(Toplevel(Toplevel::ARRANGER, arrangerView)); arrangerView->hide(); arranger=arrangerView->getArranger(); @@ -1550,7 +1550,7 @@ void MusE::showMarker(bool flag) markerView = new MarkerView(this); connect(markerView, SIGNAL(closed()), SLOT(markerClosed())); - toplevels.push_back(Toplevel(Toplevel::MARKER, (unsigned long)(markerView), markerView)); + toplevels.push_back(Toplevel(Toplevel::MARKER, markerView)); markerView->show(); } markerView->setVisible(flag); @@ -1748,8 +1748,8 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) { destination = new ScoreEdit(this, 0, arranger->cursorValue()); destination->show(); - toplevels.push_back(Toplevel(Toplevel::SCORE, (unsigned long)(destination), destination)); - connect(destination, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::SCORE, 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())); //commented out by flo, because the ScoreEditor connects to all @@ -1786,8 +1786,8 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) if(showDefaultCtrls) // p4.0.12 pianoroll->addCtrl(); pianoroll->show(); - toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, (unsigned long)(pianoroll), pianoroll)); - connect(pianoroll, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::PIANO_ROLL, pianoroll)); + connect(pianoroll, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged())); } @@ -1807,8 +1807,8 @@ void MusE::startListEditor(PartList* pl) { ListEdit* listEditor = new ListEdit(pl); listEditor->show(); - toplevels.push_back(Toplevel(Toplevel::LISTE, (unsigned long)(listEditor), listEditor)); - connect(listEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::LISTE, listEditor)); + connect(listEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged())); } @@ -1820,8 +1820,8 @@ void MusE::startMasterEditor() { MasterEdit* masterEditor = new MasterEdit(); masterEditor->show(); - toplevels.push_back(Toplevel(Toplevel::MASTER, (unsigned long)(masterEditor), masterEditor)); - connect(masterEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::MASTER, masterEditor)); + connect(masterEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } //--------------------------------------------------------- @@ -1832,8 +1832,8 @@ void MusE::startLMasterEditor() { LMaster* lmaster = new LMaster(); lmaster->show(); - toplevels.push_back(Toplevel(Toplevel::LMASTER, (unsigned long)(lmaster), lmaster)); - connect(lmaster, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::LMASTER, lmaster)); + connect(lmaster, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged())); } @@ -1856,8 +1856,8 @@ void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls) if(showDefaultCtrls) // p4.0.12 drumEditor->addCtrl(); drumEditor->show(); - toplevels.push_back(Toplevel(Toplevel::DRUM, (unsigned long)(drumEditor), drumEditor)); - connect(drumEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::DRUM, drumEditor)); + connect(drumEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged())); } @@ -1880,8 +1880,8 @@ 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, (unsigned long)(waveEditor), waveEditor)); - connect(waveEditor, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::WAVE, waveEditor)); + connect(waveEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } @@ -1937,8 +1937,8 @@ void MusE::startClipList(bool checked) if (clipListEdit == 0) { //clipListEdit = new ClipListEdit(); clipListEdit = new ClipListEdit(this); - toplevels.push_back(Toplevel(Toplevel::CLIPLIST, (unsigned long)(clipListEdit), clipListEdit)); - connect(clipListEdit, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::CLIPLIST, clipListEdit)); + connect(clipListEdit, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); } clipListEdit->show(); viewCliplistAction->setChecked(checked); @@ -1986,12 +1986,12 @@ void MusE::selectProject(QAction* act) // toplevelDeleted //--------------------------------------------------------- -void MusE::toplevelDeleted(unsigned long tl) +void MusE::toplevelDeleted(TopWin* tl) { for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { if (i->object() == tl) { - if (i->cobject() == currentMenuSharingTopwin) + if (tl == currentMenuSharingTopwin) setCurrentMenuSharingTopwin(NULL); @@ -2025,7 +2025,7 @@ void MusE::toplevelDeleted(unsigned long tl) return; } } - printf("topLevelDeleted: top level %lx not found\n", tl); + printf("topLevelDeleted: top level %p not found\n", tl); //assert(false); } @@ -2624,7 +2624,6 @@ bool MusE::clearSong(bool clear_all) again: for (iToplevel i = toplevels.begin(); i != toplevels.end(); ++i) { Toplevel tl = *i; - unsigned long obj = tl.object(); switch (tl.type()) { case Toplevel::CLIPLIST: case Toplevel::MARKER: @@ -2637,7 +2636,7 @@ again: case Toplevel::MASTER: case Toplevel::WAVE: case Toplevel::LMASTER: - ((QWidget*)(obj))->close(); + tl.object()->close(); goto again; } } diff --git a/muse2/muse/app.h b/muse2/muse/app.h index f1d112e9..a070c864 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -294,7 +294,7 @@ class MusE : public QMainWindow void closeEvent(QCloseEvent*e); void loadProjectFile(const QString&); void loadProjectFile(const QString&, bool songTemplate, bool loadAll); - void toplevelDeleted(unsigned long tl); + void toplevelDeleted(TopWin* tl); void loadTheme(const QString&); void loadStyleSheetFile(const QString&); bool seqRestart(); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index e9ace563..8c0627b4 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -581,7 +581,7 @@ ArrangerView::~ArrangerView() void ArrangerView::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); emit closed(); e->accept(); } @@ -759,7 +759,7 @@ void ArrangerView::updateScoreMenus() for (ToplevelList::const_iterator it=toplevels->begin(); it!=toplevels->end(); it++) if (it->type()==Toplevel::SCORE) { - ScoreEdit* score = (ScoreEdit*) it->cobject(); + ScoreEdit* score = (ScoreEdit*) it->object(); action=new QAction(score->get_name(), this); connect(action, SIGNAL(activated()), scoreOneStaffPerTrackMapper, SLOT(map())); diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index 9f869402..dc4aa638 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -102,7 +102,7 @@ class ArrangerView : public TopWin void cmd(int); signals: - void deleted(unsigned long); + void deleted(TopWin*); void closed(); public: diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 96636463..35d38b3d 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -149,7 +149,7 @@ void ClipListEdit::updateList() void ClipListEdit::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/cliplist/cliplist.h b/muse2/muse/cliplist/cliplist.h index d440aec3..e452478a 100644 --- a/muse2/muse/cliplist/cliplist.h +++ b/muse2/muse/cliplist/cliplist.h @@ -54,7 +54,7 @@ class ClipListEdit : public TopWin { void clicked(QTreeWidgetItem*, int); signals: - void deleted(unsigned long); + void deleted(TopWin*); public: ClipListEdit(QWidget* parent); diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 6244e876..48653f4b 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -77,19 +77,16 @@ class Toplevel { , M_PATCHBAY #endif /* PATCHBAY */ }; - Toplevel(ToplevelType t, unsigned long obj, TopWin* cobj) { + Toplevel(ToplevelType t, TopWin* obj) { _type = t; _object = obj; - _cobject = cobj; } ToplevelType type() const { return _type; } - unsigned long object() const { return _object; } - TopWin* cobject() const { return _cobject; } + TopWin* object() const { return _object; } private: ToplevelType _type; - unsigned long _object; - TopWin* _cobject; + TopWin* _object; }; typedef std::list ToplevelList; diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 5f73a3ba..887fc4f7 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -165,7 +165,7 @@ static QString midiMetaComment(const Event& ev) void ListEdit::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h index 397a5e08..9e29035e 100644 --- a/muse2/muse/liste/listedit.h +++ b/muse2/muse/liste/listedit.h @@ -68,7 +68,7 @@ class ListEdit : public MidiEditor { void songChanged(int); signals: - void deleted(unsigned long); + void deleted(TopWin*); public: ListEdit(PartList*); diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index d22807b6..8a13e118 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -141,7 +141,7 @@ void MarkerItem::setTick(unsigned v) void MarkerView::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); emit closed(); e->accept(); } diff --git a/muse2/muse/marker/markerview.h b/muse2/muse/marker/markerview.h index 5ad4f4bd..94a6314e 100644 --- a/muse2/muse/marker/markerview.h +++ b/muse2/muse/marker/markerview.h @@ -77,7 +77,7 @@ class MarkerView : public TopWin { void songChanged(int); signals: - void deleted(unsigned long); + void deleted(TopWin*); void closed(); public: diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 9083c024..9d61311e 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -95,7 +95,7 @@ QString keyToString(key_enum key) //flo void LMaster::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h index b2919b23..a64fd49d 100644 --- a/muse2/muse/master/lmaster.h +++ b/muse2/muse/master/lmaster.h @@ -156,7 +156,7 @@ class LMaster : public MidiEditor { void configChanged(); signals: - void deleted(unsigned long); + void deleted(TopWin*); void seekTo(int tick); public: diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 9053f3a8..8d41e37a 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -43,7 +43,7 @@ QByteArray MasterEdit::_toolbarInit; void MasterEdit::closeEvent(QCloseEvent* e) { - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h index b2b06291..011ea302 100644 --- a/muse2/muse/master/masteredit.h +++ b/muse2/muse/master/masteredit.h @@ -81,7 +81,7 @@ class MasterEdit : public MidiEditor { // void tempoChanged(double); signals: - void deleted(unsigned long); + void deleted(TopWin*); public: MasterEdit(); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index e6326cf9..fde698ce 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -147,7 +147,7 @@ void DrumEdit::closeEvent(QCloseEvent* e) _dlistWidthInit = *it; //There are only 2 values stored in the sizelist, size of dlist widget and dcanvas widget it++; _dcanvasWidthInit = *it; - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index 64390cd9..a9ec4d06 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -122,7 +122,7 @@ class DrumEdit : public MidiEditor { virtual void updateHScrollRange(); signals: - void deleted(unsigned long); + void deleted(TopWin*); public: DrumEdit(PartList*, QWidget* parent = 0, const char* name = 0, unsigned initPos = MAXINT); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index b2fe55ee..46c59f2f 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -788,7 +788,7 @@ void PianoRoll::closeEvent(QCloseEvent* e) //settings.setValue("Pianoroll/geometry", saveGeometry()); settings.setValue("Pianoroll/windowState", saveState()); - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h index 1f53254d..2677d530 100644 --- a/muse2/muse/midiedit/pianoroll.h +++ b/muse2/muse/midiedit/pianoroll.h @@ -160,7 +160,7 @@ class PianoRoll : public MidiEditor { void updateTrackInfo(); signals: - void deleted(unsigned long); + void deleted(TopWin*); public slots: virtual void updateHScrollRange(); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index cc581965..99ce2844 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -636,7 +636,7 @@ void ScoreEdit::closeEvent(QCloseEvent* e) //settings.setValue("ScoreEdit/geometry", saveGeometry()); settings.setValue("ScoreEdit/windowState", saveState()); - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index 6a5dd63a..65990df5 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -168,7 +168,7 @@ class ScoreEdit : public TopWin void clipboard_changed(); signals: - void deleted(unsigned long); + void deleted(TopWin*); void name_changed(); void velo_changed(int); void velo_off_changed(int); diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 72cacfaa..d6c06889 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -1011,15 +1011,15 @@ void MusE::readToplevels(Xml& xml) if(!pl->empty()) { startPianoroll(pl); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->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, (unsigned long)(score), score)); - connect(score, SIGNAL(deleted(unsigned long)), SLOT(toplevelDeleted(unsigned long))); + toplevels.push_back(Toplevel(Toplevel::SCORE, 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().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); pl = new PartList; } } @@ -1035,33 +1035,33 @@ void MusE::readToplevels(Xml& xml) if(!pl->empty()) { startListEditor(pl); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); pl = new PartList; } } else if (tag == "master") { startMasterEditor(); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); } else if (tag == "lmaster") { startLMasterEditor(); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); } else if (tag == "marker") { showMarker(true); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); } else if (tag == "waveedit") { if(!pl->empty()) { startWaveEditor(pl); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->readStatus(xml); pl = new PartList; } } else if (tag == "cliplist") { startClipList(true); - toplevels.back().cobject()->readStatus(xml); + toplevels.back().object()->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->cobject()->isVisible()) - i->cobject()->writeStatus(level, xml); + if (i->object()->isVisible()) + i->object()->writeStatus(level, xml); } xml.tag(level--, "/toplevels"); } diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 7a5ad815..cf0d2fc9 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -53,7 +53,7 @@ void WaveEdit::closeEvent(QCloseEvent* e) QSettings settings("MusE", "MusE-qt"); //settings.setValue("Waveedit/geometry", saveGeometry()); settings.setValue("Waveedit/windowState", saveState()); - emit deleted((unsigned long)this); + emit deleted(static_cast(this)); e->accept(); } diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h index 1ff8a65b..2bfffcc1 100644 --- a/muse2/muse/waveedit/waveedit.h +++ b/muse2/muse/waveedit/waveedit.h @@ -78,7 +78,7 @@ class WaveEdit : public MidiEditor { signals: - void deleted(unsigned long); + void deleted(TopWin*); public: WaveEdit(PartList*); diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp index c70cb79f..07527973 100644 --- a/muse2/muse/widgets/midisyncimpl.cpp +++ b/muse2/muse/widgets/midisyncimpl.cpp @@ -673,8 +673,6 @@ void MidiSyncConfig::closeEvent(QCloseEvent* e) apply(); } - //emit deleted((unsigned long)this); - disconnect(heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat())); disconnect(song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); diff --git a/muse2/muse/widgets/midisyncimpl.h b/muse2/muse/widgets/midisyncimpl.h index 3eb33451..9b133af2 100644 --- a/muse2/muse/widgets/midisyncimpl.h +++ b/muse2/muse/widgets/midisyncimpl.h @@ -104,9 +104,6 @@ class MidiSyncConfig : public QDialog, public Ui::MidiSyncConfigBase { //void renameOk(QListViewItem*, int, const QString&); void songChanged(int); - //signals: - // void deleted(unsigned long); - public: MidiSyncConfig(QWidget* parent=0); //MidiSyncConfig(); -- cgit v1.2.3 From 078e927639369928a6fa0483c82867dae6cbf9a2 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 14 Aug 2011 20:55:27 +0000 Subject: added "As subwindow" menu entries and made them work --- muse2/muse/app.cpp | 25 ++++++++++-------- muse2/muse/app.h | 2 ++ muse2/muse/arranger/arrangerview.cpp | 2 ++ muse2/muse/cliplist/cliplist.cpp | 5 ++++ muse2/muse/cobject.cpp | 51 ++++++++++++++++++++++++++++++++---- muse2/muse/cobject.h | 11 +++++--- muse2/muse/liste/listedit.cpp | 4 +++ muse2/muse/marker/markerview.cpp | 7 ++++- muse2/muse/master/lmaster.cpp | 4 +++ muse2/muse/master/masteredit.cpp | 5 ++++ muse2/muse/midiedit/drumedit.cpp | 3 +++ muse2/muse/midiedit/pianoroll.cpp | 5 ++++ muse2/muse/midiedit/scoreedit.cpp | 6 ++++- muse2/muse/waveedit/waveedit.cpp | 4 +++ 14 files changed, 113 insertions(+), 21 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index cb1b9363..29f2dbc1 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -878,10 +878,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow() arrangerView->hide(); arranger=arrangerView->getArranger(); - //QMdiSubWindow* subwin=new QMdiSubWindow(this); //FINDMICHJETZT - //subwin->setWidget(arrangerView); - //mdiArea->addSubWindow(subwin); - mdiArea->addSubWindow(arrangerView->createMdiWrapper()); + //mdiArea->addSubWindow(arrangerView->createMdiWrapper()); + arrangerView->setIsMdiWin(true); + //--------------------------------------------------- // read list of "Recent Projects" @@ -3075,11 +3074,11 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) + for (list::iterator it = leadingMenus.begin(); it!=leadingMenus.end(); it++) + menuBar()->addMenu(*it); + if (win) { - for (list::iterator it = leadingMenus.begin(); it!=leadingMenus.end(); it++) - menuBar()->addMenu(*it); - const QList& actions=win->menuBar()->actions(); for (QList::const_iterator it=actions.begin(); it!=actions.end(); it++) { @@ -3088,9 +3087,6 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) menuBar()->addAction(*it); } - for (list::iterator it = trailingMenus.begin(); it!=trailingMenus.end(); it++) - menuBar()->addMenu(*it); - const list& toolbars=win->toolbars(); @@ -3111,6 +3107,13 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) foreignToolbars.push_back(NULL); } } - //TODO FINDMICHJETZT + + for (list::iterator it = trailingMenus.begin(); it!=trailingMenus.end(); it++) + menuBar()->addMenu(*it); } } + +void MusE::addMdiSubWindow(QMdiSubWindow* win) +{ + mdiArea->addSubWindow(win); +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index a070c864..d71d947b 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -329,6 +329,8 @@ class MusE : public QMainWindow void startMidiTransformer(); void focusChanged(QWidget* old, QWidget* now); + + void addMdiSubWindow(QMdiSubWindow*); public: MusE(int argc, char** argv); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 8c0627b4..576cd7eb 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -488,6 +488,8 @@ ArrangerView::ArrangerView(QWidget* parent) menuStructure->addSeparator(); menuStructure->addAction(strCutEventsAction); + QMenu* menuSettings = menuBar()->addMenu(tr("&Settings")); + menuSettings->addAction(subwinAction); //-------- Edit connections diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 35d38b3d..e0008ba1 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -7,6 +7,8 @@ //========================================================= #include +#include +#include #include "cliplist.h" #include "song.h" @@ -107,6 +109,9 @@ ClipListEdit::ClipListEdit(QWidget* parent) //editor->view->setColumnAlignment(COL_REFS, Qt::AlignRight); + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 int w = 2 + fm.width('9') * 9 + fm.width(':') * 3 + fw * 4; diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index c8ab1b08..8091db4b 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -9,10 +9,13 @@ #include "cobject.h" #include "xml.h" #include "gui.h" +#include "globals.h" +#include "app.h" #include #include #include +#include using std::list; @@ -27,6 +30,11 @@ TopWin::TopWin(QWidget* parent, const char* name, Qt::WindowFlags f) mdisubwin=NULL; _sharesToolsAndMenu=false; + + subwinAction=new QAction(tr("As subwindow"), this); + subwinAction->setCheckable(true); + subwinAction->setChecked(isMdiWin()); + connect(subwinAction, SIGNAL(toggled(bool)), SLOT(setIsMdiWin(bool))); } @@ -123,13 +131,45 @@ QMdiSubWindow* TopWin::createMdiWrapper() return mdisubwin; } -void TopWin::setFree() +void TopWin::setIsMdiWin(bool val) { - if (mdisubwin) + if (val) + { + if (!isMdiWin()) + { + bool vis=isVisible(); + QMdiSubWindow* subwin = createMdiWrapper(); + muse->addMdiSubWindow(subwin); + subwin->setVisible(vis); + + subwinAction->setChecked(true); + } + else + { + if (debugMsg) printf("TopWin::setIsMdiWin(true) called, but window is already a MDI win\n"); + } + } + else { - setParent(0); - mdisubwin->hide(); - delete mdisubwin; + if (isMdiWin()) + { + bool vis=isVisible(); + QMdiSubWindow* mdisubwin_temp=mdisubwin; + mdisubwin=NULL; + setParent(NULL); + mdisubwin_temp->hide(); + //TODO FINDMICH evtl noch ein signal emitten oder sowas? + delete mdisubwin_temp; + + printf("unMDIfied, visible is %i\n",vis); + setVisible(vis); + + subwinAction->setChecked(false); + } + else + { + if (debugMsg) printf("TopWin::setIsMdiWin(false) called, but window is not a MDI win\n"); + } } } @@ -185,3 +225,4 @@ void TopWin::shareToolsAndMenu(bool val) emit toolsAndMenuSharingChanged(val); } + diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 48653f4b..f02aa4dc 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -18,6 +18,7 @@ class QMdiSubWindow; class QFocusEvent; class QToolBar; class Xml; +class QAction; //--------------------------------------------------------- // TopWin @@ -31,9 +32,7 @@ class TopWin : public QMainWindow virtual void readStatus(Xml&); virtual void writeStatus(int, Xml&) const; - virtual QMdiSubWindow* createMdiWrapper(); bool isMdiWin(); - void setFree(); TopWin(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); @@ -49,17 +48,23 @@ class TopWin : public QMainWindow QMdiSubWindow* mdisubwin; bool _sharesToolsAndMenu; std::list _toolbars; - + void insertToolBar(QToolBar*, QToolBar*); void insertToolBarBreak(QToolBar*); void removeToolBar(QToolBar*); void removeToolBarBreak(QToolBar*); void addToolBar(Qt::ToolBarArea, QToolBar*); + virtual QMdiSubWindow* createMdiWrapper(); + + protected: + QAction* subwinAction; + public slots: virtual void hide(); virtual void show(); virtual void setVisible(bool); + void setIsMdiWin(bool); signals: void toolsAndMenuSharingChanged(bool); diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 887fc4f7..1c7e70da 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -496,6 +496,10 @@ ListEdit::ListEdit(PartList* pl) connect(editSignalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + + //---------ToolBar---------------------------------- listTools = addToolBar(tr("List tools")); diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index 8a13e118..ff7c8c07 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -172,7 +172,12 @@ MarkerView::MarkerView(QWidget* parent) editMenu->addAction(markerAdd); editMenu->addAction(markerDelete); - + + + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + + //---------ToolBar---------------------------------- tools = addToolBar(tr("marker-tools")); tools->addActions(undoRedo->actions()); diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 9d61311e..79762673 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -140,6 +140,10 @@ LMaster::LMaster() delAction = menuEdit->addAction(tr("Delete Event")); delAction->setShortcut(Qt::Key_Delete); + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + + connect(tempoAction, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(signAction, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(keyAction, SIGNAL(triggered()), signalMapper, SLOT(map())); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 8d41e37a..edc1a702 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include int MasterEdit::_rasterInit = 0; int MasterEdit::_widthInit = 600; @@ -91,6 +93,9 @@ MasterEdit::MasterEdit() // QPopupMenu* file = new QPopupMenu(this); // menuBar()->insertItem("&File", file); + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + //---------ToolBar---------------------------------- tools = addToolBar(tr("Master tools")); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index fde698ce..4b4910dd 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -264,6 +264,9 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini QMenu* menuScriptPlugins = menuBar()->addMenu(tr("&Plugins")); song->populateScriptMenu(menuScriptPlugins, this); + + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); connect(signalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 46c59f2f..1f20bf52 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -174,6 +174,11 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i connect(colorMapper, SIGNAL(mapped(int)), this, SLOT(eventColorModeChanged(int))); + menuConfig->addSeparator(); + menuConfig->addAction(subwinAction); + + + menuFunctions = menuBar()->addMenu(tr("&Functions")); menuFunctions->setTearOffEnabled(true); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 99ce2844..1297c395 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -403,7 +403,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) color_black_action->setChecked(true); menu_command(CMD_COLOR_BLACK); - + QMenu* preamble_menu = settings_menu->addMenu(tr("Set up &preamble")); preamble_keysig_action = preamble_menu->addAction(tr("Display &key signature")); preamble_timesig_action = preamble_menu->addAction(tr("Display &time signature")); @@ -418,6 +418,10 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) QAction* set_name_action = settings_menu->addAction(tr("Set Score &name"), menu_mapper, SLOT(map())); menu_mapper->setMapping(set_name_action, CMD_SET_NAME); + + settings_menu->addSeparator(); + settings_menu->addAction(subwinAction); + QMenu* functions_menu = menuBar()->addMenu(tr("&Functions")); diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index cf0d2fc9..6ad50c1c 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -154,6 +154,10 @@ WaveEdit::WaveEdit(PartList* pl) mapper->setMapping(selectNoneAction, CMD_SELECT_NONE); connect(selectNoneAction, SIGNAL(triggered()), mapper, SLOT(map())); + + QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + settingsMenu->addAction(subwinAction); + //---------ToolBar---------------------------------- tools = addToolBar(tr("Wave edit tools")); tools->setObjectName("Wave edit tools"); -- cgit v1.2.3 From 23f3026199641b6e2a2af69e10353cbe304e5649 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 15 Aug 2011 12:37:39 +0000 Subject: added transport and panic toolbars to all TopWins removed the Toplevel class, as the TopWin::type() function replaces it --- muse2/muse/app.cpp | 76 +++++++++++++++++++----------------- muse2/muse/arranger/arrangerview.cpp | 7 ++-- muse2/muse/cliplist/cliplist.cpp | 17 +++++++- muse2/muse/cobject.cpp | 4 +- muse2/muse/cobject.h | 41 +++++++------------ muse2/muse/liste/listedit.cpp | 21 +++++++--- muse2/muse/marker/markerview.cpp | 18 +++++++-- muse2/muse/master/lmaster.cpp | 18 +++++++-- muse2/muse/master/masteredit.cpp | 19 ++++++--- muse2/muse/midiedit/drumedit.cpp | 2 +- muse2/muse/midiedit/pianoroll.cpp | 2 +- muse2/muse/midiedit/scoreedit.cpp | 2 +- muse2/muse/midieditor.cpp | 4 +- muse2/muse/midieditor.h | 2 +- muse2/muse/songfile.cpp | 22 +++++------ muse2/muse/waveedit/waveedit.cpp | 2 +- 16 files changed, 153 insertions(+), 104 deletions(-) (limited to 'muse2/muse/app.cpp') 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(*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 #include #include +#include #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 _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 ToplevelList; +typedef std::list 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); -- cgit v1.2.3 From 6b5e69ff5def2c8469657e33413bec84d815df9d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 16 Aug 2011 16:27:54 +0000 Subject: this is only a backup commit toolbar states are now saved also for shared toolbars toolbar and window state saving is now handled in TopWin TODO: finish list, cliplist, masterlist, marker, arranger --- muse2/muse/app.cpp | 94 ++++++++++++------------------ muse2/muse/app.h | 2 + muse2/muse/arranger/arrangerview.cpp | 4 +- muse2/muse/cliplist/cliplist.cpp | 2 + muse2/muse/cobject.cpp | 109 +++++++++++++++++++++++++++++++++++ muse2/muse/cobject.h | 28 +++++++-- muse2/muse/liste/listedit.cpp | 1 + muse2/muse/marker/markerview.cpp | 5 +- muse2/muse/master/lmaster.cpp | 1 + muse2/muse/master/masteredit.cpp | 52 ++--------------- muse2/muse/master/masteredit.h | 6 -- muse2/muse/midiedit/drumedit.cpp | 59 +++---------------- muse2/muse/midiedit/drumedit.h | 6 -- muse2/muse/midiedit/pianoroll.cpp | 59 +++---------------- muse2/muse/midiedit/pianoroll.h | 6 -- muse2/muse/midiedit/scoreedit.cpp | 44 +++----------- muse2/muse/midiedit/scoreedit.h | 6 -- muse2/muse/waveedit/waveedit.cpp | 60 +++---------------- muse2/muse/waveedit/waveedit.h | 5 -- 19 files changed, 217 insertions(+), 332 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index fe3b987e..d3ad0e64 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1746,6 +1746,7 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) if (destination==NULL) // if no destination given, create a new one { destination = new ScoreEdit(this, 0, arranger->cursorValue()); + destination->shareToolsAndMenu(true); //FINDMICHJETZT destination->show(); toplevels.push_back(destination); connect(destination, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); @@ -2018,7 +2019,7 @@ void MusE::toplevelDeleted(TopWin* tl) case TopWin::SCORE: mustUpdateScoreMenus=true; - case TopWin::LAST_ENTRY: //to avoid a warning + case TopWin::TOPLEVELTYPE_LAST_ENTRY: //to avoid a warning break; } toplevels.erase(i); @@ -2641,7 +2642,7 @@ again: tl->close(); goto again; - case TopWin::LAST_ENTRY: //to avoid a warning + case TopWin::TOPLEVELTYPE_LAST_ENTRY: //to avoid a warning break; } } @@ -2956,7 +2957,15 @@ void MusE::findUnusedWaveFiles() void MusE::focusChanged(QWidget*, QWidget* now) { QWidget* ptr=now; + + if (activeTopWin) + activeTopWin->storeInitialState(); + if (currentMenuSharingTopwin && (currentMenuSharingTopwin!=activeTopWin)) + currentMenuSharingTopwin->storeInitialState(); + + + while (ptr) { if ( (dynamic_cast(ptr)!=0) || // *ptr is a TopWin or a derived class @@ -2966,21 +2975,6 @@ void MusE::focusChanged(QWidget*, QWidget* now) } // ptr is either NULL, this or the pointer to a TopWin - /*if (ptr==this) FINDMICHJETZT - { - QMdiSubWindow* subwin=mdiArea->currentSubWindow(); - if (subwin) - { - ptr=subwin->widget(); - if (dynamic_cast(ptr)==NULL) - { - printf("ERROR: THIS SHOULD NEVER HAPPEN: The currently active MdiSubWindow (%s) does not wrap a TopWin but a %s\n",subwin->windowTitle().toAscii().data(),typeid(*ptr).name()); - ptr=NULL; - } - } - else - ptr=NULL; - }*/ if (ptr!=this) // if the main win is selected, don't treat that as "none", but also don't handle it { TopWin* win=dynamic_cast(ptr); @@ -2994,28 +2988,6 @@ void MusE::focusChanged(QWidget*, QWidget* now) } } -/* FINDMICHJETZT -void MusE::focusChanged(QWidget* old, QWidget* now) -{ - if (now) - { - QWidget* ptr=now; - while (ptr) - { - if (dynamic_cast(ptr)!=0) break; - ptr=dynamic_cast(ptr->parent()); //in the unlikely case that ptr is a QObject, this returns NULL, which stops the loop - } - - if (ptr) - printf("focus changed to MainWin %p (%s)\n",ptr,ptr->windowTitle().toAscii().data()); - else - printf("focus changed to something which has no MainWin: %p (%s)\n",now, typeid(*now).name()); - } - else - printf("focus lost\n"); -} -*/ - void MusE::activeTopWinChangedSlot(TopWin* win) { @@ -3026,19 +2998,6 @@ void MusE::activeTopWinChangedSlot(TopWin* win) if (debugMsg) printf(" that's out of the MDI area\n"); menuBar()->setFocus(Qt::MenuBarFocusReason); } - if (win && false) //FINDMICHJETZT - { - if (win->isMdiWin()) - { - if (debugMsg) printf(" that's a mdiSubWin\n"); - } - else - { - if (debugMsg) printf(" that's a free floating window\n"); - mdiArea->setActiveSubWindow(NULL); - mdiArea->clearFocus(); - } - } if (win && (win->sharesToolsAndMenu())) setCurrentMenuSharingTopwin(win); @@ -3056,27 +3015,38 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) if (win!=currentMenuSharingTopwin) { + TopWin* previousMenuSharingTopwin = currentMenuSharingTopwin; + currentMenuSharingTopwin = NULL; + if (debugMsg) printf("MENU SHARING TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "", win); // empty our toolbars - if (currentMenuSharingTopwin) + if (previousMenuSharingTopwin) { for (list::iterator it = foreignToolbars.begin(); it!=foreignToolbars.end(); it++) - if (*it) removeToolBar(*it); // this does not delete *it, which is good + if (*it) + { + if (debugMsg) printf(" removing sharer's toolbar '%s'\n", (*it)->windowTitle().toAscii().data()); + removeToolBar(*it); // this does not delete *it, which is good + (*it)->setParent(NULL); + } foreignToolbars.clear(); } else { for (list::iterator it = optionalToolbars.begin(); it!=optionalToolbars.end(); it++) - if (*it) removeToolBar(*it); // this does not delete *it, which is good + if (*it) + { + if (debugMsg) printf(" removing optional toolbar '%s'\n", (*it)->windowTitle().toAscii().data()); + removeToolBar(*it); // this does not delete *it, which is good + (*it)->setParent(NULL); + } } //empty our menu menuBar()->clear(); - - currentMenuSharingTopwin=win; - + @@ -3116,6 +3086,14 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) for (list::iterator it = trailingMenus.begin(); it!=trailingMenus.end(); it++) menuBar()->addMenu(*it); + + + currentMenuSharingTopwin=win; + + printf ("FINDMICH: changing sharing win DONE.\n"); + + if (win) + win->restoreMainwinState(); //restore toolbar positions in main window } } diff --git a/muse2/muse/app.h b/muse2/muse/app.h index d71d947b..c491a2de 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -357,6 +357,8 @@ class MusE : public QMainWindow const ToplevelList* getToplevels() { return &toplevels; } + TopWin* getCurrentMenuSharingTopwin() { return currentMenuSharingTopwin; } + #ifdef HAVE_LASH void lash_idle_cb (); #endif diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 9e6b5c11..b6a48608 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -335,7 +335,7 @@ ArrangerView::ArrangerView(QWidget* parent) undo_tools->addActions(undoRedo->actions()); - QToolBar* panic_toolbar = addToolBar(tr("panic")); + QToolBar* panic_toolbar = addToolBar(tr("panic")); panic_toolbar->setObjectName("panic"); panic_toolbar->addAction(panicAction); @@ -573,6 +573,8 @@ ArrangerView::ArrangerView(QWidget* parent) // bug: 2811156 Softsynth GUI unclosable with XFCE4 (and a few others) show(); hide(); + + initalizing=false; } ArrangerView::~ArrangerView() diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index afd843ef..e49b315d 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -143,6 +143,8 @@ ClipListEdit::ClipListEdit(QWidget* parent) connect(editor->len, SIGNAL(valueChanged(const Pos&)), SLOT(lenChanged(const Pos&))); updateList(); + + initalizing=false; } ClipListEdit::~ClipListEdit() diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 8f3932ec..a97a29a1 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -19,9 +19,28 @@ using std::list; +int TopWin::_widthInit[TOPLEVELTYPE_LAST_ENTRY]; +int TopWin::_heightInit[TOPLEVELTYPE_LAST_ENTRY]; +QByteArray TopWin::_toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY]; +QByteArray TopWin::_toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY]; +bool TopWin::initInited=false; + TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlags f) : QMainWindow(parent, f) { + if (initInited==false) + { + for (int i=0;igetCurrentMenuSharingTopwin() == this) + _toolbarSharedInit[_type] = muse->saveState(); + } + else + _toolbarNonsharedInit[_type] = saveState(); + } + +//--------------------------------------------------------- +// readConfiguration +//--------------------------------------------------------- + +void TopWin::readConfiguration(ToplevelType t, Xml& xml) + { + for (;;) { + Xml::Token token = xml.parse(); + if (token == Xml::Error || token == Xml::End) + break; + const QString& tag = xml.s1(); + switch (token) { + case Xml::TagStart: + if (tag == "width") + _widthInit[t] = xml.parseInt(); + else if (tag == "height") + _heightInit[t] = xml.parseInt(); + else if (tag == "nonshared_toolbars") + _toolbarNonsharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "shared_toolbars") + _toolbarSharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii()); + else + xml.unknown("TopWin"); + break; + case Xml::TagEnd: + if (tag == "topwin") + return; + default: + break; + } + } + } + +//--------------------------------------------------------- +// writeConfiguration +//--------------------------------------------------------- + +void TopWin::writeConfiguration(ToplevelType t, int level, Xml& xml) + { + xml.tag(level++, "topwin"); + xml.intTag(level, "width", _widthInit[t]); + xml.intTag(level, "height", _heightInit[t]); + xml.strTag(level, "nonshared_toolbars", _toolbarNonsharedInit[t].toHex().data()); + xml.strTag(level, "shared_toolbars", _toolbarSharedInit[t].toHex().data()); + xml.etag(level, "topwin"); + } + +void TopWin::initTopwinState() +{ + printf("FINDMICH: in initTopwinState()\n"); + + if (sharesToolsAndMenu()) + { + if (this == muse->getCurrentMenuSharingTopwin()) + { + printf("FINDMICH RESTORING for %s...\n",windowTitle().toAscii().data()); + muse->restoreState(_toolbarSharedInit[_type]); + } + } + else + restoreState(_toolbarNonsharedInit[_type]); +} + +void TopWin::restoreMainwinState() +{ + if (sharesToolsAndMenu()) + initTopwinState(); +} diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index a106702a..ba731d1e 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -13,6 +13,7 @@ #include #include +#include class QMdiSubWindow; class QFocusEvent; @@ -29,12 +30,12 @@ class TopWin : public QMainWindow Q_OBJECT public: - enum ToplevelType { PIANO_ROLL, LISTE, DRUM, MASTER, WAVE, - LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER, + enum ToplevelType { PIANO_ROLL=0, LISTE, DRUM, MASTER, WAVE, //there shall be no + LMASTER, CLIPLIST, MARKER, SCORE, ARRANGER, //gaps in the enum! #ifdef PATCHBAY M_PATCHBAY, #endif /* PATCHBAY */ - LAST_ENTRY + TOPLEVELTYPE_LAST_ENTRY //this has to be always the last entry }; ToplevelType type() const { return _type; } @@ -42,6 +43,10 @@ class TopWin : public QMainWindow virtual void readStatus(Xml&); virtual void writeStatus(int, Xml&) const; + + static void readConfiguration(ToplevelType, Xml&); + static void writeConfiguration(ToplevelType, int, Xml&); + bool isMdiWin(); @@ -55,8 +60,6 @@ class TopWin : public QMainWindow QToolBar* addToolBar(const QString& title); private: - ToplevelType _type; - QMdiSubWindow* mdisubwin; bool _sharesToolsAndMenu; std::list _toolbars; @@ -68,15 +71,30 @@ class TopWin : public QMainWindow void addToolBar(Qt::ToolBarArea, QToolBar*); virtual QMdiSubWindow* createMdiWrapper(); + protected: QAction* subwinAction; + + ToplevelType _type; + + static int _widthInit[TOPLEVELTYPE_LAST_ENTRY]; + static int _heightInit[TOPLEVELTYPE_LAST_ENTRY]; + static QByteArray _toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY]; + static QByteArray _toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY]; + static bool initInited; + + void initTopwinState(); + + bool initalizing; //if true, no state is saved public slots: virtual void hide(); virtual void show(); virtual void setVisible(bool); void setIsMdiWin(bool); + void restoreMainwinState(); + void storeInitialState(); signals: void toolsAndMenuSharingChanged(bool); diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index d37d80bd..cd3d165e 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -587,6 +587,7 @@ ListEdit::ListEdit(PartList* pl) } initShortcuts(); + initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index ad1e49d2..3c0f2267 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -188,7 +188,7 @@ MarkerView::MarkerView(QWidget* parent) edit->addAction(markerAdd); edit->addAction(markerDelete); - QToolBar* panic_toolbar = addToolBar(tr("panic")); + QToolBar* panic_toolbar = addToolBar(tr("panic")); panic_toolbar->setObjectName("panic"); panic_toolbar->addAction(panicAction); @@ -284,7 +284,8 @@ MarkerView::MarkerView(QWidget* parent) // bug: 2811156 Softsynth GUI unclosable with XFCE4 (and a few others) show(); hide(); - + + initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 538a20c7..f434e99a 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -245,6 +245,7 @@ LMaster::LMaster() connect(keyButton, SIGNAL(clicked()), SLOT(insertKey())); initShortcuts(); + initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 30e95dbd..f484e935 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -35,9 +35,6 @@ #include int MasterEdit::_rasterInit = 0; -int MasterEdit::_widthInit = 600; -int MasterEdit::_heightInit = 400; -QByteArray MasterEdit::_toolbarInit; //--------------------------------------------------------- // closeEvent @@ -86,8 +83,8 @@ MasterEdit::MasterEdit() { setWindowTitle(tr("MusE: Mastertrack")); _raster = 0; // measure + resize(_widthInit[_type], _heightInit[_type]); setMinimumSize(400, 300); - resize(_widthInit, _heightInit); //---------Pulldown Menu---------------------------- // QPopupMenu* file = new QPopupMenu(this); @@ -247,8 +244,8 @@ MasterEdit::MasterEdit() connect(canvas, SIGNAL(followEvent(int)), hscroll, SLOT(setOffset(int))); connect(canvas, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); - if (!_toolbarInit.isEmpty()) - restoreState(_toolbarInit); + initTopwinState(); + initalizing=false; } //--------------------------------------------------------- @@ -337,12 +334,8 @@ void MasterEdit::readConfiguration(Xml& xml) case Xml::TagStart: if (tag == "raster") _rasterInit = xml.parseInt(); - else if (tag == "width") - _widthInit = xml.parseInt(); - else if (tag == "height") - _heightInit = xml.parseInt(); - else if (tag == "toolbars") - _toolbarInit = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "topwin") + TopWin::readConfiguration(MASTER, xml); else xml.unknown("MasterEdit"); break; @@ -363,9 +356,7 @@ void MasterEdit::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "masteredit"); xml.intTag(level, "raster", _rasterInit); - xml.intTag(level, "width", _widthInit); - xml.intTag(level, "height", _heightInit); - xml.strTag(level, "toolbars", _toolbarInit.toHex().data()); + TopWin::writeConfiguration(MASTER, level, xml); xml.tag(level, "/masteredit"); } @@ -434,34 +425,3 @@ void MasterEdit::setTempo(int val) } -//--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -void MasterEdit::resizeEvent(QResizeEvent* ev) - { - QWidget::resizeEvent(ev); - storeInitialState(); - } - -//--------------------------------------------------------- -// focusOutEvent -//--------------------------------------------------------- - -void MasterEdit::focusOutEvent(QFocusEvent* ev) - { - QWidget::focusOutEvent(ev); - storeInitialState(); - } - - -//--------------------------------------------------------- -// storeInitialState -//--------------------------------------------------------- - -void MasterEdit::storeInitialState() - { - _widthInit = width(); - _heightInit = height(); - _toolbarInit=saveState(); - } diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h index 011ea302..4e66f70e 100644 --- a/muse2/muse/master/masteredit.h +++ b/muse2/muse/master/masteredit.h @@ -61,14 +61,8 @@ class MasterEdit : public MidiEditor { QToolButton* enableButton; static int _rasterInit; - static int _widthInit, _heightInit; - static QByteArray _toolbarInit; - virtual void closeEvent(QCloseEvent*); - virtual void resizeEvent(QResizeEvent*); - virtual void focusOutEvent(QFocusEvent*); - void storeInitialState(); private slots: void _setRaster(int); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index bf9744b6..8c02dbeb 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -62,11 +62,8 @@ static const char* map_file_save_pattern[] = { */ int DrumEdit::_rasterInit = 96; -int DrumEdit::_widthInit = 600; -int DrumEdit::_heightInit = 400; int DrumEdit::_dlistWidthInit = 50; int DrumEdit::_dcanvasWidthInit = 300; -QByteArray DrumEdit::_toolbarInit; static const int xscale = -10; static const int yscale = 1; @@ -159,8 +156,9 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini : MidiEditor(TopWin::DRUM, _rasterInit, pl, parent, name) { setFocusPolicy(Qt::StrongFocus); + resize(_widthInit[_type], _heightInit[_type]); + split1w1 = 0; - resize(_widthInit, _heightInit); selPart = 0; QSignalMapper *signalMapper = new QSignalMapper(this); @@ -485,9 +483,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl())); - if (!_toolbarInit.isEmpty()) - restoreState(_toolbarInit); - QClipboard* cb = QApplication::clipboard(); connect(cb, SIGNAL(dataChanged()), SLOT(clipboardChanged())); @@ -510,10 +505,10 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini if(canvas->track()) toolbar->setSolo(canvas->track()->solo()); - - QSettings settings("MusE", "MusE-qt"); - //restoreGeometry(settings.value("Drumedit/geometry").toByteArray()); - restoreState(settings.value("Drumedit/windowState").toByteArray()); + + + initTopwinState(); + initalizing=false; } //--------------------------------------------------------- @@ -764,16 +759,12 @@ void DrumEdit::readConfiguration(Xml& xml) case Xml::TagStart: if (tag == "raster") _rasterInit = xml.parseInt(); - else if (tag == "width") - _widthInit = xml.parseInt(); - else if (tag == "height") - _heightInit = xml.parseInt(); else if (tag == "dcanvaswidth") _dcanvasWidthInit = xml.parseInt(); else if (tag == "dlistwidth") _dlistWidthInit = xml.parseInt(); - else if (tag == "toolbars") - _toolbarInit = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "topwin") + TopWin::readConfiguration(DRUM, xml); else xml.unknown("DrumEdit"); break; @@ -795,11 +786,9 @@ void DrumEdit::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "drumedit"); xml.intTag(level, "raster", _rasterInit); - xml.intTag(level, "width", _widthInit); - xml.intTag(level, "height", _heightInit); xml.intTag(level, "dlistwidth", _dlistWidthInit); xml.intTag(level, "dcanvaswidth", _dcanvasWidthInit); - xml.strTag(level, "toolbars", _toolbarInit.toHex().data()); + TopWin::writeConfiguration(DRUM, level,xml); xml.tag(level, "/drumedit"); } @@ -1048,37 +1037,7 @@ void DrumEdit::newCanvasWidth(int w) updateHScrollRange(); } -//--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -void DrumEdit::resizeEvent(QResizeEvent* ev) - { - QWidget::resizeEvent(ev); - storeInitialState(); //TODO: Make the dlist not expand/shrink, but the canvas instead - } - -//--------------------------------------------------------- -// focusOutEvent -//--------------------------------------------------------- - -void DrumEdit::focusOutEvent(QFocusEvent* ev) - { - QWidget::focusOutEvent(ev); - storeInitialState(); - } - -//--------------------------------------------------------- -// storeInitialState -//--------------------------------------------------------- - -void DrumEdit::storeInitialState() - { - _widthInit = width(); - _heightInit = height(); - _toolbarInit=saveState(); - } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index a9ec4d06..a242eda8 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -71,9 +71,7 @@ class DrumEdit : public MidiEditor { QComboBox *stepLenWidget; static int _rasterInit; - static int _widthInit, _heightInit; static int _dlistWidthInit, _dcanvasWidthInit; - static QByteArray _toolbarInit; QAction *loadAction, *saveAction, *resetAction; QAction *cutAction, *copyAction, *pasteAction, *deleteAction; @@ -88,10 +86,6 @@ class DrumEdit : public MidiEditor { QWidget* genToolbar(QWidget* parent); virtual void keyPressEvent(QKeyEvent*); - virtual void resizeEvent(QResizeEvent*); - virtual void focusOutEvent(QFocusEvent*); - void storeInitialState(); - void setHeaderToolTips(); void setHeaderWhatsThis(); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 7b095713..ac15f9cd 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -53,10 +53,7 @@ #include "mtrackinfo.h" int PianoRoll::_rasterInit = 96; -int PianoRoll::_widthInit = 600; -int PianoRoll::_heightInit = 400; int PianoRoll::colorModeInit = 0; -QByteArray PianoRoll::_toolbarInit; static const int xscale = -10; static const int yscale = 1; @@ -72,11 +69,12 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i : MidiEditor(TopWin::PIANO_ROLL, _rasterInit, pl, parent, name) { deltaMode = false; - resize(_widthInit, _heightInit); selPart = 0; _playEvents = false; colorMode = colorModeInit; + resize(_widthInit[_type], _heightInit[_type]); + QSignalMapper* mapper = new QSignalMapper(this); QSignalMapper* colorMapper = new QSignalMapper(this); @@ -473,9 +471,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i setFocusPolicy(Qt::StrongFocus); setEventColorMode(colorMode); - if (!_toolbarInit.isEmpty()) - restoreState(_toolbarInit); - QClipboard* cb = QApplication::clipboard(); connect(cb, SIGNAL(dataChanged()), SLOT(clipboardChanged())); @@ -503,10 +498,8 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i toolbar->setSolo(canvas->track()->solo()); } - QSettings settings("MusE", "MusE-qt"); - //restoreGeometry(settings.value("Pianoroll/geometry").toByteArray()); - restoreState(settings.value("Pianoroll/windowState").toByteArray()); - + initTopwinState(); + initalizing=false; } //--------------------------------------------------------- @@ -814,12 +807,8 @@ void PianoRoll::readConfiguration(Xml& xml) _rasterInit = xml.parseInt(); else if (tag == "colormode") colorModeInit = xml.parseInt(); - else if (tag == "width") - _widthInit = xml.parseInt(); - else if (tag == "height") - _heightInit = xml.parseInt(); - else if (tag == "toolbars") - _toolbarInit = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "topwin") + TopWin::readConfiguration(PIANO_ROLL,xml); else xml.unknown("PianoRoll"); break; @@ -840,10 +829,8 @@ void PianoRoll::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "pianoroll"); xml.intTag(level, "raster", _rasterInit); - xml.intTag(level, "width", _widthInit); - xml.intTag(level, "height", _heightInit); xml.intTag(level, "colormode", colorModeInit); - xml.strTag(level, "toolbars", _toolbarInit.toHex().data()); + TopWin::writeConfiguration(PIANO_ROLL, level, xml); xml.etag(level, "pianoroll"); } @@ -1211,38 +1198,6 @@ void PianoRoll::setSpeaker(bool val) canvas->playEvents(_playEvents); } -//--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -void PianoRoll::resizeEvent(QResizeEvent* ev) - { - QWidget::resizeEvent(ev); - storeInitialState(); - } - - -//--------------------------------------------------------- -// focusOutEvent -//--------------------------------------------------------- - -void PianoRoll::focusOutEvent(QFocusEvent* ev) - { - QWidget::focusOutEvent(ev); - storeInitialState(); - } - - -//--------------------------------------------------------- -// storeInitialState -//--------------------------------------------------------- - -void PianoRoll::storeInitialState() - { - _widthInit = width(); - _heightInit = height(); - _toolbarInit=saveState(); - } /* diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h index 2677d530..b55d7689 100644 --- a/muse2/muse/midiedit/pianoroll.h +++ b/muse2/muse/midiedit/pianoroll.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "noteinfo.h" @@ -117,8 +116,6 @@ class PianoRoll : public MidiEditor { int colorMode; static int _rasterInit; - static int _widthInit, _heightInit; - static QByteArray _toolbarInit; static int colorModeInit; @@ -133,9 +130,6 @@ class PianoRoll : public MidiEditor { QWidget* genToolbar(QWidget* parent); virtual void closeEvent(QCloseEvent*); virtual void keyPressEvent(QKeyEvent*); - virtual void resizeEvent(QResizeEvent*); - virtual void focusOutEvent(QFocusEvent*); - void storeInitialState(); private slots: void setSelection(int, Event&, Part*); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 378a7ad3..4623bca7 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -141,9 +141,6 @@ QColor* mycolors; // array [NUM_MYCOLORS] set ScoreEdit::names; -int ScoreEdit::width_init = 600; -int ScoreEdit::height_init = 400; -QByteArray ScoreEdit::default_toolbar_state; //--------------------------------------------------------- @@ -156,7 +153,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) setAttribute(Qt::WA_DeleteOnClose); setFocusPolicy(Qt::StrongFocus); - resize(width_init, height_init); + resize(_widthInit[_type], _heightInit[_type]); mainw = new QWidget(this); @@ -457,9 +454,6 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) clipboard_changed(); selection_changed(); - if (!default_toolbar_state.isEmpty()) - restoreState(default_toolbar_state); - connect(song, SIGNAL(songChanged(int)), SLOT(song_changed(int))); score_canvas->fully_recalculate(); @@ -472,6 +466,9 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) apply_velo=true; + + initTopwinState(); + initalizing=false; } void ScoreEdit::init_shortcuts() @@ -644,26 +641,6 @@ void ScoreEdit::closeEvent(QCloseEvent* e) e->accept(); } -void ScoreEdit::resizeEvent(QResizeEvent* ev) -{ - QWidget::resizeEvent(ev); - - store_initial_state(); -} - -void ScoreEdit::focusOutEvent(QFocusEvent* ev) -{ - QMainWindow::focusOutEvent(ev); - - store_initial_state(); -} - -void ScoreEdit::store_initial_state() -{ - width_init=width(); - height_init=height(); - default_toolbar_state=saveState(); -} void ScoreEdit::menu_command(int cmd) { @@ -1034,12 +1011,8 @@ void ScoreEdit::read_configuration(Xml& xml) switch (token) { case Xml::TagStart: - if (tag == "height") - height_init = xml.parseInt(); - else if (tag == "width") - width_init = xml.parseInt(); - else if (tag == "toolbars") - default_toolbar_state = QByteArray::fromHex(xml.parse1().toAscii()); + if (tag == "topwin") + TopWin::readConfiguration(SCORE, xml); else xml.unknown("ScoreEdit"); break; @@ -1058,9 +1031,7 @@ void ScoreEdit::read_configuration(Xml& xml) void ScoreEdit::write_configuration(int level, Xml& xml) { xml.tag(level++, "scoreedit"); - xml.intTag(level, "width", width_init); - xml.intTag(level, "height", height_init); - xml.strTag(level, "toolbars", default_toolbar_state.toHex().data()); + TopWin::writeConfiguration(SCORE, level, xml); xml.etag(level, "scoreedit"); } @@ -4477,6 +4448,7 @@ void staff_t::update_part_indices() * o IMPORTANT: check new windowed arranger! * - 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 * * IMPORTANT TODO diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index 65990df5..0d4ce522 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -81,10 +81,6 @@ class ScoreEdit : public TopWin Q_OBJECT private: virtual void closeEvent(QCloseEvent*); - virtual void resizeEvent(QResizeEvent*); - virtual void focusOutEvent(QFocusEvent*); - - void store_initial_state(); void init_name(); @@ -150,8 +146,6 @@ class ScoreEdit : public TopWin bool apply_velo; static set names; - static int width_init, height_init; - static QByteArray default_toolbar_state; QString name; diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index d4b692fe..9674af5a 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -40,10 +40,6 @@ extern QColor readColor(Xml& xml); -int WaveEdit::_widthInit = 600; -int WaveEdit::_heightInit = 400; -QByteArray WaveEdit::_toolbarInit; - //--------------------------------------------------------- // closeEvent //--------------------------------------------------------- @@ -64,8 +60,8 @@ void WaveEdit::closeEvent(QCloseEvent* e) WaveEdit::WaveEdit(PartList* pl) : MidiEditor(TopWin::WAVE, 1, pl) { - resize(_widthInit, _heightInit); setFocusPolicy(Qt::StrongFocus); + resize(_widthInit[_type], _heightInit[_type]); QSignalMapper* mapper = new QSignalMapper(this); QAction* act; @@ -207,7 +203,7 @@ WaveEdit::WaveEdit(PartList* pl) if (!parts()->empty()) { // Roughly match total size of part Part* firstPart = parts()->begin()->second; - xscale = 0 - firstPart->lenFrame()/_widthInit; + xscale = 0 - firstPart->lenFrame()/_widthInit[_type]; } else { xscale = -8000; @@ -260,9 +256,6 @@ WaveEdit::WaveEdit(PartList* pl) connect(hscroll, SIGNAL(scaleChanged(int)), SLOT(updateHScrollRange())); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); - if (!_toolbarInit.isEmpty()) - restoreState(_toolbarInit); - initShortcuts(); updateHScrollRange(); @@ -273,10 +266,9 @@ WaveEdit::WaveEdit(PartList* pl) WavePart* part = (WavePart*)(parts()->begin()->second); solo->setChecked(part->track()->solo()); } - QSettings settings("MusE", "MusE-qt"); - //restoreGeometry(settings.value("Waveedit/geometry").toByteArray()); - restoreState(settings.value("Waveedit/windowState").toByteArray()); + initTopwinState(); + initalizing=false; } void WaveEdit::initShortcuts() @@ -363,12 +355,8 @@ void WaveEdit::readConfiguration(Xml& xml) case Xml::TagStart: if (tag == "bgcolor") config.waveEditBackgroundColor = readColor(xml); - else if (tag == "width") - _widthInit = xml.parseInt(); - else if (tag == "height") - _heightInit = xml.parseInt(); - else if (tag == "toolbars") - _toolbarInit = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "topwin") + TopWin::readConfiguration(WAVE, xml); else xml.unknown("WaveEdit"); break; @@ -392,9 +380,7 @@ void WaveEdit::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "waveedit"); xml.colorTag(level, "bgcolor", config.waveEditBackgroundColor); - xml.intTag(level, "width", _widthInit); - xml.intTag(level, "height", _heightInit); - xml.strTag(level, "toolbars", _toolbarInit.toHex().data()); + TopWin::writeConfiguration(WAVE, level,xml); xml.tag(level, "/waveedit"); } @@ -446,38 +432,6 @@ void WaveEdit::readStatus(Xml& xml) } } -//--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -void WaveEdit::resizeEvent(QResizeEvent* ev) - { - QWidget::resizeEvent(ev); - storeInitialState(); - } - -//--------------------------------------------------------- -// focusOutEvent -//--------------------------------------------------------- - -void WaveEdit::focusOutEvent(QFocusEvent* ev) - { - QWidget::focusOutEvent(ev); - storeInitialState(); - } - - -//--------------------------------------------------------- -// storeInitialState -//--------------------------------------------------------- - -void WaveEdit::storeInitialState() - { - _widthInit = width(); - _heightInit = height(); - _toolbarInit=saveState(); - } - //--------------------------------------------------------- // songChanged1 diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h index 2bfffcc1..4f040d6e 100644 --- a/muse2/muse/waveedit/waveedit.h +++ b/muse2/muse/waveedit/waveedit.h @@ -48,15 +48,10 @@ class WaveEdit : public MidiEditor { QAction* copyAction; QAction* pasteAction; - static int _widthInit, _heightInit; - static QByteArray _toolbarInit; virtual void closeEvent(QCloseEvent*); virtual void keyPressEvent(QKeyEvent*); - virtual void resizeEvent(QResizeEvent* ev); - virtual void focusOutEvent(QFocusEvent*); - void storeInitialState(); QMenu* menuFunctions, *select, *menuGain; -- cgit v1.2.3 From 3513555193d44fe99bc30dd3bf04701278a797a1 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 18 Aug 2011 16:03:23 +0000 Subject: "share tools and menu" can be set at runtime added global settings for "default isMDI state" and "share..." (one default for Subwins, one for free wins) TODO: read and save them into configuration, add settings dialog for it --- muse2/muse/app.cpp | 21 +++++++++++++-- muse2/muse/app.h | 1 + muse2/muse/arranger/arrangerview.cpp | 1 + muse2/muse/cliplist/cliplist.cpp | 1 + muse2/muse/cobject.cpp | 50 ++++++++++++++++++++++++++++++------ muse2/muse/cobject.h | 8 +++--- muse2/muse/liste/listedit.cpp | 1 + muse2/muse/marker/markerview.cpp | 1 + muse2/muse/master/lmaster.cpp | 1 + muse2/muse/master/masteredit.cpp | 1 + muse2/muse/midiedit/drumedit.cpp | 1 + muse2/muse/midiedit/pianoroll.cpp | 1 + muse2/muse/midiedit/scoreedit.cpp | 5 ++-- muse2/muse/waveedit/waveedit.cpp | 1 + 14 files changed, 78 insertions(+), 16 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index d3ad0e64..e48425d7 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1746,7 +1746,6 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) if (destination==NULL) // if no destination given, create a new one { destination = new ScoreEdit(this, 0, arranger->cursorValue()); - destination->shareToolsAndMenu(true); //FINDMICHJETZT destination->show(); toplevels.push_back(destination); connect(destination, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); @@ -1782,7 +1781,6 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) { PianoRoll* pianoroll = new PianoRoll(pl, this, 0, arranger->cursorValue()); - pianoroll->shareToolsAndMenu(true); //FINDMICHJETZT if(showDefaultCtrls) // p4.0.12 pianoroll->addCtrl(); pianoroll->show(); @@ -3101,3 +3099,22 @@ void MusE::addMdiSubWindow(QMdiSubWindow* win) { mdiArea->addSubWindow(win); } + +void MusE::shareMenuAndToolbarChanged(TopWin* win, bool val) +{ + if (val) + { + if ((win == activeTopWin) && (win != currentMenuSharingTopwin)) + setCurrentMenuSharingTopwin(win); + } + else + { + if (win == currentMenuSharingTopwin) + { + if (win != activeTopWin) + setCurrentMenuSharingTopwin(activeTopWin); + else + setCurrentMenuSharingTopwin(NULL); + } + } +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index c491a2de..7e47101a 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -331,6 +331,7 @@ class MusE : public QMainWindow void focusChanged(QWidget* old, QWidget* now); void addMdiSubWindow(QMdiSubWindow*); + void shareMenuAndToolbarChanged(TopWin*, bool); public: MusE(int argc, char** argv); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index af4c59e0..6ec47375 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -489,6 +489,7 @@ ArrangerView::ArrangerView(QWidget* parent) QMenu* menuSettings = menuBar()->addMenu(tr("&Settings")); menuSettings->addAction(subwinAction); + menuSettings->addAction(shareAction); //-------- Edit connections diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 1172919a..6ee9c7fe 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -126,6 +126,7 @@ ClipListEdit::ClipListEdit(QWidget* parent) QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index a97a29a1..5e007fe3 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -23,6 +23,9 @@ int TopWin::_widthInit[TOPLEVELTYPE_LAST_ENTRY]; int TopWin::_heightInit[TOPLEVELTYPE_LAST_ENTRY]; QByteArray TopWin::_toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY]; QByteArray TopWin::_toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY]; +bool TopWin::_sharesWhenFree[TOPLEVELTYPE_LAST_ENTRY]; +bool TopWin::_sharesWhenSubwin[TOPLEVELTYPE_LAST_ENTRY]; +bool TopWin::_defaultSubwin[TOPLEVELTYPE_LAST_ENTRY]; bool TopWin::initInited=false; TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlags f) @@ -34,8 +37,16 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag { _widthInit[i]=800; _heightInit[i]=600; + _sharesWhenFree[i]=false; + _sharesWhenSubwin[i]=true; + _defaultSubwin[i]=false; } + _defaultSubwin[ARRANGER]=true; + + _defaultSubwin[SCORE]=true; //FINDMICH + _sharesWhenFree[SCORE]=true; + initInited=true; } @@ -43,19 +54,29 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag _type=t; + + setObjectName(QString(name)); - //setAttribute(Qt::WA_DeleteOnClose); // Allow multiple rows. Tim. //setDockNestingEnabled(true); setIconSize(ICON_SIZE); - mdisubwin=NULL; - _sharesToolsAndMenu=false; - subwinAction=new QAction(tr("As subwindow"), this); subwinAction->setCheckable(true); - subwinAction->setChecked(isMdiWin()); connect(subwinAction, SIGNAL(toggled(bool)), SLOT(setIsMdiWin(bool))); + + shareAction=new QAction(tr("Shares tools and menu"), this); + shareAction->setCheckable(true); + connect(shareAction, SIGNAL(toggled(bool)), SLOT(shareToolsAndMenu(bool))); + + mdisubwin=NULL; + _sharesToolsAndMenu=_defaultSubwin[_type] ? _sharesWhenSubwin[_type] : _sharesWhenFree[_type]; + if (_defaultSubwin[_type]) + setIsMdiWin(true); + + + subwinAction->setChecked(isMdiWin()); + shareAction->setChecked(_sharesToolsAndMenu); } @@ -163,6 +184,9 @@ void TopWin::setIsMdiWin(bool val) muse->addMdiSubWindow(subwin); subwin->setVisible(vis); + if (_sharesToolsAndMenu == _sharesWhenFree[_type]) + shareToolsAndMenu(_sharesWhenSubwin[_type]); + subwinAction->setChecked(true); } else @@ -182,9 +206,12 @@ void TopWin::setIsMdiWin(bool val) //TODO FINDMICH evtl noch ein signal emitten oder sowas? delete mdisubwin_temp; - printf("unMDIfied, visible is %i\n",vis); + printf("FINDMICH unMDIfied, visible is %i\n",vis); setVisible(vis); - + + if (_sharesToolsAndMenu == _sharesWhenSubwin[_type]) + shareToolsAndMenu(_sharesWhenFree[_type]); + subwinAction->setChecked(false); } else @@ -227,6 +254,8 @@ void TopWin::shareToolsAndMenu(bool val) if (!val) { + muse->shareMenuAndToolbarChanged(this, false); + for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) if (*it != NULL) QMainWindow::addToolBar(*it); @@ -239,12 +268,17 @@ void TopWin::shareToolsAndMenu(bool val) { for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) if (*it != NULL) + { QMainWindow::removeToolBar(*it); // this does NOT delete the toolbar, which is good + (*it)->setParent(NULL); + } menuBar()->hide(); + + muse->shareMenuAndToolbarChanged(this, true); } - emit toolsAndMenuSharingChanged(val); + shareAction->setChecked(val); } diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index ba731d1e..f76f6f61 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -53,7 +53,6 @@ class TopWin : public QMainWindow TopWin(ToplevelType t, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); bool sharesToolsAndMenu() { return _sharesToolsAndMenu; } - void shareToolsAndMenu(bool); const std::list& toolbars() { return _toolbars; } void addToolBar(QToolBar* toolbar); @@ -75,6 +74,7 @@ class TopWin : public QMainWindow protected: QAction* subwinAction; + QAction* shareAction; ToplevelType _type; @@ -82,6 +82,9 @@ class TopWin : public QMainWindow static int _heightInit[TOPLEVELTYPE_LAST_ENTRY]; static QByteArray _toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY]; static QByteArray _toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY]; + static bool _sharesWhenFree[TOPLEVELTYPE_LAST_ENTRY]; + static bool _sharesWhenSubwin[TOPLEVELTYPE_LAST_ENTRY]; + static bool _defaultSubwin[TOPLEVELTYPE_LAST_ENTRY]; static bool initInited; void initTopwinState(); @@ -93,11 +96,10 @@ class TopWin : public QMainWindow virtual void show(); virtual void setVisible(bool); void setIsMdiWin(bool); + void shareToolsAndMenu(bool); void restoreMainwinState(); void storeInitialState(); - signals: - void toolsAndMenuSharingChanged(bool); }; diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index d0a7d83c..c0580e3b 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -498,6 +498,7 @@ ListEdit::ListEdit(PartList* pl) QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); // Toolbars --------------------------------------------------------- diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index 8def5714..89011b2b 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -176,6 +176,7 @@ MarkerView::MarkerView(QWidget* parent) QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); // Toolbars --------------------------------------------------------- diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 7f5e6f75..d1aad157 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -145,6 +145,7 @@ LMaster::LMaster() QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); connect(tempoAction, SIGNAL(triggered()), signalMapper, SLOT(map())); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index f484e935..68e8a3b2 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -92,6 +92,7 @@ MasterEdit::MasterEdit() QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); // Toolbars --------------------------------------------------------- QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 8c02dbeb..5477752d 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -265,6 +265,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); connect(signalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index ac15f9cd..d8fdc34d 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -174,6 +174,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i menuConfig->addSeparator(); menuConfig->addAction(subwinAction); + menuConfig->addAction(shareAction); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 29c25937..2f077365 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -418,6 +418,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) settings_menu->addSeparator(); settings_menu->addAction(subwinAction); + settings_menu->addAction(shareAction); @@ -4445,13 +4446,11 @@ void staff_t::update_part_indices() * because after A (and B) got resized, the B-resize is invalid! * * CURRENT TODO - * o IMPORTANT: check new windowed arranger! - * - 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: 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. + * o arranger: shortcuts for "pencil" etc don't work * * IMPORTANT TODO * o redo transport menu: offer "one beat" and "one bar" steps diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 9674af5a..f54e23c3 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -153,6 +153,7 @@ WaveEdit::WaveEdit(PartList* pl) QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); settingsMenu->addAction(subwinAction); + settingsMenu->addAction(shareAction); //---------ToolBar---------------------------------- tools = addToolBar(tr("Wave edit tools")); -- cgit v1.2.3 From edbe737895dacf8bf54813d7bc99c5e851dc8018 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 21 Aug 2011 13:23:24 +0000 Subject: added "windows" menu removed unneeded debugging messages ("FINDMICH") --- muse2/muse/app.cpp | 107 +++++++++++++++++++++++++++++++++++--- muse2/muse/app.h | 11 +++- muse2/muse/cobject.cpp | 9 +--- muse2/muse/cobject.h | 1 + muse2/muse/midiedit/scoreedit.cpp | 13 +++-- 5 files changed, 122 insertions(+), 19 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 8f059c73..60075a1a 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -298,7 +298,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() { // By T356. For LADSPA plugins in plugin.cpp // QWidgetFactory::addWidgetFactory( new PluginWidgetFactory ); ddskrjo - setIconSize(ICON_SIZE); setFocusPolicy(Qt::WheelFocus); //setFocusPolicy(Qt::NoFocus); @@ -334,6 +333,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() setWindowTitle(appName); midiPluginSignalMapper = new QSignalMapper(this); followSignalMapper = new QSignalMapper(this); + windowsMapper = new QSignalMapper(this); + connect(windowsMapper, SIGNAL(mapped(QWidget*)), SLOT(bringToFront(QWidget*))); song = new Song("song"); song->blockSignals(true); @@ -533,8 +534,13 @@ MusE::MusE(int argc, char** argv) : QMainWindow() autoSnapshotAction = new QAction(QIcon(*automation_take_snapshotIcon), tr("Take Snapshot"), this); autoClearAction = new QAction(QIcon(*automation_clear_dataIcon), tr("Clear Automation Data"), this); autoClearAction->setEnabled(false); + - + //-------- Windows Actions + windowsCascadeAction = new QAction(tr("Cascade"), this); + windowsTileAction = new QAction(tr("Tile"), this); + + //-------- Settings Actions settingsGlobalAction = new QAction(QIcon(*settings_globalsettingsIcon), tr("Global Settings"), this); settingsShortcutsAction = new QAction(QIcon(*settings_configureshortcutsIcon), tr("Configure Shortcuts"), this); @@ -819,6 +825,17 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menuAutomation->addAction(autoSnapshotAction); menuAutomation->addAction(autoClearAction); + //------------------------------------------------------------- + // popup Windows + //------------------------------------------------------------- + + menuWindows = new QMenu(tr("&Windows"), this); + menuBar()->addMenu(menuWindows); + trailingMenus.push_back(menuWindows); + + menuWindows->addAction(windowsCascadeAction); + menuWindows->addAction(windowsTileAction); + //------------------------------------------------------------- // popup Settings //------------------------------------------------------------- @@ -869,6 +886,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() mdiArea=new QMdiArea(this); setCentralWidget(mdiArea); + connect(windowsTileAction, SIGNAL(activated()), mdiArea, SLOT(tileSubWindows())); + connect(windowsCascadeAction, SIGNAL(activated()), mdiArea, SLOT(cascadeSubWindows())); arrangerView = new ArrangerView(this); @@ -878,7 +897,6 @@ MusE::MusE(int argc, char** argv) : QMainWindow() arrangerView->hide(); arranger=arrangerView->getArranger(); - //mdiArea->addSubWindow(arrangerView->createMdiWrapper()); arrangerView->setIsMdiWin(true); @@ -954,6 +972,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() restoreState(settings.value("MusE/windowState").toByteArray()); song->update(); + + updateWindowMenu(); } MusE::~MusE() @@ -1554,6 +1574,7 @@ void MusE::showMarker(bool flag) } markerView->setVisible(flag); viewMarkerAction->setChecked(flag); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1563,6 +1584,7 @@ void MusE::showMarker(bool flag) void MusE::markerClosed() { viewMarkerAction->setChecked(false); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1582,6 +1604,7 @@ void MusE::showArranger(bool flag) { arrangerView->setVisible(flag); viewArrangerAction->setChecked(flag); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1591,6 +1614,7 @@ void MusE::showArranger(bool flag) void MusE::arrangerClosed() { viewArrangerAction->setChecked(false); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1755,6 +1779,7 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) //relevant signals on his own arrangerView->updateScoreMenus(); + updateWindowMenu(); } destination->add_parts(pl, allInOne); @@ -1787,6 +1812,7 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) toplevels.push_back(pianoroll); connect(pianoroll, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged())); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1808,6 +1834,7 @@ void MusE::startListEditor(PartList* pl) toplevels.push_back(listEditor); connect(listEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged())); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1820,6 +1847,7 @@ void MusE::startMasterEditor() masterEditor->show(); toplevels.push_back(masterEditor); connect(masterEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1833,6 +1861,7 @@ void MusE::startLMasterEditor() toplevels.push_back(lmaster); connect(lmaster, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged())); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1857,6 +1886,7 @@ void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls) toplevels.push_back(drumEditor); connect(drumEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged())); + updateWindowMenu(); } //--------------------------------------------------------- @@ -1880,6 +1910,7 @@ void MusE::startWaveEditor(PartList* pl) connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged())); toplevels.push_back(waveEditor); connect(waveEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); + updateWindowMenu(); } @@ -1940,6 +1971,7 @@ void MusE::startClipList(bool checked) } clipListEdit->show(); viewCliplistAction->setChecked(checked); + updateWindowMenu(); } //--------------------------------------------------------- @@ -2001,7 +2033,8 @@ void MusE::toplevelDeleted(TopWin* tl) case TopWin::CLIPLIST: // ORCAN: This needs to be verified. aid2 used to correspond to Cliplist: //menu_audio->setItemChecked(aid2, false); - viewCliplistAction->setChecked(false); + viewCliplistAction->setChecked(false); + updateWindowMenu(); return; //break; @@ -2023,6 +2056,7 @@ void MusE::toplevelDeleted(TopWin* tl) toplevels.erase(i); if (mustUpdateScoreMenus) arrangerView->updateScoreMenus(); + updateWindowMenu(); return; } } @@ -3071,7 +3105,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) addToolBar(*it); foreignToolbars.push_back(*it); - (*it)->show(); //FINDMICHJETZT + (*it)->show(); } else { @@ -3088,8 +3122,6 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win) currentMenuSharingTopwin=win; - printf ("FINDMICH: changing sharing win DONE.\n"); - if (win) win->restoreMainwinState(); //restore toolbar positions in main window } @@ -3118,3 +3150,64 @@ void MusE::shareMenuAndToolbarChanged(TopWin* win, bool val) } } } + +void MusE::updateWindowMenu() +{ + bool sep; + bool there_are_subwins=false; + + menuWindows->clear(); // frees memory automatically + + menuWindows->addAction(windowsCascadeAction); + menuWindows->addAction(windowsTileAction); + + sep=false; + for (iToplevel it=toplevels.begin(); it!=toplevels.end(); it++) + if (((*it)->isVisible() || (*it)->isVisibleTo(this)) && (*it)->isMdiWin()) + // the isVisibleTo check is neccessary because isVisible returns false if a + // MdiSubWin is actually visible, but the muse main window is hidden for some reason + { + if (!sep) + { + menuWindows->addSeparator(); + sep=true; + } + QAction* temp=menuWindows->addAction((*it)->windowTitle()); + connect(temp, SIGNAL(activated()), windowsMapper, SLOT(map())); + windowsMapper->setMapping(temp, static_cast(*it)); + + there_are_subwins=true; + } + + sep=false; + for (iToplevel it=toplevels.begin(); it!=toplevels.end(); it++) + if (((*it)->isVisible() || (*it)->isVisibleTo(this)) && !(*it)->isMdiWin()) + { + if (!sep) + { + menuWindows->addSeparator(); + sep=true; + } + QAction* temp=menuWindows->addAction((*it)->windowTitle()); + connect(temp, SIGNAL(activated()), windowsMapper, SLOT(map())); + windowsMapper->setMapping(temp, static_cast(*it)); + } + + windowsCascadeAction->setEnabled(there_are_subwins); + windowsTileAction->setEnabled(there_are_subwins); +} + +void MusE::bringToFront(QWidget* widget) +{ + TopWin* win=dynamic_cast(widget); + if (win->isMdiWin()) + { + win->show(); + mdiArea->setActiveSubWindow(win->getMdiWin()); + } + else + { + win->activateWindow(); + win->raise(); + } +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 7e47101a..52bccf64 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -128,6 +128,10 @@ class MusE : public QMainWindow // Automation Menu Actions QAction *autoMixerAction, *autoSnapshotAction, *autoClearAction; + // Window Menu Actions + QAction* windowsCascadeAction; + QAction* windowsTileAction; + // Settings Menu Actions QAction *settingsGlobalAction, *settingsShortcutsAction, *settingsMetronomeAction, *settingsMidiSyncAction; QAction *settingsMidiIOAction, *settingsAppearanceAction, *settingsMidiPortAction; @@ -149,7 +153,7 @@ class MusE : public QMainWindow // when adding a menu to the main window, remember adding it to // either the leadingMenus or trailingMenus list! - QMenu *menu_file, *menuView, *menuSettings, *menu_help; + QMenu *menu_file, *menuView, *menuSettings, *menuWindows, *menu_help; QMenu* menu_audio, *menuAutomation, *menuUtils; QMenu* menu_functions, *menuScriptPlugins; @@ -211,6 +215,7 @@ class MusE : public QMainWindow QSignalMapper *midiPluginSignalMapper; QSignalMapper *followSignalMapper; + QSignalMapper *windowsMapper; signals: void configChanged(); @@ -287,6 +292,8 @@ class MusE : public QMainWindow void activeTopWinChangedSlot(TopWin*); void setCurrentMenuSharingTopwin(TopWin*); + + void bringToFront(QWidget* win); public slots: bool saveAs(); @@ -333,6 +340,8 @@ class MusE : public QMainWindow void addMdiSubWindow(QMdiSubWindow*); void shareMenuAndToolbarChanged(TopWin*, bool); + void updateWindowMenu(); + public: MusE(int argc, char** argv); ~MusE(); diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 2c60a90c..02a7ca74 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -176,6 +176,7 @@ void TopWin::setIsMdiWin(bool val) shareToolsAndMenu(_sharesWhenSubwin[_type]); subwinAction->setChecked(true); + muse->updateWindowMenu(); } else { @@ -191,16 +192,15 @@ void TopWin::setIsMdiWin(bool val) mdisubwin=NULL; setParent(NULL); mdisubwin_temp->hide(); - //TODO FINDMICH evtl noch ein signal emitten oder sowas? delete mdisubwin_temp; - printf("FINDMICH unMDIfied, visible is %i\n",vis); setVisible(vis); if (_sharesToolsAndMenu == _sharesWhenSubwin[_type]) shareToolsAndMenu(_sharesWhenFree[_type]); subwinAction->setChecked(false); + muse->updateWindowMenu(); } else { @@ -381,15 +381,10 @@ void TopWin::writeConfiguration(ToplevelType t, int level, Xml& xml) void TopWin::initTopwinState() { - printf("FINDMICH: in initTopwinState()\n"); - if (sharesToolsAndMenu()) { if (this == muse->getCurrentMenuSharingTopwin()) - { - printf("FINDMICH RESTORING for %s...\n",windowTitle().toAscii().data()); muse->restoreState(_toolbarSharedInit[_type]); - } } else restoreState(_toolbarNonsharedInit[_type]); diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index e934aff0..14a40a93 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -51,6 +51,7 @@ class TopWin : public QMainWindow bool isMdiWin() const; + QMdiSubWindow* getMdiWin() const { return mdisubwin; } TopWin(ToplevelType t, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 157a6845..1b6c66e7 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4438,6 +4438,8 @@ void staff_t::update_part_indices() /* BUGS and potential bugs + * o THIS SHOULD NEVER HAPPEN: could not split note (found by tim) + * * o tied notes don't work properly when there's a key-change in * between, for example, when a cis is tied to a des * o schedule_all_same_len_parts: if there are two clones A and B, @@ -4447,10 +4449,13 @@ void staff_t::update_part_indices() * * CURRENT TODO * o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) - * 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. - * o arranger: shortcuts for "pencil" etc don't work + * o shortcuts for "pencil" etc don't work when only mdiwin has focus and not the mainwin inside + * o implement borland-style maximize: free windows do not cover the main menu, even when maximized + * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer + * journey to the menu bar. try to find a way which does not involve duplicate code! + * o fix arranger config loading: problem: first arranger is displayed and inited from garbage, then + * the real config is loaded :/ + * o restoreState(settings.value("MusE/windowState").toByteArray()); in app.cpp: unneccessary? * * IMPORTANT TODO * o redo transport menu: offer "one beat" and "one bar" steps -- cgit v1.2.3 From 958f22a0b718d5a94cecd20073710c80e609cdac Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 21 Aug 2011 14:29:25 +0000 Subject: fixed bugs regarding saving and restoring toolbar state --- muse2/muse/app.cpp | 2 +- muse2/muse/cobject.cpp | 37 ++++++++++++++++++++++++++++++++++--- muse2/muse/cobject.h | 2 ++ muse2/muse/midiedit/scoreedit.cpp | 4 ++++ 4 files changed, 41 insertions(+), 4 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 60075a1a..ba4d2487 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -3143,7 +3143,7 @@ void MusE::shareMenuAndToolbarChanged(TopWin* win, bool val) { if (win == currentMenuSharingTopwin) { - if (win != activeTopWin) + if (activeTopWin && (win != activeTopWin) && (activeTopWin->sharesToolsAndMenu())) setCurrentMenuSharingTopwin(activeTopWin); else setCurrentMenuSharingTopwin(NULL); diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 02a7ca74..7b5b4cb6 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -58,6 +58,8 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag if (_defaultSubwin[_type]) setIsMdiWin(true); + if (_sharesToolsAndMenu) + menuBar()->hide(); subwinAction->setChecked(isMdiWin()); shareAction->setChecked(_sharesToolsAndMenu); @@ -82,8 +84,15 @@ void TopWin::readStatus(Xml& xml) fprintf(stderr,"ERROR: couldn't restore geometry. however, this is probably not really a problem.\n"); } else if (tag == "toolbars") { - if (!restoreState(QByteArray::fromHex(xml.parse1().toAscii()))) - fprintf(stderr,"ERROR: couldn't restore toolbars. however, this is not really a problem.\n"); + if (!sharesToolsAndMenu()) { + if (!restoreState(QByteArray::fromHex(xml.parse1().toAscii()))) + fprintf(stderr,"ERROR: couldn't restore toolbars. however, this is not really a problem.\n"); + } + else { + _savedToolbarState=QByteArray::fromHex(xml.parse1().toAscii()); + if (_savedToolbarState.isEmpty()) + _savedToolbarState=_toolbarNonsharedInit[_type]; + } } else if (tag == "shares_menu") { shareToolsAndMenu(xml.parseInt()); @@ -117,7 +126,11 @@ void TopWin::writeStatus(int level, Xml& xml) const xml.intTag(level, "is_subwin", isMdiWin()); xml.strTag(level, "geometry_state", saveGeometry().toHex().data()); xml.intTag(level, "shares_menu", sharesToolsAndMenu()); - xml.strTag(level, "toolbars", saveState().toHex().data()); + + if (!sharesToolsAndMenu()) + xml.strTag(level, "toolbars", saveState().toHex().data()); + else + xml.strTag(level, "toolbars", _savedToolbarState.toHex().data()); xml.tag(level, "/topwin"); } @@ -167,6 +180,8 @@ void TopWin::setIsMdiWin(bool val) { if (!isMdiWin()) { + _savedToolbarState = saveState(); + bool vis=isVisible(); QMdiSubWindow* subwin = createMdiWrapper(); muse->addMdiSubWindow(subwin); @@ -238,6 +253,13 @@ QToolBar* TopWin::addToolBar(const QString& title) void TopWin::shareToolsAndMenu(bool val) { + if (_sharesToolsAndMenu == val) + { + if (debugMsg) printf("TopWin::shareToolsAndMenu() called but has no effect\n"); + return; + } + + _sharesToolsAndMenu = val; if (!val) @@ -246,14 +268,23 @@ void TopWin::shareToolsAndMenu(bool val) for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) if (*it != NULL) + { QMainWindow::addToolBar(*it); + (*it)->show(); + } else QMainWindow::addToolBarBreak(); + + restoreState(_savedToolbarState); + _savedToolbarState.clear(); menuBar()->show(); } else { + if (_savedToolbarState.isEmpty()) // this check avoids overwriting a previously saved state + _savedToolbarState = saveState(); // (by setIsMdiWin) with a now incorrect (empty) state + for (list::iterator it=_toolbars.begin(); it!=_toolbars.end(); it++) if (*it != NULL) { diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 14a40a93..604a8c28 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -93,6 +93,8 @@ class TopWin : public QMainWindow static QByteArray _toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY]; static bool initInited; + QByteArray _savedToolbarState; + void initTopwinState(); bool initalizing; //if true, no state is saved diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 1b6c66e7..d674d81d 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4439,6 +4439,7 @@ void staff_t::update_part_indices() /* BUGS and potential bugs * o THIS SHOULD NEVER HAPPEN: could not split note (found by tim) + * o when un-mdi-fying, toolbar state gets broken * * o tied notes don't work properly when there's a key-change in * between, for example, when a cis is tied to a des @@ -4446,8 +4447,11 @@ void staff_t::update_part_indices() * and both A and B get scheduled to be expanded (because we * have one event from A and one event from B), this causes a bug, * because after A (and B) got resized, the B-resize is invalid! + * o when changing toolbarstate when sharing and immediately after that + * changing "share" status, the changed state isn't stored * * CURRENT TODO + * o save toolstate also when changing share/don't share * o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) * o shortcuts for "pencil" etc don't work when only mdiwin has focus and not the mainwin inside * o implement borland-style maximize: free windows do not cover the main menu, even when maximized -- cgit v1.2.3 From 74ef94afca796f9cdd2fe9b5eba0c60c3c9150d3 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 21 Aug 2011 16:33:13 +0000 Subject: fixed saving window state. again. --- muse2/muse/app.cpp | 10 ++++++---- muse2/muse/midiedit/scoreedit.cpp | 9 ++------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index ba4d2487..16b91d17 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -968,8 +968,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() changeConfig(false); QSettings settings("MusE", "MusE-qt"); - //restoreGeometry(settings.value("MusE/geometry").toByteArray()); - restoreState(settings.value("MusE/windowState").toByteArray()); + restoreGeometry(settings.value("MusE/geometry").toByteArray()); + //restoreState(settings.value("MusE/windowState").toByteArray()); song->update(); @@ -1469,8 +1469,10 @@ void MusE::closeEvent(QCloseEvent* event) } QSettings settings("MusE", "MusE-qt"); - //settings.setValue("MusE/geometry", saveGeometry()); - settings.setValue("MusE/windowState", saveState()); + settings.setValue("MusE/geometry", saveGeometry()); + //settings.setValue("MusE/windowState", saveState()); + + writeGlobalConfiguration(); // save "Open Recent" list QString prjPath(configPath); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index d674d81d..1e86e1e0 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4439,7 +4439,6 @@ void staff_t::update_part_indices() /* BUGS and potential bugs * o THIS SHOULD NEVER HAPPEN: could not split note (found by tim) - * o when un-mdi-fying, toolbar state gets broken * * o tied notes don't work properly when there's a key-change in * between, for example, when a cis is tied to a des @@ -4451,15 +4450,11 @@ void staff_t::update_part_indices() * changing "share" status, the changed state isn't stored * * CURRENT TODO - * o save toolstate also when changing share/don't share * o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) - * o shortcuts for "pencil" etc don't work when only mdiwin has focus and not the mainwin inside - * o implement borland-style maximize: free windows do not cover the main menu, even when maximized * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! - * o fix arranger config loading: problem: first arranger is displayed and inited from garbage, then - * the real config is loaded :/ - * o restoreState(settings.value("MusE/windowState").toByteArray()); in app.cpp: unneccessary? + * o shortcuts for "pencil" etc don't work when only mdiwin has focus and not the mainwin inside + * o implement borland-style maximize: free windows do not cover the main menu, even when maximized * * IMPORTANT TODO * o redo transport menu: offer "one beat" and "one bar" steps -- cgit v1.2.3 From 6aa5a11e56b977c26cb4e108e23ed191160ba801 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 21 Aug 2011 18:52:05 +0000 Subject: automatic maximizing for arranger when in traditional SDI mode --- muse2/muse/app.cpp | 19 +++++++++++++++++++ muse2/muse/cobject.cpp | 3 +++ muse2/muse/midiedit/scoreedit.cpp | 4 ++++ 3 files changed, 26 insertions(+) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 16b91d17..69e4525a 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -885,6 +885,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() mdiArea=new QMdiArea(this); + mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation); setCentralWidget(mdiArea); connect(windowsTileAction, SIGNAL(activated()), mdiArea, SLOT(tileSubWindows())); connect(windowsCascadeAction, SIGNAL(activated()), mdiArea, SLOT(cascadeSubWindows())); @@ -1280,6 +1281,24 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll showMarker(config.markerVisible); } + if (songTemplate) + { + // maximize the arranger in traditional SDI mode + if (TopWin::_defaultSubwin[TopWin::ARRANGER]) + { + bool maximizeArranger=true; + for (int i=0; ishowMaximized(); + } + } + } //--------------------------------------------------------- diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 7b5b4cb6..bebbf310 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -186,6 +186,7 @@ void TopWin::setIsMdiWin(bool val) QMdiSubWindow* subwin = createMdiWrapper(); muse->addMdiSubWindow(subwin); subwin->setVisible(vis); + this->QMainWindow::show(); //bypass the delegation to the subwin if (_sharesToolsAndMenu == _sharesWhenFree[_type]) shareToolsAndMenu(_sharesWhenSubwin[_type]); @@ -241,6 +242,8 @@ void TopWin::addToolBar(QToolBar* toolbar) if (!_sharesToolsAndMenu) QMainWindow::addToolBar(toolbar); + else + toolbar->hide(); } QToolBar* TopWin::addToolBar(const QString& title) diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 1e86e1e0..73d796fa 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4450,6 +4450,10 @@ void staff_t::update_part_indices() * changing "share" status, the changed state isn't stored * * CURRENT TODO + * o fullscreen mode for muse + * o clear menu/toolbars when hiding a window + * o strange sizes of toolbars oO? + * o restore arranger's maximized state when loading * o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! -- cgit v1.2.3 From 83d25a41dfc356d2249d8cbed2f08416013eb07c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 22 Aug 2011 17:17:23 +0000 Subject: renamed and rearranged "settings" menus fixed empty title problem for list editor shared menu is also resetted when closing/hiding arranger, marker, cliplist --- muse2/muse/app.cpp | 16 +++++++- muse2/muse/arranger/arrangerview.cpp | 2 +- muse2/muse/cliplist/cliplist.cpp | 2 +- muse2/muse/liste/listedit.cpp | 5 ++- muse2/muse/marker/markerview.cpp | 2 +- muse2/muse/master/lmaster.cpp | 2 +- muse2/muse/master/masteredit.cpp | 2 +- muse2/muse/midiedit/drumedit.cpp | 2 +- muse2/muse/midiedit/pianoroll.cpp | 77 ++++++++++++++++++++---------------- muse2/muse/midiedit/scoreedit.cpp | 58 ++++++++++++++------------- muse2/muse/waveedit/waveedit.cpp | 2 +- 11 files changed, 98 insertions(+), 72 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 69e4525a..b30358b1 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -840,7 +840,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() // popup Settings //------------------------------------------------------------- - menuSettings = new QMenu(tr("Se&ttings"), this); + menuSettings = new QMenu(tr("MusE Se&ttings"), this); menuBar()->addMenu(menuSettings); trailingMenus.push_back(menuSettings); @@ -886,6 +886,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() mdiArea=new QMdiArea(this); mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation); + mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setCentralWidget(mdiArea); connect(windowsTileAction, SIGNAL(activated()), mdiArea, SLOT(tileSubWindows())); connect(windowsCascadeAction, SIGNAL(activated()), mdiArea, SLOT(cascadeSubWindows())); @@ -1595,6 +1597,10 @@ void MusE::showMarker(bool flag) } markerView->setVisible(flag); viewMarkerAction->setChecked(flag); + if (!flag) + if (currentMenuSharingTopwin == markerView) + setCurrentMenuSharingTopwin(NULL); + updateWindowMenu(); } @@ -1605,6 +1611,9 @@ void MusE::showMarker(bool flag) void MusE::markerClosed() { viewMarkerAction->setChecked(false); + if (currentMenuSharingTopwin == markerView) + setCurrentMenuSharingTopwin(NULL); + updateWindowMenu(); } @@ -1625,6 +1634,9 @@ void MusE::showArranger(bool flag) { arrangerView->setVisible(flag); viewArrangerAction->setChecked(flag); + if (!flag) + if (currentMenuSharingTopwin == arrangerView) + setCurrentMenuSharingTopwin(NULL); updateWindowMenu(); } @@ -2055,6 +2067,8 @@ void MusE::toplevelDeleted(TopWin* tl) // ORCAN: This needs to be verified. aid2 used to correspond to Cliplist: //menu_audio->setItemChecked(aid2, false); viewCliplistAction->setChecked(false); + if (currentMenuSharingTopwin == clipListEdit) + setCurrentMenuSharingTopwin(NULL); updateWindowMenu(); return; //break; diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 6ec47375..cd0f53a9 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -487,7 +487,7 @@ ArrangerView::ArrangerView(QWidget* parent) menuStructure->addSeparator(); menuStructure->addAction(strCutEventsAction); - QMenu* menuSettings = menuBar()->addMenu(tr("&Settings")); + QMenu* menuSettings = menuBar()->addMenu(tr("Window &Config")); menuSettings->addAction(subwinAction); menuSettings->addAction(shareAction); diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 6ee9c7fe..58bacdd0 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -124,7 +124,7 @@ ClipListEdit::ClipListEdit(QWidget* parent) transport_toolbar->setObjectName("transport"); transport_toolbar->addActions(transportAction->actions()); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index c0580e3b..8d4588eb 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -496,7 +496,7 @@ ListEdit::ListEdit(PartList* pl) connect(editSignalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); @@ -588,6 +588,9 @@ ListEdit::ListEdit(PartList* pl) } initShortcuts(); + + setWindowTitle("MusE: List Editor"); + initalizing=false; } diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index 89011b2b..7889761c 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -174,7 +174,7 @@ MarkerView::MarkerView(QWidget* parent) editMenu->addAction(markerDelete); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index d1aad157..83f303ee 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -143,7 +143,7 @@ LMaster::LMaster() delAction = menuEdit->addAction(tr("Delete Event")); delAction->setShortcut(Qt::Key_Delete); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 777e6066..d8432ad0 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -90,7 +90,7 @@ MasterEdit::MasterEdit() // QPopupMenu* file = new QPopupMenu(this); // menuBar()->insertItem("&File", file); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index f8061c06..d9202a5b 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -263,7 +263,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini QMenu* menuScriptPlugins = menuBar()->addMenu(tr("&Plugins")); song->populateScriptMenu(menuScriptPlugins, this); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index c98657ea..ed58fec7 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -142,42 +142,10 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i mapper->setMapping(selectNextPartAction, PianoCanvas::CMD_SELECT_NEXT_PART); connect(selectNextPartAction, SIGNAL(triggered()), mapper, SLOT(map())); - menuConfig = menuBar()->addMenu(tr("&Config")); - - eventColor = menuConfig->addMenu(tr("&Event Color")); - - QActionGroup* actgrp = new QActionGroup(this); - actgrp->setExclusive(true); - - //evColorBlueAction = eventColor->addAction(tr("&Blue")); - evColorBlueAction = actgrp->addAction(tr("&Blue")); - evColorBlueAction->setCheckable(true); - colorMapper->setMapping(evColorBlueAction, 0); - - //evColorPitchAction = eventColor->addAction(tr("&Pitch colors")); - evColorPitchAction = actgrp->addAction(tr("&Pitch colors")); - evColorPitchAction->setCheckable(true); - colorMapper->setMapping(evColorPitchAction, 1); - - //evColorVelAction = eventColor->addAction(tr("&Velocity colors")); - evColorVelAction = actgrp->addAction(tr("&Velocity colors")); - evColorVelAction->setCheckable(true); - colorMapper->setMapping(evColorVelAction, 2); - - connect(evColorBlueAction, SIGNAL(triggered()), colorMapper, SLOT(map())); - connect(evColorPitchAction, SIGNAL(triggered()), colorMapper, SLOT(map())); - connect(evColorVelAction, SIGNAL(triggered()), colorMapper, SLOT(map())); - - eventColor->addActions(actgrp->actions()); - - connect(colorMapper, SIGNAL(mapped(int)), this, SLOT(eventColorModeChanged(int))); - - menuConfig->addSeparator(); - menuConfig->addAction(subwinAction); - menuConfig->addAction(shareAction); - - + + + menuFunctions = menuBar()->addMenu(tr("Fu&nctions")); menuFunctions->setTearOffEnabled(true); @@ -228,6 +196,45 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i connect(mapper, SIGNAL(mapped(int)), this, SLOT(cmd(int))); + + + + + menuConfig = menuBar()->addMenu(tr("Window &Config")); + + eventColor = menuConfig->addMenu(tr("&Event Color")); + + QActionGroup* actgrp = new QActionGroup(this); + actgrp->setExclusive(true); + + //evColorBlueAction = eventColor->addAction(tr("&Blue")); + evColorBlueAction = actgrp->addAction(tr("&Blue")); + evColorBlueAction->setCheckable(true); + colorMapper->setMapping(evColorBlueAction, 0); + + //evColorPitchAction = eventColor->addAction(tr("&Pitch colors")); + evColorPitchAction = actgrp->addAction(tr("&Pitch colors")); + evColorPitchAction->setCheckable(true); + colorMapper->setMapping(evColorPitchAction, 1); + + //evColorVelAction = eventColor->addAction(tr("&Velocity colors")); + evColorVelAction = actgrp->addAction(tr("&Velocity colors")); + evColorVelAction->setCheckable(true); + colorMapper->setMapping(evColorVelAction, 2); + + connect(evColorBlueAction, SIGNAL(triggered()), colorMapper, SLOT(map())); + connect(evColorPitchAction, SIGNAL(triggered()), colorMapper, SLOT(map())); + connect(evColorVelAction, SIGNAL(triggered()), colorMapper, SLOT(map())); + + eventColor->addActions(actgrp->actions()); + + connect(colorMapper, SIGNAL(mapped(int)), this, SLOT(eventColorModeChanged(int))); + + menuConfig->addSeparator(); + menuConfig->addAction(subwinAction); + menuConfig->addAction(shareAction); + + //---------ToolBar---------------------------------- tools = addToolBar(tr("Pianoroll tools")); tools->setObjectName("Pianoroll tools"); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 73d796fa..e2f87b33 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -381,7 +381,31 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) connect(select_oloop_action, SIGNAL(triggered()), menu_mapper, SLOT(map())); - QMenu* settings_menu = menuBar()->addMenu(tr("&Settings")); + QMenu* functions_menu = menuBar()->addMenu(tr("Fu&nctions")); + + func_quantize_action = functions_menu->addAction(tr("&Quantize"), menu_mapper, SLOT(map())); + func_notelen_action = functions_menu->addAction(tr("Change note &length"), menu_mapper, SLOT(map())); + func_velocity_action = functions_menu->addAction(tr("Change note &velocity"), menu_mapper, SLOT(map())); + func_cresc_action = functions_menu->addAction(tr("Crescendo/Decrescendo"), menu_mapper, SLOT(map())); + func_transpose_action = functions_menu->addAction(tr("Transpose"), menu_mapper, SLOT(map())); + func_erase_action = functions_menu->addAction(tr("Erase Events"), menu_mapper, SLOT(map())); + func_move_action = functions_menu->addAction(tr("Move Notes"), menu_mapper, SLOT(map())); + func_fixed_len_action = functions_menu->addAction(tr("Set Fixed Length"), menu_mapper, SLOT(map())); + func_del_overlaps_action = functions_menu->addAction(tr("Delete Overlaps"), menu_mapper, SLOT(map())); + func_legato_action = functions_menu->addAction(tr("Legato"), menu_mapper, SLOT(map())); + menu_mapper->setMapping(func_quantize_action, CMD_QUANTIZE); + menu_mapper->setMapping(func_notelen_action, CMD_NOTELEN); + menu_mapper->setMapping(func_velocity_action, CMD_VELOCITY); + menu_mapper->setMapping(func_cresc_action, CMD_CRESCENDO); + menu_mapper->setMapping(func_transpose_action, CMD_TRANSPOSE); + menu_mapper->setMapping(func_erase_action, CMD_ERASE); + menu_mapper->setMapping(func_move_action, CMD_MOVE); + menu_mapper->setMapping(func_fixed_len_action, CMD_FIXED_LEN); + menu_mapper->setMapping(func_del_overlaps_action, CMD_DELETE_OVERLAPS); + menu_mapper->setMapping(func_legato_action, CMD_LEGATO); + + + QMenu* settings_menu = menuBar()->addMenu(tr("Window &Config")); color_menu = settings_menu->addMenu(tr("Note head &colors")); color_actions = new QActionGroup(this); @@ -419,32 +443,8 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) settings_menu->addSeparator(); settings_menu->addAction(subwinAction); settings_menu->addAction(shareAction); - - QMenu* functions_menu = menuBar()->addMenu(tr("Fu&nctions")); - - func_quantize_action = functions_menu->addAction(tr("&Quantize"), menu_mapper, SLOT(map())); - func_notelen_action = functions_menu->addAction(tr("Change note &length"), menu_mapper, SLOT(map())); - func_velocity_action = functions_menu->addAction(tr("Change note &velocity"), menu_mapper, SLOT(map())); - func_cresc_action = functions_menu->addAction(tr("Crescendo/Decrescendo"), menu_mapper, SLOT(map())); - func_transpose_action = functions_menu->addAction(tr("Transpose"), menu_mapper, SLOT(map())); - func_erase_action = functions_menu->addAction(tr("Erase Events"), menu_mapper, SLOT(map())); - func_move_action = functions_menu->addAction(tr("Move Notes"), menu_mapper, SLOT(map())); - func_fixed_len_action = functions_menu->addAction(tr("Set Fixed Length"), menu_mapper, SLOT(map())); - func_del_overlaps_action = functions_menu->addAction(tr("Delete Overlaps"), menu_mapper, SLOT(map())); - func_legato_action = functions_menu->addAction(tr("Legato"), menu_mapper, SLOT(map())); - menu_mapper->setMapping(func_quantize_action, CMD_QUANTIZE); - menu_mapper->setMapping(func_notelen_action, CMD_NOTELEN); - menu_mapper->setMapping(func_velocity_action, CMD_VELOCITY); - menu_mapper->setMapping(func_cresc_action, CMD_CRESCENDO); - menu_mapper->setMapping(func_transpose_action, CMD_TRANSPOSE); - menu_mapper->setMapping(func_erase_action, CMD_ERASE); - menu_mapper->setMapping(func_move_action, CMD_MOVE); - menu_mapper->setMapping(func_fixed_len_action, CMD_FIXED_LEN); - menu_mapper->setMapping(func_del_overlaps_action, CMD_DELETE_OVERLAPS); - menu_mapper->setMapping(func_legato_action, CMD_LEGATO); - init_shortcuts(); connect(muse, SIGNAL(configChanged()), SLOT(init_shortcuts())); @@ -4450,10 +4450,12 @@ void staff_t::update_part_indices() * changing "share" status, the changed state isn't stored * * CURRENT TODO - * o fullscreen mode for muse - * o clear menu/toolbars when hiding a window + * M o fullscreen mode for muse + * m o arranger's size hint sucks oO + * maybe related: windows -> tile doesn't work, overrides scrollbarpolicy + * m o rename "borland" to "mac" style??? + * o fix saving muse main win settings in global config dialog * o strange sizes of toolbars oO? - * o restore arranger's maximized state when loading * o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index f54e23c3..380731df 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -151,7 +151,7 @@ WaveEdit::WaveEdit(PartList* pl) connect(selectNoneAction, SIGNAL(triggered()), mapper, SLOT(map())); - QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings")); + QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); -- cgit v1.2.3 From b420f1dd82698c9d7c46212a57a1142a4e37f228 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 22 Aug 2011 18:17:08 +0000 Subject: added fullscreen mode --- muse2/muse/app.cpp | 14 ++++++++++++++ muse2/muse/app.h | 2 ++ muse2/muse/arranger/arrangerview.cpp | 1 + muse2/muse/cliplist/cliplist.cpp | 1 + muse2/muse/cobject.cpp | 17 +++++++++++++++++ muse2/muse/cobject.h | 4 ++++ muse2/muse/liste/listedit.cpp | 1 + muse2/muse/marker/markerview.cpp | 1 + muse2/muse/master/lmaster.cpp | 1 + muse2/muse/master/masteredit.cpp | 1 + muse2/muse/midiedit/drumedit.cpp | 1 + muse2/muse/midiedit/pianoroll.cpp | 1 + muse2/muse/midiedit/scoreedit.cpp | 3 ++- muse2/muse/waveedit/waveedit.cpp | 1 + 14 files changed, 48 insertions(+), 1 deletion(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index b30358b1..d6990c67 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -506,6 +506,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow() viewMarkerAction->setCheckable(true); viewArrangerAction = new QAction(tr("Arranger View"), this); viewArrangerAction->setCheckable(true); + fullscreenAction=new QAction(tr("Fullscreen"), this); + fullscreenAction->setCheckable(true); + fullscreenAction->setChecked(false); //-------- Midi Actions menuScriptPlugins = new QMenu(tr("&Plugins"), this); @@ -595,6 +598,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() connect(viewCliplistAction, SIGNAL(toggled(bool)), SLOT(startClipList(bool))); connect(viewMarkerAction, SIGNAL(toggled(bool)), SLOT(toggleMarker(bool))); connect(viewArrangerAction, SIGNAL(toggled(bool)), SLOT(toggleArranger(bool))); + connect(fullscreenAction, SIGNAL(toggled(bool)), SLOT(setFullscreen(bool))); //-------- Midi connections connect(midiEditInstAction, SIGNAL(activated()), SLOT(startEditInstrument())); @@ -767,6 +771,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menuView->addAction(viewCliplistAction); menuView->addAction(viewMarkerAction); menuView->addAction(viewArrangerAction); + menuView->addSeparator(); + menuView->addAction(fullscreenAction); //------------------------------------------------------------- @@ -3246,3 +3252,11 @@ void MusE::bringToFront(QWidget* widget) win->raise(); } } + +void MusE::setFullscreen(bool val) +{ + if (val) + showFullScreen(); + else + showNormal(); +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 52bccf64..8ff0f72c 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -114,6 +114,7 @@ class MusE : public QMainWindow // View Menu actions QAction *viewTransportAction, *viewBigtimeAction, *viewMixerAAction, *viewMixerBAction, *viewCliplistAction, *viewMarkerAction, *viewArrangerAction; + QAction* fullscreenAction; // Midi Menu Actions QAction *midiEditInstAction, *midiResetInstAction, *midiInitInstActions, *midiLocalOffAction; @@ -294,6 +295,7 @@ class MusE : public QMainWindow void setCurrentMenuSharingTopwin(TopWin*); void bringToFront(QWidget* win); + void setFullscreen(bool); public slots: bool saveAs(); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index cd0f53a9..cfbffc0f 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -490,6 +490,7 @@ ArrangerView::ArrangerView(QWidget* parent) QMenu* menuSettings = menuBar()->addMenu(tr("Window &Config")); menuSettings->addAction(subwinAction); menuSettings->addAction(shareAction); + menuSettings->addAction(fullscreenAction); //-------- Edit connections diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 58bacdd0..8dbb80ef 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -127,6 +127,7 @@ ClipListEdit::ClipListEdit(QWidget* parent) QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index bebbf310..a3b62a80 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -53,6 +53,11 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag shareAction->setCheckable(true); connect(shareAction, SIGNAL(toggled(bool)), SLOT(shareToolsAndMenu(bool))); + fullscreenAction=new QAction(tr("Fullscreen"), this); + fullscreenAction->setCheckable(true); + fullscreenAction->setChecked(false); + connect(fullscreenAction, SIGNAL(toggled(bool)), SLOT(setFullscreen(bool))); + mdisubwin=NULL; _sharesToolsAndMenu=_defaultSubwin[_type] ? _sharesWhenSubwin[_type] : _sharesWhenFree[_type]; if (_defaultSubwin[_type]) @@ -63,6 +68,7 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag subwinAction->setChecked(isMdiWin()); shareAction->setChecked(_sharesToolsAndMenu); + fullscreenAction->setEnabled(!isMdiWin()); } @@ -191,6 +197,8 @@ void TopWin::setIsMdiWin(bool val) if (_sharesToolsAndMenu == _sharesWhenFree[_type]) shareToolsAndMenu(_sharesWhenSubwin[_type]); + fullscreenAction->setEnabled(false); + fullscreenAction->setChecked(false); subwinAction->setChecked(true); muse->updateWindowMenu(); } @@ -215,6 +223,7 @@ void TopWin::setIsMdiWin(bool val) if (_sharesToolsAndMenu == _sharesWhenSubwin[_type]) shareToolsAndMenu(_sharesWhenFree[_type]); + fullscreenAction->setEnabled(true); subwinAction->setChecked(false); muse->updateWindowMenu(); } @@ -447,3 +456,11 @@ QString TopWin::typeName(ToplevelType t) default: return tr(""); } } + +void TopWin::setFullscreen(bool val) +{ + if (val) + showFullScreen(); + else + showNormal(); +} diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 604a8c28..aff4964a 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -84,6 +84,7 @@ class TopWin : public QMainWindow protected: QAction* subwinAction; QAction* shareAction; + QAction* fullscreenAction; ToplevelType _type; @@ -99,6 +100,9 @@ class TopWin : public QMainWindow bool initalizing; //if true, no state is saved + private slots: + void setFullscreen(bool); + public slots: virtual void hide(); virtual void show(); diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 8d4588eb..970d43c4 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -499,6 +499,7 @@ ListEdit::ListEdit(PartList* pl) QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); // Toolbars --------------------------------------------------------- diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index 7889761c..fabb35fd 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -177,6 +177,7 @@ MarkerView::MarkerView(QWidget* parent) QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); // Toolbars --------------------------------------------------------- diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 83f303ee..897ad0b4 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -146,6 +146,7 @@ LMaster::LMaster() QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); connect(tempoAction, SIGNAL(triggered()), signalMapper, SLOT(map())); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index d8432ad0..eb623c14 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -93,6 +93,7 @@ MasterEdit::MasterEdit() QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); // Toolbars --------------------------------------------------------- QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index d9202a5b..629591e7 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -266,6 +266,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); connect(signalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index ed58fec7..a494a728 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -233,6 +233,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i menuConfig->addSeparator(); menuConfig->addAction(subwinAction); menuConfig->addAction(shareAction); + menuConfig->addAction(fullscreenAction); //---------ToolBar---------------------------------- diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index e2f87b33..a682eab0 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -443,6 +443,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) settings_menu->addSeparator(); settings_menu->addAction(subwinAction); settings_menu->addAction(shareAction); + settings_menu->addAction(fullscreenAction); init_shortcuts(); @@ -4450,7 +4451,7 @@ void staff_t::update_part_indices() * changing "share" status, the changed state isn't stored * * CURRENT TODO - * M o fullscreen mode for muse + * o shortcuts, especially for fullscreen * m o arranger's size hint sucks oO * maybe related: windows -> tile doesn't work, overrides scrollbarpolicy * m o rename "borland" to "mac" style??? diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 380731df..942242e7 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -154,6 +154,7 @@ WaveEdit::WaveEdit(PartList* pl) QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); + settingsMenu->addAction(fullscreenAction); //---------ToolBar---------------------------------- tools = addToolBar(tr("Wave edit tools")); -- cgit v1.2.3 From cb4ae0b104084e9c054d2a1b28ce531d104e9d76 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sat, 27 Aug 2011 20:17:59 +0000 Subject: full screen + part edit focus --- muse2/ChangeLog | 3 +++ muse2/awl/CMakeLists.txt | 2 ++ muse2/awl/lineedit.cpp | 11 +++++++++++ muse2/awl/lineedit.h | 18 ++++++++++++++++++ muse2/muse/app.cpp | 1 + muse2/muse/arranger/pcanvas.cpp | 8 +++++--- muse2/muse/arranger/pcanvas.h | 4 ++-- muse2/muse/cliplist/cliplist.cpp | 4 +++- muse2/muse/liste/listedit.cpp | 1 + muse2/muse/marker/markerview.cpp | 4 +++- muse2/muse/master/lmaster.cpp | 1 + muse2/muse/master/masteredit.cpp | 2 ++ muse2/muse/midiedit/drumedit.cpp | 1 + muse2/muse/midiedit/pianoroll.cpp | 1 + muse2/muse/midiedit/scoreedit.cpp | 3 ++- muse2/muse/shortcuts.cpp | 3 ++- muse2/muse/shortcuts.h | 1 + muse2/muse/waveedit/waveedit.cpp | 1 + 18 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 muse2/awl/lineedit.cpp create mode 100644 muse2/awl/lineedit.h (limited to 'muse2/muse/app.cpp') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index d5dd93ce..e5ea1660 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,6 @@ +27.08.2011: + - Added fullscreen shortcut to all editors which have full screen action (rj) + - Part text editor now closes when focus is lost (rj) 17.08.2011: - Convert some Qt3 style coding in ComboBox to Qt4 in terms of menu entry handling. (Orcan) - Add mouse wheel support to ComboBox. (Orcan) diff --git a/muse2/awl/CMakeLists.txt b/muse2/awl/CMakeLists.txt index 21772470..532d0c8d 100644 --- a/muse2/awl/CMakeLists.txt +++ b/muse2/awl/CMakeLists.txt @@ -29,6 +29,7 @@ QT4_WRAP_CPP (awl_mocs drawbar.h floatentry.h knob.h + lineedit.h midimeter.h midimslider.h midipanentry.h @@ -64,6 +65,7 @@ file (GLOB awl_source_files floatentry.cpp knob.cpp # ltest.cpp + lineedit.cpp midimeter.cpp midimslider.cpp midipanentry.cpp diff --git a/muse2/awl/lineedit.cpp b/muse2/awl/lineedit.cpp new file mode 100644 index 00000000..07d2e49f --- /dev/null +++ b/muse2/awl/lineedit.cpp @@ -0,0 +1,11 @@ +#include +#include "lineedit.h" + +LineEdit::LineEdit(QWidget *parent) : + QLineEdit(parent) +{ +} +void LineEdit::focusOutEvent ( QFocusEvent * e ) +{ + emit returnPressed(); +} diff --git a/muse2/awl/lineedit.h b/muse2/awl/lineedit.h new file mode 100644 index 00000000..4ad6116e --- /dev/null +++ b/muse2/awl/lineedit.h @@ -0,0 +1,18 @@ +#ifndef LINEEDIT_H +#define LINEEDIT_H + +#include + +class LineEdit : public QLineEdit +{ + Q_OBJECT +public: + explicit LineEdit(QWidget *parent = 0); + void focusOutEvent ( QFocusEvent * e ); +signals: + +public slots: + +}; + +#endif // LINEEDIT_H diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index d6990c67..cece85ed 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -2858,6 +2858,7 @@ void MusE::updateConfiguration() followCtsAction->setShortcut(shortcuts[SHRT_FOLLOW_CONTINUOUS].key); helpManualAction->setShortcut(shortcuts[SHRT_OPEN_HELP].key); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); // Orcan: Old stuff, needs to be converted. These aren't used anywhere so I commented them out //menuSettings->setAccel(shortcuts[SHRT_CONFIG_AUDIO_PORTS].key, menu_ids[CMD_CONFIG_AUDIO_PORTS]); diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 56d68ceb..1bf7a541 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -16,13 +16,13 @@ #include #include -#include #include #include #include #include #include +#include #include "fastlog.h" #include "widgets/tools.h" #include "arranger.h" @@ -183,7 +183,8 @@ void PartCanvas::viewMouseDoubleClickEvent(QMouseEvent* event) editPart = (NPart*)curItem; QRect r = map(curItem->bbox()); if (lineEditor == 0) { - lineEditor = new QLineEdit(this); + lineEditor = new LineEdit(this); + connect(lineEditor, SIGNAL(returnPressed()),SLOT(returnPressed())); lineEditor->setFrame(true); } editMode = true; @@ -685,7 +686,8 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) editPart = npart; QRect r = map(curItem->bbox()); if (lineEditor == 0) { - lineEditor = new QLineEdit(this); + lineEditor = new LineEdit(this); + connect(lineEditor, SIGNAL(returnPressed()),SLOT(returnPressed())); lineEditor->setFrame(true); } lineEditor->setText(editPart->name()); diff --git a/muse2/muse/arranger/pcanvas.h b/muse2/muse/arranger/pcanvas.h index 71a0129c..4d8e97f8 100644 --- a/muse2/muse/arranger/pcanvas.h +++ b/muse2/muse/arranger/pcanvas.h @@ -50,7 +50,7 @@ struct AutomationObject { ControllerVals controllerState; }; -class QLineEdit; +class LineEdit; class MidiEditor; class QMenu; class Xml; @@ -66,7 +66,7 @@ class PartCanvas : public Canvas { TrackList* tracks; Part* resizePart; - QLineEdit* lineEditor; + LineEdit* lineEditor; NPart* editPart; int curColorIndex; bool editMode; diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 8dbb80ef..47f88d1b 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -16,6 +16,7 @@ #include "globals.h" #include "wave.h" #include "xml.h" +#include "shortcuts.h" #include "ui_cliplisteditorbase.h" @@ -128,7 +129,8 @@ ClipListEdit::ClipListEdit(QWidget* parent) settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); - + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); + QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 int w = 2 + fm.width('9') * 9 + fm.width(':') * 3 + fw * 4; diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index bc90433d..ce102dc5 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -500,6 +500,7 @@ ListEdit::ListEdit(PartList* pl) settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); // Toolbars --------------------------------------------------------- diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index fabb35fd..0e1e3c4a 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -14,6 +14,7 @@ #include "sync.h" #include "icons.h" #include "song.h" +#include "shortcuts.h" ///#include "posedit.h" #include "awl/posedit.h" @@ -178,7 +179,8 @@ MarkerView::MarkerView(QWidget* parent) settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); - + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); + // Toolbars --------------------------------------------------------- QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 5370a493..ab392497 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -158,6 +158,7 @@ LMaster::LMaster() settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); connect(tempoAction, SIGNAL(triggered()), signalMapper, SLOT(map())); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 1eb2d071..9f5c45e5 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -20,6 +20,7 @@ #include "xml.h" #include "lcombo.h" #include "doublelabel.h" +#include "shortcuts.h" ///#include "sigedit.h" #include "globals.h" @@ -92,6 +93,7 @@ MasterEdit::MasterEdit() settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); // Toolbars --------------------------------------------------------- QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools")); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 14419e0f..32ae8208 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -266,6 +266,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); connect(signalMapper, SIGNAL(mapped(int)), SLOT(cmd(int))); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 89f84062..c8fa1887 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -232,6 +232,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i menuConfig->addAction(subwinAction); menuConfig->addAction(shareAction); menuConfig->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); //---------ToolBar---------------------------------- diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 6bc60205..1a2a4ab6 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -442,7 +442,8 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) settings_menu->addAction(subwinAction); settings_menu->addAction(shareAction); settings_menu->addAction(fullscreenAction); - + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); + init_shortcuts(); diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index 86ab0dcd..effdd03a 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -37,7 +37,8 @@ void initShortCuts() defShrt(SHRT_TOGGLE_LOOP, Qt::Key_Slash, "Transport: Toggle Loop section", GLOBAL_SHRT, "toggle_loop"); defShrt(SHRT_START_REC, Qt::Key_Asterisk, "Transport: Toggle Record", GLOBAL_SHRT, "toggle_rec"); defShrt(SHRT_REC_CLEAR, Qt::Key_Backspace, "Transport: Clear all rec enabled tracks", GLOBAL_SHRT, "rec_clear"); - + defShrt(SHRT_FULLSCREEN, Qt::CTRL + Qt::Key_F, "Toggle fullscreen", GLOBAL_SHRT, "fullscreen"); + defShrt(SHRT_COPY, Qt::CTRL + Qt::Key_C, "Edit: Copy", INVIS_SHRT, "copy"); defShrt(SHRT_UNDO, Qt::CTRL + Qt::Key_Z, "Edit: Undo", INVIS_SHRT, "undo"); defShrt(SHRT_REDO, Qt::CTRL + Qt::Key_Y, "Edit: Redo", INVIS_SHRT, "redo"); diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h index b72e0207..ee29a770 100644 --- a/muse2/muse/shortcuts.h +++ b/muse2/muse/shortcuts.h @@ -63,6 +63,7 @@ enum { SHRT_TOGGLE_METRO, // C SHRT_START_REC, // *(keypad) SHRT_REC_CLEAR, // *(keypad) + SHRT_FULLSCREEN, //Main + Drumeditor SHRT_NEW, //Ctrl+N diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index e138769d..003162d2 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -154,6 +154,7 @@ WaveEdit::WaveEdit(PartList* pl) settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); + fullscreenAction->setShortcut(shortcuts[SHRT_FULLSCREEN].key); //---------ToolBar---------------------------------- tools = addToolBar(tr("Wave edit tools")); -- cgit v1.2.3 From 8c37b557d6f865b4320f7b1168030e7d54adacd0 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 30 Aug 2011 16:25:38 +0000 Subject: added "arrange windows in rows" and "in columns" functions --- muse2/muse/app.cpp | 94 +++++++++++++++++++++++++++++++++++++++ muse2/muse/app.h | 5 +++ muse2/muse/midiedit/scoreedit.cpp | 12 +---- 3 files changed, 100 insertions(+), 11 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index cece85ed..91dbaed8 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -542,6 +542,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //-------- Windows Actions windowsCascadeAction = new QAction(tr("Cascade"), this); windowsTileAction = new QAction(tr("Tile"), this); + windowsRowsAction = new QAction(tr("In rows"), this); + windowsColumnsAction = new QAction(tr("In columns"), this); //-------- Settings Actions @@ -841,6 +843,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() menuWindows->addAction(windowsCascadeAction); menuWindows->addAction(windowsTileAction); + menuWindows->addAction(windowsRowsAction); + menuWindows->addAction(windowsColumnsAction); //------------------------------------------------------------- // popup Settings @@ -896,6 +900,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow() mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setCentralWidget(mdiArea); connect(windowsTileAction, SIGNAL(activated()), mdiArea, SLOT(tileSubWindows())); + connect(windowsRowsAction, SIGNAL(activated()), this, SLOT(arrangeSubWindowsRows())); + connect(windowsColumnsAction, SIGNAL(activated()), this, SLOT(arrangeSubWindowsColumns())); connect(windowsCascadeAction, SIGNAL(activated()), mdiArea, SLOT(cascadeSubWindows())); @@ -3202,6 +3208,8 @@ void MusE::updateWindowMenu() menuWindows->addAction(windowsCascadeAction); menuWindows->addAction(windowsTileAction); + menuWindows->addAction(windowsRowsAction); + menuWindows->addAction(windowsColumnsAction); sep=false; for (iToplevel it=toplevels.begin(); it!=toplevels.end(); it++) @@ -3237,6 +3245,8 @@ void MusE::updateWindowMenu() windowsCascadeAction->setEnabled(there_are_subwins); windowsTileAction->setEnabled(there_are_subwins); + windowsRowsAction->setEnabled(there_are_subwins); + windowsColumnsAction->setEnabled(there_are_subwins); } void MusE::bringToFront(QWidget* widget) @@ -3261,3 +3271,87 @@ void MusE::setFullscreen(bool val) else showNormal(); } + + + +list get_all_visible_subwins(QMdiArea* mdiarea) +{ + QList wins = mdiarea->subWindowList(); + list result; + + for (QList::iterator it=wins.begin(); it!=wins.end(); it++) + if ((*it)->isVisible() && ((*it)->isMinimized()==false)) + result.push_back(*it); + + return result; +} + +void MusE::arrangeSubWindowsColumns() +{ + list wins=get_all_visible_subwins(mdiArea); + int n=wins.size(); + + if (n==0) + return; + else if (n==1) + (*wins.begin())->showMaximized(); + else + { + int width = mdiArea->width(); + int height = mdiArea->height(); + int x_add = (*wins.begin())->frameGeometry().width() - (*wins.begin())->geometry().width(); + int y_add = (*wins.begin())->frameGeometry().height() - (*wins.begin())->geometry().height(); + int width_per_win = width/n; + + if (x_add >= width_per_win) + { + printf("ERROR: tried to arrange subwins in columns, but there's too few space.\n"); + return; + } + + int i=0; + for (list::iterator it=wins.begin(); it!=wins.end(); it++, i++) + { + int left = (float) width*i/n; + int right = (float) width*(i+1.0)/n; + + (*it)->move(left,0); + (*it)->resize(right-left-x_add, height-y_add); + } + } +} + +void MusE::arrangeSubWindowsRows() +{ + list wins=get_all_visible_subwins(mdiArea); + int n=wins.size(); + + if (n==0) + return; + else if (n==1) + (*wins.begin())->showMaximized(); + else + { + int width = mdiArea->width(); + int height = mdiArea->height(); + int x_add = (*wins.begin())->frameGeometry().width() - (*wins.begin())->geometry().width(); + int y_add = (*wins.begin())->frameGeometry().height() - (*wins.begin())->geometry().height(); + int height_per_win = height/n; + + if (y_add >= height_per_win) + { + printf("ERROR: tried to arrange subwins in rows, but there's too few space.\n"); + return; + } + + int i=0; + for (list::iterator it=wins.begin(); it!=wins.end(); it++, i++) + { + int top = (float) height*i/n; + int bottom = (float) height*(i+1.0)/n; + + (*it)->move(0,top); + (*it)->resize(width-x_add, bottom-top-y_add); + } + } +} diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 8ff0f72c..83fb70ae 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -132,6 +132,8 @@ class MusE : public QMainWindow // Window Menu Actions QAction* windowsCascadeAction; QAction* windowsTileAction; + QAction* windowsRowsAction; + QAction* windowsColumnsAction; // Settings Menu Actions QAction *settingsGlobalAction, *settingsShortcutsAction, *settingsMetronomeAction, *settingsMidiSyncAction; @@ -296,6 +298,9 @@ class MusE : public QMainWindow void bringToFront(QWidget* win); void setFullscreen(bool); + + void arrangeSubWindowsRows(); + void arrangeSubWindowsColumns(); public slots: bool saveAs(); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index bf52f94b..eee92a9b 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4450,21 +4450,11 @@ void staff_t::update_part_indices() * * CURRENT TODO * M o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) - * m o shortcuts, especially for fullscreen + * M o shortcuts for "pencil" in score editor etc. * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! * o implement borland-style maximize: free windows do not cover the main menu, even when maximized * - * o window menu -> "arrange" -> "all in rows" / "all in columns" - * o add everything of the function-menus of the midieditors to - * the arranger; except "move notes": call it "move parts" and - * actually move parts not notes - * how it works: - * there will be extra dialogs for the arranger - * when such a dialog has been executed, the "selected" option - * only controls the set, but not the "selected" option - * which is given to the actual function call. the range option - * is kept. * o replace "insert empty measure" by a "global insert"-like operation * o replace "insert" and "paste" by a paste-dialog ("move other notes" or "overwrite notes" or "mix with notes") * skip dialog when there is nothing to erase, move or merge with (i.e., at the end of the song) -- cgit v1.2.3 From a8c8fa89d916bded2905e0a5a8c05ac30e159902 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Tue, 13 Sep 2011 23:59:23 +0000 Subject: Added: You can now insert new tracks instead of always at the track list end. If main menu 'Add track': Inserts before currently selected track, else adds at end. If Track List right-click existing Track Name: New 'Insert track' menu inserts before clicked track. If Track List right-click on empty space, or Mixer 'Create': Adds at end, as usual. Fixed track selection bug: Track info panel not clearing when clicking empty area. --- muse2/ChangeLog | 9 +++ muse2/muse/app.cpp | 12 ++-- muse2/muse/app.h | 3 +- muse2/muse/appearance.cpp | 8 +-- muse2/muse/arranger/arrangerview.cpp | 7 ++ muse2/muse/arranger/arrangerview.h | 1 + muse2/muse/arranger/pcanvas.cpp | 18 ++--- muse2/muse/arranger/tlist.cpp | 134 ++++++++++++----------------------- muse2/muse/conf.cpp | 2 +- muse2/muse/confmport.cpp | 3 +- muse2/muse/helper.cpp | 2 +- muse2/muse/importmidi.cpp | 4 +- muse2/muse/mixer/amixer.cpp | 7 ++ muse2/muse/mixer/amixer.h | 1 + muse2/muse/remote/pyapi.cpp | 2 +- muse2/muse/song.cpp | 76 ++++++++++---------- muse2/muse/song.h | 7 +- muse2/muse/songfile.cpp | 2 +- muse2/muse/synth.cpp | 17 ++--- muse2/muse/wave.cpp | 4 +- 20 files changed, 153 insertions(+), 166 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index c50fed97..1f032ab6 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,12 @@ +13.09.2011: + *Added: You can now insert new tracks instead of always at the track list end. (Tim) + If main menu 'Add track': Inserts before currently selected track, else adds at end. + If Track List right-click existing Track Name: New 'Insert track' menu inserts before clicked track. + If Track List right-click on empty space, or Mixer 'Create': Adds at end, as usual. + - Fixed track selection bug: Track info panel not clearing when clicking empty area. (Tim) + Added an emit selectionChanged(0) in TList::mousePressEvent. + - Observed: Ancient bug: Track Info doesn't change if selecting multiple tracks in reverse order. + Will need to be fixed if/when adding 'multiple track global editing'. 09.09.2011: - Removed sending of SEQM_ADD_TRACK, SEQM_REMOVE_TRACK, SEQM_CHANGE_TRACK, SEQM_REMOVE_PART, and SEQM_CHANGE_PART to ALSA midi thread (which waits) from inside Audio::processMsg. diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 454ae1d0..bbe5de22 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -930,7 +930,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed())); toplevels.push_back(arrangerView); arrangerView->hide(); - arranger=arrangerView->getArranger(); + _arranger=arrangerView->getArranger(); arrangerView->setIsMdiWin(true); @@ -1151,7 +1151,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll mixer1->clear(); if (mixer2) mixer2->clear(); - arranger->clear(); // clear track info + _arranger->clear(); // clear track info //if (clearSong()) if (clearSong(loadAll)) // Allow not touching things like midi ports. p4.0.17 TESTING: Maybe some problems... return; @@ -1834,7 +1834,7 @@ void MusE::openInScoreEdit(ScoreEdit* destination, PartList* pl, bool allInOne) { if (destination==NULL) // if no destination given, create a new one { - destination = new ScoreEdit(this, 0, arranger->cursorValue()); + destination = new ScoreEdit(this, 0, _arranger->cursorValue()); destination->show(); toplevels.push_back(destination); connect(destination, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); @@ -1870,7 +1870,7 @@ void MusE::startPianoroll() void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls) { - PianoRoll* pianoroll = new PianoRoll(pl, this, 0, arranger->cursorValue()); + PianoRoll* pianoroll = new PianoRoll(pl, this, 0, _arranger->cursorValue()); if(showDefaultCtrls) // p4.0.12 pianoroll->addCtrl(); pianoroll->show(); @@ -1944,7 +1944,7 @@ void MusE::startDrumEditor() void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls) { - DrumEdit* drumEditor = new DrumEdit(pl, this, 0, arranger->cursorValue()); + DrumEdit* drumEditor = new DrumEdit(pl, this, 0, _arranger->cursorValue()); if(showDefaultCtrls) // p4.0.12 drumEditor->addCtrl(); drumEditor->show(); @@ -2313,7 +2313,7 @@ void MusE::cmd(int cmd) void MusE::configAppearance() { if (!appearance) - appearance = new Appearance(arranger); + appearance = new Appearance(_arranger); appearance->resetValues(); if(appearance->isVisible()) { appearance->raise(); diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 721b9c05..cd18ba4a 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -205,6 +205,7 @@ class MusE : public QMainWindow AudioMixerApp* mixer1; AudioMixerApp* mixer2; + Arranger* _arranger; ToplevelList toplevels; ClipListEdit* clipListEdit; MarkerView* markerView; @@ -375,7 +376,7 @@ class MusE : public QMainWindow public: MusE(int argc, char** argv); ~MusE(); - Arranger* arranger; + Arranger* arranger() { return _arranger; } QRect configGeometryMain; QProgressDialog *progress; bool importMidi(const QString name, bool merge); diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index c26f9542..835ced81 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -550,7 +550,7 @@ void Appearance::bgSelectionChanged(QTreeWidgetItem* item) removeBgButton->setEnabled(true); lastSelectedBgItem = item; - MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap(item->data(0, Qt::UserRole).toString())); + MusEGlobal::muse->arranger()->getCanvas()->setBg(QPixmap(item->data(0, Qt::UserRole).toString())); } //--------------------------------------------------------- @@ -741,7 +741,7 @@ void Appearance::ok() void Appearance::cancel() { - MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap(config->canvasBgPixmap)); + MusEGlobal::muse->arranger()->getCanvas()->setBg(QPixmap(config->canvasBgPixmap)); close(); } @@ -752,7 +752,7 @@ void Appearance::cancel() void Appearance::removeBackground() { QTreeWidgetItem* item = backgroundTree->currentItem(); - MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap()); + MusEGlobal::muse->arranger()->getCanvas()->setBg(QPixmap()); user_bg->takeChild(user_bg->indexOfChild(item)); backgroundTree->setCurrentItem (0); removeBgButton->setEnabled(false); @@ -791,7 +791,7 @@ void Appearance::addBackground() void Appearance::clearBackground() { - MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap()); + MusEGlobal::muse->arranger()->getCanvas()->setBg(QPixmap()); backgroundTree->setCurrentItem (0); removeBgButton->setEnabled(false); } diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 10f43436..06d41802 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -628,6 +628,7 @@ void ArrangerView::clearScoreMenuMappers() void ArrangerView::populateAddTrack() { QActionGroup *grp = MusEUtil::populateAddTrack(addTrack); + connect(addTrack, SIGNAL(triggered(QAction *)), SLOT(addNewTrack(QAction *))); trackMidiAction = grp->actions()[0]; trackDrumAction = grp->actions()[1]; @@ -638,6 +639,12 @@ void ArrangerView::populateAddTrack() trackAAuxAction = grp->actions()[6]; } +void ArrangerView::addNewTrack(QAction* action) +{ + song->addNewTrack(action, MusEGlobal::muse->arranger()->curTrack()); // Insert at current selected track. + //song->addNewTrack(action); // Add at end. +} + void ArrangerView::updateShortcuts() { editCutAction->setShortcut(shortcuts[SHRT_CUT].key); diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index d5e06c6c..bdb450ae 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -118,6 +118,7 @@ class ArrangerView : public TopWin void globalInsert(); void globalSplit(); void cmd(int); + void addNewTrack(QAction* action); signals: void deleted(TopWin*); diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 1dd4c44d..056dcce7 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -349,7 +349,7 @@ UndoOp PartCanvas::moveItem(MusEWidget::CItem* item, const QPoint& newpos, DragT ntrack = tracks->size(); if (MusEGlobal::debugMsg) printf("PartCanvas::moveItem - add new track\n"); - Track* newTrack = song->addTrack(int(type)); + Track* newTrack = song->addTrack(type, false); // Add at end of list. if (type == Track::WAVE) { WaveTrack* st = (WaveTrack*) track; WaveTrack* dt = (WaveTrack*) newTrack; @@ -662,17 +662,17 @@ QMenu* PartCanvas::genItemPopup(MusEWidget::CItem* item) partPopup->addSeparator(); switch(trackType) { case Track::MIDI: { - partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startPianoEditAction); - partPopup->addMenu(MusEGlobal::muse->arranger->parentWin->scoreSubmenu); - partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startScoreEditAction); - partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startListEditAction); + partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startPianoEditAction); + partPopup->addMenu(MusEGlobal::muse->arranger()->parentWin->scoreSubmenu); + partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startScoreEditAction); + partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startListEditAction); QAction *act_mexport = partPopup->addAction(tr("save part to disk")); act_mexport->setData(16); } break; case Track::DRUM: { - partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startDrumEditAction); - partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startListEditAction); + partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startDrumEditAction); + partPopup->addAction(MusEGlobal::muse->arranger()->parentWin->startListEditAction); QAction *act_dexport = partPopup->addAction(tr("save part to disk")); act_dexport->setData(16); } @@ -3236,9 +3236,9 @@ void PartCanvas::viewDropEvent(QDropEvent* event) if (!track) { // we need to create a track for this drop if (text.endsWith(".mpt", Qt::CaseInsensitive)) { - track = song->addTrack((Track::MIDI)); + track = song->addTrack(Track::MIDI, false); // Add at end of list. } else { - track = song->addTrack((Track::WAVE)); + track = song->addTrack(Track::WAVE, false); // Add at end of list. } } if (track->type() == Track::WAVE && diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 786b4ad7..28b12fdc 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -990,105 +990,44 @@ void TList::mousePressEvent(QMouseEvent* ev) Track* t = y2Track(y + ypos); + // FIXME Observed: Ancient bug: Track Info doesn't change if selecting multiple tracks in reverse order. + // Will need to be fixed if/when adding 'multiple track global editing'. + TrackColumn col = TrackColumn(header->logicalIndexAt(x)); if (t == 0) { if (button == Qt::RightButton) { QMenu* p = new QMenu; - //p->clear(); - QAction* midi = p->addAction(*addtrack_addmiditrackIcon, - tr("Add Midi Track")); - midi->setData(Track::MIDI); - QAction* drum = p->addAction(*addtrack_drumtrackIcon, - tr("Add Drum Track")); - drum->setData(Track::DRUM); - QAction* wave = p->addAction(*addtrack_wavetrackIcon, - tr("Add Wave Track")); - wave->setData(Track::WAVE); - QAction* aoutput = p->addAction(*addtrack_audiooutputIcon, - tr("Add Output")); - aoutput->setData(Track::AUDIO_OUTPUT); - QAction* agroup = p->addAction(*addtrack_audiogroupIcon, - tr("Add Group")); - agroup->setData(Track::AUDIO_GROUP); - QAction* ainput = p->addAction(*addtrack_audioinputIcon, - tr("Add Input")); - ainput->setData(Track::AUDIO_INPUT); - QAction* aaux = p->addAction(*addtrack_auxsendIcon, - tr("Add Aux Send")); - aaux->setData(Track::AUDIO_AUX); + MusEUtil::populateAddTrack(p); - // Create a sub-menu and fill it with found synth types. Make p the owner. - QMenu* synp = MusEUtil::populateAddSynth(p); - synp->setIcon(*synthIcon); - synp->setTitle(QT_TRANSLATE_NOOP("@default", "Add Synth")); - - // Add the 'Add Synth' sub-menu to the menu. - p->addMenu(synp); - // Show the menu QAction* act = p->exec(ev->globalPos(), 0); // Valid click? if(act) { - int n = act->data().toInt(); - // Valid item? - if((n >= 0) && ((Track::TrackType)n != Track::AUDIO_SOFTSYNTH)) + t = song->addNewTrack(act); // Add at end of list. + if(t) { - // Synth sub-menu id? - if(n >= MENU_ADD_SYNTH_ID_BASE) - { - n -= MENU_ADD_SYNTH_ID_BASE; - //if(n < synthis.size()) - // t = song->createSynthI(synthis[n]->baseName()); - //if((n - MENU_ADD_SYNTH_ID_BASE) < (int)synthis.size()) - if(n < (int)synthis.size()) - { - //t = song->createSynthI(synp->text(n)); - //t = song->createSynthI(synthis[n]->name()); - t = song->createSynthI(synthis[n]->baseName(), synthis[n]->name()); - - if(t) - { - // Add instance last in midi device list. - for (int i = 0; i < MIDI_PORTS; ++i) - { - MidiPort* port = &midiPorts[i]; - MidiDevice* dev = port->device(); - if (dev==0) - { - midiSeq->msgSetMidiDevice(port, (SynthI*)t); - MusEGlobal::muse->changeConfig(true); // save configuration file - song->update(); - break; - } - } - } - } - } - // Normal track. - else - t = song->addTrack((Track::TrackType)n); - - if(t) - { - song->deselectTracks(); - t->setSelected(true); - - ///emit selectionChanged(); - emit selectionChanged(t); - adjustScrollbar(); - } - } + song->deselectTracks(); + t->setSelected(true); + + ///emit selectionChanged(); + emit selectionChanged(t); + adjustScrollbar(); + } } // Just delete p, and all its children will go too, right? //delete synp; delete p; - } + } else if (button == Qt::LeftButton) { - if (!ctrl) song->deselectTracks(); - } + if (!ctrl) + { + song->deselectTracks(); + emit selectionChanged(0); + } + } return; } @@ -1294,18 +1233,28 @@ void TList::mousePressEvent(QMouseEvent* ev) mode = NORMAL; QMenu* p = new QMenu; //p->clear(); - p->addAction(QIcon(*automation_clear_dataIcon), tr("Delete Track"))->setData(0); - p->addAction(QIcon(*track_commentIcon), tr("Track Comment"))->setData(1); + // Leave room for normal track IDs - base these at AUDIO_SOFTSYNTH. + p->addAction(QIcon(*automation_clear_dataIcon), tr("Delete Track"))->setData(Track::AUDIO_SOFTSYNTH + 1); + p->addAction(QIcon(*track_commentIcon), tr("Track Comment"))->setData(Track::AUDIO_SOFTSYNTH + 2); + p->addSeparator(); + QMenu* pnew = new QMenu(p); + pnew->setTitle(tr("Insert Track")); + pnew->setIcon(QIcon(*edit_track_addIcon)); + MusEUtil::populateAddTrack(pnew); + p->addMenu(pnew); QAction* act = p->exec(ev->globalPos(), 0); if (act) { int n = act->data().toInt(); - switch (n) { - case 0: // delete track + if(n >= Track::AUDIO_SOFTSYNTH && n < MENU_ADD_SYNTH_ID_BASE) + { + n -= Track::AUDIO_SOFTSYNTH; + switch (n) { + case 1: // delete track song->removeTrack0(t); audio->msgUpdateSoloStates(); break; - case 1: // show track comment + case 2: // show track comment { MusEWidget::TrackComment* tc = new MusEWidget::TrackComment(t, 0); tc->show(); @@ -1317,8 +1266,19 @@ void TList::mousePressEvent(QMouseEvent* ev) printf("action %d\n", n); break; } - } + else + { + t = song->addNewTrack(act, t); // Let addNewTrack handle it. Insert before clicked-on track 't'. + if(t) + { + song->deselectTracks(); + t->setSelected(true); + emit selectionChanged(t); + adjustScrollbar(); + } + } + } delete p; } break; diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 669ba55e..3fb09c2a 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -1477,7 +1477,7 @@ 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); writeSeqConfiguration(level, xml, true); DrumEdit::writeConfiguration(level, xml); diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index ce59b673..6e371d0e 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -1341,8 +1341,7 @@ void MPConfig::addInstanceClicked() QTreeWidgetItem* item = synthList->currentItem(); if (item == 0) return; - //SynthI *si = song->createSynthI(item->text(2)); - SynthI *si = song->createSynthI(item->text(0), item->text(2)); + SynthI *si = song->createSynthI(item->text(0), item->text(2), false); // Add at end of list. if(!si) return; diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp index 82c22c64..1a223bb3 100644 --- a/muse2/muse/helper.cpp +++ b/muse2/muse/helper.cpp @@ -318,7 +318,7 @@ QActionGroup* populateAddTrack(QMenu* addTrack) // Add the sub-menu to the given menu. addTrack->addMenu(synp); - QObject::connect(addTrack, SIGNAL(triggered(QAction *)), song, SLOT(addNewTrack(QAction *))); + //QObject::connect(addTrack, SIGNAL(triggered(QAction *)), song, SLOT(addNewTrack(QAction *))); return grp; } diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index c7c02253..fd690671 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -268,8 +268,8 @@ bool MusE::importMidi(const QString name, bool merge) song->updatePos(); - arranger->reset(); - ///arranger->setMode(int(song->mtype())); // p4.0.7 Tim + _arranger->reset(); + ///_arranger->setMode(int(song->mtype())); // p4.0.7 Tim } else { song->initLen(); diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 35173731..e30524ae 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -169,6 +169,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c) QMenu* menuConfig = menuBar()->addMenu(tr("&Create")); MusEUtil::populateAddTrack(menuConfig); + connect(menuConfig, SIGNAL(triggered(QAction *)), song, SLOT(addNewTrack(QAction *))); QMenu* menuView = menuBar()->addMenu(tr("&View")); routingId = menuView->addAction(tr("Routing"), this, SLOT(toggleRouteDialog())); @@ -252,6 +253,12 @@ bool AudioMixerApp::event(QEvent* event) } */ +//void AudioMixerApp::addNewTrack(QAction* action) +//{ + //song->addNewTrack(action, MusEGlobal::muse->arranger()->curTrack()); // Insert at current selected track. +// song->addNewTrack(action); // Add at end. +//} + void AudioMixerApp::setSizing() { int w = 0; diff --git a/muse2/muse/mixer/amixer.h b/muse2/muse/mixer/amixer.h index 1726ba7b..41f1e5e1 100644 --- a/muse2/muse/mixer/amixer.h +++ b/muse2/muse/mixer/amixer.h @@ -122,6 +122,7 @@ class AudioMixerApp : public QMainWindow { void songChanged(int); //void configChanged() { songChanged(-1); } void configChanged(); + //void addNewTrack(QAction*); void setSizing(); void toggleRouteDialog(); void routingDialogClosed(); diff --git a/muse2/muse/remote/pyapi.cpp b/muse2/muse/remote/pyapi.cpp index 2143faf0..c9f9470f 100644 --- a/muse2/muse/remote/pyapi.cpp +++ b/muse2/muse/remote/pyapi.cpp @@ -1127,7 +1127,7 @@ bool Song::event(QEvent* _e) break; } case QPybridgeEvent::SONG_ADD_TRACK: - song->addTrack(e->getP1()); + song->addTrack((Track::TrackType)e->getP1(), false); // Add at end of list. break; case QPybridgeEvent::SONG_CHANGE_TRACKNAME: { Track* t = this->findTrack(e->getS1()); diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index af5b0489..7adc37f3 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -162,12 +162,13 @@ void Song::setSig(const AL::TimeSignature& sig) //--------------------------------------------------------- // addNewTrack // Called from GUI context +// If insertAt is valid, inserts before insertAt. Else at the end after all tracks. // Besides normal track types, n includes synth menu ids from populateAddTrack() //--------------------------------------------------------- -Track* Song::addNewTrack(QAction* action) +Track* Song::addNewTrack(QAction* action, Track* insertAt) { - int n = action->data().toInt(); + int n = action->data().toInt(); // Ignore negative numbers since this slot could be called by a menu or list etc. passing -1. if(n < 0) return 0; @@ -176,45 +177,42 @@ Track* Song::addNewTrack(QAction* action) if(n >= MENU_ADD_SYNTH_ID_BASE) { n -= MENU_ADD_SYNTH_ID_BASE; - if(n < (int)synthis.size()) - { - //SynthI* si = createSynthI(synthis[n]->baseName()); - //SynthI* si = createSynthI(synthis[n]->name()); - SynthI* si = createSynthI(synthis[n]->baseName(), synthis[n]->name()); - if(!si) - return 0; + if(n >= (int)synthis.size()) + return 0; - // Add instance last in midi device list. - for (int i = 0; i < MIDI_PORTS; ++i) + SynthI* si = createSynthI(synthis[n]->baseName(), synthis[n]->name(), insertAt); + if(!si) + return 0; + + // Add instance last in midi device list. + for (int i = 0; i < MIDI_PORTS; ++i) + { + MidiPort* port = &midiPorts[i]; + MidiDevice* dev = port->device(); + if (dev==0) { - MidiPort* port = &midiPorts[i]; - MidiDevice* dev = port->device(); - if (dev==0) - { - midiSeq->msgSetMidiDevice(port, si); - MusEGlobal::muse->changeConfig(true); // save configuration file - deselectTracks(); - si->setSelected(true); - update(); - return si; - } + midiSeq->msgSetMidiDevice(port, si); + MusEGlobal::muse->changeConfig(true); // save configuration file + deselectTracks(); + si->setSelected(true); + update(); + return si; } - deselectTracks(); - si->setSelected(true); - update(SC_SELECTION); - return si; - } - else - return 0; + } + deselectTracks(); + si->setSelected(true); + update(SC_SELECTION); + return si; } // Normal track. else { - // Ignore AUDIO_SOFTSYNTH, now that we have it as the synth menu id, since addTrack doesn't like it. - if((Track::TrackType)n == Track::AUDIO_SOFTSYNTH) + // Ignore AUDIO_SOFTSYNTH (or anything greater, to allow for other entries in some menu), + // now that we have it as the synth menu id, since addTrack doesn't like it. + if((Track::TrackType)n >= Track::AUDIO_SOFTSYNTH) return 0; - Track* t = addTrack((Track::TrackType)n); + Track* t = addTrack((Track::TrackType)n, insertAt); deselectTracks(); t->setSelected(true); update(SC_SELECTION); @@ -226,11 +224,12 @@ Track* Song::addNewTrack(QAction* action) //--------------------------------------------------------- // addTrack // called from GUI context +// type is track type +// If insertAt is valid, inserts before insertAt. Else at the end after all tracks. //--------------------------------------------------------- -Track* Song::addTrack(int t) +Track* Song::addTrack(Track::TrackType type, Track* insertAt) { - Track::TrackType type = (Track::TrackType) t; Track* track = 0; int lastAuxIdx = _auxs.size(); switch(type) { @@ -270,9 +269,12 @@ Track* Song::addTrack(int t) abort(); } track->setDefaultName(); - insertTrack1(track, -1); - msgInsertTrack(track, -1, true); - insertTrack3(track, -1); + + int idx = insertAt ? _tracks.index(insertAt) : -1; + + insertTrack1(track, idx); + msgInsertTrack(track, idx, true); + insertTrack3(track, idx); // Add default track <-> midiport routes. if(track->isMidiTrack()) diff --git a/muse2/muse/song.h b/muse2/muse/song.h index 09174f71..79e5521f 100644 --- a/muse2/muse/song.h +++ b/muse2/muse/song.h @@ -358,8 +358,7 @@ class Song : public QObject { // Configuration //----------------------------------------- - //SynthI* createSynthI(const QString& sclass); - SynthI* createSynthI(const QString& sclass, const QString& label = QString()); + SynthI* createSynthI(const QString& sclass, const QString& label = QString(), Track* insertAt = 0); void rescanAlsaPorts(); @@ -407,8 +406,8 @@ class Song : public QObject { void setQuantize(bool val); void panic(); void seqSignal(int fd); - Track* addTrack(int); - Track* addNewTrack(QAction* action); + Track* addTrack(Track::TrackType type, Track* insertAt = 0); + Track* addNewTrack(QAction* action, Track* insertAt = 0); QString getScriptPath(int id, bool delivered); void populateScriptMenu(QMenu* menuPlugins, QObject* receiver); diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 3958c933..2763f1b6 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -1033,7 +1033,7 @@ void MusE::readToplevels(Xml& xml) } } else if (tag == "scoreedit") { - ScoreEdit* score = new ScoreEdit(this, 0, arranger->cursorValue()); + ScoreEdit* score = new ScoreEdit(this, 0, _arranger->cursorValue()); score->show(); toplevels.push_back(score); connect(score, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*))); diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp index ae54cd15..62da5e1d 100644 --- a/muse2/muse/synth.cpp +++ b/muse2/muse/synth.cpp @@ -35,13 +35,13 @@ //#include #include "app.h" +#include "arranger.h" #include "synth.h" #include "xml.h" #include "midi.h" #include "midiport.h" #include "mididev.h" -//#include "libsynti/mess.h" -#include "synti/libsynti/mess.h" // p4.0.2 +#include "synti/libsynti/mess.h" #include "song.h" #include "audio.h" #include "event.h" @@ -162,7 +162,6 @@ static Synth* findSynth(const QString& sclass, const QString& label) // create a synthesizer instance of class "label" //--------------------------------------------------------- -//static SynthI* createSynthI(const QString& sclass) static SynthI* createSynthInstance(const QString& sclass, const QString& label) { //Synth* s = findSynth(sclass); @@ -648,10 +647,10 @@ void initMidiSynth() //--------------------------------------------------------- // createSynthI // create a synthesizer instance of class "label" +// If insertAt is valid, inserts before insertAt. Else at the end after all tracks. //--------------------------------------------------------- -//SynthI* Song::createSynthI(const QString& sclass) -SynthI* Song::createSynthI(const QString& sclass, const QString& label) +SynthI* Song::createSynthI(const QString& sclass, const QString& label, Track* insertAt) { //printf("Song::createSynthI calling ::createSynthI class:%s\n", sclass.toLatin1().constData()); @@ -662,13 +661,15 @@ SynthI* Song::createSynthI(const QString& sclass, const QString& label) return 0; //printf("Song::createSynthI created SynthI. Before insertTrack1...\n"); - insertTrack1(si, -1); + int idx = insertAt ? _tracks.index(insertAt) : -1; + + insertTrack1(si, idx); //printf("Song::createSynthI after insertTrack1. Before msgInsertTrack...\n"); - msgInsertTrack(si, -1, true); // add to instance list + msgInsertTrack(si, idx, true); // add to instance list //printf("Song::createSynthI after msgInsertTrack. Before insertTrack3...\n"); - insertTrack3(si, -1); + insertTrack3(si, idx); //printf("Song::createSynthI after insertTrack3. Adding default routes...\n"); diff --git a/muse2/muse/wave.cpp b/muse2/muse/wave.cpp index 6f97a3f0..731606d3 100644 --- a/muse2/muse/wave.cpp +++ b/muse2/muse/wave.cpp @@ -815,7 +815,7 @@ namespace MusEApp { void MusE::importWave() { - Track* track = arranger->curTrack(); + Track* track = _arranger->curTrack(); if (track == 0 || track->type() != Track::WAVE) { QMessageBox::critical(this, QString("MusE"), tr("to import an audio file you have first to select" @@ -838,7 +838,7 @@ void MusE::importWave() bool MusE::importWaveToTrack(QString& name, unsigned tick, Track* track) { if (track==NULL) - track = (WaveTrack*)(arranger->curTrack()); + track = (WaveTrack*)(_arranger->curTrack()); SndFile* f = getWave(name, true); -- cgit v1.2.3 From 539b0f88b82d7f0f9c625165c815cbbe19599b1c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 14 Sep 2011 13:55:37 +0000 Subject: fixed window->tile --- muse2/muse/app.cpp | 60 +++++++++++++++++++++++++++++++++++++-- muse2/muse/app.h | 1 + muse2/muse/midiedit/scoreedit.cpp | 4 ++- 3 files changed, 62 insertions(+), 3 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index bbe5de22..de35e5bc 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -919,7 +919,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow() mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setCentralWidget(mdiArea); - connect(windowsTileAction, SIGNAL(activated()), mdiArea, SLOT(tileSubWindows())); + connect(windowsTileAction, SIGNAL(activated()), this, SLOT(tileSubWindows())); connect(windowsRowsAction, SIGNAL(activated()), this, SLOT(arrangeSubWindowsRows())); connect(windowsColumnsAction, SIGNAL(activated()), this, SLOT(arrangeSubWindowsColumns())); connect(windowsCascadeAction, SIGNAL(activated()), mdiArea, SLOT(cascadeSubWindows())); @@ -3299,9 +3299,17 @@ list get_all_visible_subwins(QMdiArea* mdiarea) QList wins = mdiarea->subWindowList(); list result; + // always put the arranger at the top of the list, if visible + for (QList::iterator it=wins.begin(); it!=wins.end(); it++) if ((*it)->isVisible() && ((*it)->isMinimized()==false)) - result.push_back(*it); + if (dynamic_cast((*it)->widget())->type()==TopWin::ARRANGER) + result.push_back(*it); + + for (QList::iterator it=wins.begin(); it!=wins.end(); it++) + if ((*it)->isVisible() && ((*it)->isMinimized()==false)) + if (dynamic_cast((*it)->widget())->type()!=TopWin::ARRANGER) + result.push_back(*it); return result; } @@ -3376,4 +3384,52 @@ void MusE::arrangeSubWindowsRows() } } +void MusE::tileSubWindows() +{ + list wins=get_all_visible_subwins(mdiArea); + int n=wins.size(); + + if (n==0) + return; + else if (n==1) + (*wins.begin())->showMaximized(); + else + { + int nx,ny; + nx=ceil(sqrt(n)); + ny=ceil((double)n/nx); + + int width = mdiArea->width(); + int height = mdiArea->height(); + int x_add = (*wins.begin())->frameGeometry().width() - (*wins.begin())->geometry().width(); + int y_add = (*wins.begin())->frameGeometry().height() - (*wins.begin())->geometry().height(); + int height_per_win = height/ny; + int width_per_win = height/nx; + + if ((x_add >= width_per_win) || (y_add >= height_per_win)) + { + printf("ERROR: tried to tile subwins, but there's too few space.\n"); + return; + } + + int i=0, j=0; + for (list::iterator it=wins.begin(); it!=wins.end(); it++, i++) + { + if (i>=nx) + { + i=0; + j++; + } + + int top = (float) height*j/ny; + int bottom = (float) height*(j+1.0)/ny; + int left = (float) width*i/nx; + int right = (float) width*(i+1.0)/nx; + + (*it)->move(left,top); + (*it)->resize(right-left-x_add, bottom-top-y_add); + } + } +} + } //namespace MusEApp diff --git a/muse2/muse/app.h b/muse2/muse/app.h index cd18ba4a..3bde68e1 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -325,6 +325,7 @@ class MusE : public QMainWindow void arrangeSubWindowsRows(); void arrangeSubWindowsColumns(); + void tileSubWindows(); public slots: bool saveAs(); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 06e32c9c..a16a872e 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4539,7 +4539,9 @@ void ScoreCanvas::add_new_parts(const std::map< Part*, std::set >& param) * from clipboard failed. ignoring this one... ) [ not reproducible ] * * CURRENT TODO - * o TEST pasting in editors! + * M o ecanvas: FINDMICH + * M o dialog.cpp: FINDMICH + * M o TEST pasting in editors! * * o ticks-to-quarter spinboxes * -- cgit v1.2.3 From 187665d84e56b63f569731550c652a89cb650309 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 14 Sep 2011 17:00:09 +0000 Subject: - provided sane configuration defaults - updated templates - windows->tile/arrange in rows/columns doesn't maximize a window if it's the only one - removed "bool initalizing stuff" - small fixes for focusing and toolbar-sharing --- muse2/ChangeLog | 3 + muse2/muse/app.cpp | 17 +- muse2/muse/arranger/arrangerview.cpp | 2 - muse2/muse/cliplist/cliplist.cpp | 2 - muse2/muse/cobject.cpp | 10 - muse2/muse/liste/listedit.cpp | 2 - muse2/muse/main.cpp | 23 ++ muse2/muse/marker/markerview.cpp | 2 - muse2/muse/master/lmaster.cpp | 1 - muse2/muse/master/masteredit.cpp | 1 - muse2/muse/midiedit/drumedit.cpp | 1 - muse2/muse/midiedit/pianoroll.cpp | 1 - muse2/muse/midiedit/scoreedit.cpp | 8 +- muse2/muse/waveedit/waveedit.cpp | 1 - muse2/share/templates/CMakeLists.txt | 5 +- muse2/share/templates/MusE-qt.conf | 14 + muse2/share/templates/MusE.cfg | 553 +++++++++++++++++++++++++++++++++++ muse2/share/templates/audio.med | 118 ++++++-- muse2/share/templates/default.med | 118 ++++++-- muse2/share/templates/midiGM.med | 143 ++++++--- muse2/share/templates/monorecord.med | 120 ++++++-- muse2/share/templates/synti.med | 170 +++++++---- 22 files changed, 1106 insertions(+), 209 deletions(-) create mode 100644 muse2/share/templates/MusE-qt.conf create mode 100644 muse2/share/templates/MusE.cfg (limited to 'muse2/muse/app.cpp') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 1f032ab6..ee6c171a 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,6 @@ +14.09.2011: + - added sane configuration defaults to muse (flo93) + - several minor fixes (flo93) 13.09.2011: *Added: You can now insert new tracks instead of always at the track list end. (Tim) If main menu 'Add track': Inserts before currently selected track, else adds at end. diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index de35e5bc..773e550f 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1329,7 +1329,10 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll } if (maximizeArranger) + { arrangerView->showMaximized(); + bringToFront(arrangerView); + } } } @@ -3282,6 +3285,8 @@ void MusE::bringToFront(QWidget* widget) win->activateWindow(); win->raise(); } + + activeTopWinChangedSlot(win); } void MusE::setFullscreen(bool val) @@ -3321,8 +3326,8 @@ void MusE::arrangeSubWindowsColumns() if (n==0) return; - else if (n==1) - (*wins.begin())->showMaximized(); + //else if (n==1) + // (*wins.begin())->showMaximized(); // commented out by flo. i like it better that way. else { int width = mdiArea->width(); @@ -3356,8 +3361,8 @@ void MusE::arrangeSubWindowsRows() if (n==0) return; - else if (n==1) - (*wins.begin())->showMaximized(); + //else if (n==1) + // (*wins.begin())->showMaximized(); // commented out by flo. i like it better that way. else { int width = mdiArea->width(); @@ -3391,8 +3396,8 @@ void MusE::tileSubWindows() if (n==0) return; - else if (n==1) - (*wins.begin())->showMaximized(); + //else if (n==1) + // (*wins.begin())->showMaximized(); // commented out by flo. i like it better that way. else { int nx,ny; diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 0a57ce8b..0cc75db9 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -358,8 +358,6 @@ ArrangerView::ArrangerView(QWidget* parent) // bug: 2811156 Softsynth GUI unclosable with XFCE4 (and a few others) show(); hide(); - - initalizing=false; } ArrangerView::~ArrangerView() diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 22bee1ff..95f58f80 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -166,8 +166,6 @@ ClipListEdit::ClipListEdit(QWidget* parent) connect(editor->len, SIGNAL(valueChanged(const Pos&)), SLOT(lenChanged(const Pos&))); updateList(); - - initalizing=false; } ClipListEdit::~ClipListEdit() diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index a4fbd6c7..eff6d9af 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -51,12 +51,8 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag if (initInited==false) initConfiguration(); - initalizing=true; - _type=t; - - setObjectName(QString(name)); // Allow multiple rows. Tim. //setDockNestingEnabled(true); @@ -350,12 +346,6 @@ void TopWin::shareToolsAndMenu(bool val) void TopWin::storeInitialState() const { - if (initalizing) - { - printf("THIS SHOULD NEVER HAPPEN: STORE INIT STATE CALLED WHILE INITING! please IMMEDIATELY report that to flo!\n"); - exit(1); - } - _widthInit[_type] = width(); _heightInit[_type] = height(); if (sharesToolsAndMenu()) diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 3da8346f..9766ba71 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -607,8 +607,6 @@ ListEdit::ListEdit(PartList* pl) initShortcuts(); setWindowTitle("MusE: List Editor"); - - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp index fe18214c..11644e2f 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -260,6 +261,28 @@ int main(int argc, char* argv[]) QDir cPath = QDir(MusEGlobal::configPath); if (! cPath.exists()) cPath.mkpath("."); + + QFile cConf (MusEGlobal::configName); + QFile cConfTempl (MusEGlobal::museGlobalShare + QString("/templates/MusE.cfg")); + if (! cConf.exists()) + { + printf ("creating new config...\n"); + if (cConfTempl.copy(MusEGlobal::configName)) + printf (" success.\n"); + else + printf (" FAILED!\n"); + } + + QFile cConfQt (MusEGlobal::configPath + QString("/MusE-qt.conf")); + QFile cConfTemplQt (MusEGlobal::museGlobalShare + QString("/templates/MusE-qt.conf")); + if (! cConfQt.exists()) + { + printf ("creating new qt config...\n"); + if (cConfTemplQt.copy(cConfQt.fileName())) + printf (" success.\n"); + else + printf (" FAILED!\n"); + } #ifdef HAVE_LASH lash_args_t * lash_args = 0; diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index f6517ee1..3aa1908c 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -301,8 +301,6 @@ MarkerView::MarkerView(QWidget* parent) // bug: 2811156 Softsynth GUI unclosable with XFCE4 (and a few others) show(); hide(); - - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 5575b64e..a2cc8538 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -276,7 +276,6 @@ LMaster::LMaster() connect(keyButton, SIGNAL(clicked()), SLOT(insertKey())); initShortcuts(); - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 976d90b9..c3fde313 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -262,7 +262,6 @@ MasterEdit::MasterEdit() connect(canvas, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); initTopwinState(); - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index a617f3ab..8821d0d8 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -531,7 +531,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini initTopwinState(); - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 1eff2504..178b5c46 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -530,7 +530,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i } initTopwinState(); - initalizing=false; } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 6e04e51e..8b5b52f7 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -501,7 +501,6 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) apply_velo=true; initTopwinState(); - initalizing=false; } void ScoreEdit::init_shortcuts() @@ -4541,18 +4540,17 @@ void ScoreCanvas::add_new_parts(const std::map< Part*, std::set >& param) * CURRENT TODO * M o TEST pasting in editors! * + * ! o fix sigedit boxes (see also "important todo") * o ticks-to-quarter spinboxes - * - * ! o fix sigedit boxes - * M o remove that ugly "bool initalizing" stuff. it's probably unneeded (watch out for the FINDMICH message) + * o newly created windows have to be focussed! * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! - * o sane defaults for toolbars * o implement borland-style maximize: free windows do not cover the main menu, even when maximized * o smart range selection: if range markers have been used recently (that is, a dialog with * "range" setting, or they've been modified), default to "in range" or "selected in range" * * IMPORTANT TODO + * ! o fix sigedit boxes (see also "current todo") * o add "dotted quarter" quantize option (for 6/8 beat) * * o rename stuff with F2 key diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 0d42ab6b..a2167a50 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -284,7 +284,6 @@ WaveEdit::WaveEdit(PartList* pl) } initTopwinState(); - initalizing=false; } void WaveEdit::initShortcuts() diff --git a/muse2/share/templates/CMakeLists.txt b/muse2/share/templates/CMakeLists.txt index 4db9f59b..d21ec36c 100644 --- a/muse2/share/templates/CMakeLists.txt +++ b/muse2/share/templates/CMakeLists.txt @@ -21,7 +21,10 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #============================================================================= -file (GLOB templates_files *.med) +file (GLOB templates_files *.med + MusE.cfg + MusE-qt.conf + ) install( FILES ${templates_files} DESTINATION ${MusE_SHARE_DIR}/templates diff --git a/muse2/share/templates/MusE-qt.conf b/muse2/share/templates/MusE-qt.conf new file mode 100644 index 00000000..55c4190e --- /dev/null +++ b/muse2/share/templates/MusE-qt.conf @@ -0,0 +1,14 @@ +[Pianoroll] +windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3T\0\0\x1\xcc\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0) + +[Drumedit] +windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\xa6\0\0\x1\xe8\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0) + +[ScoreEdit] +windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\x63\0\0\x2 \0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0) + +[Waveedit] +windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x2\xf8\0\0\x1\xcc\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0) + +[MusE] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\xff\xff\xff\xfa\0\0\0\0\0\0\x4\x5\0\0\x2\xd3\0\0\0\0\0\0\0\0\xff\xff\xff\xfe\xff\xff\xff\xfe\0\0\0\0\x2\0) diff --git a/muse2/share/templates/MusE.cfg b/muse2/share/templates/MusE.cfg new file mode 100644 index 00000000..9406e1ae --- /dev/null +++ b/muse2/share/templates/MusE.cfg @@ -0,0 +1,553 @@ + + + + 384 + 1024 + -60 + -60 + 0 + 1 + 1 + 0 + 0 + 512 + 44100 + 64 + 20 + /home/flo/.config/MusE/instruments + 1 + 384 + 384 + + 1 + 0 + 1 + 1 + 1 + + ./ + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + :/style.qss + sweep + 0 + 0 + 0 + arial,10,-1,5,50,0,0,0,0,0 + arial,8,-1,5,50,0,0,0,0,0 + arial,10,-1,5,50,0,0,0,0,0 + arial,10,-1,5,75,0,0,0,0,0 + arial,8,-1,5,75,0,0,0,0,0 + Lucidatypewriter,14,-1,5,75,0,0,0,0,0 + arial,8,-1,5,75,1,0,0,0,0 + 190 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + Refrain + Bridge + Intro + Coda + Chorus + Solo + Brass + Percussion + Drums + Guitar + Bass + Flute + Strings + Keyboard + Piano + Saxophone + + + + + + + + + + + + + + + + + + + + + + + 1 + 00:00:00:00:00 + 0 + + + + + + 0 + 0 + 0 + 0 + + Mixer A + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + Mixer B + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + 1 + 1 + 5 + 1 + + + + + + + + + 2 + 63 + 127 + 63 + 70 + 9 + 0 + 0 + 0 + 4 + 4 + 0 + 0 + 1 + 0 + 0.5 + + 0 + 28 + 31 + 33 + 29 + 36 + + + 96 + 133 + 795 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + + + + 96 + 0 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + + + + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + + + + 0 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + + + + + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + + + + + 756 + 327 + 000000ff00000000fd00000000000002fc0000012700000004000000040000000800000008fc0000000100000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000022006c00690073007400200069006e007300650072007400200074006f006f006c00730100000049000000e0000000000000000000000012007400720061006e00730070006f007200740100000129ffffffff00000000000000000000000a00700061006e00690063010000024f000000b50000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000022006c00690073007400200069006e007300650072007400200074006f006f006c007301000000d5000000e7000000000000000000000012007400720061006e00730070006f0072007401000001bcffffffff00000000000000000000000a00700061006e0069006301000002e20000011e0000000000000000 + 0 + 1 + 0 + + + + + 784 + 544 + 000000ff00000000fd00000000000003180000020000000004000000040000000800000008fc0000000100000002000000030000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000000000000059000000000000000000000012007400720061006e00730070006f007200740100000059ffffffff00000000000000000000000a00700061006e00690063010000017f000001a10000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000012007400720061006e00730070006f0072007401000000d5ffffffff00000000000000000000000a00700061006e0069006301000001fb000002050000000000000000 + 0 + 1 + 0 + + + + + 400 + 360 + 000000ff00000000fd00000000000001900000012600000004000000040000000800000008fc00000003000000020000000200000012007400720061006e00730070006f007200740100000000ffffffff00000000000000000000000a00700061006e0069006301000001260000006a0000000000000000000000020000000000000002000000020000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002c004d006100730074006500720020004c0069007300740020004500640069007400200054006f006f006c00730100000049ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002c004d006100730074006500720020004c0069007300740020004500640069007400200054006f006f006c007301000000d5000000ac000000000000000000000012007400720061006e00730070006f007200740100000181ffffffff00000000000000000000000a00700061006e0069006301000002a7000001590000000000000000 + 0 + 1 + 0 + + + + + 784 + 544 + 000000ff00000000fd00000000000003180000020000000004000000040000000800000008fc0000000100000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000022006d00610072006b006500720020006500640069007400200074006f006f006c0073010000004900000054000000000000000000000012007400720061006e00730070006f00720074010000009dffffffff00000000000000000000000a00700061006e0069006301000001c30000015d0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000022006d00610072006b006500720020006500640069007400200074006f006f006c007301000000d50000007f000000000000000000000012007400720061006e00730070006f007200740100000154ffffffff00000000000000000000000a00700061006e00690063010000027a000001860000000000000000 + 0 + 1 + 0 + + + + + 996 + 223 + 000000ff00000000fd00000000000003ec0000008d00000004000000040000000800000008fc0000000200000002000000050000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000001a0061007200720061006e0067006500720054006f006f006c00730100000049ffffffff00000000000000000000002600560069007300690062006c006500200074007200610063006b0020007400790070006500730100000128000000f0000000000000000000000012007400720061006e00730070006f007200740100000218ffffffff00000000000000000000000a00700061006e00690063010000033e000000b6000000000000000000000002000000010000001e0041007200720061006e0067006500720054006f006f006c0062006100720100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000001a0061007200720061006e0067006500720054006f006f006c007301000000d5ffffffff00000000000000000000002600560069007300690062006c006500200074007200610063006b00200074007900700065007301000001b4ffffffff000000000000000000000012007400720061006e00730070006f007200740100000293ffffffff00000000000000000000000a00700061006e0069006301000003b900000047000000000000000000000002000000010000001e0041007200720061006e0067006500720054006f006f006c0062006100720100000000ffffffff0000000000000000 + 0 + 1 + 1 + + + + + 1 + 0 + 100 + + + 1 + 0 + 100 + + + 1 + 90 + 0 + 3 + 0 + 1 + + + 1 + 16 + 0 + 12 + 0 + + + 1 + + + 1 + 384 + + + 1 + 0 + + + 1 + 0 + + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + + + + 16777221 + 32 + 16777222 + 87 + 16777233 + 16777239 + 43 + 45 + 47 + 67 + 42 + 16777219 + 67108934 + 67108942 + 67108943 + 67108947 + 100663363 + 100663382 + 0 + 67108913 + 0 + 0 + 0 + 0 + 0 + 67108945 + 201326672 + 67108933 + 67108932 + 67108940 + 67108951 + 67108941 + 100663373 + 67108948 + 0 + 0 + 0 + 0 + 16777274 + 16777275 + 16777273 + 83886137 + 16777272 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 67108938 + 0 + 0 + 0 + 0 + 0 + 0 + 16777264 + 50331696 + 16777220 + 16777235 + 50331667 + 16777237 + 50331669 + 100663375 + 67108930 + 100663362 + 83886101 + 83886099 + 67108929 + 100663361 + 67108937 + 0 + 0 + 150994962 + 150994964 + 16777234 + 50331666 + 16777236 + 50331668 + 83886099 + 83886101 + 83886100 + 83886098 + 33554475 + 33554477 + 134217808 + 50331668 + 117440532 + 117440530 + 0 + 83886102 + 83886103 + 67 + 72 + 76 + 134217804 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 84 + 46 + 44 + 69 + 65 + 68 + 82 + 70 + 85 + 86 + 66 + 78 + 77 + 48 + 57 + 16777237 + 16777235 + 83 + 71 + 0 + 67108942 + 67108947 + 67108948 + 0 + 67108929 + 67108944 + 67108948 + 67108946 + 100663365 + 67108933 + 67108939 + 16777269 + 16777268 + + + diff --git a/muse2/share/templates/audio.med b/muse2/share/templates/audio.med index 6c9dad29..27a3a79f 100644 --- a/muse2/share/templates/audio.med +++ b/muse2/share/templates/audio.med @@ -25,15 +25,15 @@ 0 0 0 - + 0 0 1 - 298 298 + 418 600 -
9 8 7 6 5 4 3 2 1 0
+
-1 9 8 7 6 5 4 3 2 1 0
0 266 @@ -63,6 +63,7 @@ 31 33 29 + 36 1 @@ -293,35 +294,65 @@ 96 - 883 - 465 126 753 - 000000ff00000000fd00000000000003730000015c00000004000000040000000800000008fc00000004000000020000000400000014004400720075006d00200074006f006f006c00730100000000000000d1000000000000000000000014004500640069007400200054006f006f006c007301000000d1000000c8000000000000000000000012007400720061006e00730070006f0072007401000001990000018400000000000000000000000a00700061006e00690063010000031dffffffff00000000000000000000000200000000000000020000000100000012004e006f0074006500200049006e0066006f0100000000ffffffff000000000000000000000002000000020000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000083ffffffff0000000000000000 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + 96 - 879 - 467 0 - 000000ff00000000fd000000000000036f0000017800000004000000040000000800000008fc00000006000000020000000000000002000000000000000200000000000000020000000000000002000000030000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000091ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000103ffffffff00000000000000000000000200000003000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c007301000000000000024c000000000000000000000012007400720061006e00730070006f00720074010000024c000000fc00000000000000000000000a00700061006e006900630100000348ffffffff0000000000000000 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + - 880 - 466 - 000000ff00000000fd00000000000003700000018500000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000099ffffffff000000000000000000000022004e006500770020006e006f00740065002000730065007400740069006e0067007301000000d9ffffffff000000000000000000000002000000030000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000000000024a000000000000000000000012007400720061006e00730070006f00720074010000024a000000ff00000000000000000000000a00700061006e006900630100000349ffffffff0000000000000000 + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + 0 - 875 - 464 - 000000ff00000000fd000000000000036b000001a400000004000000040000000800000008fc000000010000000200000004ffffffff0100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff0000000000000000ffffffff0100000099ffffffff0000000000000000ffffffff01000000faffffffff0000000000000000 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + - 883 - 466 - 000000ff00000000fd0000000000000373000001a100000004000000040000000800000008fc0000000200000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000400000023b000000000000000000000012007400720061006e00730070006f00720074010000027b0000003900000000000000000000000200000000 + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + @@ -344,6 +375,10 @@ 1 + 16 + 0 + 12 + 0 1 @@ -360,6 +395,32 @@ 1 0 + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + @@ -601,15 +662,24 @@ 4 - - - 0 - 1 - - + + + 0 + 1 + + + + + 1 + 01d9d0cb000100000000000000000000000003ff000002440000000000000000fffffffefffffffe000000000200 + 1 + 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 + + 1 + diff --git a/muse2/share/templates/default.med b/muse2/share/templates/default.med index db22ffc2..2c13e64f 100644 --- a/muse2/share/templates/default.med +++ b/muse2/share/templates/default.med @@ -25,15 +25,15 @@ 0 0 0 - + 0 0 1 - 418 456 + 418 600 -
9 8 7 6 5 4 3 2 1 0
+
-1 9 8 7 6 5 4 3 2 1 0
0 266 @@ -63,6 +63,7 @@ 31 33 29 + 36 1 @@ -293,35 +294,65 @@ 96 - 883 - 465 126 753 - 000000ff00000000fd00000000000003730000015c00000004000000040000000800000008fc00000004000000020000000400000014004400720075006d00200074006f006f006c00730100000000000000d1000000000000000000000014004500640069007400200054006f006f006c007301000000d1000000c8000000000000000000000012007400720061006e00730070006f0072007401000001990000018400000000000000000000000a00700061006e00690063010000031dffffffff00000000000000000000000200000000000000020000000100000012004e006f0074006500200049006e0066006f0100000000ffffffff000000000000000000000002000000020000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000083ffffffff0000000000000000 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + 96 - 879 - 467 0 - 000000ff00000000fd000000000000036f0000017800000004000000040000000800000008fc00000006000000020000000000000002000000000000000200000000000000020000000000000002000000030000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000091ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000103ffffffff00000000000000000000000200000003000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c007301000000000000024c000000000000000000000012007400720061006e00730070006f00720074010000024c000000fc00000000000000000000000a00700061006e006900630100000348ffffffff0000000000000000 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + - 880 - 466 - 000000ff00000000fd00000000000003700000018500000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000099ffffffff000000000000000000000022004e006500770020006e006f00740065002000730065007400740069006e0067007301000000d9ffffffff000000000000000000000002000000030000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000000000024a000000000000000000000012007400720061006e00730070006f00720074010000024a000000ff00000000000000000000000a00700061006e006900630100000349ffffffff0000000000000000 + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + 0 - 875 - 464 - 000000ff00000000fd000000000000036b000001a400000004000000040000000800000008fc000000010000000200000004ffffffff0100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff0000000000000000ffffffff0100000099ffffffff0000000000000000ffffffff01000000faffffffff0000000000000000 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + - 883 - 466 - 000000ff00000000fd0000000000000373000001a100000004000000040000000800000008fc0000000200000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000400000023b000000000000000000000012007400720061006e00730070006f00720074010000027b0000003900000000000000000000000200000000 + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + @@ -344,6 +375,10 @@ 1 + 16 + 0 + 12 + 0 1 @@ -360,6 +395,32 @@ 1 0 + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + @@ -416,15 +477,24 @@ 4 - - - 0 - 1 - - + + + 0 + 1 + + + + + 1 + 01d9d0cb000100000000000000000000000003ff000002440000000000000000000003ff00000244000000000000 + 1 + 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 + + 1 + diff --git a/muse2/share/templates/midiGM.med b/muse2/share/templates/midiGM.med index 2fc6bc77..b2da48e4 100644 --- a/muse2/share/templates/midiGM.med +++ b/muse2/share/templates/midiGM.med @@ -25,15 +25,15 @@ 0 0 0 - + 0 0 1 - 298 298 + 418 600 -
9 8 7 6 5 4 3 2 1 0
+
-1 9 8 7 6 5 4 3 2 1 0
0 266 @@ -63,6 +63,7 @@ 31 33 29 + 36 1 @@ -341,35 +342,65 @@ 96 - 883 - 465 126 753 - 000000ff00000000fd00000000000003730000015c00000004000000040000000800000008fc00000004000000020000000400000014004400720075006d00200074006f006f006c00730100000000000000d1000000000000000000000014004500640069007400200054006f006f006c007301000000d1000000c8000000000000000000000012007400720061006e00730070006f0072007401000001990000018400000000000000000000000a00700061006e00690063010000031dffffffff00000000000000000000000200000000000000020000000100000012004e006f0074006500200049006e0066006f0100000000ffffffff000000000000000000000002000000020000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000083ffffffff0000000000000000 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + 96 - 879 - 467 0 - 000000ff00000000fd000000000000036f0000017800000004000000040000000800000008fc00000006000000020000000000000002000000000000000200000000000000020000000000000002000000030000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000091ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000103ffffffff00000000000000000000000200000003000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c007301000000000000024c000000000000000000000012007400720061006e00730070006f00720074010000024c000000fc00000000000000000000000a00700061006e006900630100000348ffffffff0000000000000000 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + - 880 - 466 - 000000ff00000000fd00000000000003700000018500000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000099ffffffff000000000000000000000022004e006500770020006e006f00740065002000730065007400740069006e0067007301000000d9ffffffff000000000000000000000002000000030000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000000000024a000000000000000000000012007400720061006e00730070006f00720074010000024a000000ff00000000000000000000000a00700061006e006900630100000349ffffffff0000000000000000 + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + 0 - 875 - 464 - 000000ff00000000fd000000000000036b000001a400000004000000040000000800000008fc000000010000000200000004ffffffff0100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff0000000000000000ffffffff0100000099ffffffff0000000000000000ffffffff01000000faffffffff0000000000000000 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + - 883 - 466 - 000000ff00000000fd0000000000000373000001a100000004000000040000000800000008fc0000000200000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000400000023b000000000000000000000012007400720061006e00730070006f00720074010000027b0000003900000000000000000000000200000000 + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + @@ -392,6 +423,10 @@ 1 + 16 + 0 + 12 + 0 1 @@ -408,6 +443,32 @@ 1 0 + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + @@ -451,6 +512,7 @@ 100 100 1 + 0 Track 2 @@ -471,6 +533,7 @@ 100 100 1 + 0 Track 3 @@ -491,6 +554,7 @@ 100 100 1 + 0 Track 4 @@ -511,6 +575,7 @@ 100 100 1 + 0 Track 5 @@ -531,27 +596,16 @@ 100 100 1 + 0 - - - - - - - - - - - - @@ -560,14 +614,6 @@ - - - - - - - - @@ -585,15 +631,24 @@ 4 - - - 0 - 1 - - + + + 0 + 1 + + + + + 1 + 01d9d0cb000100000000000000000000000003ff000002440000000000000000000003ff00000244000000000000 + 1 + 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 + + 1 + diff --git a/muse2/share/templates/monorecord.med b/muse2/share/templates/monorecord.med index 5bbb48dd..dfcc2c78 100644 --- a/muse2/share/templates/monorecord.med +++ b/muse2/share/templates/monorecord.med @@ -25,15 +25,15 @@ 0 0 0 - + 0 0 - 0 - 298 298 + 1 + 418 600 -
7 6 5 4 3 2 1 0 8
+
-1 9 8 7 6 5 4 3 2 1 0
0 266 @@ -63,6 +63,7 @@ 31 33 29 + 36 1 @@ -293,35 +294,65 @@ 96 - 883 - 465 126 753 - 000000ff00000000fd00000000000003730000015c00000004000000040000000800000008fc00000004000000020000000400000014004400720075006d00200074006f006f006c00730100000000000000d1000000000000000000000014004500640069007400200054006f006f006c007301000000d1000000c8000000000000000000000012007400720061006e00730070006f0072007401000001990000018400000000000000000000000a00700061006e00690063010000031dffffffff00000000000000000000000200000000000000020000000100000012004e006f0074006500200049006e0066006f0100000000ffffffff000000000000000000000002000000020000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000083ffffffff0000000000000000 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + 96 - 879 - 467 0 - 000000ff00000000fd000000000000036f0000017800000004000000040000000800000008fc00000006000000020000000000000002000000000000000200000000000000020000000000000002000000030000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000091ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000103ffffffff00000000000000000000000200000003000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c007301000000000000024c000000000000000000000012007400720061006e00730070006f00720074010000024c000000fc00000000000000000000000a00700061006e006900630100000348ffffffff0000000000000000 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + - 880 - 466 - 000000ff00000000fd00000000000003700000018500000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000099ffffffff000000000000000000000022004e006500770020006e006f00740065002000730065007400740069006e0067007301000000d9ffffffff000000000000000000000002000000030000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000000000024a000000000000000000000012007400720061006e00730070006f00720074010000024a000000ff00000000000000000000000a00700061006e006900630100000349ffffffff0000000000000000 + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + 0 - 875 - 464 - 000000ff00000000fd000000000000036b000001a400000004000000040000000800000008fc000000010000000200000004ffffffff0100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff0000000000000000ffffffff0100000099ffffffff0000000000000000ffffffff01000000faffffffff0000000000000000 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + - 883 - 466 - 000000ff00000000fd0000000000000373000001a100000004000000040000000800000008fc0000000200000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000400000023b000000000000000000000012007400720061006e00730070006f00720074010000027b0000003900000000000000000000000200000000 + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + @@ -344,6 +375,10 @@ 1 + 16 + 0 + 12 + 0 1 @@ -360,6 +395,32 @@ 1 0 + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + @@ -462,15 +523,24 @@ 4 - - - 0 - 1 - - + + + 0 + 1 + + + + + 1 + 01d9d0cb000100000000000000000000000003ff000002440000000000000000000003ff00000244000000000000 + 1 + 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 + + 1 + diff --git a/muse2/share/templates/synti.med b/muse2/share/templates/synti.med index c2efb6b5..1198359c 100644 --- a/muse2/share/templates/synti.med +++ b/muse2/share/templates/synti.med @@ -25,15 +25,15 @@ 0 0 0 - + 0 0 - 0 - 298 298 + 1 + 418 600 -
9 8 7 6 5 4 3 2 1 0
+
-1 9 8 7 6 5 4 3 2 1 0
0 266 @@ -63,6 +63,7 @@ 31 33 29 + 36 1 organ-1 @@ -696,35 +697,65 @@ 96 - 883 - 465 126 753 - 000000ff00000000fd00000000000003730000015c00000004000000040000000800000008fc00000004000000020000000400000014004400720075006d00200074006f006f006c00730100000000000000d1000000000000000000000014004500640069007400200054006f006f006c007301000000d1000000c8000000000000000000000012007400720061006e00730070006f0072007401000001990000018400000000000000000000000a00700061006e00690063010000031dffffffff00000000000000000000000200000000000000020000000100000012004e006f0074006500200049006e0066006f0100000000ffffffff000000000000000000000002000000020000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000083ffffffff0000000000000000 + + 934 + 488 + 000000ff00000000fd00000000000003ae0000019e00000004000000040000000800000008fc00000002000000020000000400000014004400720075006d00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000f5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000198ffffffff00000000000000000000000a00700061006e0069006301000002be000000f8000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a90000020d0000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c000000000000000000000014004400720075006d00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000181ffffffff000000000000000000000012007400720061006e00730070006f007200740100000224ffffffff00000000000000000000000a00700061006e00690063010000034a000000b6000000000000000000000002000000030000000c0063007500720073006f00720100000000ffffffff0000000000000000000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000081ffffffff000000000000000000000012004e006f0074006500200049006e0066006f01000001a9000002570000000000000000 + 0 + 1 + 0 + 96 - 879 - 467 0 - 000000ff00000000fd000000000000036f0000017800000004000000040000000800000008fc00000006000000020000000000000002000000000000000200000000000000020000000000000002000000030000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000091ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000103ffffffff00000000000000000000000200000003000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c007301000000000000024c000000000000000000000012007400720061006e00730070006f00720074010000024c000000fc00000000000000000000000a00700061006e006900630100000348ffffffff0000000000000000 + + 852 + 460 + 000000ff00000000fd000000000000035c0000018200000004000000040000000800000008fc0000000200000002000000040000001e005000690061006e006f0072006f006c006c00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000ae00000098000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c000000f800000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002120000000000000000 + 000000ff00000000fd00000000000004000000024d00000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e005000690061006e006f0072006f006c006c00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c0073010000013affffffff000000000000000000000012007400720061006e00730070006f0072007401000001bfffffffff00000000000000000000000a00700061006e0069006301000002e50000011b00000000000000000000000200000002000000260050006f0073002f0053006e00610070002f0053006f006c006f002d0074006f006f006c00730100000000ffffffff000000000000000000000012004e006f0074006500200049006e0066006f0100000152000002ae0000000000000000 + 0 + 1 + 0 + - 880 - 466 - 000000ff00000000fd00000000000003700000018500000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000099ffffffff000000000000000000000022004e006500770020006e006f00740065002000730065007400740069006e0067007301000000d9ffffffff000000000000000000000002000000030000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000000000024a000000000000000000000012007400720061006e00730070006f00720074010000024a000000ff00000000000000000000000a00700061006e006900630100000349ffffffff0000000000000000 + + 867 + 544 + 000000ff00000000fd000000000000036b000001e300000004000000040000000800000008fc0000000200000002000000060000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c00730100000049ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000074ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000000dbffffffff000000000000000000000012007400720061006e00730070006f007200740100000203ffffffff00000000000000000000000a00700061006e006900630100000329000000420000000000000000000000020000000100000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000025900000004000000040000000800000008fc0000000200000002000000060000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff00000000000000000000002800530074006500700020007200650063006f007200640069006e006700200074006f006f006c007301000000d5ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000100ffffffff000000000000000000000012007400720061006e00730070006f007200740100000167ffffffff00000000000000000000000a00700061006e00690063010000028d000001730000000000000000000000020000000200000022004e006500770020006e006f00740065002000730065007400740069006e006700730100000000ffffffff00000000000000000000002a005100750061006e007400690073006100740069006f006e002000730065007400740069006e0067007301000002650000019b0000000000000000 + 0 + 1 + 0 + 0 - 875 - 464 - 000000ff00000000fd000000000000036b000001a400000004000000040000000800000008fc000000010000000200000004ffffffff0100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000040ffffffff0000000000000000ffffffff0100000099ffffffff0000000000000000ffffffff01000000faffffffff0000000000000000 + + 784 + 544 + 000000ff00000000fd0000000000000318000001ce00000004000000040000000800000008fc0000000200000002000000040000001e0055006e0064006f002f005200650064006f00200074006f006f006c00730100000000ffffffff000000000000000000000014004500640069007400200054006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f0072007401000000b0ffffffff00000000000000000000000a00700061006e0069006301000001d600000142000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000002bb0000000000000000 + 000000ff00000000fd00000000000004000000024500000004000000040000000800000008fc0000000200000002000000050000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e0055006e0064006f002f005200650064006f00200074006f006f006c0073010000008cffffffff000000000000000000000014004500640069007400200054006f006f006c007301000000d500000071000000000000000000000012007400720061006e00730070006f007200740100000146ffffffff00000000000000000000000a00700061006e00690063010000026c00000194000000000000000000000002000000020000001a0045006e00610062006c00650020006d006100730074006500720100000000ffffffff0000000000000000000000080049006e0066006f010000005d000003a30000000000000000 + 0 + 1 + 0 + - 883 - 466 - 000000ff00000000fd0000000000000373000001a100000004000000040000000800000008fc0000000200000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000400000023b000000000000000000000012007400720061006e00730070006f00720074010000027b0000003900000000000000000000000200000000 + + 760 + 460 + 000000ff00000000fd0000000000000300000001ac00000004000000040000000800000008fc0000000100000002000000030000001e00570061007600650020006500640069007400200074006f006f006c00730100000000ffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c00730100000049ffffffff000000000000000000000012007400720061006e00730070006f007200740100000184ffffffff0000000000000000 + 000000ff00000000fd00000000000004000000027700000004000000040000000800000008fc0000000100000002000000040000001800460069006c006500200042007500740074006f006e007301000000000000008c00000000000000000000001e00570061007600650020006500640069007400200074006f006f006c0073010000008cffffffff00000000000000000000001c0057006100760065004500640069007400200074006f006f006c007301000000d5ffffffff000000000000000000000012007400720061006e00730070006f007200740100000210ffffffff0000000000000000 + 0 + 1 + 0 + @@ -747,6 +778,10 @@ 1 + 16 + 0 + 12 + 0 1 @@ -763,6 +798,32 @@ 1 0 + + 3 + 80 + 130 + 0 + + + 1 + 0 + 0 + + + 0 + 1 + 384 + 0 + 0 + + + 1 + 384 + 0 + 0 + 3072 + 0 + @@ -805,6 +866,7 @@ 100 100 1 + 0 Track 1 @@ -878,15 +940,15 @@ 0 0 - + - - - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 14 00 00 00 14 00 00 00 - 00 00 00 00 14 00 00 00 0a 00 00 00 0a 00 00 00 - 00 00 00 00 0a 00 00 00 01 00 00 00 01 00 00 00 - 01 00 00 00 00 00 00 00 + + + 7c 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 14 + 00 00 00 00 00 00 00 14 00 00 00 0a 00 00 00 0a + 00 00 00 00 00 00 00 0a 00 00 00 01 00 00 00 01 + 00 00 00 01 00 00 00 00 00 00 00 @@ -912,18 +974,19 @@ 3 0 - + - - - 00 20 00 00 00 20 00 00 01 00 00 00 01 00 00 00 + + + 7c 02 01 00 20 00 00 00 20 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - fe 3e 00 00 fe 3e 00 00 00 00 00 00 00 00 00 00 + 00 00 00 fe 3e 00 00 fe 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 00 00 00 00 ff 3f 00 00 - 00 00 00 00 00 00 00 00 00 00 00 00 7a 3a 00 00 - 00 20 00 00 00 20 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff + 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7a + 3a 00 00 00 20 00 00 00 20 00 00 00 00 00 00 00 + 00 00 00 @@ -943,14 +1006,6 @@ - - - - - - - - @@ -959,14 +1014,6 @@ - - - - - - - - @@ -984,15 +1031,24 @@ 4 - - - 0 - 1 - - + + + 0 + 1 + + + + + 1 + 01d9d0cb000100000000000000000000000003ff000002440000000000000000000003ff00000244000000000000 + 1 + 000000ff00000000fd00000000000000000000000000000004000000040000000800000008fc00000000 + + 1 + -- cgit v1.2.3