From b5a9f51073ba4e3c166f9229cd596f22878acafc Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Tue, 26 Oct 2010 22:30:37 +0000 Subject: See ChangeLog --- muse2/ChangeLog | 3 + muse2/muse/app.cpp | 271 ++++++--- muse2/muse/app.cpp.orig | 1123 ++++++++++++++++++++++++++++++----- muse2/muse/app.h | 32 +- muse2/muse/appearance.cpp | 10 +- muse2/muse/arranger/alayout.h | 2 +- muse2/muse/arranger/arranger.cpp | 86 ++- muse2/muse/arranger/arranger.h | 4 +- muse2/muse/arranger/trackinfo.cpp | 4 +- muse2/muse/cobject.cpp | 8 +- muse2/muse/cobject.h | 5 +- muse2/muse/conf.cpp | 2 +- muse2/muse/confmport.cpp | 2 +- muse2/muse/globals.cpp | 30 +- muse2/muse/globals.h | 34 +- muse2/muse/liste/editevent.cpp | 16 +- muse2/muse/liste/editevent.h | 16 +- muse2/muse/liste/listedit.cpp | 36 +- muse2/muse/liste/listedit.h | 10 +- muse2/muse/marker/markerview.cpp | 23 +- muse2/muse/marker/markerview.h | 4 +- muse2/muse/master/lmaster.cpp | 7 +- muse2/muse/master/lmaster.h | 2 +- muse2/muse/master/masteredit.cpp | 12 +- muse2/muse/master/masteredit.h | 2 +- muse2/muse/midiedit/drumedit.cpp | 79 ++- muse2/muse/midiedit/drumedit.h | 2 +- muse2/muse/midiedit/pianoroll.cpp | 51 +- muse2/muse/midiedit/pianoroll.h | 2 +- muse2/muse/midiedit/quantconfig.cpp | 6 +- muse2/muse/mixer/amixer.cpp | 72 ++- muse2/muse/mixer/amixer.h | 45 +- muse2/muse/mixer/astrip.cpp | 19 +- muse2/muse/mixer/meter.cpp | 4 +- muse2/muse/mixer/meter.h | 5 +- muse2/muse/mixer/mstrip.cpp | 16 +- muse2/muse/mixer/strip.cpp | 11 +- muse2/muse/mixer/strip.h | 17 +- muse2/muse/mplugins/rhythm.cpp | 39 +- muse2/muse/plugin.cpp | 33 +- muse2/muse/song.cpp | 18 +- muse2/muse/song.h | 7 +- muse2/muse/transport.cpp | 7 +- muse2/muse/waveedit/waveedit.cpp | 9 +- muse2/muse/waveedit/waveedit.h | 4 +- muse2/muse/widgets/action.h | 8 +- muse2/muse/widgets/combobox.cpp | 4 +- muse2/muse/widgets/lcombo.cpp | 18 +- muse2/muse/widgets/lcombo.h | 7 +- muse2/muse/widgets/nentry.cpp | 10 +- muse2/muse/widgets/nentry.h | 10 +- muse2/muse/widgets/noteinfo.cpp | 55 +- muse2/muse/widgets/noteinfo.h | 11 +- muse2/muse/widgets/pitchlabel.cpp | 6 +- muse2/muse/widgets/poslabel.cpp | 6 +- muse2/muse/widgets/poslabel.h | 3 +- muse2/muse/widgets/sliderbase.h | 2 +- muse2/muse/widgets/tb1.cpp | 84 ++- muse2/muse/widgets/tb1.h | 12 +- muse2/muse/widgets/tools.cpp | 40 +- muse2/muse/widgets/tools.h | 15 +- muse2/muse/widgets/utils.cpp | 16 +- muse2/muse/widgets/utils.h | 10 +- 63 files changed, 1864 insertions(+), 643 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 207cf58a..0e25838e 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,6 @@ +26.10.2010 + - Applied large patch by Orcan to (start) converting to native QMainWindow and QToolBar. (Tim) + - Completed piano roll, drum edit, MusE app, and arranger toolbars. 24.10.2010 - Finds MESS synths now including fluid/fluidsynth, but all crash except Vam and S1. (Tim.) 22.10.2010 diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 4a3d79a3..fffd542b 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -22,8 +22,9 @@ #include #include -#include -#include +#include +//#include +#include #include #include #include @@ -42,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -608,10 +609,10 @@ struct addSynth_cmp_str } }; */ - -Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot = 0) + // ORCAN - CHECK +QMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot = 0) { - Q3PopupMenu* synp = new Q3PopupMenu(parent); + QMenu* synp = new QMenu(parent); //typedef std::multimap asmap; typedef std::multimap asmap; @@ -620,23 +621,23 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo typedef std::multimap::iterator imap; MessSynth* synMESS = 0; - Q3PopupMenu* synpMESS = 0; + QMenu* synpMESS = 0; asmap mapMESS; #ifdef DSSI_SUPPORT DssiSynth* synDSSI = 0; - Q3PopupMenu* synpDSSI = 0; + QMenu* synpDSSI = 0; asmap mapDSSI; #endif #ifdef VST_SUPPORT VstSynth* synVST = 0; - Q3PopupMenu* synpVST = 0; + QMenu* synpVST = 0; asmap mapVST; #endif // Not necessary, but what the heck. - Q3PopupMenu* synpOther = 0; + QMenu* synpOther = 0; asmap mapOther; //const int synth_base_id = 0x1000; @@ -690,7 +691,7 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo { // No MESS sub-menu yet? Create it now. if(!synpMESS) - synpMESS = new Q3PopupMenu(parent); + synpMESS = new QMenu(parent); synpMESS->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -706,7 +707,7 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo { // No DSSI sub-menu yet? Create it now. if(!synpDSSI) - synpDSSI = new Q3PopupMenu(parent); + synpDSSI = new QMenu(parent); synpDSSI->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -723,7 +724,7 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo { // No VST sub-menu yet? Create it now. if(!synpVST) - synpVST = new Q3PopupMenu(parent); + synpVST = new QMenu(parent); synpVST->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -737,7 +738,7 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo Synth* s = synthis[idx]; // No Other sub-menu yet? Create it now. if(!synpOther) - synpOther = new Q3PopupMenu(parent); + synpOther = new QMenu(parent); synpOther->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } @@ -781,7 +782,7 @@ Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slo // this is also used in "mixer" //--------------------------------------------------------- -void populateAddTrack(Q3PopupMenu* addTrack) +void populateAddTrack(QMenu* addTrack) { addTrack->insertItem(QIcon(*addtrack_addmiditrackIcon), QT_TR_NOOP("Add Midi Track"), Track::MIDI); @@ -799,7 +800,7 @@ void populateAddTrack(Q3PopupMenu* addTrack) QT_TR_NOOP("Add Aux Send"), Track::AUDIO_AUX); // Create a sub-menu and fill it with found synth types. Make addTrack the owner. - Q3PopupMenu* synp = populateAddSynth(addTrack, song, SLOT(addNewTrack(int))); + QMenu* synp = populateAddSynth(addTrack, song, SLOT(addNewTrack(int))); // Add the sub-menu to the given menu. addTrack->insertItem(*synthIcon, QT_TR_NOOP("Add Synth"), synp, Track::AUDIO_SOFTSYNTH); @@ -812,7 +813,8 @@ void populateAddTrack(Q3PopupMenu* addTrack) // MusE //--------------------------------------------------------- -MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") +//MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") +MusE::MusE(int argc, char** argv) : QMainWindow() { // By T356. For LADSPA plugins in plugin.cpp // QWidgetFactory::addWidgetFactory( new PluginWidgetFactory ); ddskrjo @@ -866,11 +868,21 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") //--------------------------------------------------- // undo/redo //--------------------------------------------------- - undoRedo = new Q3ActionGroup(this, tr("UndoRedo"), false); - undoAction = new Q3Action(tr("undo"), QIcon(*undoIconS), tr("Und&o"), // ddskrjo + // ORCAN - CHECK: + /* + undoRedo = new QActionGroup(this, tr("UndoRedo"), false); + undoAction = new QAction(tr("undo"), QIcon(*undoIconS), tr("Und&o"), // ddskrjo Qt::CTRL+Qt::Key_Z, undoRedo, "undo"); - redoAction = new Q3Action(tr("redo"), QIcon(*redoIconS), tr("Re&do"), // ddskrjo + redoAction = new QAction(tr("redo"), QIcon(*redoIconS), tr("Re&do"), // ddskrjo Qt::CTRL+Qt::Key_Y, undoRedo, "redo"); + */ + undoRedo = new QActionGroup(this); + undoRedo->setExclusive(false); + undoAction = new QAction(QIcon(*undoIconS), tr("Und&o"), // ddskrjo + undoRedo); + redoAction = new QAction(QIcon(*redoIconS), tr("Re&do"), // ddskrjo + undoRedo); + undoAction->setWhatsThis(tr("undo last change to song")); redoAction->setWhatsThis(tr("redo last undo")); undoAction->setEnabled(false); @@ -881,60 +893,126 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") //--------------------------------------------------- // Transport //--------------------------------------------------- + // ORCAN - CHECK: + /* + transportAction = new QActionGroup(this, tr("Transport"), false); - transportAction = new Q3ActionGroup(this, tr("Transport"), false); - - loopAction = new Q3Action(tr("loop"), QIcon(*loop1Icon), + loopAction = new QAction(tr("loop"), QIcon(*loop1Icon), tr("Loop"), 0, transportAction, "loop", true); + */ + transportAction = new QActionGroup(this); + transportAction->setExclusive(false); + + loopAction = new QAction(QIcon(*loop1Icon), + tr("Loop"), transportAction); + loopAction->setCheckable(true); + loopAction->setWhatsThis(tr(infoLoopButton)); connect(loopAction, SIGNAL(toggled(bool)), song, SLOT(setLoop(bool))); - - punchinAction = new Q3Action(tr("punchin"), QIcon(*punchin1Icon), + // ORCAN - CHECK: + /* + punchinAction = new QAction(tr("punchin"), QIcon(*punchin1Icon), tr("Punchin"), 0, transportAction, "Punchin", true); + */ + punchinAction = new QAction(QIcon(*punchin1Icon), + tr("Punchin"), transportAction); + punchinAction->setCheckable(true); + punchinAction->setWhatsThis(tr(infoPunchinButton)); connect(punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool))); - punchoutAction = new Q3Action(tr("punchout"), QIcon(*punchout1Icon), + // ORCAN - CHECK: + /* + punchoutAction = new QAction(tr("punchout"), QIcon(*punchout1Icon), tr("Punchout"), 0, transportAction, "punchout", true); + */ + punchoutAction = new QAction(QIcon(*punchout1Icon), + tr("Punchout"), transportAction); + punchoutAction->setCheckable(true); + punchoutAction->setWhatsThis(tr(infoPunchoutButton)); connect(punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool))); transportAction->addSeparator(); - startAction = new Q3Action(tr("start"), QIcon(*startIcon), + // ORCAN - CHECK: + /* + startAction = new QAction(tr("start"), QIcon(*startIcon), tr("Start"), 0, transportAction, "start"); + */ + startAction = new QAction(QIcon(*startIcon), + tr("Start"), transportAction); + startAction->setWhatsThis(tr(infoStartButton)); connect(startAction, SIGNAL(activated()), song, SLOT(rewindStart())); - rewindAction = new Q3Action(tr("rewind"), QIcon(*frewindIcon), + // ORCAN - CHECK: + /* + rewindAction = new QAction(tr("rewind"), QIcon(*frewindIcon), tr("Rewind"), 0, transportAction, "rewind"); + */ + rewindAction = new QAction(QIcon(*frewindIcon), + tr("Rewind"), transportAction); + rewindAction->setWhatsThis(tr(infoRewindButton)); connect(rewindAction, SIGNAL(activated()), song, SLOT(rewind())); - forwardAction = new Q3Action(tr("forward"), QIcon(*fforwardIcon), + // ORCAN - CHECK: + /* + forwardAction = new QAction(tr("forward"), QIcon(*fforwardIcon), tr("Forward"), 0, transportAction, "forward"); + */ + forwardAction = new QAction(QIcon(*fforwardIcon), + tr("Forward"), transportAction); + forwardAction->setWhatsThis(tr(infoForwardButton)); connect(forwardAction, SIGNAL(activated()), song, SLOT(forward())); - stopAction = new Q3Action(tr("stop"), QIcon(*stopIcon), + // ORCAN - CHECK: + /* + stopAction = new QAction(tr("stop"), QIcon(*stopIcon), tr("Stop"), 0, transportAction, "stop", true); + */ + stopAction = new QAction(QIcon(*stopIcon), + tr("Stop"), transportAction); + stopAction->setCheckable(true); + stopAction->setWhatsThis(tr(infoStopButton)); stopAction->setOn(true); connect(stopAction, SIGNAL(toggled(bool)), song, SLOT(setStop(bool))); - playAction = new Q3Action(tr("play"), QIcon(*playIcon), + // ORCAN - CHECK: + /* + playAction = new QAction(tr("play"), QIcon(*playIcon), tr("Play"), 0, transportAction, "play", true); + */ + playAction = new QAction(QIcon(*playIcon), + tr("Play"), transportAction); + playAction->setCheckable(true); + playAction->setWhatsThis(tr(infoPlayButton)); playAction->setOn(false); connect(playAction, SIGNAL(toggled(bool)), song, SLOT(setPlay(bool))); - recordAction = new Q3Action(tr("record"), QIcon(*recordIcon), + // ORCAN - CHECK: + /* + recordAction = new QAction(tr("record"), QIcon(*recordIcon), tr("Record"), 0, transportAction, "record", true); + */ + recordAction = new QAction(QIcon(*recordIcon), + tr("Record"), transportAction); + recordAction->setCheckable(true); recordAction->setWhatsThis(tr(infoRecordButton)); connect(recordAction, SIGNAL(toggled(bool)), song, SLOT(setRecord(bool))); - panicAction = new Q3Action(tr("panic"), QIcon(*panicIcon), + // ORCAN - CHECK: + /* + panicAction = new QAction(tr("panic"), QIcon(*panicIcon), tr("Panic"), 0, 0, "panic", false); + */ + panicAction = new QAction(QIcon(*panicIcon), + tr("Panic"), 0); + panicAction->setWhatsThis(tr(infoPanicButton)); connect(panicAction, SIGNAL(activated()), song, SLOT(panic())); @@ -944,23 +1022,47 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") //----Actions - fileNewAction = new Q3Action(tr("new"), + // ORCAN - CHECK: + /* + fileNewAction = new QAction(tr("new"), QIcon(*filenewIcon), tr("&New"), 0, this, "new"); // ddskrjo + */ + fileNewAction = new QAction( + QIcon(*filenewIcon), tr("&New"), this); // ddskrjo + fileNewAction->setToolTip(tr(fileNewText)); fileNewAction->setWhatsThis(tr(fileNewText)); - fileOpenAction = new Q3Action(tr("open"), + // ORCAN - CHECK: + /* + fileOpenAction = new QAction(tr("open"), QIcon(*openIcon), tr("&Open"), 0, this, "open"); // ddskrjo + */ + fileOpenAction = new QAction( + QIcon(*openIcon), tr("&Open"), this); // ddskrjo + fileOpenAction->setToolTip(tr(fileOpenText)); fileOpenAction->setWhatsThis(tr(fileOpenText)); - fileSaveAction = new Q3Action(tr("save"), + // ORCAN - CHECK: + /* + fileSaveAction = new QAction(tr("save"), QIcon(*saveIcon), tr("&Save"), 0, this, "save"); // ddskrjo + */ + fileSaveAction = new QAction( + QIcon(*saveIcon), tr("&Save"), this); // ddskrjo + fileSaveAction->setToolTip(tr(fileSaveText)); fileSaveAction->setWhatsThis(tr(fileSaveText)); - pianoAction = new Q3Action(tr("pianoroll"), + // ORCAN - CHECK: + /* + pianoAction = new QAction(tr("pianoroll"), *pianoIconSet, tr("Pianoroll"), 0, this, "pianoroll"); + */ + pianoAction = new QAction( + *pianoIconSet, tr("Pianoroll"), this); + connect(pianoAction, SIGNAL(activated()), SLOT(startPianoroll())); // markerAction = new QAction(tr("marker"), QIconSet(*view_markerIcon), tr("Marker"), @@ -974,27 +1076,44 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") //-------------------------------------------------- // Toolbar //-------------------------------------------------- - - tools = new Q3ToolBar(tr("File Buttons"), this); - fileNewAction->addTo(tools); - fileOpenAction->addTo(tools); - fileSaveAction->addTo(tools); - + // FIXME - Orcan + //tools = new QToolBar(tr("File Buttons"), this); + tools = addToolBar(tr("File Buttons")); + + //fileNewAction->addTo(tools); + //fileOpenAction->addTo(tools); + //fileSaveAction->addTo(tools); + tools->addAction(fileNewAction); + tools->addAction(fileOpenAction); + tools->addAction(fileSaveAction); + // // Whats This // - Q3WhatsThis::whatsThisButton(tools); - + // FIXME - Orcan: Do we need this? + //Q3WhatsThis::whatsThisButton(tools); + tools->addAction(QWhatsThis::createAction(this)); + tools->addSeparator(); - undoRedo->addTo(tools); + //undoRedo->addTo(tools); + tools->addActions(undoRedo->actions()); + //addToolBar(tools); tools1 = new EditToolBar(this, arrangerTools); + addToolBar(tools1); + + //QToolBar* transportToolbar = new QToolBar(this); + QToolBar* transportToolbar = addToolBar(tr("Transport")); + //transportAction->addTo(transportToolbar); + transportToolbar->addActions(transportAction->actions()); + //addToolBar(transportToolbar); - Q3ToolBar* transportToolbar = new Q3ToolBar(this); - transportAction->addTo(transportToolbar); + //QToolBar* panicToolbar = new QToolBar(this); + QToolBar* panicToolbar = addToolBar(tr("Panic")); + //panicAction->addTo(panicToolbar); + panicToolbar->addAction(panicAction); + //addToolBar(panicToolbar); - Q3ToolBar* panicToolbar = new Q3ToolBar(this); - panicAction->addTo(panicToolbar); if (realTimePriority < sched_get_priority_min(SCHED_FIFO)) realTimePriority = sched_get_priority_min(SCHED_FIFO); @@ -1032,16 +1151,19 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup File //------------------------------------------------------------- - menu_file = new Q3PopupMenu(this); + menu_file = new QMenu(this); menuBar()->insertItem(tr("&File"), menu_file); - fileNewAction->addTo(menu_file); - fileOpenAction->addTo(menu_file); - openRecent = new Q3PopupMenu(menu_file); + //fileNewAction->addTo(menu_file); + //fileOpenAction->addTo(menu_file); + menu_file->addAction(fileNewAction); + menu_file->addAction(fileOpenAction); + openRecent = new QMenu(menu_file); connect(openRecent, SIGNAL(aboutToShow()), this, SLOT(openRecentMenu())); connect(openRecent, SIGNAL(activated(int)), this, SLOT(selectProject(int))); menu_ids[CMD_OPEN_RECENT] = menu_file->insertItem(tr("Open &Recent"), openRecent, 0); menu_file->insertSeparator(); - fileSaveAction->addTo(menu_file); + //fileSaveAction->addTo(menu_file); + menu_file->addAction(fileSaveAction); menu_ids[CMD_SAVE_AS] = menu_file->insertItem(tr("Save &As"), this, SLOT(saveAs()), 0, -2); menu_file->insertSeparator(); menu_ids[CMD_IMPORT_MIDI] = menu_file->insertItem(*openIconS, tr("Import Midifile"), this, SLOT(importMidi()), 0, -2); @@ -1050,7 +1172,6 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") menu_file->insertSeparator(); menu_ids[CMD_IMPORT_AUDIO] = menu_file->insertItem(*openIconS, tr("Import Wave File"), this, SLOT(importWave()), 0, -2); - menu_file->insertSeparator(); menu_ids[CMD_QUIT] = menu_file->insertItem(*exitIconS, tr("&Quit"), this, SLOT(quitDoc()), 0, -2); menu_file->insertSeparator(); @@ -1059,8 +1180,9 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Edit //------------------------------------------------------------- - menuEdit = new Q3PopupMenu(this); - undoRedo->addTo(menuEdit); + menuEdit = new QMenu(this); + //undoRedo->addTo(menuEdit); + menuEdit->addActions(undoRedo->actions()); menuEdit->insertSeparator(); menuBar()->insertItem(tr("&Edit"), menuEdit); @@ -1085,14 +1207,14 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") menuEdit->insertItem(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), CMD_DELETE_TRACK); - addTrack = new Q3PopupMenu(this); + addTrack = new QMenu(this); // Moved below. Have to wait until synths are available... //populateAddTrack(addTrack); menuEdit->insertItem(QIcon(*edit_track_addIcon), tr("Add Track"), addTrack); - select = new Q3PopupMenu(this); + select = new QMenu(this); select->insertItem(QIcon(*select_allIcon), tr("Select &All"), CMD_SELECT_ALL); select->insertItem(QIcon(*select_deselect_allIcon), @@ -1110,7 +1232,8 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") tr("Select"), select); menuEdit->insertSeparator(); - pianoAction->addTo(menuEdit); + //pianoAction->addTo(menuEdit); + menuEdit->addAction(pianoAction); menu_ids[CMD_OPEN_DRUMS] = menuEdit->insertItem( QIcon(*edit_drummsIcon), tr("Drums"), this, SLOT(startDrumEditor()), 0); menu_ids[CMD_OPEN_LIST] = menuEdit->insertItem( @@ -1118,7 +1241,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") menu_ids[CMD_OPEN_WAVE] = menuEdit->insertItem( QIcon(*edit_waveIcon), tr("Wave"), this, SLOT(startWaveEditor()), 0); - master = new Q3PopupMenu(this); + master = new QMenu(this); master->setCheckable(false); menu_ids[CMD_OPEN_GRAPHIC_MASTER] = master->insertItem( QIcon(*mastertrack_graphicIcon),tr("Graphic"), this, SLOT(startMasterEditor()), 0); @@ -1131,7 +1254,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); connect(select, SIGNAL(activated(int)), SLOT(cmd(int))); - midiEdit = new Q3PopupMenu(this); + midiEdit = new QMenu(this); midiEdit->setCheckable(false); #if 0 // TODO menu_ids[CMD_OPEN_MIDI_TRANSFORM] = midiEdit->insertItem( @@ -1162,7 +1285,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup View //------------------------------------------------------------- - menuView = new Q3PopupMenu(this); + menuView = new QMenu(this); menuView->setCheckable(true); menuBar()->insertItem(tr("View"), menuView); @@ -1188,7 +1311,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Structure //------------------------------------------------------------- - menuStructure = new Q3PopupMenu(this); + menuStructure = new QMenu(this); menuStructure->setCheckable(false); menuBar()->insertItem(tr("&Structure"), menuStructure); menu_ids[CMD_GLOBAL_CUT] = menuStructure->insertItem(tr("Global Cut"), this, SLOT(globalCut()), 0); @@ -1204,7 +1327,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Midi //------------------------------------------------------------- - midiInputPlugins = new Q3PopupMenu(this); + midiInputPlugins = new QMenu(this); midiInputPlugins->setCheckable(false); mpid0 = midiInputPlugins->insertItem( QIcon(*midi_inputplugins_transposeIcon), tr("Transpose"), 0); @@ -1222,12 +1345,12 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // midiInputPlugins->setItemEnabled(mpid4, false); - menu_functions = new Q3PopupMenu(this); + menu_functions = new QMenu(this); menu_functions->setCheckable(true); menuBar()->insertItem(tr("&Midi"), menu_functions); menu_functions->setCaption(tr("Midi")); - menuScriptPlugins = new Q3PopupMenu(this); + menuScriptPlugins = new QMenu(this); song->populateScriptMenu(menuScriptPlugins, this); menu_functions->insertItem(tr("&Plugins"), menuScriptPlugins); @@ -1247,7 +1370,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Audio //------------------------------------------------------------- - menu_audio = new Q3PopupMenu(this); + menu_audio = new QMenu(this); menu_audio->setCheckable(true); menuBar()->insertItem(tr("&Audio"), menu_audio); menu_ids[CMD_AUDIO_BOUNCE_TO_TRACK] = menu_audio->insertItem( @@ -1262,7 +1385,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Automation //------------------------------------------------------------- - menuAutomation = new Q3PopupMenu(this); + menuAutomation = new QMenu(this); menuAutomation->setCheckable(true); menuBar()->insertItem(tr("Automation"), menuAutomation); autoId = menuAutomation->insertItem( @@ -1278,7 +1401,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") // popup Settings //------------------------------------------------------------- - follow = new Q3PopupMenu(this); + follow = new QMenu(this); follow->setCheckable(false); fid0 = follow->insertItem(tr("dont follow Song"), CMD_FOLLOW_NO); fid1 = follow->insertItem(tr("follow page"), CMD_FOLLOW_JUMP); @@ -1286,7 +1409,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") follow->setItemChecked(fid1, true); connect(follow, SIGNAL(activated(int)), SLOT(cmd(int))); - menuSettings = new Q3PopupMenu(this); + menuSettings = new QMenu(this); menuSettings->setCheckable(false); menuBar()->insertItem(tr("Settings"), menuSettings); menu_ids[CMD_GLOBAL_CONFIG] = menuSettings->insertItem( @@ -1314,7 +1437,7 @@ MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") //--------------------------------------------------- menuBar()->insertSeparator(); - menu_help = new Q3PopupMenu(this); + menu_help = new QMenu(this); menu_help->setCheckable(false); menuBar()->insertItem(tr("&Help"), menu_help); @@ -4761,7 +4884,7 @@ void MusE::focusInEvent(QFocusEvent* ev) if (mixer2) mixer2->raise(); raise(); - Q3MainWindow::focusInEvent(ev); + QMainWindow::focusInEvent(ev); } //--------------------------------------------------------- diff --git a/muse2/muse/app.cpp.orig b/muse2/muse/app.cpp.orig index 219f59bd..4a3d79a3 100644 --- a/muse2/muse/app.cpp.orig +++ b/muse2/muse/app.cpp.orig @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -35,8 +35,19 @@ #include #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "app.h" +#include "popupmenu.h" #include "transport.h" #include "bigtime.h" #include "arranger.h" @@ -93,7 +104,7 @@ #include #include "songinfo.h" #include "didyouknow.h" -#include +#include //extern void cacheJackRouteNames(); @@ -131,6 +142,9 @@ extern void exitDummyAudio(); extern void initVST_fst_init(); extern void initVST(); extern void initDSSI(); +// p3.3.39 +extern void initOSC(); +extern void exitOSC(); #ifdef HAVE_LASH #include @@ -402,12 +416,25 @@ bool MusE::seqStart() //audioWriteback->start(0); } */ + int pfprio = 0; int midiprio = 0; + + // NOTE: realTimeScheduling can be true (gotten using jack_is_realtime()), + // while the determined realTimePriority can be 0. + // realTimePriority is gotten using pthread_getschedparam() on the client thread + // in JackAudioDevice::realtimePriority() which is a bit flawed - it reports there's no RT... if(realTimeScheduling) { - if(realTimePriority < 5) - printf("MusE: WARNING: Recommend setting audio realtime priority to at least 5!\n"); + //if(realTimePriority < 5) + // printf("MusE: WARNING: Recommend setting audio realtime priority to a higher value!\n"); + /* + if(realTimePriority == 0) + { + pfprio = 1; + midiprio = 2; + } + else if(realTimePriority == 1) { pfprio = 2; @@ -444,11 +471,17 @@ bool MusE::seqStart() midiprio = 6; } else + */ { - pfprio = realTimePriority - 5; + //pfprio = realTimePriority - 5; + // p3.3.40 + pfprio = realTimePriority + 1; + //midiprio = realTimePriority - 2; // p3.3.37 - midiprio = realTimePriority + 1; + //midiprio = realTimePriority + 1; + // p3.3.40 + midiprio = realTimePriority + 2; } } @@ -576,9 +609,9 @@ struct addSynth_cmp_str }; */ -QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot = 0) +Q3PopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot = 0) { - QPopupMenu* synp = new QPopupMenu(parent); + Q3PopupMenu* synp = new Q3PopupMenu(parent); //typedef std::multimap asmap; typedef std::multimap asmap; @@ -587,23 +620,23 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot typedef std::multimap::iterator imap; MessSynth* synMESS = 0; - QPopupMenu* synpMESS = 0; + Q3PopupMenu* synpMESS = 0; asmap mapMESS; #ifdef DSSI_SUPPORT DssiSynth* synDSSI = 0; - QPopupMenu* synpDSSI = 0; + Q3PopupMenu* synpDSSI = 0; asmap mapDSSI; #endif #ifdef VST_SUPPORT VstSynth* synVST = 0; - QPopupMenu* synpVST = 0; + Q3PopupMenu* synpVST = 0; asmap mapVST; #endif - // Not neccessary, but what the heck. - QPopupMenu* synpOther = 0; + // Not necessary, but what the heck. + Q3PopupMenu* synpOther = 0; asmap mapOther; //const int synth_base_id = 0x1000; @@ -657,7 +690,7 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot { // No MESS sub-menu yet? Create it now. if(!synpMESS) - synpMESS = new QPopupMenu(parent); + synpMESS = new Q3PopupMenu(parent); synpMESS->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -673,7 +706,7 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot { // No DSSI sub-menu yet? Create it now. if(!synpDSSI) - synpDSSI = new QPopupMenu(parent); + synpDSSI = new Q3PopupMenu(parent); synpDSSI->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -690,7 +723,7 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot { // No VST sub-menu yet? Create it now. if(!synpVST) - synpVST = new QPopupMenu(parent); + synpVST = new Q3PopupMenu(parent); synpVST->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -704,7 +737,7 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot Synth* s = synthis[idx]; // No Other sub-menu yet? Create it now. if(!synpOther) - synpOther = new QPopupMenu(parent); + synpOther = new Q3PopupMenu(parent); synpOther->insertItem(QT_TR_NOOP(s->description()) + " <" + QT_TR_NOOP(s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); } @@ -748,25 +781,25 @@ QPopupMenu* populateAddSynth(QWidget* parent, QObject* obj = 0, const char* slot // this is also used in "mixer" //--------------------------------------------------------- -void populateAddTrack(QPopupMenu* addTrack) +void populateAddTrack(Q3PopupMenu* addTrack) { - addTrack->insertItem(QIconSet(*addtrack_addmiditrackIcon), + addTrack->insertItem(QIcon(*addtrack_addmiditrackIcon), QT_TR_NOOP("Add Midi Track"), Track::MIDI); - addTrack->insertItem(QIconSet(*addtrack_drumtrackIcon), + addTrack->insertItem(QIcon(*addtrack_drumtrackIcon), QT_TR_NOOP("Add Drum Track"), Track::DRUM); - addTrack->insertItem(QIconSet(*addtrack_wavetrackIcon), + addTrack->insertItem(QIcon(*addtrack_wavetrackIcon), QT_TR_NOOP("Add Wave Track"), Track::WAVE); - addTrack->insertItem(QIconSet(*addtrack_audiooutputIcon), + addTrack->insertItem(QIcon(*addtrack_audiooutputIcon), QT_TR_NOOP("Add Audio Output"), Track::AUDIO_OUTPUT); - addTrack->insertItem(QIconSet(*addtrack_audiogroupIcon), + addTrack->insertItem(QIcon(*addtrack_audiogroupIcon), QT_TR_NOOP("Add Audio Group"), Track::AUDIO_GROUP); - addTrack->insertItem(QIconSet(*addtrack_audioinputIcon), + addTrack->insertItem(QIcon(*addtrack_audioinputIcon), QT_TR_NOOP("Add Audio Input"), Track::AUDIO_INPUT); - addTrack->insertItem(QIconSet(*addtrack_auxsendIcon), + addTrack->insertItem(QIcon(*addtrack_auxsendIcon), QT_TR_NOOP("Add Aux Send"), Track::AUDIO_AUX); // Create a sub-menu and fill it with found synth types. Make addTrack the owner. - QPopupMenu* synp = populateAddSynth(addTrack, song, SLOT(addNewTrack(int))); + Q3PopupMenu* synp = populateAddSynth(addTrack, song, SLOT(addNewTrack(int))); // Add the sub-menu to the given menu. addTrack->insertItem(*synthIcon, QT_TR_NOOP("Add Synth"), synp, Track::AUDIO_SOFTSYNTH); @@ -779,12 +812,12 @@ void populateAddTrack(QPopupMenu* addTrack) // MusE //--------------------------------------------------------- -MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") +MusE::MusE(int argc, char** argv) : Q3MainWindow(0, "mainwindow") { // By T356. For LADSPA plugins in plugin.cpp - QWidgetFactory::addWidgetFactory( new PluginWidgetFactory ); + // QWidgetFactory::addWidgetFactory( new PluginWidgetFactory ); ddskrjo - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); muse = this; // hack clipListEdit = 0; midiSyncConfig = 0; @@ -807,7 +840,8 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") mixer2 = 0; watchdogThread = 0; editInstrument = 0; - + routingPopupMenu = 0; + appName = QString("MusE"); song = new Song("song"); @@ -832,11 +866,11 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") //--------------------------------------------------- // undo/redo //--------------------------------------------------- - undoRedo = new QActionGroup(this, tr("UndoRedo"), false); - undoAction = new QAction(tr("undo"), QIconSet(*undoIconS, *undoIcon), tr("Und&o"), - CTRL+Key_Z, undoRedo, "undo"); - redoAction = new QAction(tr("redo"), QIconSet(*redoIconS, *redoIcon), tr("Re&do"), - CTRL+Key_Y, undoRedo, "redo"); + undoRedo = new Q3ActionGroup(this, tr("UndoRedo"), false); + undoAction = new Q3Action(tr("undo"), QIcon(*undoIconS), tr("Und&o"), // ddskrjo + Qt::CTRL+Qt::Key_Z, undoRedo, "undo"); + redoAction = new Q3Action(tr("redo"), QIcon(*redoIconS), tr("Re&do"), // ddskrjo + Qt::CTRL+Qt::Key_Y, undoRedo, "redo"); undoAction->setWhatsThis(tr("undo last change to song")); redoAction->setWhatsThis(tr("redo last undo")); undoAction->setEnabled(false); @@ -848,58 +882,58 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // Transport //--------------------------------------------------- - transportAction = new QActionGroup(this, tr("Transport"), false); + transportAction = new Q3ActionGroup(this, tr("Transport"), false); - loopAction = new QAction(tr("loop"), QIconSet(*loop1Icon), + loopAction = new Q3Action(tr("loop"), QIcon(*loop1Icon), tr("Loop"), 0, transportAction, "loop", true); loopAction->setWhatsThis(tr(infoLoopButton)); connect(loopAction, SIGNAL(toggled(bool)), song, SLOT(setLoop(bool))); - punchinAction = new QAction(tr("punchin"), QIconSet(*punchin1Icon), + punchinAction = new Q3Action(tr("punchin"), QIcon(*punchin1Icon), tr("Punchin"), 0, transportAction, "Punchin", true); punchinAction->setWhatsThis(tr(infoPunchinButton)); connect(punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool))); - punchoutAction = new QAction(tr("punchout"), QIconSet(*punchout1Icon), + punchoutAction = new Q3Action(tr("punchout"), QIcon(*punchout1Icon), tr("Punchout"), 0, transportAction, "punchout", true); punchoutAction->setWhatsThis(tr(infoPunchoutButton)); connect(punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool))); transportAction->addSeparator(); - startAction = new QAction(tr("start"), QIconSet(*startIcon), + startAction = new Q3Action(tr("start"), QIcon(*startIcon), tr("Start"), 0, transportAction, "start"); startAction->setWhatsThis(tr(infoStartButton)); connect(startAction, SIGNAL(activated()), song, SLOT(rewindStart())); - rewindAction = new QAction(tr("rewind"), QIconSet(*frewindIcon), + rewindAction = new Q3Action(tr("rewind"), QIcon(*frewindIcon), tr("Rewind"), 0, transportAction, "rewind"); rewindAction->setWhatsThis(tr(infoRewindButton)); connect(rewindAction, SIGNAL(activated()), song, SLOT(rewind())); - forwardAction = new QAction(tr("forward"), QIconSet(*fforwardIcon), + forwardAction = new Q3Action(tr("forward"), QIcon(*fforwardIcon), tr("Forward"), 0, transportAction, "forward"); forwardAction->setWhatsThis(tr(infoForwardButton)); connect(forwardAction, SIGNAL(activated()), song, SLOT(forward())); - stopAction = new QAction(tr("stop"), QIconSet(*stopIcon), + stopAction = new Q3Action(tr("stop"), QIcon(*stopIcon), tr("Stop"), 0, transportAction, "stop", true); stopAction->setWhatsThis(tr(infoStopButton)); stopAction->setOn(true); connect(stopAction, SIGNAL(toggled(bool)), song, SLOT(setStop(bool))); - playAction = new QAction(tr("play"), QIconSet(*playIcon), + playAction = new Q3Action(tr("play"), QIcon(*playIcon), tr("Play"), 0, transportAction, "play", true); playAction->setWhatsThis(tr(infoPlayButton)); playAction->setOn(false); connect(playAction, SIGNAL(toggled(bool)), song, SLOT(setPlay(bool))); - recordAction = new QAction(tr("record"), QIconSet(*recordIcon), + recordAction = new Q3Action(tr("record"), QIcon(*recordIcon), tr("Record"), 0, transportAction, "record", true); recordAction->setWhatsThis(tr(infoRecordButton)); connect(recordAction, SIGNAL(toggled(bool)), song, SLOT(setRecord(bool))); - panicAction = new QAction(tr("panic"), QIconSet(*panicIcon), + panicAction = new Q3Action(tr("panic"), QIcon(*panicIcon), tr("Panic"), 0, 0, "panic", false); panicAction->setWhatsThis(tr(infoPanicButton)); connect(panicAction, SIGNAL(activated()), song, SLOT(panic())); @@ -910,22 +944,22 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") //----Actions - fileNewAction = new QAction(tr("new"), - QIconSet(*filenewIconS, *filenewIcon), tr("&New"), 0, this, "new"); + fileNewAction = new Q3Action(tr("new"), + QIcon(*filenewIcon), tr("&New"), 0, this, "new"); // ddskrjo fileNewAction->setToolTip(tr(fileNewText)); fileNewAction->setWhatsThis(tr(fileNewText)); - fileOpenAction = new QAction(tr("open"), - QIconSet(*openIconS, *openIcon), tr("&Open"), 0, this, "open"); + fileOpenAction = new Q3Action(tr("open"), + QIcon(*openIcon), tr("&Open"), 0, this, "open"); // ddskrjo fileOpenAction->setToolTip(tr(fileOpenText)); fileOpenAction->setWhatsThis(tr(fileOpenText)); - fileSaveAction = new QAction(tr("save"), - QIconSet(*saveIconS, *saveIcon), tr("&Save"), 0, this, "save"); + fileSaveAction = new Q3Action(tr("save"), + QIcon(*saveIcon), tr("&Save"), 0, this, "save"); // ddskrjo fileSaveAction->setToolTip(tr(fileSaveText)); fileSaveAction->setWhatsThis(tr(fileSaveText)); - pianoAction = new QAction(tr("pianoroll"), + pianoAction = new Q3Action(tr("pianoroll"), *pianoIconSet, tr("Pianoroll"), 0, this, "pianoroll"); connect(pianoAction, SIGNAL(activated()), SLOT(startPianoroll())); @@ -941,7 +975,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // Toolbar //-------------------------------------------------- - tools = new QToolBar(tr("File Buttons"), this); + tools = new Q3ToolBar(tr("File Buttons"), this); fileNewAction->addTo(tools); fileOpenAction->addTo(tools); fileSaveAction->addTo(tools); @@ -949,17 +983,17 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // // Whats This // - QWhatsThis::whatsThisButton(tools); + Q3WhatsThis::whatsThisButton(tools); tools->addSeparator(); undoRedo->addTo(tools); tools1 = new EditToolBar(this, arrangerTools); - QToolBar* transportToolbar = new QToolBar(this); + Q3ToolBar* transportToolbar = new Q3ToolBar(this); transportAction->addTo(transportToolbar); - QToolBar* panicToolbar = new QToolBar(this); + Q3ToolBar* panicToolbar = new Q3ToolBar(this); panicAction->addTo(panicToolbar); if (realTimePriority < sched_get_priority_min(SCHED_FIFO)) @@ -998,11 +1032,11 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // popup File //------------------------------------------------------------- - menu_file = new QPopupMenu(this); + menu_file = new Q3PopupMenu(this); menuBar()->insertItem(tr("&File"), menu_file); fileNewAction->addTo(menu_file); fileOpenAction->addTo(menu_file); - openRecent = new QPopupMenu(menu_file); + openRecent = new Q3PopupMenu(menu_file); connect(openRecent, SIGNAL(aboutToShow()), this, SLOT(openRecentMenu())); connect(openRecent, SIGNAL(activated(int)), this, SLOT(selectProject(int))); menu_ids[CMD_OPEN_RECENT] = menu_file->insertItem(tr("Open &Recent"), openRecent, 0); @@ -1025,79 +1059,83 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // popup Edit //------------------------------------------------------------- - menuEdit = new QPopupMenu(this); + menuEdit = new Q3PopupMenu(this); undoRedo->addTo(menuEdit); menuEdit->insertSeparator(); menuBar()->insertItem(tr("&Edit"), menuEdit); menuEdit->insertItem(*editcutIconSet, tr("C&ut"), CMD_CUT); - menuEdit->setAccel(CTRL+Key_X, CMD_CUT); + menuEdit->setAccel(Qt::CTRL+Qt::Key_X, CMD_CUT); menuEdit->insertItem(*editcopyIconSet, tr("&Copy"), CMD_COPY); - menuEdit->setAccel(CTRL+Key_C, CMD_COPY); + menuEdit->setAccel(Qt::CTRL+Qt::Key_C, CMD_COPY); menuEdit->insertItem(*editpasteIconSet, tr("&Paste"), CMD_PASTE); - menuEdit->setAccel(CTRL+Key_V, CMD_PASTE); + menuEdit->setAccel(Qt::CTRL+Qt::Key_V, CMD_PASTE); + menuEdit->insertItem(*editpasteIconSet, tr("&Insert"), CMD_INSERT); + menuEdit->setAccel(Qt::CTRL+Qt::SHIFT+Qt::Key_I, CMD_INSERT); menuEdit->insertItem(*editpasteCloneIconSet, tr("Paste c&lone"), CMD_PASTE_CLONE); - menuEdit->setAccel(CTRL+SHIFT+Key_V, CMD_PASTE_CLONE); + menuEdit->setAccel(Qt::CTRL+Qt::SHIFT+Qt::Key_V, CMD_PASTE_CLONE); menuEdit->insertItem(*editpaste2TrackIconSet, tr("Paste to &track"), CMD_PASTE_TO_TRACK); - menuEdit->setAccel(CTRL+Key_B, CMD_PASTE_TO_TRACK); + menuEdit->setAccel(Qt::CTRL+Qt::Key_B, CMD_PASTE_TO_TRACK); menuEdit->insertItem(*editpasteClone2TrackIconSet, tr("Paste clone to trac&k"), CMD_PASTE_CLONE_TO_TRACK); - menuEdit->setAccel(CTRL+SHIFT+Key_B, CMD_PASTE_CLONE_TO_TRACK); + menuEdit->setAccel(Qt::CTRL+Qt::SHIFT+Qt::Key_B, CMD_PASTE_CLONE_TO_TRACK); + menuEdit->insertItem(*editpasteIconSet, tr("&Insert empty measure"), CMD_INSERTMEAS); + menuEdit->setAccel(Qt::CTRL+Qt::SHIFT+Qt::Key_X, CMD_INSERTMEAS); menuEdit->insertSeparator(); - menuEdit->insertItem(QIconSet(*edit_track_delIcon), + menuEdit->insertItem(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), CMD_DELETE_TRACK); - addTrack = new QPopupMenu(this); + addTrack = new Q3PopupMenu(this); // Moved below. Have to wait until synths are available... //populateAddTrack(addTrack); - menuEdit->insertItem(QIconSet(*edit_track_addIcon), + menuEdit->insertItem(QIcon(*edit_track_addIcon), tr("Add Track"), addTrack); - select = new QPopupMenu(this); - select->insertItem(QIconSet(*select_allIcon), + select = new Q3PopupMenu(this); + select->insertItem(QIcon(*select_allIcon), tr("Select &All"), CMD_SELECT_ALL); - select->insertItem(QIconSet(*select_deselect_allIcon), + select->insertItem(QIcon(*select_deselect_allIcon), tr("&Deselect All"), CMD_SELECT_NONE); menuEdit->insertSeparator(); - select->insertItem(QIconSet(*select_invert_selectionIcon), + select->insertItem(QIcon(*select_invert_selectionIcon), tr("Invert &Selection"), CMD_SELECT_INVERT); - select->insertItem(QIconSet(*select_inside_loopIcon), + select->insertItem(QIcon(*select_inside_loopIcon), tr("&Inside Loop"), CMD_SELECT_ILOOP); - select->insertItem(QIconSet(*select_outside_loopIcon), + select->insertItem(QIcon(*select_outside_loopIcon), tr("&Outside Loop"), CMD_SELECT_OLOOP); - select->insertItem(QIconSet(*select_all_parts_on_trackIcon), + select->insertItem(QIcon(*select_all_parts_on_trackIcon), tr("All &Parts on Track"), CMD_SELECT_PARTS); - menuEdit->insertItem(QIconSet(*selectIcon), + menuEdit->insertItem(QIcon(*selectIcon), tr("Select"), select); menuEdit->insertSeparator(); pianoAction->addTo(menuEdit); menu_ids[CMD_OPEN_DRUMS] = menuEdit->insertItem( - QIconSet(*edit_drummsIcon), tr("Drums"), this, SLOT(startDrumEditor()), 0); + QIcon(*edit_drummsIcon), tr("Drums"), this, SLOT(startDrumEditor()), 0); menu_ids[CMD_OPEN_LIST] = menuEdit->insertItem( - QIconSet(*edit_listIcon), tr("List"), this, SLOT(startListEditor()), 0); + QIcon(*edit_listIcon), tr("List"), this, SLOT(startListEditor()), 0); menu_ids[CMD_OPEN_WAVE] = menuEdit->insertItem( - QIconSet(*edit_waveIcon), tr("Wave"), this, SLOT(startWaveEditor()), 0); + QIcon(*edit_waveIcon), tr("Wave"), this, SLOT(startWaveEditor()), 0); - master = new QPopupMenu(this); + master = new Q3PopupMenu(this); master->setCheckable(false); menu_ids[CMD_OPEN_GRAPHIC_MASTER] = master->insertItem( - QIconSet(*mastertrack_graphicIcon),tr("Graphic"), this, SLOT(startMasterEditor()), 0); + QIcon(*mastertrack_graphicIcon),tr("Graphic"), this, SLOT(startMasterEditor()), 0); menu_ids[CMD_OPEN_LIST_MASTER] = master->insertItem( - QIconSet(*mastertrack_listIcon),tr("List"), this, SLOT(startLMasterEditor()), 0); - menuEdit->insertItem(QIconSet(*edit_mastertrackIcon), - tr("Mastertrack"), master, Key_F); + QIcon(*mastertrack_listIcon),tr("List"), this, SLOT(startLMasterEditor()), 0); + menuEdit->insertItem(QIcon(*edit_mastertrackIcon), + tr("Mastertrack"), master, Qt::Key_F); menuEdit->insertSeparator(); connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); connect(select, SIGNAL(activated(int)), SLOT(cmd(int))); - midiEdit = new QPopupMenu(this); + midiEdit = new Q3PopupMenu(this); midiEdit->setCheckable(false); #if 0 // TODO menu_ids[CMD_OPEN_MIDI_TRANSFORM] = midiEdit->insertItem( - QIconSet(*midi_transformIcon), tr("Midi &Transform"), this, SLOT(startMidiTransformer()), 0); + QIcon(*midi_transformIcon), tr("Midi &Transform"), this, SLOT(startMidiTransformer()), 0); midiEdit->insertItem(tr("Modify Gate Time"), this, SLOT(modifyGateTime())); midiEdit->insertItem(tr("Modify Velocity"), this, SLOT(modifyVelocity())); midiEdit->insertItem(tr("Crescendo"), this, SLOT(crescendo())); @@ -1113,36 +1151,36 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") midiEdit->insertItem(tr("Mix Track"), this, SLOT(mixTrack())); #endif menu_ids[CMD_TRANSPOSE] = midiEdit->insertItem( - QIconSet(*midi_transposeIcon), tr("Transpose"), this, SLOT(transpose()), 0); + QIcon(*midi_transposeIcon), tr("Transpose"), this, SLOT(transpose()), 0); menuEdit->insertItem( - QIconSet(*edit_midiIcon), tr("Midi"), midiEdit); + QIcon(*edit_midiIcon), tr("Midi"), midiEdit); menuEdit->insertSeparator(); menuEdit->insertItem( - QIconSet(*edit_listIcon), tr("Song info"), this, SLOT(startSongInfo()), 0); + QIcon(*edit_listIcon), tr("Song info"), this, SLOT(startSongInfo()), 0); //------------------------------------------------------------- // popup View //------------------------------------------------------------- - menuView = new QPopupMenu(this); + menuView = new Q3PopupMenu(this); menuView->setCheckable(true); menuBar()->insertItem(tr("View"), menuView); tr_id = menuView->insertItem( - QIconSet(*view_transport_windowIcon), tr("Transport Panel"), this, SLOT(toggleTransport()), 0); + QIcon(*view_transport_windowIcon), tr("Transport Panel"), this, SLOT(toggleTransport()), 0); bt_id = menuView->insertItem( - QIconSet(*view_bigtime_windowIcon), tr("Bigtime window"), this, SLOT(toggleBigTime()), 0); + QIcon(*view_bigtime_windowIcon), tr("Bigtime window"), this, SLOT(toggleBigTime()), 0); //aid1 = menuView->insertItem( // QIconSet(*mixerSIcon), tr("Mixer"), this, SLOT(toggleMixer()), 0); aid1a = menuView->insertItem( - QIconSet(*mixerSIcon), tr("Mixer A"), this, SLOT(toggleMixer1()), 0); + QIcon(*mixerSIcon), tr("Mixer A"), this, SLOT(toggleMixer1()), 0); aid1b = menuView->insertItem( - QIconSet(*mixerSIcon), tr("Mixer B"), this, SLOT(toggleMixer2()), 0); + QIcon(*mixerSIcon), tr("Mixer B"), this, SLOT(toggleMixer2()), 0); // p3.2.24 aid2 = menuView->insertItem( - QIconSet(*cliplistSIcon), tr("Cliplist"), this, SLOT(startClipList()), 0); + QIcon(*cliplistSIcon), tr("Cliplist"), this, SLOT(startClipList()), 0); mr_id = menuView->insertItem( - QIconSet(*view_markerIcon), tr("Marker View"), this, SLOT(toggleMarker()), 0); + QIcon(*view_markerIcon), tr("Marker View"), this, SLOT(toggleMarker()), 0); //markerAction->addTo(menuView); @@ -1150,7 +1188,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // popup Structure //------------------------------------------------------------- - menuStructure = new QPopupMenu(this); + menuStructure = new Q3PopupMenu(this); menuStructure->setCheckable(false); menuBar()->insertItem(tr("&Structure"), menuStructure); menu_ids[CMD_GLOBAL_CUT] = menuStructure->insertItem(tr("Global Cut"), this, SLOT(globalCut()), 0); @@ -1166,16 +1204,16 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // popup Midi //------------------------------------------------------------- - midiInputPlugins = new QPopupMenu(this); + midiInputPlugins = new Q3PopupMenu(this); midiInputPlugins->setCheckable(false); mpid0 = midiInputPlugins->insertItem( - QIconSet(*midi_inputplugins_transposeIcon), tr("Transpose"), 0); + QIcon(*midi_inputplugins_transposeIcon), tr("Transpose"), 0); mpid1 = midiInputPlugins->insertItem( - QIconSet(*midi_inputplugins_midi_input_transformIcon), tr("Midi Input Transform"), 1); + QIcon(*midi_inputplugins_midi_input_transformIcon), tr("Midi Input Transform"), 1); mpid2 = midiInputPlugins->insertItem( - QIconSet(*midi_inputplugins_midi_input_filterIcon), tr("Midi Input Filter"), 2); + QIcon(*midi_inputplugins_midi_input_filterIcon), tr("Midi Input Filter"), 2); mpid3 = midiInputPlugins->insertItem( - QIconSet(*midi_inputplugins_remote_controlIcon), tr("Midi Remote Control"), 3); + QIcon(*midi_inputplugins_remote_controlIcon), tr("Midi Remote Control"), 3); /* ** mpid4 = midiInputPlugins->insertItem( ** QIconSet(*midi_inputplugins_random_rhythm_generatorIcon), tr("Random Rhythm Generator"), 4); @@ -1184,63 +1222,63 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") // midiInputPlugins->setItemEnabled(mpid4, false); - menu_functions = new QPopupMenu(this); + menu_functions = new Q3PopupMenu(this); menu_functions->setCheckable(true); menuBar()->insertItem(tr("&Midi"), menu_functions); menu_functions->setCaption(tr("Midi")); - menuScriptPlugins = new QPopupMenu(this); + menuScriptPlugins = new Q3PopupMenu(this); song->populateScriptMenu(menuScriptPlugins, this); menu_functions->insertItem(tr("&Plugins"), menuScriptPlugins); menu_ids[CMD_MIDI_EDIT_INSTRUMENTS] = menu_functions->insertItem( - QIconSet(*midi_edit_instrumentIcon), tr("Edit Instrument"), this, SLOT(startEditInstrument()), 0); + QIcon(*midi_edit_instrumentIcon), tr("Edit Instrument"), this, SLOT(startEditInstrument()), 0); menu_functions->insertItem( - QIconSet(*midi_inputpluginsIcon), tr("Input Plugins"), midiInputPlugins, Key_P); + QIcon(*midi_inputpluginsIcon), tr("Input Plugins"), midiInputPlugins, Qt::Key_P); menu_functions->insertSeparator(); menu_ids[CMD_MIDI_RESET] = menu_functions->insertItem( - QIconSet(*midi_reset_instrIcon), tr("Reset Instr."), this, SLOT(resetMidiDevices()), 0); + QIcon(*midi_reset_instrIcon), tr("Reset Instr."), this, SLOT(resetMidiDevices()), 0); menu_ids[CMD_MIDI_INIT] = menu_functions->insertItem( - QIconSet(*midi_init_instrIcon), tr("Init Instr."), this, SLOT(initMidiDevices()), 0); + QIcon(*midi_init_instrIcon), tr("Init Instr."), this, SLOT(initMidiDevices()), 0); menu_ids[CMD_MIDI_LOCAL_OFF] = menu_functions->insertItem( - QIconSet(*midi_local_offIcon), tr("local off"), this, SLOT(localOff()), 0); + QIcon(*midi_local_offIcon), tr("local off"), this, SLOT(localOff()), 0); //------------------------------------------------------------- // popup Audio //------------------------------------------------------------- - menu_audio = new QPopupMenu(this); + menu_audio = new Q3PopupMenu(this); menu_audio->setCheckable(true); menuBar()->insertItem(tr("&Audio"), menu_audio); menu_ids[CMD_AUDIO_BOUNCE_TO_TRACK] = menu_audio->insertItem( - QIconSet(*audio_bounce_to_trackIcon), tr("Bounce to Track"), this, SLOT(bounceToTrack()), 0); + QIcon(*audio_bounce_to_trackIcon), tr("Bounce to Track"), this, SLOT(bounceToTrack()), 0); menu_ids[CMD_AUDIO_BOUNCE_TO_FILE] = menu_audio->insertItem( - QIconSet(*audio_bounce_to_fileIcon), tr("Bounce to File"), this, SLOT(bounceToFile()), 0); + QIcon(*audio_bounce_to_fileIcon), tr("Bounce to File"), this, SLOT(bounceToFile()), 0); menu_audio->insertSeparator(); menu_ids[CMD_AUDIO_RESTART] = menu_audio->insertItem( - QIconSet(*audio_restartaudioIcon), tr("Restart Audio"), this, SLOT(seqRestart()), 0); + QIcon(*audio_restartaudioIcon), tr("Restart Audio"), this, SLOT(seqRestart()), 0); //------------------------------------------------------------- // popup Automation //------------------------------------------------------------- - menuAutomation = new QPopupMenu(this); + menuAutomation = new Q3PopupMenu(this); menuAutomation->setCheckable(true); menuBar()->insertItem(tr("Automation"), menuAutomation); autoId = menuAutomation->insertItem( - QIconSet(*automation_mixerIcon), tr("Mixer Automation"), this, SLOT(switchMixerAutomation()), 0); + QIcon(*automation_mixerIcon), tr("Mixer Automation"), this, SLOT(switchMixerAutomation()), 0); menuAutomation->insertSeparator(); menu_ids[CMD_MIXER_SNAPSHOT] = menuAutomation->insertItem( - QIconSet(*automation_take_snapshotIcon), tr("Take Snapshot"), this, SLOT(takeAutomationSnapshot()), 0); + QIcon(*automation_take_snapshotIcon), tr("Take Snapshot"), this, SLOT(takeAutomationSnapshot()), 0); menu_ids[CMD_MIXER_AUTOMATION_CLEAR] = menuAutomation->insertItem( - QIconSet(*automation_clear_dataIcon), tr("Clear Automation Data"), this, SLOT(clearAutomation()), 0); + QIcon(*automation_clear_dataIcon), tr("Clear Automation Data"), this, SLOT(clearAutomation()), 0); menuAutomation->setItemEnabled(menu_ids[CMD_MIXER_AUTOMATION_CLEAR], false); //------------------------------------------------------------- // popup Settings //------------------------------------------------------------- - follow = new QPopupMenu(this); + follow = new Q3PopupMenu(this); follow->setCheckable(false); fid0 = follow->insertItem(tr("dont follow Song"), CMD_FOLLOW_NO); fid1 = follow->insertItem(tr("follow page"), CMD_FOLLOW_JUMP); @@ -1248,35 +1286,35 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") follow->setItemChecked(fid1, true); connect(follow, SIGNAL(activated(int)), SLOT(cmd(int))); - menuSettings = new QPopupMenu(this); + menuSettings = new Q3PopupMenu(this); menuSettings->setCheckable(false); menuBar()->insertItem(tr("Settings"), menuSettings); menu_ids[CMD_GLOBAL_CONFIG] = menuSettings->insertItem( - QIconSet(*settings_globalsettingsIcon), tr("Global Settings"), this, SLOT(configGlobalSettings()),0); + QIcon(*settings_globalsettingsIcon), tr("Global Settings"), this, SLOT(configGlobalSettings()),0); menu_ids[CMD_CONFIG_SHORTCUTS] = menuSettings->insertItem( - QIconSet(*settings_configureshortcutsIcon), tr("Configure shortcuts"), this, SLOT(configShortCuts()), 0); + QIcon(*settings_configureshortcutsIcon), tr("Configure shortcuts"), this, SLOT(configShortCuts()), 0); menuSettings->insertItem( - QIconSet(*settings_follow_songIcon), tr("follow song"), follow, Key_F); + QIcon(*settings_follow_songIcon), tr("follow song"), follow, Qt::Key_F); menu_ids[CMD_CONFIG_METRONOME] = menuSettings->insertItem( - QIconSet(*settings_metronomeIcon), tr("Metronome"), this, SLOT(configMetronome()), 0); + QIcon(*settings_metronomeIcon), tr("Metronome"), this, SLOT(configMetronome()), 0); menuSettings->insertSeparator(); menu_ids[CMD_CONFIG_MIDISYNC] = menuSettings->insertItem( - QIconSet(*settings_midisyncIcon), tr("Midi Sync"), this, SLOT(configMidiSync()), 0); + QIcon(*settings_midisyncIcon), tr("Midi Sync"), this, SLOT(configMidiSync()), 0); menu_ids[CMD_MIDI_FILE_CONFIG] = menuSettings->insertItem( - QIconSet(*settings_midifileexportIcon), tr("Midi File Import/Export"), this, SLOT(configMidiFile()), 0); + QIcon(*settings_midifileexportIcon), tr("Midi File Import/Export"), this, SLOT(configMidiFile()), 0); menuSettings->insertSeparator(); menu_ids[CMD_APPEARANCE_SETTINGS] = menuSettings->insertItem( - QIconSet(*settings_appearance_settingsIcon), tr("Appearance settings"), this, SLOT(configAppearance()), 0); + QIcon(*settings_appearance_settingsIcon), tr("Appearance settings"), this, SLOT(configAppearance()), 0); menuSettings->insertSeparator(); menu_ids[CMD_CONFIG_MIDI_PORTS] = menuSettings->insertItem( - QIconSet(*settings_midiport_softsynthsIcon), tr("Midi Ports / Soft Synth"), this, SLOT(configMidiPorts()), 0); + QIcon(*settings_midiport_softsynthsIcon), tr("Midi Ports / Soft Synth"), this, SLOT(configMidiPorts()), 0); //--------------------------------------------------- // popup Help //--------------------------------------------------- menuBar()->insertSeparator(); - menu_help = new QPopupMenu(this); + menu_help = new Q3PopupMenu(this); menu_help->setCheckable(false); menuBar()->insertItem(tr("&Help"), menu_help); @@ -1286,9 +1324,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow(0, "mainwindow") menu_ids[CMD_OPEN_BUG] = menu_help->insertItem(tr("&Report Bug..."), this, SLOT(startBugBrowser()), 0); menu_help->insertSeparator(); menu_help->insertItem(tr("&About MusE"), this, SLOT(about())); - menu_help->insertItem(tr("About&Qt"), this, SLOT(aboutQt())); - menu_help->insertSeparator(); - menu_ids[CMD_START_WHATSTHIS] = menu_help->insertItem(tr("What's &This?"), this, SLOT(whatsThis()), 0); + //menu_help->insertItem(tr("About&Qt"), this, SLOT(aboutQt())); + //menu_help->insertSeparator(); + //menu_ids[CMD_START_WHATSTHIS] = menu_help->insertItem(tr("What's &This?"), this, SLOT(whatsThis()), 0); //--------------------------------------------------- // Central Widget @@ -1560,7 +1598,27 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll showBigtime(config.bigTimeVisible); //showMixer(config.mixerVisible); showMixer1(config.mixer1Visible); - showMixer2(config.mixer1Visible); + showMixer2(config.mixer2Visible); + + // Added p3.3.43 Make sure the geometry is correct because showMixerX() will NOT + // set the geometry if the mixer has already been created. + if(mixer1) + { + //if(mixer1->geometry().size() != config.mixer1.geometry.size()) // p3.3.53 Moved below + // mixer1->resize(config.mixer1.geometry.size()); + + if(mixer1->geometry().topLeft() != config.mixer1.geometry.topLeft()) + mixer1->move(config.mixer1.geometry.topLeft()); + } + if(mixer2) + { + //if(mixer2->geometry().size() != config.mixer2.geometry.size()) // p3.3.53 Moved below + // mixer2->resize(config.mixer2.geometry.size()); + + if(mixer2->geometry().topLeft() != config.mixer2.geometry.topLeft()) + mixer2->move(config.mixer2.geometry.topLeft()); + } + showMarker(config.markerVisible); resize(config.geometryMain.size()); move(config.geometryMain.topLeft()); @@ -1579,6 +1637,36 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll song->updatePos(); clipboardChanged(); // enable/disable "Paste" selectionChanged(); // enable/disable "Copy" & "Paste" + + // p3.3.53 Try this AFTER the song update above which does a mixer update... Tested OK - mixers resize properly now. + if (loadAll) + { + if(mixer1) + { + if(mixer1->geometry().size() != config.mixer1.geometry.size()) + { + //printf("MusE::loadProjectFile1 resizing mixer1 x:%d y:%d w:%d h:%d\n", config.mixer1.geometry.x(), + // config.mixer1.geometry.y(), + // config.mixer1.geometry.width(), + // config.mixer1.geometry.height() + // ); + mixer1->resize(config.mixer1.geometry.size()); + } + } + if(mixer2) + { + if(mixer2->geometry().size() != config.mixer2.geometry.size()) + { + //printf("MusE::loadProjectFile1 resizing mixer2 x:%d y:%d w:%d h:%d\n", config.mixer2.geometry.x(), + // config.mixer2.geometry.y(), + // config.mixer2.geometry.width(), + // config.mixer2.geometry.height() + // ); + mixer2->resize(config.mixer2.geometry.size()); + } + } + } + } //--------------------------------------------------------- @@ -1719,7 +1807,8 @@ bool MusE::save(const QString& name, bool overwriteWarn) write(xml); if (ferror(f)) { QString s = "Write File\n" + name + "\nfailed: " - + strerror(errno); + //+ strerror(errno); + + QString(strerror(errno)); // p4.0.0 QMessageBox::critical(this, tr("MusE: Write File failed"), s); popenFlag? pclose(f) : fclose(f); @@ -1798,6 +1887,11 @@ void MusE::closeEvent(QCloseEvent*) printf("Muse: Exiting Metronome\n"); exitMetronome(); + // p3.3.47 + // Make sure to clear the menu, which deletes any sub menus. + if(routingPopupMenu) + routingPopupMenu->clear(); + // Changed by Tim. p3.3.14 //SynthIList* sl = song->syntis(); //for (iSynthI i = sl->begin(); i != sl->end(); ++i) @@ -1832,6 +1926,16 @@ void MusE::closeEvent(QCloseEvent*) printf("Muse: Exiting Dsp\n"); AL::exitDsp(); + if(debugMsg) + printf("Muse: Exiting OSC\n"); + exitOSC(); + + // p3.3.47 + delete audioPrefetch; + delete audio; + delete midiSeq; + delete song; + qApp->quit(); } @@ -1854,7 +1958,10 @@ void MusE::showMarker(bool flag) if (markerView == 0) { markerView = new MarkerView(this); - connect(arranger, SIGNAL(addMarker(int)), markerView, SLOT(addMarker(int))); + // 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(); @@ -1892,6 +1999,676 @@ void MusE::showTransport(bool flag) menuView->setItemChecked(tr_id, flag); } +//--------------------------------------------------------- +// getRoutingPopupMenu +//--------------------------------------------------------- + +PopupMenu* MusE::getRoutingPopupMenu() +{ + if(!routingPopupMenu) + routingPopupMenu = new PopupMenu(this); + return routingPopupMenu; +} + +//--------------------------------------------------------- +// updateRouteMenus +//--------------------------------------------------------- + +//void MusE::updateRouteMenus(Track* track) +void MusE::updateRouteMenus(Track* track, QObject* master) // p3.3.50 +{ + //if(!track || track != gRoutingPopupMenuMaster || track->type() == Track::AUDIO_AUX) + //if(!track || track->type() == Track::AUDIO_AUX) + if(!track || gRoutingPopupMenuMaster != master) // p3.3.50 + return; + + //QPopupMenu* pup = muse->getORoutesPopup(); + PopupMenu* pup = getRoutingPopupMenu(); + + if(pup->count() == 0) + return; + + // p4.0.1 Protection since reverting to regular (self-extinguishing) menu behaviour here in muse2. + if(!pup->isVisible()) + { + //printf("MusE::updateRouteMenus menu is not visible\n"); + return; + } + + //AudioTrack* t = (AudioTrack*)track; + RouteList* rl = gIsOutRoutingPopupMenu ? track->outRoutes() : track->inRoutes(); + + /* + iRoute iorl = orl->begin(); + for(; iorl != orl->end(); ++iorl) + { + iRouteMenuMap imm = ormm->begin(); + for(; imm != ormm->end(); ++imm) + { + if(*iorl == imm->second) + { + orpup->setItemChecked(imm->first, true); + break; + } + } + //if(imm == ormm->end()) + //{ + //} + + } + //if (iorl == orl->end()) + //{ + //} + */ + + iRouteMenuMap imm = gRoutingMenuMap.begin(); + for(; imm != gRoutingMenuMap.end(); ++imm) + { + // p3.3.50 Ignore the 'toggle' items. + if(imm->second.type == Route::MIDI_PORT_ROUTE && + imm->first >= (MIDI_PORTS * MIDI_CHANNELS) && imm->first < (MIDI_PORTS * MIDI_CHANNELS + MIDI_PORTS)) + continue; + + //bool found = false; + iRoute irl = rl->begin(); + for(; irl != rl->end(); ++irl) + { + if(imm->second.type == Route::MIDI_PORT_ROUTE) // p3.3.50 Is the map route a midi port route? + { + if(irl->type == Route::MIDI_PORT_ROUTE && irl->midiPort == imm->second.midiPort // Is the track route a midi port route? + && (irl->channel & imm->second.channel) == imm->second.channel) // Is the exact channel mask bit(s) set? + { + //found = true; + break; + } + } + else + if(*irl == imm->second) + { + //found = true; + break; + } + } + //pup->setItemChecked(imm->first, found); + pup->setItemChecked(imm->first, irl != rl->end()); + } + + + return; +} + +//--------------------------------------------------------- +// routingPopupMenuActivated +//--------------------------------------------------------- + +void MusE::routingPopupMenuActivated(Track* track, int n) +{ + //if(!track || (track != gRoutingPopupMenuMaster)) + if(!track) + return; + + if(track->isMidiTrack()) + { + PopupMenu* pup = getRoutingPopupMenu(); + + //printf("MusE::routingPopupMenuActivated midi n:%d count:%d\n", n, pup->count()); + + if(pup->count() == 0) + return; + + //MidiTrack* t = (MidiTrack*)track; + RouteList* rl = gIsOutRoutingPopupMenu ? track->outRoutes() : track->inRoutes(); + + if(n == -1) + { + //printf("MusE::routingPopupMenuActivated midi n = -1\n"); + ///delete pup; + ///pup = 0; + return; + } + else + { + //int mdidx = n / MIDI_CHANNELS; + //int ch = n % MIDI_CHANNELS; + //int chbit = 1 << ch; // p3.3.50 + //int chmask = 0; + + //if(n >= MIDI_PORTS * MIDI_CHANNELS) // p3.3.50 Toggle channels. + //{ + //for (int i = 0; i < MIDI_CHANNELS; i++) + //muse->routingPopupMenuActivated(selected, i + MIDI_CHANNELS * (n-1000)); + //muse->routingPopupMenuActivated(selected, i + MIDI_CHANNELS * (n - MIDI_PORTS * MIDI_CHANNELS)); // p3.3.50 + // chbit = (1 << MIDI_CHANNELS) - 1; + //} + //if(debugMsg) + //printf("MusE::routingPopupMenuActivated mdidx:%d ch:%d\n", mdidx, ch); + + // p3.3.50 + iRouteMenuMap imm = gRoutingMenuMap.find(n); + if(imm == gRoutingMenuMap.end()) + return; + if(imm->second.type != Route::MIDI_PORT_ROUTE) + return; + Route &aRoute = imm->second; + int chbit = aRoute.channel; + Route bRoute(track, chbit); + int mdidx = aRoute.midiPort; + + MidiPort* mp = &midiPorts[mdidx]; + MidiDevice* md = mp->device(); + if(!md) + { + ///delete pup; + return; + } + + //if(!(md->rwFlags() & 2)) + if(!(md->rwFlags() & (gIsOutRoutingPopupMenu ? 1 : 2))) + { + ///delete pup; + return; + } + + //QString s(pup->text(n)); + //QT_TR_NOOP(md->name()) + + //Route srcRoute(s, false, -1); + + //Route aRoute(md, ch); + //Route aRoute(mdidx, ch); // p3.3.49 + //Route aRoute(mdidx, chbit); // p3.3.50 In accordance with new channel mask, use the bit position. + + //Route srcRoute(md, -1); + //Route dstRoute(track, -1); + //Route bRoute(track, ch); + //Route bRoute(track, chbit); // p3.3.50 + + //if (track->type() == Track::AUDIO_INPUT) + // srcRoute.channel = dstRoute.channel = n & 0xf; + + int chmask = 0; + iRoute iir = rl->begin(); + for (; iir != rl->end(); ++iir) + { + //if(*iir == (dst ? bRoute : aRoute)) + //if(*iir == aRoute) + if(iir->type == Route::MIDI_PORT_ROUTE && iir->midiPort == mdidx) // p3.3.50 Is there already a route to this port? + { + chmask = iir->channel; // p3.3.50 Grab the channel mask. + break; + } + } + //if (iir != rl->end()) + if ((chmask & chbit) == chbit) // p3.3.50 Is the channel's bit(s) set? + { + // disconnect + if(gIsOutRoutingPopupMenu) + { + //printf("MusE::routingPopupMenuActivated removing route src track name: %s dst device name: %s\n", track->name().latin1(), md->name().latin1()); + audio->msgRemoveRoute(bRoute, aRoute); + } + else + { + //printf("MusE::routingPopupMenuActivated removing route src device name: %s dst track name: %s\n", md->name().latin1(), track->name().latin1()); + audio->msgRemoveRoute(aRoute, bRoute); + } + } + else + { + // connect + if(gIsOutRoutingPopupMenu) + { + //printf("MusE::routingPopupMenuActivated adding route src track name: %s dst device name: %s\n", track->name().latin1(), md->name().latin1()); + audio->msgAddRoute(bRoute, aRoute); + } + else + { + //printf("MusE::routingPopupMenuActivated adding route src device name: %s dst track name: %s\n", md->name().latin1(), track->name().latin1()); + audio->msgAddRoute(aRoute, bRoute); + } + } + + //printf("MusE::routingPopupMenuActivated calling msgUpdateSoloStates\n"); + audio->msgUpdateSoloStates(); + //printf("MusE::routingPopupMenuActivated calling song->update\n"); + song->update(SC_ROUTE); + } + } + else + { + // TODO: Try to move code from AudioStrip::routingPopupMenuActivated into here. + + /* + PopupMenu* pup = getRoutingPopupMenu(); + + printf("MusE::routingPopupMenuActivated audio n:%d count:%d\n", n, pup->count()); + + if(pup->count() == 0) + return; + + AudioTrack* t = (AudioTrack*)track; + RouteList* rl = gIsOutRoutingPopupMenu ? t->outRoutes() : t->inRoutes(); + + //QPoint ppt = QCursor::pos(); + + if(n == -1) + { + //printf("MusE::routingPopupMenuActivated audio n = -1 deleting popup...\n"); + printf("MusE::routingPopupMenuActivated audio n = -1\n"); + ///delete pup; + ///pup = 0; + return; + } + else + //if(n == 0) + //{ + //printf("MusE::routingPopupMenuActivated audio n = 0 = tearOffHandle\n"); + //oR->setDown(false); + // return; + //} + //else + { + if(gIsOutRoutingPopupMenu) + { + QString s(pup->text(n)); + + //printf("AudioStrip::routingPopupMenuActivated audio text:%s\n", s.latin1()); + + if(track->type() == Track::AUDIO_OUTPUT) + { + ///delete orpup; + + int chan = n & 0xf; + + //Route srcRoute(t, -1); + //Route srcRoute(t, chan, chans); + //Route srcRoute(t, chan, 1); + Route srcRoute(t, chan); + + //Route dstRoute(s, true, -1); + Route dstRoute(s, true, -1, Route::JACK_ROUTE); + //Route dstRoute(s, true, 0, Route::JACK_ROUTE); + + //srcRoute.channel = dstRoute.channel = chan; + dstRoute.channel = chan; + //dstRoute.channels = 1; + + // check if route src->dst exists: + iRoute irl = rl->begin(); + for (; irl != rl->end(); ++irl) { + if (*irl == dstRoute) + break; + } + if (irl != rl->end()) { + // disconnect if route exists + audio->msgRemoveRoute(srcRoute, dstRoute); + } + else { + // connect if route does not exist + audio->msgAddRoute(srcRoute, dstRoute); + } + audio->msgUpdateSoloStates(); + song->update(SC_ROUTE); + + // p3.3.47 + //pup->popup(ppt, 0); + + //oR->setDown(false); + return; + + // p3.3.46 + ///goto _redisplay; + } + + iRouteMenuMap imm = gRoutingMenuMap.find(n); + if(imm == gRoutingMenuMap.end()) + { + ///delete orpup; + //oR->setDown(false); // orpup->exec() catches mouse release event + return; + } + + //int chan = n >> 16; + //int chans = (chan >> 15) + 1; // Bit 31 MSB: Mono or stereo. + //chan &= 0xffff; + //int chan = imm->second.channel; + //int chans = imm->second.channels; + + //Route srcRoute(t, -1); + //srcRoute.remoteChannel = chan; + //Route srcRoute(t, chan, chans); + Route srcRoute(t, imm->second.channel, imm->second.channels); + //Route srcRoute(t, imm->second.channel); + srcRoute.remoteChannel = imm->second.remoteChannel; + + //Route dstRoute(s, true, -1); + //Route dstRoute(s, true, -1, Route::TRACK_ROUTE); + Route &dstRoute = imm->second; + + // check if route src->dst exists: + iRoute irl = rl->begin(); + for (; irl != rl->end(); ++irl) { + if (*irl == dstRoute) + break; + } + if (irl != rl->end()) { + // disconnect if route exists + audio->msgRemoveRoute(srcRoute, dstRoute); + } + else { + // connect if route does not exist + audio->msgAddRoute(srcRoute, dstRoute); + } + audio->msgUpdateSoloStates(); + song->update(SC_ROUTE); + + // p3.3.46 + //oR->setDown(false); + ///goto _redisplay; + + // p3.3.47 + //pup->popup(ppt, 0); + } + else + { + QString s(pup->text(n)); + + if(track->type() == Track::AUDIO_INPUT) + { + ///delete pup; + int chan = n & 0xf; + + Route srcRoute(s, false, -1, Route::JACK_ROUTE); + Route dstRoute(t, chan); + + srcRoute.channel = chan; + + iRoute irl = rl->begin(); + for(; irl != rl->end(); ++irl) + { + if(*irl == srcRoute) + break; + } + if(irl != rl->end()) + // disconnect + audio->msgRemoveRoute(srcRoute, dstRoute); + else + // connect + audio->msgAddRoute(srcRoute, dstRoute); + + audio->msgUpdateSoloStates(); + song->update(SC_ROUTE); + //iR->setDown(false); // pup->exec() catches mouse release event + return; + + // p3.3.46 + ///goto _redisplay; + } + + iRouteMenuMap imm = gRoutingMenuMap.find(n); + if(imm == gRoutingMenuMap.end()) + { + //delete pup; + //iR->setDown(false); // pup->exec() catches mouse release event + return; + } + + //int chan = n >> 16; + //int chans = (chan >> 15) + 1; // Bit 31 MSB: Mono or stereo. + //chan &= 0xffff; + //int chan = imm->second.channel; + //int chans = imm->second.channels; + + //Route srcRoute(s, false, -1); + //Route srcRoute(s, false, -1, Route::TRACK_ROUTE); + Route &srcRoute = imm->second; + + //Route dstRoute(t, -1); + //Route dstRoute(t, chan, chans); + Route dstRoute(t, imm->second.channel, imm->second.channels); + //Route dstRoute(t, imm->second.channel); + dstRoute.remoteChannel = imm->second.remoteChannel; + + iRoute irl = rl->begin(); + for (; irl != rl->end(); ++irl) { + if (*irl == srcRoute) + break; + } + if (irl != rl->end()) { + // disconnect + audio->msgRemoveRoute(srcRoute, dstRoute); + } + else { + // connect + audio->msgAddRoute(srcRoute, dstRoute); + } + audio->msgUpdateSoloStates(); + song->update(SC_ROUTE); + + // p3.3.46 + //iR->setDown(false); + ///goto _redisplay; + + + + + } + + } + */ + + } + //else + //{ + //} + + ///delete pup; + //oR->setDown(false); +} + +//--------------------------------------------------------- +// routingPopupMenuAboutToHide +//--------------------------------------------------------- + +void MusE::routingPopupMenuAboutToHide() +{ + // p3.3.47 + //printf("MusE::routingPopupMenuAboutToHide\n"); + //if(track) + // printf("%s", track->name().latin1()); + //printf("\n"); + + // Hmm, can't do this? Sub-menus stay open with this. Re-arranged, testing... Nope. + //PopupMenu* pup = muse->getRoutingPopupMenu(); + //pup->disconnect(); + //pup->clear(); + + // p4.0.1 Removed. IIRC These lines were not strictly necessary in muse-1, + // and here in muse-2 we reverted back to regular Q3PopupMenu behaviour for now, + // which is self-extinguishing, so these lines cannot be enabled - + // gRoutingPopupMenuMaster and gRoutingMenuMap are required for routingPopupMenuActivated(). + //gRoutingMenuMap.clear(); + //gRoutingPopupMenuMaster = 0; +} + +//--------------------------------------------------------- +// prepareRoutingPopupMenu +//--------------------------------------------------------- + +PopupMenu* MusE::prepareRoutingPopupMenu(Track* track, bool dst) +{ + if(!track) + return 0; + + //QPoint ppt = QCursor::pos(); + + if(track->isMidiTrack()) + { + + //QPoint ppt = parent->rect().bottomLeft(); + + //if(dst) + //{ + // TODO + + //} + //else + //{ + RouteList* rl = dst ? track->outRoutes() : track->inRoutes(); + //Route dst(track, -1); + + ///QPopupMenu* pup = new QPopupMenu(parent); + + PopupMenu* pup = getRoutingPopupMenu(); + pup->disconnect(); + //connect(pup, SIGNAL(activated(int)), SLOT(routingPopupMenuActivated(int))); + //connect(pup, SIGNAL(aboutToHide()), SLOT(routingPopupMenuAboutToHide())); + + pup->setCheckable(true); + + int gid = 0; + //int n; + + // Routes can't be re-read until the message sent from msgAddRoute1() + // has had time to be sent and actually affected the routes. + ///_redisplay: + + pup->clear(); + gRoutingMenuMap.clear(); + gid = 0; + + //MidiInPortList* tl = song->midiInPorts(); + //for(iMidiInPort i = tl->begin();i != tl->end(); ++i) + for(int i = 0; i < MIDI_PORTS; ++i) + { + //MidiInPort* track = *i; + // NOTE: Could possibly list all devices, bypassing ports, but no, let's stick with ports. + MidiPort* mp = &midiPorts[i]; + MidiDevice* md = mp->device(); + if(!md) + continue; + + if(!(md->rwFlags() & (dst ? 1 : 2))) + continue; + + //printf("MusE::prepareRoutingPopupMenu adding submenu portnum:%d\n", i); + + //QMenu* m = menu->addMenu(track->name()); + //QPopupMenu* subp = new QPopupMenu(parent); + //PopupMenu* subp = new PopupMenu(this); + PopupMenu* subp = new PopupMenu(); + connect(subp, SIGNAL(activated(int)), pup, SIGNAL(activated(int))); + //connect(subp, SIGNAL(aboutToHide()), pup, SIGNAL(aboutToHide())); + + int chanmask = 0; + // p3.3.50 To reduce number of routes required, from one per channel to just one containing a channel mask. + // Look for the first route to this midi port. There should always be only a single route for each midi port, now. + for(iRoute ir = rl->begin(); ir != rl->end(); ++ir) + { + if(ir->type == Route::MIDI_PORT_ROUTE && ir->midiPort == i) + { + // We have a route to the midi port. Grab the channel mask. + chanmask = ir->channel; + break; + } + } + + for(int ch = 0; ch < MIDI_CHANNELS; ++ch) + { + //QAction* a = m->addAction(QString("Channel %1").arg(ch+1)); + //subp->insertItem(QT_TR_NOOP(QString("Channel %1").arg(ch+1)), i * MIDI_CHANNELS + ch); + gid = i * MIDI_CHANNELS + ch; + + //printf("MusE::prepareRoutingPopupMenu inserting gid:%d\n", gid); + + subp->insertItem(QString("Channel %1").arg(ch+1), gid); + //a->setCheckable(true); + //Route src(track, ch, RouteNode::TRACK); + //Route src(md, ch); + //Route r = Route(src, dst); + //a->setData(QVariant::fromValue(r)); + //a->setChecked(rl->indexOf(r) != -1); + + //Route srcRoute(md, ch); + //Route srcRoute(i, ch); // p3.3.49 New: Midi port route. + int chbit = 1 << ch; + Route srcRoute(i, chbit); // p3.3.50 In accordance with new channel mask, use the bit position. + + gRoutingMenuMap.insert( pRouteMenuMap(gid, srcRoute) ); + + //for(iRoute ir = rl->begin(); ir != rl->end(); ++ir) // p3.3.50 Removed. + //{ + //if(*ir == dst) + // if(*ir == srcRoute) + // { + // subp->setItemChecked(id, true); + // break; + // } + //} + if(chanmask & chbit) // p3.3.50 Is the channel already set? Show item check mark. + subp->setItemChecked(gid, true); + } + //subp->insertItem(QString("Toggle all"), 1000+i); + // p3.3.50 One route with all channel bits set. + gid = MIDI_PORTS * MIDI_CHANNELS + i; // Make sure each 'toggle' item gets a unique id. + subp->insertItem(QString("Toggle all"), gid); + Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. + gRoutingMenuMap.insert( pRouteMenuMap(gid, togRoute) ); + + pup->insertItem(QT_TR_NOOP(md->name()), subp); + } + + /* + QPopupMenu* pup = new QPopupMenu(iR); + pup->setCheckable(true); + //MidiTrack* t = (MidiTrack*)track; + RouteList* irl = track->inRoutes(); + + MidiTrack* t = (MidiTrack*)track; + int gid = 0; + for (int i = 0; i < channel; ++i) + { + char buffer[128]; + snprintf(buffer, 128, "%s %d", tr("Channel").latin1(), i+1); + MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); + pup->insertItem(titel); + + if (!checkAudioDevice()) return; + std::list ol = audioDevice->outputPorts(); + for (std::list::iterator ip = ol.begin(); ip != ol.end(); ++ip) { + int id = pup->insertItem(*ip, (gid * 16) + i); + Route dst(*ip, true, i); + ++gid; + for (iRoute ir = irl->begin(); ir != irl->end(); ++ir) { + if (*ir == dst) { + pup->setItemChecked(id, true); + break; + } + } + } + if (i+1 != channel) + pup->insertSeparator(); + } + */ + + if(pup->count() == 0) + { + ///delete pup; + gRoutingPopupMenuMaster = 0; + //pup->clear(); + //pup->disconnect(); + gRoutingMenuMap.clear(); + //oR->setDown(false); + return 0; + } + + gIsOutRoutingPopupMenu = dst; + return pup; + } + + return 0; +} + //--------------------------------------------------------- // saveAs //--------------------------------------------------------- @@ -1925,7 +2702,7 @@ bool MusE::saveAs() static void printVersion(const char* prog) { - fprintf(stderr, "%s: Linux Music Editor; Version %s\n", prog, VERSION); + fprintf(stderr, "%s: Linux Music Editor; Version %s, (svn revision %s)\n", prog, VERSION, SVNVERSION); } //--------------------------------------------------------- @@ -2269,6 +3046,11 @@ void MusE::kbAccel(int key) song->setRecord(!song->record()); } } + else if (key == shortcuts[SHRT_REC_CLEAR].key) { + if (!audio->isPlaying()) { + song->clearTrackRec(); + } + } else if (key == shortcuts[SHRT_OPEN_TRANSPORT].key) { toggleTransport(); } @@ -2328,7 +3110,14 @@ class MuseApplication : public QApplication { globalKeyState = ke->stateAfter(); bool accepted = ke->isAccepted(); if (!accepted) { - muse->kbAccel(ke->key()); + int key = ke->key(); + if (ke->state() & Qt::ShiftModifier) + key += Qt::SHIFT; + if (ke->state() & Qt::AltModifier) + key += Qt::ALT; + if (ke->state() & Qt::ControlModifier) + key+= Qt::CTRL; + muse->kbAccel(key); return true; } } @@ -2367,7 +3156,7 @@ static void usage(const char* prog, const char* txt) fprintf(stderr, " -a no audio\n"); //fprintf(stderr, " -P n set real time priority to n (default: 50)\n"); fprintf(stderr, " -P n set audio driver real time priority to n (Dummy only, default 40. Else fixed by Jack.)\n"); - fprintf(stderr, " -Y n force midi real time priority to n (default: audio driver prio +1)\n"); + fprintf(stderr, " -Y n force midi real time priority to n (default: audio driver prio +2)\n"); fprintf(stderr, " -p don't load LADSPA plugins\n"); #ifdef ENABLE_PYTHON fprintf(stderr, " -y enable Python control support\n"); @@ -2438,13 +3227,26 @@ int main(int argc, char* argv[]) museGlobal = p; if (museGlobal.isEmpty()) { - QString museGlobal(INSTPREFIX); - museGlobalLib = museGlobal + "/lib/muse"; - museGlobalShare = museGlobal + "/share/muse"; + //QString museGlobal(INSTPREFIX); + //QString museGlobalLibDir(INSTLIBDIR); + //QString museGlobalLibDir(LIBINSTPREFIX); // This has no prefix. + //museGlobalLib = museGlobalLibDir + "/muse"; + //museGlobalShare = museGlobal + "/share/muse"; + + // p4.0.7 + museGlobalLib = QString(INSTPREFIX) + QString("/") + + QString(LIBINSTPREFIX) + QString("/") + + QString(INSTALL_NAME); + //museGlobalShare = museGlobal + QString("/share/") + QString(INSTALL_NAME); + museGlobalShare = QString(INSTPREFIX) + QString("/") + + QString(SHAREINSTPREFIX) + QString("/") + // This has no prefix. Default is "share", set in top cmake script. + QString(INSTALL_NAME); } else { - museGlobalLib = museGlobal + "/lib"; - museGlobalShare = museGlobal + "/share"; + //museGlobalLib = museGlobal + "/lib"; + //museGlobalShare = museGlobal + "/share"; + museGlobalLib = museGlobal + QString("/") + QString(LIBINSTPREFIX); // p4.0.7 + museGlobalShare = museGlobal + QString("/") + QString(SHAREINSTPREFIX); } museProject = museProjectInitPath; //getcwd(0, 0); configName = QString(getenv("HOME")) + QString("/.MusE"); @@ -2578,6 +3380,7 @@ int main(int argc, char* argv[]) else realTimeScheduling = audioDevice->isRealtime(); + useJackTransport.setValue(true); // setup the prefetch fifo length now that the segmentSize is known // Changed by Tim. p3.3.17 // Changed to 4 *, JUST FOR TEST!!! @@ -2625,10 +3428,13 @@ int main(int argc, char* argv[]) if(loadDSSI) initDSSI(); + // p3.3.39 + initOSC(); + initIcons(); initMetronome(); - QApplication::clipboard()->setSelectionMode(false); + //QApplication::clipboard()->setSelectionMode(false); ddskrjo QApplication::addLibraryPath(museGlobalLib + "/qtplugins"); if (debugMsg) { @@ -2671,7 +3477,15 @@ int main(int argc, char* argv[]) } #endif /* HAVE_LASH */ QTimer::singleShot(100, muse, SLOT(showDidYouKnowDialog())); + return app.exec(); + // p3.3.47 + //int rv = app.exec(); + // FIXME: Can't do, seg fault at MarkerView::~MarkerView() + // due to already deleted undoRedo. + //delete muse; + //return rv; + } #if 0 @@ -2735,6 +3549,12 @@ void MusE::cmd(int cmd) 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: song->startUndo(); if (song->msgRemoveParts()) { @@ -2821,7 +3641,7 @@ void MusE::cmd(int cmd) void MusE::clipboardChanged() { - QCString subtype("partlist"); + Q3CString subtype("partlist"); QMimeSource* ms = QApplication::clipboard()->data(QClipboard::Clipboard); if (ms == 0) return; @@ -2837,6 +3657,7 @@ void MusE::clipboardChanged() } } menuEdit->setItemEnabled(CMD_PASTE, flag); + menuEdit->setItemEnabled(CMD_INSERT, flag); menuEdit->setItemEnabled(CMD_PASTE_CLONE, flag); menuEdit->setItemEnabled(CMD_PASTE_TO_TRACK, flag); menuEdit->setItemEnabled(CMD_PASTE_CLONE_TO_TRACK, flag); @@ -2995,7 +3816,7 @@ void MusE::configAppearance() void MusE::loadTheme(QString s) { - if (style().name() != s) + if (style()->name() != s) QApplication::setStyle(s); } @@ -3688,7 +4509,7 @@ void MusE::updateConfiguration() menu_file->setAccel(shortcuts[SHRT_IMPORT_AUDIO].key, menu_ids[CMD_IMPORT_AUDIO]); menu_file->setAccel(shortcuts[SHRT_QUIT].key, menu_ids[CMD_QUIT]); - menuEdit->setAccel(Key_Delete, CMD_DELETE); + menuEdit->setAccel(Qt::Key_Delete, CMD_DELETE); menuEdit->setAccel(shortcuts[SHRT_OPEN_DRUMS].key, menu_ids[CMD_OPEN_DRUMS]); menuEdit->setAccel(shortcuts[SHRT_OPEN_LIST].key, menu_ids[CMD_OPEN_LIST]); menuEdit->setAccel(shortcuts[SHRT_OPEN_WAVE].key, menu_ids[CMD_OPEN_WAVE]); @@ -3874,7 +4695,9 @@ void MusE::toggleMixer() void MusE::toggleMixer1() { - showMixer1(!menuView->isItemChecked(aid1a)); + printf("toggle mixer1\n"); + //showMixer1(!menuView->isItemChecked(aid1a)); + showMixer1(true); } //--------------------------------------------------------- @@ -3938,7 +4761,7 @@ void MusE::focusInEvent(QFocusEvent* ev) if (mixer2) mixer2->raise(); raise(); - QMainWindow::focusInEvent(ev); + Q3MainWindow::focusInEvent(ev); } //--------------------------------------------------------- diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 3e0d36a6..b3dd701a 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -11,11 +11,13 @@ #include "config.h" -#include +//#include +#include #include //Added by qt3to4: #include -#include +//#include +#include #include #include #include "cobject.h" @@ -24,8 +26,8 @@ class Part; class PartList; -class Q3ToolBar; -class Q3PopupMenu; +class QToolBar; +class QMenu; class Transport; class BigTime; class Arranger; @@ -69,7 +71,7 @@ class EditInstrument; // MusE //--------------------------------------------------------- -class MusE : public Q3MainWindow +class MusE : public QMainWindow { Q_OBJECT enum {CMD_CUT, CMD_COPY, CMD_PASTE, CMD_INSERT, CMD_INSERTMEAS, CMD_PASTE_CLONE, @@ -95,22 +97,22 @@ class MusE : public Q3MainWindow CMD_LAST }; int menu_ids[CMD_LAST]; - Q3Action *fileSaveAction, *fileOpenAction, *pianoAction, *fileNewAction, /* *markerAction,*/ *testAction; + QAction *fileSaveAction, *fileOpenAction, *pianoAction, *fileNewAction, /* *markerAction,*/ *testAction; QString appName; QFileInfo project; - Q3ToolBar *tools; + QToolBar *tools; EditToolBar *tools1; Transport* transport; BigTime* bigtime; EditInstrument* editInstrument; - Q3PopupMenu *menu_file, *menuView, *menuSettings, *menu_help; - Q3PopupMenu *menuEdit, *menuStructure; - Q3PopupMenu* menu_audio, *menuAutomation; - Q3PopupMenu* menu_functions, *menuScriptPlugins; - Q3PopupMenu* select, *master, *midiEdit, *addTrack; + QMenu *menu_file, *menuView, *menuSettings, *menu_help; + QMenu *menuEdit, *menuStructure; + QMenu* menu_audio, *menuAutomation; + QMenu* menu_functions, *menuScriptPlugins; + QMenu* select, *master, *midiEdit, *addTrack; // Special 'stay-open' menu for routes. PopupMenu* routingPopupMenu; @@ -118,9 +120,9 @@ class MusE : public Q3MainWindow int aid1a, aid1b, aid2, aid3, autoId; int tr_id, bt_id, mr_id; int cc_id; - Q3PopupMenu* follow; + QMenu* follow; int fid0, fid1, fid2; - Q3PopupMenu* midiInputPlugins; + QMenu* midiInputPlugins; int mpid0, mpid1, mpid2, mpid3, mpid4; QWidget* midiPortConfig; @@ -143,7 +145,7 @@ class MusE : public Q3MainWindow ClipListEdit* clipListEdit; MarkerView* markerView; MidiTransformerDialog* midiTransformerDialog; - Q3PopupMenu* openRecent; + QMenu* openRecent; bool readMidi(FILE*); void read(Xml& xml, bool skipConfig); diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 201d0c4b..e47653d5 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -5,11 +5,11 @@ //========================================================= #include -#include +#include #include #include #include -#include +#include #include #include #include @@ -645,7 +645,7 @@ void Appearance::addToPaletteClicked() { if (!color) return; - Q3Button* button = (Q3Button*)aPalette->selected(); // ddskrjo + QAbstractButton* button = (QAbstractButton*)aPalette->selected(); // ddskrjo int r, g, b; QColor c; if (button) { @@ -661,7 +661,7 @@ void Appearance::addToPaletteClicked() // found empty slot aPalette->setButton(i); //aPalette->moveFocus(i); ddskrjo - button = (Q3Button*)aPalette->find(i); // ddskrjo + button = (QAbstractButton*)aPalette->find(i); // ddskrjo break; } } @@ -682,7 +682,7 @@ void Appearance::paletteClicked(int id) { if (!color) return; - Q3Button* button = (Q3Button*)aPalette->find(id); // ddskrjo + QAbstractButton* button = (QAbstractButton*)aPalette->find(id); // ddskrjo if (button) { QColor c = button->paletteBackgroundColor(); int r, g, b; diff --git a/muse2/muse/arranger/alayout.h b/muse2/muse/arranger/alayout.h index 1a1d5ee2..225a416f 100644 --- a/muse2/muse/arranger/alayout.h +++ b/muse2/muse/arranger/alayout.h @@ -9,7 +9,7 @@ #define __ALAYOUT_H__ #include -#include +#include class QScrollBar; class WidgetStack; diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index d25911cd..386267e2 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -13,12 +13,13 @@ #include #include #include -#include +#include #include -#include +//#include #include -#include -#include +//#include +//#include +#include #include #include #include @@ -26,15 +27,16 @@ #include #include #include -#include +//#include +#include #include #include //Added by qt3to4: #include #include -#include +#include #include -#include +#include #include #include "arranger.h" @@ -92,7 +94,7 @@ QString TWhatsThis::text(const QPoint& pos) // is the central widget in app //--------------------------------------------------------- -Arranger::Arranger(Q3MainWindow* parent, const char* name) +Arranger::Arranger(QMainWindow* parent, const char* name) : QWidget(parent, name) { _raster = 0; // measure @@ -111,42 +113,59 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) // create toolbar in toplevel widget //--------------------------------------------------- - Q3ToolBar* toolbar = new Q3ToolBar(tr("Arranger"), parent); - - QLabel* label = new QLabel(tr("Cursor"), toolbar, "Cursor"); + // FIXME - Orcan: This toolbar needs a hand + //QToolBar* toolbar = new QToolBar(tr("Arranger"), parent); + parent->addToolBarBreak(); + QToolBar* toolbar = parent->addToolBar(tr("Arranger")); + + //QLabel* label = new QLabel(tr("Cursor"), toolbar, "Cursor"); + QLabel* label = new QLabel(tr("Cursor")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - cursorPos = new PosLabel(toolbar); + toolbar->addWidget(label); + //cursorPos = new PosLabel(toolbar); + cursorPos = new PosLabel(0); cursorPos->setEnabled(false); + cursorPos->setFixedHeight(22); + toolbar->addWidget(cursorPos); const char* rastval[] = { QT_TR_NOOP("Off"), QT_TR_NOOP("Bar"), "1/2", "1/4", "1/8", "1/16" }; - label = new QLabel(tr("Snap"), toolbar, "Snap"); + //label = new QLabel(tr("Snap"), toolbar, "Snap"); + label = new QLabel(tr("Snap")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - QComboBox* raster = new QComboBox(toolbar); + toolbar->addWidget(label); + //QComboBox* raster = new QComboBox(toolbar); + QComboBox* raster = new QComboBox(); for (int i = 0; i < 6; i++) raster->insertItem(tr(rastval[i]), i); raster->setCurrentItem(1); connect(raster, SIGNAL(activated(int)), SLOT(_setRaster(int))); raster->setFocusPolicy(Qt::NoFocus); + toolbar->addWidget(raster); // Song len - label = new QLabel(tr("Len"), toolbar, "Len"); + //label = new QLabel(tr("Len"), toolbar, "Len"); + label = new QLabel(tr("Len")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); + toolbar->addWidget(label); // song length is limited to 10000 bars; the real song len is limited // by overflows in tick computations // - lenEntry = new SpinBox(1, 10000, 1, toolbar); + //lenEntry = new SpinBox(1, 10000, 1, toolbar); + lenEntry = new SpinBox(1, 10000, 1); lenEntry->setValue(song->len()); connect(lenEntry, SIGNAL(valueChanged(int)), SLOT(songlenChanged(int))); QToolTip::add(lenEntry, tr("song length - bars")); Q3WhatsThis::add(lenEntry, tr("song length - bars")); + toolbar->addWidget(lenEntry); - typeBox = new LabelCombo(tr("Type"), toolbar); + //typeBox = new LabelCombo(tr("Type"), toolbar); + typeBox = new LabelCombo(tr("Type"), 0); typeBox->insertItem(tr("NO"), 0); typeBox->insertItem(tr("GM"), 1); typeBox->insertItem(tr("GS"), 2); @@ -156,35 +175,52 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) QToolTip::add(typeBox, tr("midi song type")); Q3WhatsThis::add(typeBox, tr("midi song type")); typeBox->setFocusPolicy(Qt::NoFocus); + toolbar->addWidget(typeBox); - label = new QLabel(tr("Pitch"), toolbar, "Pitch"); + //label = new QLabel(tr("Pitch"), toolbar, "Pitch"); + label = new QLabel(tr("Pitch")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - globalPitchSpinBox = new SpinBox(-127, 127, 1, toolbar); + toolbar->addWidget(label); + //globalPitchSpinBox = new SpinBox(-127, 127, 1, toolbar); + globalPitchSpinBox = new SpinBox(-127, 127, 1); globalPitchSpinBox->setValue(song->globalPitchShift()); QToolTip::add(globalPitchSpinBox, tr("midi pitch")); Q3WhatsThis::add(globalPitchSpinBox, tr("global midi pitch shift")); connect(globalPitchSpinBox, SIGNAL(valueChanged(int)), SLOT(globalPitchChanged(int))); - label = new QLabel(tr("Tempo"), toolbar, "Tempo"); + toolbar->addWidget(globalPitchSpinBox); + //label = new QLabel(tr("Tempo"), toolbar, "Tempo"); + label = new QLabel(tr("Tempo")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); + toolbar->addWidget(label); + globalTempoSpinBox = new SpinBox(50, 200, 1, toolbar); globalTempoSpinBox->setSuffix(QString("%")); globalTempoSpinBox->setValue(tempomap.globalTempo()); QToolTip::add(globalTempoSpinBox, tr("midi tempo")); Q3WhatsThis::add(globalTempoSpinBox, tr("midi tempo")); connect(globalTempoSpinBox, SIGNAL(valueChanged(int)), SLOT(globalTempoChanged(int))); - QToolButton* tempo50 = new QToolButton(toolbar, "tempo50"); + toolbar->addWidget(globalTempoSpinBox); + + //QToolButton* tempo50 = new QToolButton(toolbar, "tempo50"); + QToolButton* tempo50 = new QToolButton(); tempo50->setText(QString("50%")); connect(tempo50, SIGNAL(clicked()), SLOT(setTempo50())); - QToolButton* tempo100 = new QToolButton(toolbar, "tempo100"); + toolbar->addWidget(tempo50); + //QToolButton* tempo100 = new QToolButton(toolbar, "tempo100"); + QToolButton* tempo100 = new QToolButton(); tempo100->setText(tr("N")); connect(tempo100, SIGNAL(clicked()), SLOT(setTempo100())); - QToolButton* tempo200 = new QToolButton(toolbar, "tempo200"); + toolbar->addWidget(tempo100); + //QToolButton* tempo200 = new QToolButton(toolbar, "tempo200"); + QToolButton* tempo200 = new QToolButton(); tempo200->setText(QString("200%")); connect(tempo200, SIGNAL(clicked()), SLOT(setTempo200())); + toolbar->addWidget(tempo200); + //parent->addToolBar(toolbar); - Q3VBoxLayout* box = new Q3VBoxLayout(this); + QVBoxLayout* box = new QVBoxLayout(this); box->addWidget(hLine(this), Qt::AlignTop); //--------------------------------------------------- @@ -307,7 +343,7 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) vallist.append(tgrid->maximumSize().width()); split->setSizes(vallist); - Q3GridLayout* egrid = new Q3GridLayout(editor); + QGridLayout* egrid = new QGridLayout(editor); egrid->setColStretch(0, 50); egrid->setRowStretch(2, 50); diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h index b96a5602..a5ca269d 100644 --- a/muse2/muse/arranger/arranger.h +++ b/muse2/muse/arranger/arranger.h @@ -22,7 +22,7 @@ #include "mtrackinfobase.h" #include "trackautomationview.h" -class Q3MainWindow; +class QMainWindow; class QToolButton; class Header; class TList; @@ -204,7 +204,7 @@ class Arranger : public QWidget { enum { CMD_CUT_PART, CMD_COPY_PART, CMD_PASTE_PART, CMD_PASTE_CLONE_PART, CMD_PASTE_PART_TO_TRACK, CMD_PASTE_CLONE_PART_TO_TRACK, CMD_INSERT_PART, CMD_INSERT_EMPTYMEAS }; - Arranger(Q3MainWindow* parent, const char* name = 0); + Arranger(QMainWindow* parent, const char* name = 0); void setMode(int); void reset(); diff --git a/muse2/muse/arranger/trackinfo.cpp b/muse2/muse/arranger/trackinfo.cpp index a6bf0a4e..382ef1e0 100644 --- a/muse2/muse/arranger/trackinfo.cpp +++ b/muse2/muse/arranger/trackinfo.cpp @@ -11,10 +11,10 @@ #include #include #include -#include +//#include #include #include -#include +//#include #include #include //Added by qt3to4: diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index bf7d7e98..c7acc11c 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -9,6 +9,9 @@ #include "cobject.h" #include "xml.h" +const int ICON_WIDTH = 18; +const QSize ICON_SIZE(ICON_WIDTH, ICON_WIDTH); + //--------------------------------------------------------- // readStatus //--------------------------------------------------------- @@ -56,7 +59,10 @@ void TopWin::writeStatus(int level, Xml& xml) const } TopWin::TopWin(QWidget* parent, const char* name, - Qt::WFlags f) : Q3MainWindow(parent, name, f) + Qt::WFlags f) : QMainWindow(parent, name, f) { + // Allow multiple rows. Tim. + //setDockNestingEnabled(true); + setIconSize(ICON_SIZE); } diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 15c687fc..416c0974 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -11,7 +11,8 @@ #include "config.h" -#include +//#include +#include #include class Xml; @@ -20,7 +21,7 @@ class Xml; // TopWin //--------------------------------------------------------- -class TopWin : public Q3MainWindow +class TopWin : public QMainWindow { Q_OBJECT diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index c3552bd9..2f55a4a0 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index 422de8cd..bbc6924f 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include //Added by qt3to4: #include #include diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp index 4e57cafd..0f89f801 100644 --- a/muse2/muse/globals.cpp +++ b/muse2/muse/globals.cpp @@ -9,7 +9,7 @@ #include #include //Added by qt3to4: -#include +#include #include #include #include @@ -301,20 +301,20 @@ int midiFilterCtrl2 = 0; int midiFilterCtrl3 = 0; int midiFilterCtrl4 = 0; -Q3ActionGroup* undoRedo; -Q3Action* undoAction; -Q3Action* redoAction; -Q3ActionGroup* transportAction; -Q3Action* playAction; -Q3Action* startAction; -Q3Action* stopAction; -Q3Action* rewindAction; -Q3Action* forwardAction; -Q3Action* loopAction; -Q3Action* punchinAction; -Q3Action* punchoutAction; -Q3Action* recordAction; -Q3Action* panicAction; +QActionGroup* undoRedo; +QAction* undoAction; +QAction* redoAction; +QActionGroup* transportAction; +QAction* playAction; +QAction* startAction; +QAction* stopAction; +QAction* rewindAction; +QAction* forwardAction; +QAction* loopAction; +QAction* punchinAction; +QAction* punchoutAction; +QAction* recordAction; +QAction* panicAction; //AudioMixerApp* audioMixer; MusE* muse; diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h index d7e3ac70..3901226a 100644 --- a/muse2/muse/globals.h +++ b/muse2/muse/globals.h @@ -14,7 +14,7 @@ //#include //#include //Added by qt3to4: -#include +#include #include //#include #include "value.h" @@ -26,7 +26,7 @@ class QString; class QFont; class QAction; -class Q3ActionGroup; +class QActionGroup; class QStringList; extern const float denormalBias; @@ -128,21 +128,21 @@ extern int midiFilterCtrl4; #define CMD_RANGE_SELECTED 1 #define CMD_RANGE_LOOP 2 -extern Q3ActionGroup* undoRedo; -extern Q3Action* undoAction; -extern Q3Action* redoAction; - -extern Q3ActionGroup* transportAction; -extern Q3Action* playAction; -extern Q3Action* startAction; -extern Q3Action* stopAction; -extern Q3Action* rewindAction; -extern Q3Action* forwardAction; -extern Q3Action* loopAction; -extern Q3Action* punchinAction; -extern Q3Action* punchoutAction; -extern Q3Action* recordAction; -extern Q3Action* panicAction; +extern QActionGroup* undoRedo; +extern QAction* undoAction; +extern QAction* redoAction; + +extern QActionGroup* transportAction; +extern QAction* playAction; +extern QAction* startAction; +extern QAction* stopAction; +extern QAction* rewindAction; +extern QAction* forwardAction; +extern QAction* loopAction; +extern QAction* punchinAction; +extern QAction* punchoutAction; +extern QAction* recordAction; +extern QAction* panicAction; //class AudioMixerApp; class MusE; diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index ef084440..5681231b 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -19,10 +19,10 @@ #include #include //Added by qt3to4: -#include -#include -#include -#include +#include +#include +#include +#include #include "song.h" #include "event.h" @@ -159,15 +159,15 @@ Event EditPAfterDialog::getEvent(int tick, const Event& event, QWidget* parent) EditEventDialog::EditEventDialog(QWidget* parent, const char* name) : QDialog(parent, name, true) { - Q3VBoxLayout* xlayout = new Q3VBoxLayout(this); - layout1 = new Q3GridLayout(this); // ddskrjo this + QVBoxLayout* xlayout = new QVBoxLayout(this); + layout1 = new QGridLayout(this); // ddskrjo this xlayout->addLayout(layout1); //--------------------------------------------------- // Ok, Cancel //--------------------------------------------------- - Q3BoxLayout* w5 = new Q3HBoxLayout(this); // ddskrjo this + QBoxLayout* w5 = new QHBoxLayout(this); // ddskrjo this xlayout->addLayout(w5); QPushButton* okB = new QPushButton(tr("Ok"), this); okB->setDefault(true); @@ -296,7 +296,7 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev, il2->setDark(); typeLabel = new QLabel(this); typeLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); - Q3HBoxLayout* typeLayout = new Q3HBoxLayout(this); + QHBoxLayout* typeLayout = new QHBoxLayout(this); typeLayout->addWidget(il2); typeLayout->addWidget(typeLabel); typeLayout->addStretch(); diff --git a/muse2/muse/liste/editevent.h b/muse2/muse/liste/editevent.h index 769ba256..7c0b431c 100644 --- a/muse2/muse/liste/editevent.h +++ b/muse2/muse/liste/editevent.h @@ -11,7 +11,7 @@ #include //Added by qt3to4: #include -#include +#include #include #include "editnotedialogbase.h" @@ -22,7 +22,7 @@ class PosEdit; class IntLabel; class PitchEdit; -class Q3GridLayout; +class QGridLayout; class Q3MultiLineEdit; class QRadioButton; class PosEdit; @@ -37,7 +37,7 @@ class EditEventDialog : public QDialog { Q_OBJECT protected: - Q3GridLayout* layout1; + QGridLayout* layout1; public: EditEventDialog(QWidget* parent=0, const char* name=0); @@ -70,7 +70,7 @@ class EditSysexDialog : public EditSysexDialogBase { int len; protected: - Q3GridLayout* layout; + QGridLayout* layout; private slots: virtual void accept(); @@ -106,7 +106,7 @@ class EditCtrlDialog : public EditCtrlBase { void instrPopup(); protected: - Q3GridLayout* layout; + QGridLayout* layout; public: @@ -133,7 +133,7 @@ class EditMetaDialog : public EditEventDialog { QLabel* typeLabel; protected: - Q3GridLayout* layout; + QGridLayout* layout; private slots: virtual void accept(); @@ -160,7 +160,7 @@ class EditCAfterDialog : public EditEventDialog { IntLabel* il2; protected: - Q3GridLayout* layout; + QGridLayout* layout; public: EditCAfterDialog(int tick, const Event&, @@ -182,7 +182,7 @@ class EditPAfterDialog : public EditEventDialog { IntLabel* il2; protected: - Q3GridLayout* layout; + QGridLayout* layout; public: EditPAfterDialog(int tick, const Event&, diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 31573571..c081b68d 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -5,7 +5,8 @@ // (C) Copyright 1999 Werner Schweer (ws@seh.de) //========================================================= -#include +//#include +#include #include #include #include @@ -14,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -25,7 +26,7 @@ #include //Added by qt3to4: #include -#include +#include #include #include "listedit.h" @@ -419,19 +420,30 @@ QString EventListItem::text(int col) const ListEdit::ListEdit(PartList* pl) : MidiEditor(0, 0, pl) { - insertItems = new Q3ActionGroup(this, "InsertItems", false); - insertNote = new Q3Action(tr("Insert Note"), QIcon(*note1Icon), tr("insert Note"), + // ORCAN - CHECK: + /* + insertItems = new QActionGroup(this, "InsertItems", false); + insertNote = new QAction(tr("Insert Note"), QIcon(*note1Icon), tr("insert Note"), 0, insertItems); - insertSysEx = new Q3Action(tr("Insert SysEx"), QIcon(*sysexIcon), tr("insert SysEx"), + insertSysEx = new QAction(tr("Insert SysEx"), QIcon(*sysexIcon), tr("insert SysEx"), 0, insertItems); - insertCtrl = new Q3Action(tr("Insert Ctrl"), QIcon(*ctrlIcon), tr("insert Ctrl"), + insertCtrl = new QAction(tr("Insert Ctrl"), QIcon(*ctrlIcon), tr("insert Ctrl"), 0, insertItems); - insertMeta = new Q3Action(tr("Insert Meta"), QIcon(*metaIcon), tr("insert Meta"), + insertMeta = new QAction(tr("Insert Meta"), QIcon(*metaIcon), tr("insert Meta"), 0, insertItems); - insertCAfter = new Q3Action(tr("Insert Channel Aftertouch"), QIcon(*cafterIcon), tr("insert Channel Aftertouch"), + insertCAfter = new QAction(tr("Insert Channel Aftertouch"), QIcon(*cafterIcon), tr("insert Channel Aftertouch"), 0, insertItems); - insertPAfter = new Q3Action(tr("Insert Key Aftertouch"), QIcon(*pafterIcon), tr("insert Poly Aftertouch"), + insertPAfter = new QAction(tr("Insert Key Aftertouch"), QIcon(*pafterIcon), tr("insert Poly Aftertouch"), 0, insertItems); + */ + insertItems = new QActionGroup(this); + insertItems->setExclusive(false); + insertNote = new QAction(QIcon(*note1Icon), tr("insert Note"), insertItems); + insertSysEx = new QAction(QIcon(*sysexIcon), tr("insert SysEx"), insertItems); + insertCtrl = new QAction(QIcon(*ctrlIcon), tr("insert Ctrl"), insertItems); + insertMeta = new QAction(QIcon(*metaIcon), tr("insert Meta"), insertItems); + insertCAfter = new QAction(QIcon(*cafterIcon), tr("insert Channel Aftertouch"), insertItems); + insertPAfter = new QAction(QIcon(*pafterIcon), tr("insert Poly Aftertouch"), insertItems); connect(insertNote, SIGNAL(activated()), SLOT(editInsertNote())); connect(insertSysEx, SIGNAL(activated()), SLOT(editInsertSysEx())); @@ -468,10 +480,10 @@ ListEdit::ListEdit(PartList* pl) connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); //---------ToolBar---------------------------------- - listTools = new Q3ToolBar(this, "list-tools"); + listTools = new QToolBar(this, "list-tools"); listTools->setLabel(tr("List Tools")); undoRedo->addTo(listTools); - Q3ToolBar* insertTools = new Q3ToolBar(this, "insert"); + QToolBar* insertTools = new QToolBar(this, "insert"); insertTools->setLabel(tr("Insert Tools")); insertItems->addTo(insertTools); diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h index efa0a591..bb06c952 100644 --- a/muse2/muse/liste/listedit.h +++ b/muse2/muse/liste/listedit.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include class Event; @@ -24,7 +24,7 @@ class PartList; class MidiPart; class MidiPart; class Xml; -class Q3ActionGroup; +class QActionGroup; class QAction; class Q3ListView; class Q3ListViewItem; @@ -36,8 +36,8 @@ class Q3ListViewItem; class ListEdit : public MidiEditor { Q3ListView* liste; Q3PopupMenu* menuEdit; - Q3ActionGroup* insertItems; - Q3ToolBar* listTools; + QActionGroup* insertItems; + QToolBar* listTools; MidiTrack* curTrack; MidiPart* curPart; int selectedTick; @@ -49,7 +49,7 @@ class ListEdit : public MidiEditor { virtual void closeEvent(QCloseEvent*); virtual void keyPressEvent(QKeyEvent*); void initShortcuts(); - Q3Action *insertNote, *insertSysEx, *insertCtrl, *insertMeta, *insertCAfter, *insertPAfter; + QAction *insertNote, *insertSysEx, *insertCtrl, *insertMeta, *insertCAfter, *insertPAfter; private slots: void editInsertNote(); diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index ce08d786..f26f3a78 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -14,7 +14,8 @@ #include "song.h" #include "posedit.h" -#include +//#include +#include #include #include #include @@ -155,14 +156,18 @@ MarkerView::MarkerView(QWidget* parent) setCaption(tr("MusE: Marker")); //---------Actions---------------------------- - Q3Action* markerAdd = new Q3Action(tr("add marker"), - QIcon(*flagIcon), tr("Add Marker"), - 0, this, "add marker"); + // CHECK - ORCAN: + //QAction* markerAdd = new QAction(tr("add marker"), + // QIcon(*flagIcon), tr("Add Marker"), + // 0, this, "add marker"); + //QAction* markerDelete = new QAction(tr("delete marker"), + // QIcon(*deleteIcon), tr("Delete Marker"), + // 0, this, "delete marker"); + + QAction* markerAdd = new QAction(QIcon(*flagIcon), tr("add marker"), this); connect(markerAdd, SIGNAL(activated()), SLOT(addMarker())); - Q3Action* markerDelete = new Q3Action(tr("delete marker"), - QIcon(*deleteIcon), tr("Delete Marker"), - 0, this, "delete marker"); + QAction* markerDelete = new QAction(QIcon(*deleteIcon), tr("delete marker"), this); connect(markerDelete, SIGNAL(activated()), SLOT(deleteMarker())); //---------Pulldown Menu---------------------------- @@ -174,10 +179,10 @@ MarkerView::MarkerView(QWidget* parent) markerDelete->addTo(editMenu); //---------ToolBar---------------------------------- - tools = new Q3ToolBar(this, "marker-tools"); + tools = new QToolBar(this, "marker-tools"); undoRedo->addTo(tools); - Q3ToolBar* edit = new Q3ToolBar(this, "edit tools"); + QToolBar* edit = new QToolBar(this, "edit tools"); markerAdd->addTo(edit); markerDelete->addTo(edit); diff --git a/muse2/muse/marker/markerview.h b/muse2/muse/marker/markerview.h index b9f5a85d..07857923 100644 --- a/muse2/muse/marker/markerview.h +++ b/muse2/muse/marker/markerview.h @@ -18,7 +18,7 @@ class QLineEdit; class PosEdit; class QToolButton; class Marker; -class Q3ToolBar; +class QToolBar; class Pos; //--------------------------------------------------------- @@ -49,7 +49,7 @@ class MarkerView : public TopWin { PosEdit* editSMPTE; PosEdit* editTick; QToolButton* lock; - Q3ToolBar* tools; + QToolBar* tools; Q_OBJECT virtual void closeEvent(QCloseEvent*); diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 42486a8b..f50635b4 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -15,7 +15,8 @@ #include "shortcuts.h" #include "debug.h" -#include +//#include +#include #include #include #include @@ -88,10 +89,10 @@ LMaster::LMaster() connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); //---------ToolBar---------------------------------- - tools = new Q3ToolBar(this, "list-tools"); + tools = new QToolBar(this, "list-tools"); undoRedo->addTo(tools); - Q3ToolBar* edit = new Q3ToolBar(this, "edit tools"); + QToolBar* edit = new QToolBar(this, "edit tools"); QToolButton* tempoButton = new QToolButton(edit); QToolButton* timeSigButton = new QToolButton(edit); tempoButton->setText(tr("Tempo")); diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h index b67f64bf..9be2daf6 100644 --- a/muse2/muse/master/lmaster.h +++ b/muse2/muse/master/lmaster.h @@ -96,7 +96,7 @@ class LMasterSigEventItem : public LMasterLViewItem { class LMaster : public MidiEditor { Q3ListView* view; - Q3ToolBar* tools; + QToolBar* tools; Q3PopupMenu* menuEdit; enum { CMD_DELETE, CMD_INSERT_SIG, CMD_INSERT_TEMPO, CMD_EDIT_BEAT, CMD_EDIT_VALUE }; diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 53189573..3adcae3f 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -22,7 +22,8 @@ #include "globals.h" #include -#include +//#include +#include #include #include #include @@ -100,13 +101,12 @@ MasterEdit::MasterEdit() // menuBar()->insertItem("&File", file); //---------ToolBar---------------------------------- - tools = new Q3ToolBar(tr("edit tools"), this); + tools = new QToolBar(tr("edit tools"), this); undoRedo->addTo(tools); - EditToolBar* tools2 = new EditToolBar(this, - PointerTool | PencilTool | RubberTool); + EditToolBar* tools2 = new EditToolBar(this, PointerTool | PencilTool | RubberTool); - Q3ToolBar* enableMaster = new Q3ToolBar(tr("EnableMaster"), this); + QToolBar* enableMaster = new QToolBar(tr("EnableMaster"), this); enableButton = new QToolButton(enableMaster); enableButton->setToggleButton(true); enableButton->setText(tr("Enable")); @@ -114,7 +114,7 @@ MasterEdit::MasterEdit() enableButton->setOn(song->masterFlag()); connect(enableButton, SIGNAL(toggled(bool)), song, SLOT(setMasterFlag(bool))); - Q3ToolBar* info = new Q3ToolBar(tr("Info"), this); + QToolBar* info = new QToolBar(tr("Info"), this); QLabel* label = new QLabel(tr("Cursor"), info); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h index 88ada6eb..04ef09eb 100644 --- a/muse2/muse/master/masteredit.h +++ b/muse2/muse/master/masteredit.h @@ -47,7 +47,7 @@ class MasterEdit : public MidiEditor { TempoEdit* curTempo; SigEdit* curSig; LabelCombo* rasterLabel; - Q3ToolBar* tools; + QToolBar* tools; PosLabel* cursorPos; TempoLabel* tempo; QToolButton* enableButton; diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 82d0186d..acfd3a03 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -23,6 +23,8 @@ #include #include #include +#include + //Added by qt3to4: #include #include @@ -221,41 +223,72 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini // Toolbars //--------------------------------------------------- - tools = new Q3ToolBar(this, "drum-tools"); - new QToolButton(*openIcon, tr("Load Drummap"), - QString::null, this, SLOT(load()), - tools, "load drummap from file"); - - new QToolButton(*saveIcon, tr("Store Drummap"), - QString::null, - this, SLOT(save()), - tools, "store drummap to file"); - - Q3WhatsThis::whatsThisButton(tools); + //tools = new QToolBar(this, "drum-tools"); + tools = addToolBar(tr("drum-tools")); + + //new QToolButton(*openIcon, tr("Load Drummap"), + // QString::null, this, SLOT(load()), + // tools, "load drummap from file"); + + //new QToolButton(*saveIcon, tr("Store Drummap"), + // QString::null, + // this, SLOT(save()), + // tools, "store drummap to file"); + + QToolButton *ldm = new QToolButton(); + QToolTip::add(ldm, tr("Load Drummap")); + ldm->setIcon(*openIcon); + connect(ldm, SIGNAL(clicked()), SLOT(load())); + tools->addWidget(ldm); + + QToolButton *sdm = new QToolButton(); + QToolTip::add(sdm, tr("Store Drummap")); + sdm->setIcon(*saveIcon); + connect(sdm, SIGNAL(clicked()), SLOT(save())); + tools->addWidget(sdm); + + //Q3WhatsThis::whatsThisButton(tools); + tools->addAction(QWhatsThis::createAction(this)); tools->addSeparator(); - undoRedo->addTo(tools); + //undoRedo->addTo(tools); + tools->addActions(undoRedo->actions()); tools->addSeparator(); - srec = new QToolButton(tools, "srec"); + //srec = new QToolButton(tools, "srec"); + srec = new QToolButton(); QToolTip::add(srec, tr("Step Record")); - srec->setPixmap(*steprecIcon); + srec->setIcon(*steprecIcon); srec->setToggleButton(true); + tools->addWidget(srec); - midiin = new QToolButton(tools, "midiin"); + //midiin = new QToolButton(tools, "midiin"); + midiin = new QToolButton(); QToolTip::add(midiin, tr("Midi Input")); - midiin->setPixmap(*midiinIcon); + midiin->setIcon(*midiinIcon); midiin->setToggleButton(true); - + tools->addWidget(midiin); + tools2 = new EditToolBar(this, drumeditTools); + addToolBar(tools2); - Q3ToolBar* transport = new Q3ToolBar(this); - transportAction->addTo(transport); - - // dontt show pitch value in toolbar - //toolbar = new Toolbar1(this, _rasterInit, _quantInit, false); - toolbar = new Toolbar1(this, _rasterInit, _quantInit); + QToolBar* panicToolbar = addToolBar(tr("panic")); + //panicAction->addTo(panicToolbar); + panicToolbar->addAction(panicAction); + + //QToolBar* transport = new QToolBar(this); + QToolBar* transport = addToolBar(tr("transport")); + //transportAction->addTo(transport); + transport->addActions(transportAction->actions()); + + addToolBarBreak(); + // don't show pitch value in toolbar + toolbar = new Toolbar1(this, _rasterInit, _quantInit, false); + addToolBar(toolbar); + + addToolBarBreak(); info = new NoteInfo(this); + addToolBar(info); //--------------------------------------------------- // split diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index 5043412f..a1c8583b 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -94,7 +94,7 @@ class DrumEdit : public MidiEditor { QWidget* split1w1; DList* dlist; Header* header; - Q3ToolBar* tools; + QToolBar* tools; static int _quantInit, _rasterInit; static int _widthInit, _heightInit; diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 22d9c55e..dbeda748 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -22,7 +22,7 @@ #include //Added by qt3to4: #include -#include +#include #include #include @@ -178,38 +178,59 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i connect(menuFunctions, SIGNAL(activated(int)), SLOT(cmd(int))); //---------ToolBar---------------------------------- - tools = new Q3ToolBar(this, "pianoroll-tools"); - tools->setLabel(tr("Pianoroll Tools")); - undoRedo->addTo(tools); + //tools = new QToolBar(this, "pianoroll-tools"); + tools = addToolBar(tr("pianoroll-tools")); + //undoRedo->addTo(tools); + tools->addActions(undoRedo->actions()); tools->addSeparator(); - srec = new QToolButton(tools, "srec"); + //srec = new QToolButton(tools, "srec"); + // Does not like this, draws on top of other buttons! Must use QToolBar::addWidget() + //srec = new QToolButton(tools); + srec = new QToolButton(); QToolTip::add(srec, tr("Step Record")); - srec->setPixmap(*steprecIcon); + srec->setIcon(*steprecIcon); srec->setToggleButton(true); + tools->addWidget(srec); - midiin = new QToolButton(tools, "midiin"); + //midiin = new QToolButton(tools, "midiin"); + midiin = new QToolButton(); QToolTip::add(midiin, tr("Midi Input")); - midiin->setPixmap(*midiinIcon); + midiin->setIcon(*midiinIcon); midiin->setToggleButton(true); + tools->addWidget(midiin); - speaker = new QToolButton(tools, "speaker"); + //speaker = new QToolButton(tools, "speaker"); + speaker = new QToolButton(); QToolTip::add(speaker, tr("Play Events")); - speaker->setPixmap(*speakerIcon); + speaker->setIcon(*speakerIcon); speaker->setToggleButton(true); + tools->addWidget(speaker); tools2 = new EditToolBar(this, pianorollTools); + addToolBar(tools2); - Q3ToolBar* panicToolbar = new Q3ToolBar(this); - panicAction->addTo(panicToolbar); + //QToolBar* panicToolbar = new QToolBar(this); + QToolBar* panicToolbar = addToolBar(tr("panic")); + //panicAction->addTo(panicToolbar); + panicToolbar->addAction(panicAction); + //this->addToolBar(panicToolbar); //------------------------------------------------------------- // Transport Bar - Q3ToolBar* transport = new Q3ToolBar(this); - transportAction->addTo(transport); + //QToolBar* transport = new QToolBar(this); + QToolBar* transport = addToolBar(tr("transport")); + //transportAction->addTo(transport); + transport->addActions(transportAction->actions()); + //this->addToolBar(transport); + addToolBarBreak(); toolbar = new Toolbar1(this, _rasterInit, _quantInit); + addToolBar(toolbar); + + addToolBarBreak(); info = new NoteInfo(this); + addToolBar(info); //--------------------------------------------------- // split @@ -233,7 +254,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i mainGrid->addRowSpacing(1, hscroll->sizeHint().height()); QWidget* split1 = new QWidget(splitter, "split1"); - Q3GridLayout* gridS1 = new Q3GridLayout(split1); + QGridLayout* gridS1 = new QGridLayout(split1); time = new MTScale(&_raster, split1, xscale); Piano* piano = new Piano(split1, yscale); canvas = new PianoCanvas(this, split1, xscale, yscale); diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h index 8987915a..10818b94 100644 --- a/muse2/muse/midiedit/pianoroll.h +++ b/muse2/muse/midiedit/pianoroll.h @@ -72,7 +72,7 @@ class PianoRoll : public MidiEditor { Splitter* splitter; QToolButton* speaker; - Q3ToolBar* tools; + QToolBar* tools; EditToolBar* tools2; Q3PopupMenu* eventColor; diff --git a/muse2/muse/midiedit/quantconfig.cpp b/muse2/muse/midiedit/quantconfig.cpp index f00b713f..867dedea 100644 --- a/muse2/muse/midiedit/quantconfig.cpp +++ b/muse2/muse/midiedit/quantconfig.cpp @@ -7,7 +7,7 @@ //========================================================= #include -#include +#include #include #include #include @@ -15,7 +15,7 @@ #include "quantconfig.h" //Added by qt3to4: -#include +#include const char* wtStrengthTxt = QT_TR_NOOP("sets amount of quantization:\n" "0 - no quantization\n" @@ -31,7 +31,7 @@ QuantConfig::QuantConfig(int s, int l, bool lenFlag) : QDialog() { setCaption(tr("MusE: Config Quantize")); - Q3VBoxLayout* layout = new Q3VBoxLayout(this); + QVBoxLayout* layout = new QVBoxLayout(this); Q3GroupBox* gb = new Q3GroupBox(2, Qt::Horizontal, tr("Config Quantize"), this); layout->addWidget(gb); diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index e6c380b4..17c818fa 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -13,11 +13,11 @@ #include #include //Added by qt3to4: -#include +#include #include -#include -#include -#include +#include +#include +#include #include "app.h" #include "amixer.h" @@ -29,7 +29,7 @@ #include "gconfig.h" #include "xml.h" -extern void populateAddTrack(Q3PopupMenu* addTrack); +extern void populateAddTrack(QMenu* addTrack); #define __WIDTH_COMPENSATION 4 @@ -44,7 +44,7 @@ extern void populateAddTrack(Q3PopupMenu* addTrack); //AudioMixerApp::AudioMixerApp(QWidget* parent) AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c) - : Q3MainWindow(parent, "mixer") + : QMainWindow(parent, "mixer") { cfg = c; oldAuxsSize = 0; @@ -55,26 +55,39 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c) //printf("AudioMixerApp::AudioMixerApp setting caption:%s\n", cfg->name.latin1()); setCaption(cfg->name); - Q3PopupMenu* menuConfig = new Q3PopupMenu(this); + QMenu* menuConfig = new QMenu(this); menuBar()->insertItem(tr("&Create"), menuConfig); populateAddTrack(menuConfig); - menuView = new Q3PopupMenu(this); + menuView = new QMenu(this); menuBar()->insertItem(tr("&View"), menuView); routingId = menuView->insertItem(tr("Routing"), this, SLOT(toggleRouteDialog())); menuView->insertSeparator(); - - Q3ActionGroup* actionItems = new Q3ActionGroup(this, "actionItems", false); + + // ORCAN - CHECK: + //QActionGroup* actionItems = new QActionGroup(this, "actionItems", false); + QActionGroup* actionItems = new QActionGroup(this); + actionItems->setExclusive(false); /* showMidiTracksId = new QAction(tr("Show Midi Tracks"), 0, menuView); showDrumTracksId = new QAction(tr("Show Drum Tracks"), 0, menuView); showWaveTracksId = new QAction(tr("Show Wave Tracks"), 0, menuView); */ - showMidiTracksId = new Q3Action(tr("Show Midi Tracks"), 0, actionItems); - showDrumTracksId = new Q3Action(tr("Show Drum Tracks"), 0, actionItems); - showWaveTracksId = new Q3Action(tr("Show Wave Tracks"), 0, actionItems); + + + + // CHECK - ORCAN + //showMidiTracksId = new QAction(tr("Show Midi Tracks"), 0, actionItems); + //showDrumTracksId = new QAction(tr("Show Drum Tracks"), 0, actionItems); + //showWaveTracksId = new QAction(tr("Show Wave Tracks"), 0, actionItems); + showMidiTracksId = new QAction(tr("Show Midi Tracks"), actionItems); + showDrumTracksId = new QAction(tr("Show Drum Tracks"), actionItems); + showWaveTracksId = new QAction(tr("Show Wave Tracks"), actionItems); + + + //showMidiTracksId->addTo(menuView); //showDrumTracksId->addTo(menuView); //showWaveTracksId->addTo(menuView); @@ -89,11 +102,23 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c) showAuxTracksId = new QAction(tr("Show Auxs"), 0, menuView); showSyntiTracksId = new QAction(tr("Show Synthesizers"), 0, menuView); */ - showInputTracksId = new Q3Action(tr("Show Inputs"), 0, actionItems); - showOutputTracksId = new Q3Action(tr("Show Outputs"), 0, actionItems); - showGroupTracksId = new Q3Action(tr("Show Groups"), 0, actionItems); - showAuxTracksId = new Q3Action(tr("Show Auxs"), 0, actionItems); - showSyntiTracksId = new Q3Action(tr("Show Synthesizers"), 0, actionItems); + + + // CHECK - ORCAN + //showInputTracksId = new QAction(tr("Show Inputs"), 0, actionItems); + //showOutputTracksId = new QAction(tr("Show Outputs"), 0, actionItems); + //showGroupTracksId = new QAction(tr("Show Groups"), 0, actionItems); + //showAuxTracksId = new QAction(tr("Show Auxs"), 0, actionItems); + //showSyntiTracksId = new QAction(tr("Show Synthesizers"), 0, actionItems); + showInputTracksId = new QAction(tr("Show Inputs"), actionItems); + showOutputTracksId = new QAction(tr("Show Outputs"), actionItems); + showGroupTracksId = new QAction(tr("Show Groups"), actionItems); + showAuxTracksId = new QAction(tr("Show Auxs"), actionItems); + showSyntiTracksId = new QAction(tr("Show Synthesizers"), actionItems); + + + + //showInputTracksId->addTo(menuView); //showOutputTracksId->addTo(menuView); //showGroupTracksId->addTo(menuView); @@ -121,13 +146,16 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c) connect(showSyntiTracksId, SIGNAL(toggled(bool)), SLOT(showSyntiTracksChanged(bool))); actionItems->addTo(menuView); - view = new Q3ScrollView(this); + view = new QScrollArea(this); setCentralWidget(view); central = new QWidget(view); - view->setResizePolicy(Q3ScrollView::AutoOneFit); - view->setVScrollBarMode(Q3ScrollView::AlwaysOff); + // ORCAN - FIXME + /* + view->setResizePolicy(QScrollView::AutoOneFit); + view->setVScrollBarMode(QScrollView::AlwaysOff); view->addChild(central); - layout = new Q3HBoxLayout(central); + */ + layout = new QHBoxLayout(central); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); connect(muse, SIGNAL(configChanged()), SLOT(configChanged())); song->update(); // calls update mixer diff --git a/muse2/muse/mixer/amixer.h b/muse2/muse/mixer/amixer.h index f6588ddb..b6650b0f 100644 --- a/muse2/muse/mixer/amixer.h +++ b/muse2/muse/mixer/amixer.h @@ -9,17 +9,17 @@ #ifndef __AMIXER_H__ #define __AMIXER_H__ -#include +#include #include -#include +//#include #include -#include +//#include //Added by qt3to4: -#include +#include #include -#include +#include #include -#include +#include #include "cobject.h" #include "synth.h" @@ -28,8 +28,9 @@ class Xml; class QWidget; -class Q3HBoxLayout; -class Q3ScrollView; +class QHBoxLayout; +// ORCAN - CHECK +class QScrollArea; class AudioTrack; class Meter; class Track; @@ -40,7 +41,7 @@ class Knob; class DoubleLabel; class ComboBox; class RouteDialog; -class Q3PopupMenu; +class QMenu; class Strip; struct MixerConfig; @@ -53,28 +54,28 @@ typedef std::list StripList; // AudioMixerApp //--------------------------------------------------------- -class AudioMixerApp : public Q3MainWindow { +class AudioMixerApp : public QMainWindow { //QString name; MixerConfig* cfg; StripList stripList; - Q3ScrollView* view; + QScrollArea* view; QWidget* central; - Q3HBoxLayout* lbox; + QHBoxLayout* lbox; //Strip* master; - Q3HBoxLayout* layout; - Q3PopupMenu* menuView; + QHBoxLayout* layout; + QMenu* menuView; RouteDialog* routingDialog; int routingId; int oldAuxsSize; - Q3Action* showMidiTracksId; - Q3Action* showDrumTracksId; - Q3Action* showInputTracksId; - Q3Action* showOutputTracksId; - Q3Action* showWaveTracksId; - Q3Action* showGroupTracksId; - Q3Action* showAuxTracksId; - Q3Action* showSyntiTracksId; + QAction* showMidiTracksId; + QAction* showDrumTracksId; + QAction* showInputTracksId; + QAction* showOutputTracksId; + QAction* showWaveTracksId; + QAction* showGroupTracksId; + QAction* showAuxTracksId; + QAction* showSyntiTracksId; Q_OBJECT diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index c7d2d4f0..56e1e3eb 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -25,8 +25,11 @@ #include #include //Added by qt3to4: -#include -#include +//#include +//#include + +#include +#include #include "app.h" #include "globals.h" @@ -644,7 +647,7 @@ Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel) plb->setFixedWidth(STRIP_WIDTH/2); plb->setAlignment(Qt::AlignCenter); - Q3GridLayout* pangrid = new Q3GridLayout(0, 2, 2, 0, 0, "pangrid"); + QGridLayout* pangrid = new QGridLayout(0, 2, 2, 0, 0, "pangrid"); pangrid->addWidget(plb, 0, 0); pangrid->addWidget(pl, 1, 0); pangrid->addMultiCellWidget(knob, 0, 1, 1, 1); @@ -723,7 +726,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) // mono/stereo pre/post //--------------------------------------------------- - Q3HBoxLayout* ppBox = new Q3HBoxLayout(0); + QHBoxLayout* ppBox = new QHBoxLayout(0); stereo = new QToolButton(this); stereo->setFont(config.fonts[1]); QIcon stereoSet; @@ -779,7 +782,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) // slider, label, meter //--------------------------------------------------- - sliderGrid = new Q3GridLayout(this); // ddskrjo this + sliderGrid = new QGridLayout(this); // ddskrjo this sliderGrid->setRowStretch(0, 100); //slider = new Slider(this); @@ -849,8 +852,8 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) Track::TrackType type = t->type(); - Q3HBoxLayout* smBox1 = new Q3HBoxLayout(0); - Q3HBoxLayout* smBox2 = new Q3HBoxLayout(0); + QHBoxLayout* smBox1 = new QHBoxLayout(0); + QHBoxLayout* smBox2 = new QHBoxLayout(0); mute = new QToolButton(this); @@ -919,7 +922,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) // routing //--------------------------------------------------- - Q3HBoxLayout* rBox = new Q3HBoxLayout(0); + QHBoxLayout* rBox = new QHBoxLayout(0); if (type != Track::AUDIO_AUX) { iR = new QToolButton(this); iR->setFont(config.fonts[1]); diff --git a/muse2/muse/mixer/meter.cpp b/muse2/muse/mixer/meter.cpp index 14b20a18..fc010a33 100644 --- a/muse2/muse/mixer/meter.cpp +++ b/muse2/muse/mixer/meter.cpp @@ -12,7 +12,7 @@ //Added by qt3to4: #include #include -#include +#include #include "meter.h" #include "gconfig.h" @@ -23,7 +23,7 @@ //--------------------------------------------------------- Meter::Meter(QWidget* parent, MeterType type) - : Q3Frame(parent, "", Qt::WNoAutoErase) + : QFrame(parent, Qt::WNoAutoErase) { mtype = type; overflow = false; diff --git a/muse2/muse/mixer/meter.h b/muse2/muse/mixer/meter.h index fc447147..719ab701 100644 --- a/muse2/muse/mixer/meter.h +++ b/muse2/muse/mixer/meter.h @@ -9,13 +9,14 @@ #ifndef __METER_H__ #define __METER_H__ -#include +//#include +#include #include //Added by qt3to4: #include #include -class Meter : public Q3Frame { +class Meter : public QFrame { public: enum MeterType {DBMeter, LinMeter}; private: diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp index 10d9ddf4..92d2d02f 100644 --- a/muse2/muse/mixer/mstrip.cpp +++ b/muse2/muse/mixer/mstrip.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include #include @@ -20,8 +20,8 @@ //#include #include //Added by qt3to4: -#include -#include +#include +#include #include #include "app.h" @@ -144,7 +144,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label, lb->setFixedHeight(15); lb->setEnabled(enabled); - Q3GridLayout* grid = new Q3GridLayout(0, 2, 2, 0, 0, "grid"); + QGridLayout* grid = new QGridLayout(0, 2, 2, 0, 0, "grid"); grid->setMargin(2); grid->addWidget(lb, 0, 0); grid->addWidget(dl, 1, 0); @@ -205,7 +205,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) meter[0]->setRange(0, 127.0); meter[0]->setFixedWidth(15); connect(meter[0], SIGNAL(mousePress()), this, SLOT(resetPeaks())); - sliderGrid = new Q3GridLayout(this); // ddskrjo this + sliderGrid = new QGridLayout(this); // ddskrjo this sliderGrid->setRowStretch(0, 100); sliderGrid->addWidget(slider, 0, 0, Qt::AlignRight); sliderGrid->addWidget(meter[0], 0, 1, Qt::AlignLeft); @@ -326,8 +326,8 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) solo->setFixedWidth(STRIP_WIDTH/2); connect(solo, SIGNAL(toggled(bool)), SLOT(soloToggled(bool))); - Q3HBoxLayout* smBox1 = new Q3HBoxLayout(0); - Q3HBoxLayout* smBox2 = new Q3HBoxLayout(0); + QHBoxLayout* smBox1 = new QHBoxLayout(0); + QHBoxLayout* smBox2 = new QHBoxLayout(0); smBox2->addWidget(mute); smBox2->addWidget(solo); @@ -369,7 +369,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) //route->setText(tr("Route")); //QToolTip::add(route, tr("set routing")); //layout->addWidget(route); - Q3HBoxLayout* rBox = new Q3HBoxLayout(0); + QHBoxLayout* rBox = new QHBoxLayout(0); iR = new QToolButton(this); iR->setFont(config.fonts[1]); iR->setFixedWidth((STRIP_WIDTH-4)/2); diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index 892a19b6..a15ad44e 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -8,10 +8,11 @@ #include #include -#include +#include //Added by qt3to4: -#include -#include +#include +//#include +#include #include "globals.h" #include "gconfig.h" @@ -168,7 +169,7 @@ void Strip::soloToggled(bool val) //--------------------------------------------------------- Strip::Strip(QWidget* parent, Track* t) - : Q3Frame(parent, "Strip", Qt::WDestructiveClose) + : QFrame(parent, Qt::WDestructiveClose) { iR = 0; oR = 0; @@ -182,7 +183,7 @@ Strip::Strip(QWidget* parent, Track* t) meter[0] = 0; meter[1] = 0; setFixedWidth(STRIP_WIDTH); - layout = new Q3VBoxLayout(this); + layout = new QVBoxLayout(this); layout->setMargin(3); //--------------------------------------------- diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h index a28cf5fd..4202b3e3 100644 --- a/muse2/muse/mixer/strip.h +++ b/muse2/muse/mixer/strip.h @@ -9,11 +9,12 @@ #ifndef __STRIP_H__ #define __STRIP_H__ -#include +//#include +#include #include //Added by qt3to4: -#include -#include +#include +#include #include #include "globaldefs.h" @@ -21,10 +22,10 @@ class Track; class QLabel; -class Q3VBoxLayout; +class QVBoxLayout; class Meter; class QToolButton; -class Q3GridLayout; +class QGridLayout; class ComboBox; static const int STRIP_WIDTH = 65; @@ -33,13 +34,13 @@ static const int STRIP_WIDTH = 65; // Strip //--------------------------------------------------------- -class Strip : public Q3Frame { +class Strip : public QFrame { Q_OBJECT protected: Track* track; QLabel* label; - Q3VBoxLayout* layout; + QVBoxLayout* layout; Meter* meter[MAX_CHANNELS]; bool useSoloIconSet2; @@ -48,7 +49,7 @@ class Strip : public Q3Frame { QToolButton* mute; QToolButton* iR; // Input routing button QToolButton* oR; // Output routing button - Q3GridLayout* sliderGrid; + QGridLayout* sliderGrid; ComboBox* autoType; void setLabelText(); diff --git a/muse2/muse/mplugins/rhythm.cpp b/muse2/muse/mplugins/rhythm.cpp index 5281fb56..2a164acf 100644 --- a/muse2/muse/mplugins/rhythm.cpp +++ b/muse2/muse/mplugins/rhythm.cpp @@ -55,7 +55,8 @@ void RhythmGen::closeEvent(QCloseEvent* ev) #include #include -#include +//#include +#include #include #include #include @@ -231,9 +232,9 @@ RhythmGenerator::RhythmGenerator( QWidget* parent, const char* name, bool modal setCaption( trUtf8( "Form3" ) ); RhythmGeneratorLayout = new Q3VBoxLayout( this, 11, 6, "RhythmGeneratorLayout"); - Frame6 = new Q3Frame( this, "Frame6" ); - Frame6->setFrameShape( Q3Frame::StyledPanel ); - Frame6->setFrameShadow( Q3Frame::Raised ); + Frame6 = new QFrame( this); + Frame6->setFrameShape( QFrame::StyledPanel ); + Frame6->setFrameShadow( QFrame::Raised ); Frame6Layout = new Q3VBoxLayout( Frame6, 11, 6, "Frame6Layout"); TextLabel1 = new QLabel( Frame6, "TextLabel1" ); @@ -351,9 +352,9 @@ RhythmGenerator::RhythmGenerator( QWidget* parent, const char* name, bool modal Layout27 = new Q3HBoxLayout( 0, 0, 15, "Layout27"); - Frame5 = new Q3Frame( this, "Frame5" ); - Frame5->setFrameShape( Q3Frame::StyledPanel ); - Frame5->setFrameShadow( Q3Frame::Raised ); + Frame5 = new QFrame( this ); + Frame5->setFrameShape( QFrame::StyledPanel ); + Frame5->setFrameShadow( QFrame::Raised ); Frame5Layout = new Q3VBoxLayout( Frame5, 11, 6, "Frame5Layout"); TextLabel2 = new QLabel( Frame5, "TextLabel2" ); @@ -430,9 +431,9 @@ RhythmGenerator::RhythmGenerator( QWidget* parent, const char* name, bool modal Frame5Layout->addWidget( RandomizeCheck ); Layout27->addWidget( Frame5 ); - Frame5_2 = new Q3Frame( this, "Frame5_2" ); - Frame5_2->setFrameShape( Q3Frame::StyledPanel ); - Frame5_2->setFrameShadow( Q3Frame::Raised ); + Frame5_2 = new QFrame( this ); + Frame5_2->setFrameShape( QFrame::StyledPanel ); + Frame5_2->setFrameShadow( QFrame::Raised ); Frame5_2Layout = new Q3VBoxLayout( Frame5_2, 11, 6, "Frame5_2Layout"); TextLabel3 = new QLabel( Frame5_2, "TextLabel3" ); @@ -477,23 +478,23 @@ RhythmGenerator::RhythmGenerator( QWidget* parent, const char* name, bool modal Layout29 = new Q3HBoxLayout( 0, 0, 6, "Layout29"); - Frame6_2 = new Q3Frame( this, "Frame6_2" ); + Frame6_2 = new QFrame( this ); Frame6_2->setMinimumSize( QSize( 200, 150 ) ); - Frame6_2->setFrameShape( Q3Frame::StyledPanel ); - Frame6_2->setFrameShadow( Q3Frame::Raised ); + Frame6_2->setFrameShape( QFrame::StyledPanel ); + Frame6_2->setFrameShadow( QFrame::Raised ); Layout29->addWidget( Frame6_2 ); - Frame7 = new Q3Frame( this, "Frame7" ); + Frame7 = new QFrame( this ); Frame7->setMinimumSize( QSize( 200, 150 ) ); - Frame7->setFrameShape( Q3Frame::StyledPanel ); - Frame7->setFrameShadow( Q3Frame::Raised ); + Frame7->setFrameShape( QFrame::StyledPanel ); + Frame7->setFrameShadow( QFrame::Raised ); Layout29->addWidget( Frame7 ); RhythmGeneratorLayout->addLayout( Layout29 ); - Frame8 = new Q3Frame( this, "Frame8" ); + Frame8 = new QFrame( this ); Frame8->setMinimumSize( QSize( 400, 150 ) ); - Frame8->setFrameShape( Q3Frame::StyledPanel ); - Frame8->setFrameShadow( Q3Frame::Raised ); + Frame8->setFrameShape( QFrame::StyledPanel ); + Frame8->setFrameShadow( QFrame::Raised ); RhythmGeneratorLayout->addWidget( Frame8 ); // signals and slots connections diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp index 0b2911ca..9bcf11bf 100644 --- a/muse2/muse/plugin.cpp +++ b/muse2/muse/plugin.cpp @@ -8,10 +8,10 @@ #include //Added by qt3to4: -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -20,13 +20,14 @@ #include #include -#include +#include #include #include #include #include #include -#include +//#include +#include #include #include #include @@ -35,7 +36,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -2530,7 +2532,7 @@ PluginDialog::PluginDialog(QWidget* parent, const char* name, bool modal) : QDialog(parent, name, modal) { setCaption(tr("MusE: select plugin")); - Q3VBoxLayout* layout = new Q3VBoxLayout(this); + QVBoxLayout* layout = new QVBoxLayout(this); pList = new Q3ListView(this); pList->setAllColumnsShowFocus(true); @@ -2553,7 +2555,7 @@ PluginDialog::PluginDialog(QWidget* parent, const char* name, bool modal) // Ok/Cancel Buttons //--------------------------------------------------- - Q3BoxLayout* w5 = new Q3HBoxLayout; + QBoxLayout* w5 = new QHBoxLayout; layout->addLayout(w5); QPushButton* okB = new QPushButton(tr("Ok"), this); @@ -2565,7 +2567,9 @@ PluginDialog::PluginDialog(QWidget* parent, const char* name, bool modal) w5->addSpacing(12); w5->addWidget(cancelB); - Q3ButtonGroup* plugSel = new Q3ButtonGroup(4, Qt::Horizontal, this, "Show plugs:"); + // ORCAN - CHECK + //QButtonGroup* plugSel = new QButtonGroup(4, Qt::Horizontal, this, "Show plugs:"); + QGroupBox* plugSel = new QGroupBox(this); plugSel->setTitle("Show plugs:"); QRadioButton* onlySM = new QRadioButton(plugSel, "Mono and Stereo"); onlySM->setText( "Mono and Stereo"); @@ -2576,8 +2580,9 @@ PluginDialog::PluginDialog(QWidget* parent, const char* name, bool modal) QRadioButton* allPlug = new QRadioButton(plugSel, "Show all"); allPlug->setText( "Show All"); - plugSel->setRadioButtonExclusive(true); - plugSel->setButton(selectedPlugType); + // ORCAN - FIXME + //plugSel->setRadioButtonExclusive(true); + //plugSel->setButton(selectedPlugType); QToolTip::add(plugSel, tr("Select which types of plugins should be visible in the list.
" "Note that using mono plugins on stereo tracks is not a problem, two will be used in parallel.
" @@ -2825,7 +2830,7 @@ PluginGui::PluginGui(PluginIBase* p) plugin = p; setCaption(plugin->name()); - Q3ToolBar* tools = new Q3ToolBar(tr("File Buttons"), this); + QToolBar* tools = new QToolBar(tr("File Buttons"), this); QToolButton* fileOpen = new QToolButton( QIcon(*openIconS), // ddskrjo tr("Load Preset"), @@ -2968,7 +2973,7 @@ PluginGui::PluginGui(PluginIBase* p) //view->setVScrollBarMode(QScrollView::AlwaysOff); view->addChild(mw); - Q3GridLayout* grid = new Q3GridLayout(mw); + QGridLayout* grid = new QGridLayout(mw); grid->setSpacing(2); int n = plugin->parameters(); diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 8c682e39..9e206fad 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -11,7 +11,8 @@ #include #include #include -#include +//#include +#include #include #include #include @@ -2342,7 +2343,7 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a { //enum { HEADER, SEP1, PREV_EVENT, NEXT_EVENT, SEP2, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; enum { HEADER, PREV_EVENT, NEXT_EVENT, SEP2, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; - Q3PopupMenu* menu = new Q3PopupMenu; + QMenu* menu = new QMenu; int count = 0; bool isEvent = false, canSeekPrev = false, canSeekNext = false, canEraseRange = false; @@ -2406,6 +2407,8 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a menu->insertItem(tr("clear automation"), CLEAR_ALL_EVENTS, CLEAR_ALL_EVENTS); menu->setItemEnabled(CLEAR_ALL_EVENTS, (bool)count); + // ORCAN - FIXME + /* int sel = menu->exec(menupos, 1); delete menu; if (sel == -1) @@ -2446,6 +2449,8 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a break; } return sel; + */ + return 0; } //--------------------------------------------------------- @@ -2459,7 +2464,7 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo //enum { HEADER, SEP1, PREV_EVENT, NEXT_EVENT, SEP2, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; enum { HEADER, ADD_EVENT, CLEAR_EVENT }; - Q3PopupMenu* menu = new Q3PopupMenu; + QMenu* menu = new QMenu; //int count = 0; bool isEvent = false; @@ -2576,6 +2581,9 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo // menu->insertItem(tr("clear automation"), CLEAR_ALL_EVENTS, CLEAR_ALL_EVENTS); // menu->setItemEnabled(CLEAR_ALL_EVENTS, (bool)count); + +// ORCAN - FIXME +/* int sel = menu->exec(menupos, 1); delete menu; if (sel == -1) @@ -2663,6 +2671,8 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo } return sel; +*/ + return 0; } //--------------------------------------------------------- @@ -3618,7 +3628,7 @@ void Song::executeScript(const char* scriptfile, PartList* parts, int quant, boo #define SCRIPTSSUFFIX "/share/muse/scripts/" #define USERSCRIPTSSUFFIX "/.muse/scripts/" -void Song::populateScriptMenu(Q3PopupMenu* menuPlugins, QObject* receiver) +void Song::populateScriptMenu(QMenu* menuPlugins, QObject* receiver) { // // List scripts diff --git a/muse2/muse/song.h b/muse2/muse/song.h index cc7267b7..15119b93 100644 --- a/muse2/muse/song.h +++ b/muse2/muse/song.h @@ -13,7 +13,8 @@ #include #include //Added by qt3to4: -#include +//#include +#include #include #include "pos.h" @@ -38,7 +39,7 @@ class EventList; class MarkerList; class Marker; class SNode; -class Q3PopupMenu; +class QMenu; class QButton; class MidiPort; @@ -390,7 +391,7 @@ class Song : public QObject { Track* addTrack(int); Track* addNewTrack(int); QString getScriptPath(int id, bool delivered); - void populateScriptMenu(Q3PopupMenu* menuPlugins, QObject* receiver); + void populateScriptMenu(QMenu* menuPlugins, QObject* receiver); signals: void songChanged(int); diff --git a/muse2/muse/transport.cpp b/muse2/muse/transport.cpp index 4cb206a2..74aa75ac 100644 --- a/muse2/muse/transport.cpp +++ b/muse2/muse/transport.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +//#include +#include #include #include #include @@ -115,8 +116,8 @@ TempoSig::TempoSig(QWidget* parent) Q3BoxLayout* vb1 = new Q3VBoxLayout(this); vb1->setAutoAdd(true); - Q3Frame* f = new Q3Frame(this); - f->setFrameStyle(Q3Frame::Panel | Q3Frame::Sunken); + QFrame* f = new QFrame(this); + f->setFrameStyle(QFrame::Panel | QFrame::Sunken); f->setLineWidth(1); Q3BoxLayout* vb2 = new Q3VBoxLayout(f); diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index cb9d9a17..f6c5484f 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -21,7 +21,8 @@ #include "icons.h" #include "shortcuts.h" -#include +//#include +#include #include #include #include @@ -105,7 +106,7 @@ WaveEdit::WaveEdit(PartList* pl) connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); //---------ToolBar---------------------------------- - tools = new Q3ToolBar(this, "waveedit-tools"); + tools = new QToolBar(this, "waveedit-tools"); undoRedo->addTo(tools); Q3Accel* qa = new Q3Accel(this); @@ -116,13 +117,13 @@ WaveEdit::WaveEdit(PartList* pl) //-------------------------------------------------- // Transport Bar - Q3ToolBar* transport = new Q3ToolBar(this); + QToolBar* transport = new QToolBar(this); transportAction->addTo(transport); //-------------------------------------------------- // ToolBar: Solo Cursor1 Cursor2 - tb1 = new Q3ToolBar(this, "pianoroll-tools"); + tb1 = new QToolBar(this, "pianoroll-tools"); tb1->setLabel(tr("weTools")); solo = new QToolButton(tb1); diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h index eac0e5bf..454fa1a1 100644 --- a/muse2/muse/waveedit/waveedit.h +++ b/muse2/muse/waveedit/waveedit.h @@ -32,8 +32,8 @@ class SNode; class WaveEdit : public MidiEditor { WaveView* view; QSlider* ymag; - Q3ToolBar* tools; - Q3ToolBar* tb1; + QToolBar* tools; + QToolBar* tb1; QToolButton* solo; PosLabel* pos1; PosLabel* pos2; diff --git a/muse2/muse/widgets/action.h b/muse2/muse/widgets/action.h index 74635f0a..32ec96ce 100644 --- a/muse2/muse/widgets/action.h +++ b/muse2/muse/widgets/action.h @@ -8,20 +8,22 @@ #ifndef __ACTION_H__ #define __ACTION_H__ -#include +//#include +#include //--------------------------------------------------------- // Action //--------------------------------------------------------- -class Action : public Q3Action { +class Action : public QAction { Q_OBJECT int _id; public: Action(QObject* parent, int i, const char* name = 0, bool toggle = false) - : Q3Action(parent, name, toggle) { + : QAction(name, parent) { _id = i; + setCheckable(toggle); } void setId(int i) { _id = i; } int id() const { return _id; } diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp index 35959636..6e5b100d 100644 --- a/muse2/muse/widgets/combobox.cpp +++ b/muse2/muse/widgets/combobox.cpp @@ -9,7 +9,7 @@ #include //Added by qt3to4: #include -#include +#include #include #include "combobox.h" @@ -24,7 +24,7 @@ ComboBox::ComboBox(QWidget* parent, const char* name) _id = -1; list = new Q3PopupMenu(0, "comboPopup"); connect(list, SIGNAL(activated(int)), SLOT(activatedIntern(int))); - setFrameStyle(Q3Frame::Panel | Q3Frame::Raised); + setFrameStyle(QFrame::Panel | QFrame::Raised); setLineWidth(2); } diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index fa647002..beb34255 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -7,11 +7,11 @@ #include "lcombo.h" -#include -#include +#include +#include #include //Added by qt3to4: -#include +#include //--------------------------------------------------------- // LabelCombo @@ -21,16 +21,18 @@ LabelCombo::LabelCombo(const QString& txt, QWidget* parent, const char* name) : QWidget(parent, name) { // setFixedHeight(20); - Q3HBoxLayout* layout = new Q3HBoxLayout(this); + QHBoxLayout* layout = new QHBoxLayout(this); QLabel* label = new QLabel(txt, this); - box = new QComboBox(false, this); - layout->addStretch(); + //box = new QComboBox(false, this); + box = new QComboBox(this); + box->setEditable(false); + ///layout->addStretch(); layout->addSpacing(5); layout->addWidget(label); layout->addSpacing(5); layout->addWidget(box); layout->addSpacing(5); - layout->addStretch(); + ///layout->addStretch(); connect(box, SIGNAL(activated(int)), SIGNAL(activated(int))); } @@ -46,4 +48,4 @@ void LabelCombo::clearFocus() void LabelCombo::setFocusPolicy ( Qt::FocusPolicy fp ) { box->setFocusPolicy(fp); -} \ No newline at end of file +} diff --git a/muse2/muse/widgets/lcombo.h b/muse2/muse/widgets/lcombo.h index bdeedcb6..a0adda7d 100644 --- a/muse2/muse/widgets/lcombo.h +++ b/muse2/muse/widgets/lcombo.h @@ -8,12 +8,15 @@ #ifndef __LCOMBO_H__ #define __LCOMBO_H__ -#include -#include +//#include +//#include class QString; +class QWidget; + //class Q3ListBox; #include +#include //--------------------------------------------------------- diff --git a/muse2/muse/widgets/nentry.cpp b/muse2/muse/widgets/nentry.cpp index c4006112..89c051df 100644 --- a/muse2/muse/widgets/nentry.cpp +++ b/muse2/muse/widgets/nentry.cpp @@ -5,13 +5,13 @@ // (C) Copyright 1999 Werner Schweer (ws@seh.de) //========================================================= -#include +#include #include //Added by qt3to4: -#include +#include #include #include -#include +#include #include #include #include "nentry.h" @@ -81,7 +81,7 @@ bool NentryFilter::eventFilter(QObject*, QEvent* event) //--------------------------------------------------------- Nentry::Nentry(QWidget* parent, const QString& txt, - int _lPos, bool dark) : Q3Frame(parent) + int _lPos, bool dark) : QFrame(parent) { focusW = 0; lPos = _lPos; @@ -97,7 +97,7 @@ Nentry::Nentry(QWidget* parent, const QString& txt, edit->setCursor(QCursor(Qt::arrowCursor)); // edit->setFont(font3); val = 0; - layout = new Q3HBoxLayout(this); + layout = new QHBoxLayout(this); if (txt == "") { layout->addWidget(edit, 1, Qt::AlignHCenter); } diff --git a/muse2/muse/widgets/nentry.h b/muse2/muse/widgets/nentry.h index 30ddd930..10eefeee 100644 --- a/muse2/muse/widgets/nentry.h +++ b/muse2/muse/widgets/nentry.h @@ -8,20 +8,20 @@ #ifndef __NENTRY_H__ #define __NENTRY_H__ -#include +#include #include #include //Added by qt3to4: #include #include -#include +#include #include #include #include #include class QTimer; -class Q3HBoxLayout; +class QHBoxLayout; class QLabel; class NentryFilter : public QObject { @@ -38,7 +38,7 @@ class NentryFilter : public QObject { // numerical entry widget with optional label //--------------------------------------------------------- -class Nentry : public Q3Frame { +class Nentry : public QFrame { Q_OBJECT int button; @@ -47,7 +47,7 @@ class Nentry : public Q3Frame { QTimer* timer; int evx; int timecount; - Q3HBoxLayout* layout; + QHBoxLayout* layout; QObject* filter; QLabel* label; int lPos; // label Position 0 - left, 1 - right diff --git a/muse2/muse/widgets/noteinfo.cpp b/muse2/muse/widgets/noteinfo.cpp index 59bce4b9..e3d869e0 100644 --- a/muse2/muse/widgets/noteinfo.cpp +++ b/muse2/muse/widgets/noteinfo.cpp @@ -21,35 +21,62 @@ // Start, L�nge, Note, Velo an, Velo aus, Kanal //--------------------------------------------------- -NoteInfo::NoteInfo(Q3MainWindow* parent) - : Q3ToolBar(tr("Note Info"), parent) +//NoteInfo::NoteInfo(QMainWindow* parent) +NoteInfo::NoteInfo(QWidget* parent) + : QToolBar(tr("Note Info"), parent) { deltaMode = false; - QLabel* label = new QLabel(tr("Start"), this, "Start"); + //QLabel* label = new QLabel(tr("Start"), this, "Start"); + QLabel* label = new QLabel(tr("Start")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selTime = new PosEdit(this, "Start"); + addWidget(label); + //selTime = new PosEdit(this, "Start"); + selTime = new PosEdit(0, "Start"); + addWidget(selTime); - label = new QLabel(tr("Len"), this, "Len"); + //label = new QLabel(tr("Len"), this, "Len"); + label = new QLabel(tr("Len")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selLen = new QSpinBox(0, 100000, 1, this); - - label = new QLabel(tr("Pitch"), this, "Pitch"); + addWidget(label); + //selLen = new QSpinBox(0, 100000, 1, this); + selLen = new QSpinBox(); + selLen->setRange(0, 100000); + selLen->setSingleStep(1); + addWidget(selLen); + + //label = new QLabel(tr("Pitch"), this, "Pitch"); + label = new QLabel(tr("Pitch")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selPitch = new PitchEdit(this, "selPitch"); + addWidget(label); + //selPitch = new PitchEdit(this, "selPitch"); + selPitch = new PitchEdit(0, "selPitch"); + addWidget(selPitch); - label = new QLabel(tr("Velo On"), this, "Velocity On"); + //label = new QLabel(tr("Velo On"), this, "Velocity On"); + label = new QLabel(tr("Velo On")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selVelOn = new QSpinBox(0, 127, 1, this); - - label = new QLabel(tr("Velo Off"), this, "Velocity Off"); + addWidget(label); + //selVelOn = new QSpinBox(0, 127, 1, this); + selVelOn = new QSpinBox(); + selVelOn->setRange(0, 127); + selVelOn->setSingleStep(1); + addWidget(selVelOn); + + //label = new QLabel(tr("Velo Off"), this, "Velocity Off"); + label = new QLabel(tr("Velo Off")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selVelOff = new QSpinBox(0, 127, 1, this); + addWidget(label); + //selVelOff = new QSpinBox(0, 127, 1, this); + selVelOff = new QSpinBox(); + selVelOff->setRange(0, 127); + selVelOff->setSingleStep(1); + addWidget(selVelOff); connect(selLen, SIGNAL(valueChanged(int)), SLOT(lenChanged(int))); connect(selPitch, SIGNAL(valueChanged(int)), SLOT(pitchChanged(int))); diff --git a/muse2/muse/widgets/noteinfo.h b/muse2/muse/widgets/noteinfo.h index 00c798fb..9607dfc1 100644 --- a/muse2/muse/widgets/noteinfo.h +++ b/muse2/muse/widgets/noteinfo.h @@ -7,19 +7,21 @@ #ifndef __NOTE_INFO_H__ #define __NOTE_INFO_H__ -#include +//#include +#include class PosEdit; class QSpinBox; class PitchEdit; -class Q3MainWindow; +//class QMainWindow; +class QWidget; class Pos; //--------------------------------------------------------- // NoteInfo //--------------------------------------------------------- -class NoteInfo : public Q3ToolBar { +class NoteInfo : public QToolBar { PosEdit* selTime; QSpinBox* selLen; PitchEdit* selPitch; @@ -31,7 +33,8 @@ class NoteInfo : public Q3ToolBar { public: enum ValType {VAL_TIME, VAL_LEN, VAL_VELON, VAL_VELOFF, VAL_PITCH }; - NoteInfo(Q3MainWindow* parent); + //NoteInfo(QMainWindow* parent); + NoteInfo(QWidget* parent = 0); void setValues(unsigned, int, int, int, int); void setDeltaMode(bool); diff --git a/muse2/muse/widgets/pitchlabel.cpp b/muse2/muse/widgets/pitchlabel.cpp index f53e6fa5..66af63fb 100644 --- a/muse2/muse/widgets/pitchlabel.cpp +++ b/muse2/muse/widgets/pitchlabel.cpp @@ -26,7 +26,8 @@ PitchLabel::PitchLabel(QWidget* parent, const char* name) setLineWidth(2); setMidLineWidth(3); setValue(0); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setIndent(fw); } @@ -46,7 +47,8 @@ void PitchLabel::setPitchMode(bool val) QSize PitchLabel::sizeHint() const { QFontMetrics fm(font()); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int h = fm.height() + fw * 2; // int w = 2 + fm.width(QString("A#8")) + fw * 4; int w = 2 + fm.width(QString("-9999")) + fw * 4; // must display 14Bit controller values diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp index 3066b640..e71fea49 100644 --- a/muse2/muse/widgets/poslabel.cpp +++ b/muse2/muse/widgets/poslabel.cpp @@ -32,7 +32,8 @@ PosLabel::PosLabel(QWidget* parent, const char* name) setFrameStyle(WinPanel | Sunken); setLineWidth(2); setMidLineWidth(3); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setIndent(fw); updateValue(); } @@ -44,7 +45,8 @@ PosLabel::PosLabel(QWidget* parent, const char* name) QSize PosLabel::sizeHint() const { QFontMetrics fm(font()); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int h = fm.height() + fw * 2; int w; if (_smpte) diff --git a/muse2/muse/widgets/poslabel.h b/muse2/muse/widgets/poslabel.h index 06cd0b09..f16aa64f 100644 --- a/muse2/muse/widgets/poslabel.h +++ b/muse2/muse/widgets/poslabel.h @@ -8,7 +8,8 @@ #ifndef __POSLABEL_H__ #define __POSLABEL_H__ -#include +//#include +#include //--------------------------------------------------------- // PosLabel diff --git a/muse2/muse/widgets/sliderbase.h b/muse2/muse/widgets/sliderbase.h index d2de6f7c..47084246 100644 --- a/muse2/muse/widgets/sliderbase.h +++ b/muse2/muse/widgets/sliderbase.h @@ -15,7 +15,7 @@ #define __SLIDERBASE_H__ #include "drange.h" -#include +#include #include #include //#include diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index d2b9b4a7..f6a2aff8 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -57,43 +57,64 @@ static const char* quantStrings[] = { // solo time pitch raster quant //--------------------------------------------------------- -Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) -//Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) // p4.0.4 - : Q3ToolBar(QString("Quant'n'Snap-tools"), parent) +//Toolbar1::Toolbar1(QMainWindow* parent, int r, int q, bool sp) +Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) + : QToolBar(QString("Quant'n'Snap-tools"), parent) //: QToolBar(QString("Qant'n'Snap-tools"), parent) { + pitch = 0; showPitch = sp; - setHorizontalStretchable(false); + // ORCAN - FIXME: Check this: + //setHorizontalStretchable(false); + //setHorizontalPolicy(QSizePolicy::Minimum); + //setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); - solo = new QToolButton(this); + solo = new QToolButton(); solo->setText(tr("Solo")); solo->setToggleButton(true); + addWidget(solo); //--------------------------------------------------- // Cursor Position //--------------------------------------------------- - QLabel* label = new QLabel(tr("Cursor"), this, "Cursor"); + //QLabel* label = new QLabel(tr("Cursor"), this, "Cursor"); + QLabel* label = new QLabel(tr("Cursor")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - pos = new PosLabel(this, "pos"); + addWidget(label); + //pos = new PosLabel(this, "pos"); + pos = new PosLabel(0, "pos"); + pos->setFixedHeight(22); + addWidget(pos); if (showPitch) { - pitch = new PitchLabel(this); + //pitch = new PitchLabel(this); + pitch = new PitchLabel(0); pitch->setEnabled(false); + pitch->setFixedHeight(22); + addWidget(pitch); } //--------------------------------------------------- // Raster, Quant. //--------------------------------------------------- - raster = new LabelCombo(tr("Snap"), this); - quant = new LabelCombo(tr("Quantize"), this); + //raster = new LabelCombo(tr("Snap"), this); + //quant = new LabelCombo(tr("Quantize"), this); + raster = new LabelCombo(tr("Snap"), 0); + quant = new LabelCombo(tr("Quantize"), 0); + //addWidget(raster); + //addWidget(quant); //Q3ListBox* rlist = new Q3ListBox(this); //Q3ListBox* qlist = new Q3ListBox(this); // p4.0.3 - QTableWidget* rlist = new QTableWidget(10, 3, this); - QTableWidget* qlist = new QTableWidget(8, 3, this); + //QTableWidget* rlist = new QTableWidget(10, 3, this); + //QTableWidget* qlist = new QTableWidget(8, 3, this); + QTableWidget* rlist = new QTableWidget(10, 3); + QTableWidget* qlist = new QTableWidget(8, 3); + //addWidget(rlist); + //addWidget(qlist); rlist->verticalHeader()->setDefaultSectionSize(22); rlist->horizontalHeader()->setDefaultSectionSize(32); rlist->setSelectionMode(QAbstractItemView::SingleSelection); @@ -130,13 +151,26 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) setRaster(r); setQuant(q); + addWidget(raster); + addWidget(quant); + + // FIXME: Not working right. + raster->setFixedHeight(38); + quant->setFixedHeight(38); + //--------------------------------------------------- // To Menu //--------------------------------------------------- - LabelCombo* to = new LabelCombo(tr("To"), this); + /* + //LabelCombo* to = new LabelCombo(tr("To"), this); + LabelCombo* to = new LabelCombo(tr("To"), 0); + addWidget(to); // Q3ListBox* toList = new Q3ListBox(this); - QListWidget* toList = new QListWidget(this); // p4.0.4 + //QListWidget* toList = new QListWidget(this); // p4.0.4 + QListWidget* toList = new QListWidget(); + toList->setFixedHeight(24); + //addWidget(toList); // //to->setListBox(toList); ddskrjo to->setView(toList); // p4.0.4 @@ -149,10 +183,21 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev.")); toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev.")); toList->insertItem(CMD_RANGE_LOOP | CMD_RANGE_SELECTED, tr("Looped+Sel.")); + */ + + addWidget(new QLabel(tr("To"))); + QComboBox* toList = new QComboBox; + toList->setFixedHeight(22); + toList->addItem(tr("All Events"), 0); + toList->addItem(tr("Looped Ev."), CMD_RANGE_LOOP); + toList->addItem(tr("Selected Ev."), CMD_RANGE_SELECTED); + toList->addItem(tr("Looped+Sel."), CMD_RANGE_LOOP | CMD_RANGE_SELECTED); + addWidget(toList); connect(raster, SIGNAL(activated(int)), SLOT(_rasterChanged(int))); connect(quant, SIGNAL(activated(int)), SLOT(_quantChanged(int))); - connect(to, SIGNAL(activated(int)), SIGNAL(toChanged(int))); + //connect(to, SIGNAL(activated(int)), SIGNAL(toChanged(int))); + connect(toList, SIGNAL(activated(int)), SIGNAL(toChanged(int))); connect(solo, SIGNAL(toggled(bool)), SIGNAL(soloChanged(bool))); pos->setEnabled(false); } @@ -181,7 +226,7 @@ void Toolbar1::_quantChanged(int index) void Toolbar1::setPitch(int val) { - if (showPitch) { + if (pitch && showPitch) { pitch->setEnabled(val != -1); pitch->setPitch(val); } @@ -189,7 +234,7 @@ void Toolbar1::setPitch(int val) void Toolbar1::setInt(int val) { - if (showPitch) { + if (pitch && showPitch) { pitch->setEnabled(val != -1); pitch->setInt(val); } @@ -202,7 +247,7 @@ void Toolbar1::setInt(int val) void Toolbar1::setTime(unsigned val) { if (!pos->isVisible()) { - printf("NOT visible\n"); + //printf("NOT visible\n"); return; } if (val == MAXINT) @@ -262,6 +307,7 @@ void Toolbar1::setSolo(bool flag) void Toolbar1::setPitchMode(bool /*flag*/) { -// pitch->setPitchMode(flag); + // if(pitch) +// pitch->setPitchMode(flag); } diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h index 40264abf..b330ee85 100644 --- a/muse2/muse/widgets/tb1.h +++ b/muse2/muse/widgets/tb1.h @@ -9,10 +9,10 @@ #define __TB1_H__ //#include -#include +//#include #include // p4.0.4 -//#include // +#include // class PosLabel; class PitchLabel; @@ -24,8 +24,8 @@ class QToolButton; // Toolbar1 //--------------------------------------------------------- -class Toolbar1 : public Q3ToolBar { -//class Toolbar1 : public QToolBar { // p4.0.4 +//class Toolbar1 : public Q3ToolBar { +class Toolbar1 : public QToolBar { // p4.0.4 QToolButton* solo; PosLabel* pos; PitchLabel* pitch; @@ -52,8 +52,8 @@ class Toolbar1 : public Q3ToolBar { void toChanged(int); public: - Toolbar1(Q3MainWindow* parent, int r=96, - //Toolbar1(QWidget* parent, int r=96, // p4.0.4 + //Toolbar1(QMainWindow* parent = 0, int r=96, + Toolbar1(QWidget* parent, int r=96, int q=96, bool showPitch=true); void setSolo(bool val); void setPitchMode(bool flag); diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp index bb6ba334..ec80230a 100644 --- a/muse2/muse/widgets/tools.cpp +++ b/muse2/muse/widgets/tools.cpp @@ -6,14 +6,18 @@ //========================================================= #include "tools.h" -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include + +#include +#include + //Added by qt3to4: -#include +#include #include "icons.h" #include "action.h" @@ -56,10 +60,12 @@ ToolB toolList[] = { // EditToolBar //--------------------------------------------------------- -EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) - : Q3ToolBar(tr("Edit Tools"), parent) +//EditToolBar::EditToolBar(QMainWindow* parent, int tools, const char*) +EditToolBar::EditToolBar(QWidget* parent, int tools, const char*) + : QToolBar(tr("Edit Tools"), parent) { - Q3ActionGroup* action = new Q3ActionGroup(parent, "editaction", true); + QActionGroup* action = new QActionGroup(parent); // Parent needed. + action->setExclusive(true); nactions = 0; for (unsigned i = 0; i < sizeof(toolList)/sizeof(*toolList); ++i) { @@ -77,7 +83,8 @@ EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) Action* a = new Action(action, 1<tip, true); actions[n] = a; - a->setIconSet(QIcon(**(t->icon))); + //a->setIconSet(QIcon(**(t->icon))); + a->setIcon(QIcon(**(t->icon))); a->setToolTip(tr(t->tip)); a->setWhatsThis(tr(t->ltip)); if (first) { @@ -86,16 +93,19 @@ EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) } ++n; } - action->addTo(this); - //connect(action, SIGNAL(selected(Q3Action*)), SLOT(toolChanged(QAction*))); - connect(action, SIGNAL(selected(Q3Action*)), SLOT(toolChanged(Q3Action*))); // p4.0.5 + action->setVisible(true); + //action->addTo(this); + // Note: Does not take ownership. + addActions(action->actions()); + + connect(action, SIGNAL(selected(QAction*)), SLOT(toolChanged(QAction*))); } //--------------------------------------------------------- // toolChanged //--------------------------------------------------------- -void EditToolBar::toolChanged(Q3Action* action) +void EditToolBar::toolChanged(QAction* action) { emit toolChanged(((Action*)action)->id()); } diff --git a/muse2/muse/widgets/tools.h b/muse2/muse/widgets/tools.h index efe5d57c..63304a4d 100644 --- a/muse2/muse/widgets/tools.h +++ b/muse2/muse/widgets/tools.h @@ -8,13 +8,15 @@ #ifndef __TOOLS_H__ #define __TOOLS_H__ -#include +//#include +#include //Added by qt3to4: #include -class Q3Action; +class QAction; class Action; -class Q3MainWindow; +//class QMainWindow; +class QWidget; enum Tool { PointerTool=1, PencilTool=2, RubberTool=4, CutTool=8, ScoreTool=16, GlueTool=32, QuantTool=64, DrawTool=128, MuteTool=256}; @@ -33,13 +35,13 @@ extern ToolB toolList[]; // EditToolBar //--------------------------------------------------------- -class EditToolBar : public Q3ToolBar { +class EditToolBar : public QToolBar { Q_OBJECT Action** actions; int nactions; private slots: - void toolChanged(Q3Action* action); + void toolChanged(QAction* action); signals: void toolChanged(int); @@ -48,7 +50,8 @@ class EditToolBar : public Q3ToolBar { void set(int id); public: - EditToolBar(Q3MainWindow*, int, const char* name = 0); + //EditToolBar(QMainWindow*, int, const char* name = 0); + EditToolBar(QWidget* /*parent*/, int /*tools*/, const char* name = 0); // Needs a parent ! ~EditToolBar(); int curTool(); }; diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp index 2a4852f3..2c4aeb01 100644 --- a/muse2/muse/widgets/utils.cpp +++ b/muse2/muse/widgets/utils.cpp @@ -9,7 +9,7 @@ #include #include "utils.h" #include -#include +#include #include // Quick bit-shift lookup table @@ -61,10 +61,10 @@ int num2cols(int min, int max) // hLine //--------------------------------------------------------- -Q3Frame* hLine(QWidget* w) +QFrame* hLine(QWidget* w) { - Q3Frame* delim = new Q3Frame(w); - delim->setFrameStyle(Q3Frame::HLine | Q3Frame::Sunken); + QFrame* delim = new QFrame(w); + delim->setFrameStyle(QFrame::HLine | QFrame::Sunken); return delim; } @@ -72,10 +72,10 @@ Q3Frame* hLine(QWidget* w) // vLine //--------------------------------------------------------- -Q3Frame* vLine(QWidget* w) +QFrame* vLine(QWidget* w) { - Q3Frame* delim = new Q3Frame(w); - delim->setFrameStyle(Q3Frame::VLine | Q3Frame::Sunken); + QFrame* delim = new QFrame(w); + delim->setFrameStyle(QFrame::VLine | QFrame::Sunken); return delim; } @@ -307,7 +307,7 @@ unsigned int string2u32bitmap(const QString& str) //--------------------------------------------------------- // Added by Tim. p3.3.8 -bool autoAdjustFontSize(Q3Frame* w, const QString& s, bool ignoreWidth, bool ignoreHeight, int max, int min) +bool autoAdjustFontSize(QFrame* w, const QString& s, bool ignoreWidth, bool ignoreHeight, int max, int min) { // In case the max or min was obtained from QFont::pointSize() which returns -1 // if the font is a pixel font, or if min is greater than max... diff --git a/muse2/muse/widgets/utils.h b/muse2/muse/widgets/utils.h index aaf501f0..297994c0 100644 --- a/muse2/muse/widgets/utils.h +++ b/muse2/muse/widgets/utils.h @@ -1,5 +1,5 @@ //Added by qt3to4: -#include +#include //========================================================= // MusE // Linux Music Editor @@ -10,7 +10,7 @@ #ifndef __UTILS_H__ #define __UTILS_H__ -class Q3Frame; +class QFrame; class QWidget; #include @@ -19,11 +19,11 @@ extern QString bitmap2String(int bm); extern int string2bitmap(const QString& str); extern QString u32bitmap2String(unsigned int bm); extern unsigned int string2u32bitmap(const QString& str); -extern bool autoAdjustFontSize(Q3Frame* w, const QString& s, bool ignoreWidth = false, bool ignoreHeight = false, int max = 10, int min = 4); +extern bool autoAdjustFontSize(QFrame* w, const QString& s, bool ignoreWidth = false, bool ignoreHeight = false, int max = 10, int min = 4); extern int num2cols(int min, int max); -extern Q3Frame* hLine(QWidget* parent); -extern Q3Frame* vLine(QWidget* parent); +extern QFrame* hLine(QWidget* parent); +extern QFrame* vLine(QWidget* parent); extern void dump(const unsigned char* p, int n); extern double curTime(); -- cgit v1.2.3