diff options
author | Florian Jung <flo@windfisch.org> | 2011-11-07 21:43:20 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-11-07 21:43:20 +0000 |
commit | 720a43f55f893c1472be0f859d224401f1ec73be (patch) | |
tree | d1876120c5e8892e0c8b2b8d023169f1013d2b11 /muse2/muse | |
parent | bce73374a78f5fdcc7cc776395157564b5ef9be5 (diff) |
housekeeping: pulled fixes from release into trunk
Diffstat (limited to 'muse2/muse')
62 files changed, 796 insertions, 1284 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 50a766dc..bd6bc560 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -93,25 +93,7 @@ namespace MusEGui { static pthread_t watchdogThread; //ErrorHandler *error; -static const char* fileOpenText = - QT_TRANSLATE_NOOP("@default", "Click this button to open a <em>new song</em>.<br>" - "You can also select the <b>Open command</b> from the File menu."); -static const char* fileSaveText = - QT_TRANSLATE_NOOP("@default", "Click this button to save the song you are " - "editing. You will be prompted for a file name.\n" - "You can also select the Save command from the File menu."); -static const char* fileNewText = QT_TRANSLATE_NOOP("@default", "Create New Song"); - -static const char* infoLoopButton = QT_TRANSLATE_NOOP("@default", "loop between left mark and right mark"); -static const char* infoPunchinButton = QT_TRANSLATE_NOOP("@default", "record starts at left mark"); -static const char* infoPunchoutButton = QT_TRANSLATE_NOOP("@default", "record stops at right mark"); -static const char* infoStartButton = QT_TRANSLATE_NOOP("@default", "rewind to start position"); -static const char* infoRewindButton = QT_TRANSLATE_NOOP("@default", "rewind current position"); -static const char* infoForwardButton = QT_TRANSLATE_NOOP("@default", "move current position"); -static const char* infoStopButton = QT_TRANSLATE_NOOP("@default", "stop sequencer"); -static const char* infoPlayButton = QT_TRANSLATE_NOOP("@default", "start sequencer play"); -static const char* infoRecordButton = QT_TRANSLATE_NOOP("@default", "to record press record and then play"); -static const char* infoPanicButton = QT_TRANSLATE_NOOP("@default", "send note off to all midi channels"); + #define PROJECT_LIST_LEN 6 static QString* projectList[PROJECT_LIST_LEN]; @@ -411,21 +393,21 @@ MusE::MusE(int argc, char** argv) : QMainWindow() tr("Loop"), MusEGlobal::transportAction); MusEGlobal::loopAction->setCheckable(true); - MusEGlobal::loopAction->setWhatsThis(tr(infoLoopButton)); + MusEGlobal::loopAction->setWhatsThis(tr("loop between left mark and right mark")); connect(MusEGlobal::loopAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setLoop(bool))); MusEGlobal::punchinAction = new QAction(QIcon(*MusEGui::punchin1Icon), tr("Punchin"), MusEGlobal::transportAction); MusEGlobal::punchinAction->setCheckable(true); - MusEGlobal::punchinAction->setWhatsThis(tr(infoPunchinButton)); + MusEGlobal::punchinAction->setWhatsThis(tr("record starts at left mark")); connect(MusEGlobal::punchinAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setPunchin(bool))); MusEGlobal::punchoutAction = new QAction(QIcon(*MusEGui::punchout1Icon), tr("Punchout"), MusEGlobal::transportAction); MusEGlobal::punchoutAction->setCheckable(true); - MusEGlobal::punchoutAction->setWhatsThis(tr(infoPunchoutButton)); + MusEGlobal::punchoutAction->setWhatsThis(tr("record stops at right mark")); connect(MusEGlobal::punchoutAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setPunchout(bool))); QAction *tseparator = new QAction(this); @@ -435,26 +417,26 @@ MusE::MusE(int argc, char** argv) : QMainWindow() MusEGlobal::startAction = new QAction(QIcon(*MusEGui::startIcon), tr("Start"), MusEGlobal::transportAction); - MusEGlobal::startAction->setWhatsThis(tr(infoStartButton)); + MusEGlobal::startAction->setWhatsThis(tr("rewind to start position")); connect(MusEGlobal::startAction, SIGNAL(activated()), MusEGlobal::song, SLOT(rewindStart())); MusEGlobal::rewindAction = new QAction(QIcon(*MusEGui::frewindIcon), tr("Rewind"), MusEGlobal::transportAction); - MusEGlobal::rewindAction->setWhatsThis(tr(infoRewindButton)); + MusEGlobal::rewindAction->setWhatsThis(tr("rewind current position")); connect(MusEGlobal::rewindAction, SIGNAL(activated()), MusEGlobal::song, SLOT(rewind())); MusEGlobal::forwardAction = new QAction(QIcon(*MusEGui::fforwardIcon), tr("Forward"), MusEGlobal::transportAction); - MusEGlobal::forwardAction->setWhatsThis(tr(infoForwardButton)); + MusEGlobal::forwardAction->setWhatsThis(tr("move current position")); connect(MusEGlobal::forwardAction, SIGNAL(activated()), MusEGlobal::song, SLOT(forward())); MusEGlobal::stopAction = new QAction(QIcon(*MusEGui::stopIcon), tr("Stop"), MusEGlobal::transportAction); MusEGlobal::stopAction->setCheckable(true); - MusEGlobal::stopAction->setWhatsThis(tr(infoStopButton)); + MusEGlobal::stopAction->setWhatsThis(tr("stop sequencer")); MusEGlobal::stopAction->setChecked(true); connect(MusEGlobal::stopAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setStop(bool))); @@ -462,20 +444,20 @@ MusE::MusE(int argc, char** argv) : QMainWindow() tr("Play"), MusEGlobal::transportAction); MusEGlobal::playAction->setCheckable(true); - MusEGlobal::playAction->setWhatsThis(tr(infoPlayButton)); + MusEGlobal::playAction->setWhatsThis(tr("start sequencer play")); MusEGlobal::playAction->setChecked(false); connect(MusEGlobal::playAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setPlay(bool))); MusEGlobal::recordAction = new QAction(QIcon(*MusEGui::recordIcon), tr("Record"), MusEGlobal::transportAction); MusEGlobal::recordAction->setCheckable(true); - MusEGlobal::recordAction->setWhatsThis(tr(infoRecordButton)); + MusEGlobal::recordAction->setWhatsThis(tr("to record press record and then play")); connect(MusEGlobal::recordAction, SIGNAL(toggled(bool)), MusEGlobal::song, SLOT(setRecord(bool))); MusEGlobal::panicAction = new QAction(QIcon(*MusEGui::panicIcon), tr("Panic"), this); - MusEGlobal::panicAction->setWhatsThis(tr(infoPanicButton)); + MusEGlobal::panicAction->setWhatsThis(tr("send note off to all midi channels")); connect(MusEGlobal::panicAction, SIGNAL(activated()), MusEGlobal::song, SLOT(panic())); MusECore::initMidiInstruments(); @@ -486,20 +468,26 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //-------- File Actions fileNewAction = new QAction(QIcon(*MusEGui::filenewIcon), tr("&New"), this); - fileNewAction->setToolTip(tr(fileNewText)); - fileNewAction->setWhatsThis(tr(fileNewText)); + fileNewAction->setToolTip(tr("Create New Song")); + fileNewAction->setWhatsThis(tr("Create New Song")); fileOpenAction = new QAction(QIcon(*MusEGui::openIcon), tr("&Open"), this); - fileOpenAction->setToolTip(tr(fileOpenText)); - fileOpenAction->setWhatsThis(tr(fileOpenText)); + fileOpenAction->setToolTip(tr("Click this button to open a <em>new song</em>.<br>" + "You can also select the <b>Open command</b> from the File menu.")); + fileOpenAction->setWhatsThis(tr("Click this button to open a <em>new song</em>.<br>" + "You can also select the <b>Open command</b> from the File menu.")); openRecent = new QMenu(tr("Open &Recent"), this); fileSaveAction = new QAction(QIcon(*MusEGui::saveIcon), tr("&Save"), this); - fileSaveAction->setToolTip(tr(fileSaveText)); - fileSaveAction->setWhatsThis(tr(fileSaveText)); + fileSaveAction->setToolTip(tr("Click this button to save the song you are " + "editing. You will be prompted for a file name.\n" + "You can also select the Save command from the File menu.")); + fileSaveAction->setWhatsThis(tr("Click this button to save the song you are " + "editing. You will be prompted for a file name.\n" + "You can also select the Save command from the File menu.")); fileSaveAsAction = new QAction(tr("Save &As"), this); @@ -2076,7 +2064,11 @@ void MusE::selectProject(QAction* act) if (!act) return; int id = act->data().toInt(); - assert(id < PROJECT_LIST_LEN); + if (!(id < PROJECT_LIST_LEN)) + { + printf("THIS SHOULD NEVER HAPPEN: id(%i) < PROJECT_LIST_LEN(%i) in MusE::selectProject!\n",id, PROJECT_LIST_LEN); + return; + } QString* name = projectList[id]; if (name == 0) return; @@ -2140,7 +2132,6 @@ void MusE::toplevelDeleting(MusEGui::TopWin* tl) } } printf("topLevelDeleting: top level %p not found\n", tl); - //assert(false); } //--------------------------------------------------------- @@ -2761,6 +2752,7 @@ again: } } microSleep(100000); + _arranger->songIsClearing(); MusEGlobal::song->clear(true, clear_all); microSleep(100000); return false; diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index 89245d64..ae753378 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -152,7 +152,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name) toolbar->addWidget(cursorPos); const char* rastval[] = { - QT_TRANSLATE_NOOP("@default", "Off"), QT_TRANSLATE_NOOP("@default", "Bar"), "1/2", "1/4", "1/8", "1/16" + QT_TRANSLATE_NOOP("MusEGui::Arranger", "Off"), QT_TRANSLATE_NOOP("MusEGui::Arranger", "Bar"), "1/2", "1/4", "1/8", "1/16" }; label = new QLabel(tr("Snap")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h index d4193c01..35a3fe36 100644 --- a/muse2/muse/arranger/arranger.h +++ b/muse2/muse/arranger/arranger.h @@ -187,6 +187,7 @@ class Arranger : public QWidget { int selectionSize() { return canvas->selectionSize(); } void setGlobalTempo(int); void clear(); + void songIsClearing() { canvas->songIsClearing(); } unsigned cursorValue() { return cursVal; } diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 9dc287ac..3b726845 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -629,7 +629,7 @@ void ArrangerView::clearScoreMenuMappers() void ArrangerView::populateAddTrack() { - QActionGroup *grp = MusEGui::populateAddTrack(addTrack); + QActionGroup *grp = MusEGui::populateAddTrack(addTrack, true); connect(addTrack, SIGNAL(triggered(QAction *)), SLOT(addNewTrack(QAction *))); trackMidiAction = grp->actions()[0]; diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 5a6e986d..366766ae 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -430,6 +430,13 @@ QPoint PartCanvas::raster(const QPoint& p) const return QPoint(x, y); } + +void PartCanvas::songIsClearing() +{ + curItem=NULL; + items.clearDelete(); +} + //--------------------------------------------------------- // partsChanged //--------------------------------------------------------- @@ -437,6 +444,10 @@ QPoint PartCanvas::raster(const QPoint& p) const void PartCanvas::partsChanged() { //items.clear(); + int sn = -1; + if (curItem) sn=curItem->part()->sn(); + curItem=NULL; + items.clearDelete(); for (MusECore::iTrack t = tracks->begin(); t != tracks->end(); ++t) { MusECore::PartList* pl = (*t)->parts(); @@ -444,6 +455,10 @@ void PartCanvas::partsChanged() MusECore::Part* part = i->second; NPart* np = new NPart(part); items.add(np); + + if (np->part()->sn() == sn) + curItem=np; + if (i->second->selected()) { selectItem(np, true); } diff --git a/muse2/muse/arranger/pcanvas.h b/muse2/muse/arranger/pcanvas.h index cda2632d..78b88a5c 100644 --- a/muse2/muse/arranger/pcanvas.h +++ b/muse2/muse/arranger/pcanvas.h @@ -180,9 +180,11 @@ class PartCanvas : public Canvas { virtual ~PartCanvas(); void partsChanged(); void cmd(int); + void songIsClearing(); + public slots: - void redirKeypress(QKeyEvent* e) { keyPress(e); } - void controllerChanged(MusECore::Track *t); + void redirKeypress(QKeyEvent* e) { keyPress(e); } + void controllerChanged(MusECore::Track *t); }; } // namespace MusEGui diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp index 7de92434..b674e20c 100644 --- a/muse2/muse/audiotrack.cpp +++ b/muse2/muse/audiotrack.cpp @@ -42,10 +42,10 @@ namespace MusECore { -bool AudioAux::_isVisible=true; -bool AudioInput::_isVisible=true; -bool AudioOutput::_isVisible=true; -bool AudioGroup::_isVisible = true; +bool AudioAux::_isVisible=false; +bool AudioInput::_isVisible=false; +bool AudioOutput::_isVisible=false; +bool AudioGroup::_isVisible =false; bool WaveTrack::_isVisible=true; // By T356. For caching jack in/out routing names BEFORE file save. diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 92748268..80fc7eae 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -100,6 +100,8 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag void TopWin::readStatus(MusECore::Xml& xml) { + int x=0, y=0, width=800, height=600; + for (;;) { MusECore::Xml::Token token = xml.parse(); @@ -110,11 +112,14 @@ void TopWin::readStatus(MusECore::Xml& xml) switch (token) { case MusECore::Xml::TagStart: - if (tag == "geometry_state") - { - if (!restoreGeometry(QByteArray::fromHex(xml.parse1().toAscii()))) - fprintf(stderr,"ERROR: couldn't restore geometry. however, this is probably not really a problem.\n"); - } + if (tag == "x") + x=xml.parseInt(); + else if (tag == "y") + y=xml.parseInt(); + else if (tag == "width") + width=xml.parseInt(); + else if (tag == "height") + height=xml.parseInt(); else if (tag == "toolbars") { if (!sharesToolsAndMenu()) @@ -143,7 +148,20 @@ void TopWin::readStatus(MusECore::Xml& xml) case MusECore::Xml::TagEnd: if (tag == "topwin") + { + if (mdisubwin) + { + mdisubwin->move(x, y); + mdisubwin->resize(width, height); + } + else + { + move(x,y); + resize(width,height); + } + return; + } default: break; @@ -163,7 +181,22 @@ void TopWin::writeStatus(int level, MusECore::Xml& xml) const // changing it won't break muse, but it may break proper // restoring of the positions xml.intTag(level, "is_subwin", isMdiWin()); - xml.strTag(level, "geometry_state", saveGeometry().toHex().data()); + + if (mdisubwin) + { + xml.intTag(level, "x", mdisubwin->x()); + xml.intTag(level, "y", mdisubwin->y()); + xml.intTag(level, "width", mdisubwin->width()); + xml.intTag(level, "height", mdisubwin->height()); + } + else + { + xml.intTag(level, "x", x()); + xml.intTag(level, "y", y()); + xml.intTag(level, "width", width()); + xml.intTag(level, "height", height()); + } + xml.intTag(level, "shares_menu", sharesToolsAndMenu()); if (!sharesToolsAndMenu()) diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index 315e686e..00914b36 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -730,7 +730,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //act = pup->addAction(tr("Create") + QT_TRANSLATE_NOOP("@default", " Jack") + tr(" output")); //act = pup->addAction(tr("Create") + QT_TRANSLATE_NOOP("@default", " Jack") + tr(" combo")); // ... or keep it simple and let the user click on the green lights instead. - act = pup->addAction(tr("Create") + QT_TRANSLATE_NOOP("@default", " Jack") + tr(" device")); + act = pup->addAction(tr("Create Jack device")); act->setData(0); typedef std::map<std::string, int > asmap; @@ -776,7 +776,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //if(!mapALSA.empty()) { pup->addSeparator(); - pup->addAction(new MusEGui::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup)); + pup->addAction(new MusEGui::MenuTitleItem("ALSA:", pup)); for(imap i = mapALSA.begin(); i != mapALSA.end(); ++i) { @@ -791,7 +791,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if(md->deviceType() != MusECore::MidiDevice::ALSA_MIDI) continue; - act = pup->addAction(QT_TRANSLATE_NOOP("@default", md->name())); + act = pup->addAction(md->name()); act->setData(idx); act->setCheckable(true); act->setChecked(md == dev); @@ -802,7 +802,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if(!mapSYNTH.empty()) { pup->addSeparator(); - pup->addAction(new MusEGui::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup)); + pup->addAction(new MusEGui::MenuTitleItem("SYNTH:", pup)); for(imap i = mapSYNTH.begin(); i != mapSYNTH.end(); ++i) { @@ -817,7 +817,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if(md->deviceType() != MusECore::MidiDevice::SYNTH_MIDI) continue; - act = pup->addAction(QT_TRANSLATE_NOOP("@default", md->name())); + act = pup->addAction(md->name()); act->setData(idx); act->setCheckable(true); act->setChecked(md == dev); @@ -828,7 +828,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //if(!mapJACK.empty()) { pup->addSeparator(); - pup->addAction(new MusEGui::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup)); + pup->addAction(new MusEGui::MenuTitleItem("JACK:", pup)); for(imap i = mapJACK.begin(); i != mapJACK.end(); ++i) { @@ -843,7 +843,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if(md->deviceType() != MusECore::MidiDevice::JACK_MIDI) continue; - act = pup->addAction(QT_TRANSLATE_NOOP("@default", md->name())); + act = pup->addAction(md->name()); act->setData(idx); act->setCheckable(true); act->setChecked(md == dev); diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp index 1a155fc4..f55eea5d 100644 --- a/muse2/muse/ctrl/ctrlcanvas.cpp +++ b/muse2/muse/ctrl/ctrlcanvas.cpp @@ -221,13 +221,11 @@ CtrlCanvas::CtrlCanvas(MidiEditor* e, QWidget* parent, int xmag, connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); setMouseTracking(true); - if (editor->parts()->empty()) { - curPart = 0; - curTrack = 0; - } - else { + curPart = 0; + curTrack = 0; + if (!editor->parts()->empty()) setCurTrackAndPart(); - } + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); @@ -1974,7 +1972,7 @@ void CtrlCanvas::draw(QPainter& p, const QRect& rect) // draw line tool //--------------------------------------------------- - if (drawLineMode && (tool == MusEGui::DrawTool)) { + if ((tool == MusEGui::DrawTool) && drawLineMode) { p.setPen(Qt::black); p.drawLine(line1x, line1y, line2x, line2y); } diff --git a/muse2/muse/dialogs.cpp b/muse2/muse/dialogs.cpp index d88977ff..54a080bf 100644 --- a/muse2/muse/dialogs.cpp +++ b/muse2/muse/dialogs.cpp @@ -71,6 +71,22 @@ void init_function_dialogs(QWidget* parent) paste_events_dialog = new PasteEventsDialog(parent); } +void retranslate_function_dialogs() +{ + gatetime_dialog->retranslateUi(gatetime_dialog); + velocity_dialog->retranslateUi(velocity_dialog); + quantize_dialog->retranslateUi(quantize_dialog); + erase_dialog->retranslateUi(erase_dialog); + del_overlaps_dialog->retranslateUi(del_overlaps_dialog); + set_notelen_dialog->retranslateUi(set_notelen_dialog); + move_notes_dialog->retranslateUi(move_notes_dialog); + transpose_dialog->retranslateUi(transpose_dialog); + crescendo_dialog->retranslateUi(crescendo_dialog); + legato_dialog->retranslateUi(legato_dialog); + paste_dialog->retranslateUi(paste_dialog); + paste_events_dialog->retranslateUi(paste_events_dialog); +} + void read_function_dialog_config(MusECore::Xml& xml) { if (erase_dialog==NULL) diff --git a/muse2/muse/dialogs.h b/muse2/muse/dialogs.h index 08830fe0..f2d28f8c 100644 --- a/muse2/muse/dialogs.h +++ b/muse2/muse/dialogs.h @@ -59,6 +59,7 @@ extern PasteDialog* paste_dialog; extern PasteEventsDialog* paste_events_dialog; void init_function_dialogs(QWidget* parent); +void retranslate_function_dialogs(); void read_function_dialog_config(MusECore::Xml& xml); void write_function_dialog_config(int level, MusECore::Xml& xml); diff --git a/muse2/muse/driver/alsamidi.cpp b/muse2/muse/driver/alsamidi.cpp index eae695db..3b6f5a20 100644 --- a/muse2/muse/driver/alsamidi.cpp +++ b/muse2/muse/driver/alsamidi.cpp @@ -39,6 +39,8 @@ #include "part.h" #include "gconfig.h" +#include <QApplication> + namespace MusECore { static int alsaSeqFdi = -1; @@ -208,18 +210,18 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const { if(!r->name().isEmpty()) { - s = QT_TRANSLATE_NOOP("@default", "Route"); + s = "Route"; if(r->channel != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel); + s += QString(" channel=\"%1\"").arg(r->channel); xml.tag(level++, s.toLatin1().constData()); xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).toLatin1().constData()); - s = QT_TRANSLATE_NOOP("@default", "dest"); + s = "dest"; if(r->type == Route::MIDI_DEVICE_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " devtype=\"%1\"")).arg(r->device->deviceType()); + s += QString(" devtype=\"%1\"").arg(r->device->deviceType()); else if(r->type != Route::TRACK_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type); - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name())); + s += QString(" type=\"%1\"").arg(r->type); + s += QString(" name=\"%1\"/").arg(Xml::xmlString(r->name())); xml.tag(level, s.toLatin1().constData()); xml.etag(level--, "Route"); diff --git a/muse2/muse/driver/jackmidi.cpp b/muse2/muse/driver/jackmidi.cpp index fa23d336..7a12b92d 100644 --- a/muse2/muse/driver/jackmidi.cpp +++ b/muse2/muse/driver/jackmidi.cpp @@ -276,10 +276,10 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const if(!r->name().isEmpty()) { xml.tag(level++, "Route"); - s = QT_TRANSLATE_NOOP("@default", "source"); + s = "source"; if(r->type != Route::TRACK_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type); - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name())); + s += QString(" type=\"%1\"").arg(r->type); + s += QString(" name=\"%1\"/").arg(Xml::xmlString(r->name())); xml.tag(level, s.toLatin1().constData()); xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData()); xml.etag(level--, "Route"); @@ -291,18 +291,18 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const { if(!r->name().isEmpty()) { - s = QT_TRANSLATE_NOOP("@default", "Route"); + s = "Route"; if(r->channel != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel); + s += QString(" channel=\"%1\"").arg(r->channel); xml.tag(level++, s.toLatin1().constData()); xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData()); - s = QT_TRANSLATE_NOOP("@default", "dest"); + s = "dest"; if(r->type == Route::MIDI_DEVICE_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " devtype=\"%1\"")).arg(r->device->deviceType()); + s += QString(" devtype=\"%1\"").arg(r->device->deviceType()); else if(r->type != Route::TRACK_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type); - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name())); + s += QString(" type=\"%1\"").arg(r->type); + s += QString(" name=\"%1\"/").arg(Xml::xmlString(r->name())); xml.tag(level, s.toLatin1().constData()); diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp index 97029d9d..4a9c1f6d 100644 --- a/muse2/muse/exportmidi.cpp +++ b/muse2/muse/exportmidi.cpp @@ -213,7 +213,7 @@ void MusE::exportMidi() //--------------------------------------------------- // Write Coment // - if (MusEGlobal::config.smfFormat == 0) // Only for smf 0 added by Tim. FIXME: Is this correct? See below. + //if (MusEGlobal::config.smfFormat == 0) // Only for smf 0 added by Tim. FIXME: Is this correct? See below. { QString comment = track->comment(); if (!comment.isEmpty()) { diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp index 256e4ad0..7459f30b 100644 --- a/muse2/muse/functions.cpp +++ b/muse2/muse/functions.cpp @@ -55,7 +55,7 @@ #include <QDrag> #include <QMessageBox> #include <QClipboard> - +#include <QSet> using namespace std; @@ -1278,34 +1278,22 @@ void shrink_parts(int raster) MusEGlobal::song->applyOperationGroup(operations); } -void internal_schedule_expand_part(Part* part, int raster, Undo& operations) -{ - EventList* events=part->events(); - unsigned len=part->lenTick(); - - for (iEvent ev=events->begin(); ev!=events->end(); ev++) - if (ev->second.endTick() > len) - len=ev->second.endTick(); - - if (raster) len=ceil((float)len/raster)*raster; - - if (len > part->lenTick()) - { - MidiPart* new_part = new MidiPart(*(MidiPart*)part); - new_part->setLenTick(len); - operations.push_back(UndoOp(UndoOp::ModifyPart, part, new_part, true, false)); - } -} void schedule_resize_all_same_len_clone_parts(Part* part, unsigned new_len, Undo& operations) { + QSet<const Part*> already_done; + + for (Undo::iterator op_it=operations.begin(); op_it!=operations.end();op_it++) + if (op_it->type==UndoOp::ModifyPart || op_it->type==UndoOp::DeletePart) + already_done.insert(op_it->nPart); + unsigned old_len=part->lenTick(); if (old_len!=new_len) { Part* part_it=part; do { - if (part_it->lenTick()==old_len) + if (part_it->lenTick()==old_len && !already_done.contains(part_it)) { MidiPart* new_part = new MidiPart(*(MidiPart*)part_it); new_part->setLenTick(new_len); diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp index fad6472e..05ba1011 100644 --- a/muse2/muse/globals.cpp +++ b/muse2/muse/globals.cpp @@ -116,21 +116,13 @@ bool loadDSSI = true; bool usePythonBridge = false; bool useLASH = true; -/* const char* midi_file_pattern[] = { - QT_TRANSLATE_NOOP("@default", "Midi/Kar (*.mid *.MID *.kar *.KAR *.mid.gz *.mid.bz2)"), - QT_TRANSLATE_NOOP("@default", "Midi (*.mid *.MID *.mid.gz *.mid.bz2)"), - QT_TRANSLATE_NOOP("@default", "Karaoke (*.kar *.KAR *.kar.gz *.kar.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "Midi/Kar (*.mid *.MID *.kar *.KAR *.mid.gz *.mid.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "Midi (*.mid *.MID *.mid.gz *.mid.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "Karaoke (*.kar *.KAR *.kar.gz *.kar.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList midi_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Midi/Kar (*.mid *.MID *.kar *.KAR *.mid.gz *.mid.bz2);;") + - QString("Midi (*.mid *.MID *.mid.gz *.mid.bz2);;") + - QString("Karaoke (*.kar *.KAR *.kar.gz *.kar.bz2);;") + - QString("All Files (*)")).split(";;"); //FIXME: By T356 01/19/2010 // If saving as a compressed file (gz or bz2), @@ -148,80 +140,40 @@ const char* midi_file_save_pattern[] = { "All Files (*)", 0 }; -QStringList midi_file_save_pattern = - QStringList::split(";;", QT_TRANSLATE_NOOP("@default", - QString("Midi (*.mid);;") + - QString("gzip compressed Midi (*.mid.gz);;") + - QString("bzip2 compressed Midi (*.mid.bz2);;") + - QString("Karaoke (*.kar);;") + - QString("gzip compressed karaoke (*.kar.gz);;") + - QString("bzip2 compressed karaoke (*.kar.bz2);;") + - QString("All Files (*)")) ); */ -/* const char* midi_file_save_pattern[] = { - QT_TRANSLATE_NOOP("@default", "Midi (*.mid)"), - QT_TRANSLATE_NOOP("@default", "Karaoke (*.kar)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "Midi (*.mid)"), + QT_TRANSLATE_NOOP("file_patterns", "Karaoke (*.kar)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList midi_file_save_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Midi (*.mid);;") + - QString("Karaoke (*.kar);;") + - QString("All Files (*)")).split(";;"); -/* const char* med_file_pattern[] = { - QT_TRANSLATE_NOOP("@default", "med Files (*.med *.med.gz *.med.bz2)"), - QT_TRANSLATE_NOOP("@default", "Uncompressed med Files (*.med)"), - QT_TRANSLATE_NOOP("@default", "gzip compressed med Files (*.med.gz)"), - QT_TRANSLATE_NOOP("@default", "bzip2 compressed med Files (*.med.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "all known files (*.med *.med.gz *.med.bz2 *.mid *.midi *.kar)"), + QT_TRANSLATE_NOOP("file_patterns", "med Files (*.med *.med.gz *.med.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "Uncompressed med Files (*.med)"), + QT_TRANSLATE_NOOP("file_patterns", "gzip compressed med Files (*.med.gz)"), + QT_TRANSLATE_NOOP("file_patterns", "bzip2 compressed med Files (*.med.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "mid Files (*.mid *.midi *.kar *.MID *.MIDI *.KAR)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; const char* med_file_save_pattern[] = { - QT_TRANSLATE_NOOP("@default", "Uncompressed med Files (*.med)"), - QT_TRANSLATE_NOOP("@default", "gzip compressed med Files (*.med.gz)"), - QT_TRANSLATE_NOOP("@default", "bzip2 compressed med Files (*.med.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "Uncompressed med Files (*.med)"), + QT_TRANSLATE_NOOP("file_patterns", "gzip compressed med Files (*.med.gz)"), + QT_TRANSLATE_NOOP("file_patterns", "bzip2 compressed med Files (*.med.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList med_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("all known files (*.med *.med.gz *.med.bz2 *.mid *.midi *.kar);;") + - QString("med Files (*.med *.med.gz *.med.bz2);;") + - QString("Uncompressed med Files (*.med);;") + - QString("gzip compressed med Files (*.med.gz);;") + - QString("bzip2 compressed med Files (*.med.bz2);;") + - QString("mid Files (*.mid *.midi *.kar);;") + - QString("All Files (*)")).split(";;"); -const QStringList med_file_save_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Uncompressed med Files (*.med);;") + - QString("gzip compressed med Files (*.med.gz);;") + - QString("bzip2 compressed med Files (*.med.bz2);;") + - QString("All Files (*)")).split(";;"); -/* const char* image_file_pattern[] = { - QT_TRANSLATE_NOOP("@default", "(*.jpg *.gif *.png)"), - QT_TRANSLATE_NOOP("@default", "(*.jpg)"), - QT_TRANSLATE_NOOP("@default", "(*.gif)"), - QT_TRANSLATE_NOOP("@default", "(*.png)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "(*.jpg *.gif *.png)"), + QT_TRANSLATE_NOOP("file_patterns", "(*.jpg)"), + QT_TRANSLATE_NOOP("file_patterns", "(*.gif)"), + QT_TRANSLATE_NOOP("file_patterns", "(*.png)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList image_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("(*.jpg *.gif *.png);;") + - QString("(*.jpg);;") + - QString("(*.gif);;") + - QString("(*.png);;") + - QString("All Files (*)")).split(";;"); // Not used. /* @@ -232,84 +184,62 @@ const char* ctrl_file_pattern[] = { }; */ -/* const char* part_file_pattern[] = { - //QT_TRANSLATE_NOOP("@default", "part Files (*.mpt)"), - QT_TRANSLATE_NOOP("@default", "part Files (*.mpt *.mpt.gz *.mpt.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "part Files (*.mpt *.mpt.gz *.mpt.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; const char* part_file_save_pattern[] = { - QT_TRANSLATE_NOOP("@default", "part Files (*.mpt)"), - QT_TRANSLATE_NOOP("@default", "gzip compressed part Files (*.mpt.gz)"), - QT_TRANSLATE_NOOP("@default", "bzip2 compressed part Files (*.mpt.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "part Files (*.mpt)"), + QT_TRANSLATE_NOOP("file_patterns", "gzip compressed part Files (*.mpt.gz)"), + QT_TRANSLATE_NOOP("file_patterns", "bzip2 compressed part Files (*.mpt.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList part_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("part Files (*.mpt *.mpt.gz *.mpt.bz2);;") + - QString("All Files (*)")).split(";;"); - -const QStringList part_file_save_pattern = - QT_TRANSLATE_NOOP("@default", - QString("part Files (*.mpt);;") + - QString("gzip compressed part Files (*.mpt.gz);;") + - QString("bzip2 compressed part Files (*.mpt.bz2);;") + - QString("All Files (*)")).split(";;"); /* const char* plug_file_pattern[] = { - QT_TRANSLATE_NOOP("@default", "part Files (*.pre)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "part Files (*.pre)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; */ -/* + const char* preset_file_pattern[] = { - QT_TRANSLATE_NOOP("@default", "Presets (*.pre *.pre.gz *.pre.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "Presets (*.pre *.pre.gz *.pre.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; const char* preset_file_save_pattern[] = { - QT_TRANSLATE_NOOP("@default", "Presets (*.pre)"), - QT_TRANSLATE_NOOP("@default", "gzip compressed presets (*.pre.gz)"), - QT_TRANSLATE_NOOP("@default", "bzip2 compressed presets (*.pre.bz2)"), - QT_TRANSLATE_NOOP("@default", "All Files (*)"), + QT_TRANSLATE_NOOP("file_patterns", "Presets (*.pre)"), + QT_TRANSLATE_NOOP("file_patterns", "gzip compressed presets (*.pre.gz)"), + QT_TRANSLATE_NOOP("file_patterns", "bzip2 compressed presets (*.pre.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), 0 }; -*/ -const QStringList preset_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Presets (*.pre *.pre.gz *.pre.bz2);;") + - QString("All Files (*)")).split(";;"); - -const QStringList preset_file_save_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Presets (*.pre);;") + - QString("gzip compressed presets (*.pre.gz);;") + - QString("bzip2 compressed presets (*.pre.bz2);;") + - QString("All Files (*)")).split(";;"); - -const QStringList drum_map_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Presets (*.map *.map.gz *.map.bz2);;") + - QString("All Files (*)")).split(";;"); -const QStringList drum_map_file_save_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Presets (*.map);;") + - QString("gzip compressed presets (*.map.gz);;") + - QString("bzip2 compressed presets (*.map.bz2);;") + - QString("All Files (*)")).split(";;"); - -const QStringList audio_file_pattern = - QT_TRANSLATE_NOOP("@default", - QString("Wave/Binary (*.wav *.ogg *.bin);;") + - QString("Wave (*.wav *.ogg);;") + - QString("Binary (*.bin);;") + - QString("All Files (*)")).split(";;"); + +const char* drum_map_file_pattern[] = { + QT_TRANSLATE_NOOP("file_patterns", "Presets (*.map *.map.gz *.map.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), + 0 +}; + +const char* drum_map_file_save_pattern[] = { + QT_TRANSLATE_NOOP("file_patterns", "Presets (*.map)"), + QT_TRANSLATE_NOOP("file_patterns", "gzip compressed presets (*.map.gz)"), + QT_TRANSLATE_NOOP("file_patterns", "bzip2 compressed presets (*.map.bz2)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), + 0 +}; + +const char* audio_file_pattern[] = { + QT_TRANSLATE_NOOP("file_patterns", "Wave/Binary (*.wav *.ogg *.bin)"), + QT_TRANSLATE_NOOP("file_patterns", "Wave (*.wav *.ogg)"), + QT_TRANSLATE_NOOP("file_patterns", "Binary (*.bin)"), + QT_TRANSLATE_NOOP("file_patterns", "All Files (*)"), + 0 +}; ///Qt::ButtonState globalKeyState; Qt::KeyboardModifiers globalKeyState; diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h index c0a3395a..ae624fb8 100644 --- a/muse2/muse/globals.h +++ b/muse2/muse/globals.h @@ -34,7 +34,6 @@ class QString; class QAction; class QActionGroup; -class QStringList; class QTimer; namespace MusEGui { @@ -91,33 +90,19 @@ extern bool realTimeScheduling; extern int realTimePriority; extern int midiRTPrioOverride; -/* -extern const char* midi_file_pattern[]; //!< File name pattern for midi files -extern const char* midi_file_save_pattern[]; //!< File name pattern for saving midi files -extern const char* med_file_pattern[]; //!< File name pattern for muse project files -extern const char* med_file_save_pattern[]; //!< File name pattern for saving muse project files -extern const char* image_file_pattern[]; //!< File name pattern for image files (gfx) -//extern const char* ctrl_file_pattern[]; //!< File name pattern for controller-files -extern const char* part_file_pattern[]; //!< File name pattern for part files -extern const char* part_file_save_pattern[]; //!< File name pattern for saving part files -//extern const char* plug_file_pattern[]; //!< File name pattern for plugin files -extern const char* preset_file_pattern[]; //!< File name pattern for plugin files -extern const char* preset_file_save_pattern[]; //!< File name pattern for saving plugin files -*/ - -extern const QStringList midi_file_pattern; -extern const QStringList midi_file_save_pattern; -extern const QStringList med_file_pattern; -extern const QStringList med_file_save_pattern; -extern const QStringList image_file_pattern; -//extern const QStringList ctrl_file_pattern; -extern const QStringList part_file_pattern; -extern const QStringList part_file_save_pattern; -extern const QStringList preset_file_pattern; -extern const QStringList preset_file_save_pattern; -extern const QStringList drum_map_file_pattern; -extern const QStringList drum_map_file_save_pattern; -extern const QStringList audio_file_pattern; +extern const char* midi_file_pattern[]; +extern const char* midi_file_save_pattern[]; +extern const char* med_file_pattern[]; +extern const char* med_file_save_pattern[]; +extern const char* image_file_pattern[]; +//extern const char* ctrl_file_pattern[]; +extern const char* part_file_pattern[]; +extern const char* part_file_save_pattern[]; +extern const char* preset_file_pattern[]; +extern const char* preset_file_save_pattern[]; +extern const char* drum_map_file_pattern[]; +extern const char* drum_map_file_save_pattern[]; +extern const char* audio_file_pattern[]; ///extern Qt::ButtonState globalKeyState; extern Qt::KeyboardModifiers globalKeyState; diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp index a3a4639c..682bfe8e 100644 --- a/muse2/muse/helper.cpp +++ b/muse2/muse/helper.cpp @@ -29,6 +29,8 @@ #include "synth.h" #include "functions.h" +#include <QApplication> + #ifdef DSSI_SUPPORT #include "dssihost.h" #endif @@ -188,7 +190,7 @@ QMenu* populateAddSynth(QWidget* parent) // No MESS sub-menu yet? Create it now. if(!synpMESS) synpMESS = new QMenu(parent); - QAction* sM = synpMESS->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); + QAction* sM = synpMESS->addAction(s->description() + " <" + s->name() + ">"); sM->setData(MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -206,7 +208,7 @@ QMenu* populateAddSynth(QWidget* parent) if(!synpDSSI) synpDSSI = new QMenu(parent); //synpDSSI->insertItem(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); - QAction* sD = synpDSSI->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); + QAction* sD = synpDSSI->addAction(s->description() + " <" + s->name() + ">"); sD->setData(MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -224,7 +226,7 @@ QMenu* populateAddSynth(QWidget* parent) // No VST sub-menu yet? Create it now. if(!synpVST) synpVST = new QMenu(parent); - QAction* sV = synpVST->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); + QAction* sV = synpVST->addAction(s->description() + " <" + "@default", s->name() + ">"); sV->setData(MENU_ADD_SYNTH_ID_BASE + idx); } } @@ -240,14 +242,14 @@ QMenu* populateAddSynth(QWidget* parent) if(!synpOther) synpOther = new QMenu(parent); //synpOther->insertItem(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">", MENU_ADD_SYNTH_ID_BASE + idx); - QAction* sO = synpOther->addAction(QT_TRANSLATE_NOOP("@default", s->description()) + " <" + QT_TRANSLATE_NOOP("@default", s->name()) + ">"); + QAction* sO = synpOther->addAction(s->description() + " <" + s->name() + ">"); sO->setData(MENU_ADD_SYNTH_ID_BASE + idx); } if(synpMESS) { synpMESS->setIcon(*synthIcon); - synpMESS->setTitle(QT_TRANSLATE_NOOP("@default", "MESS")); + synpMESS->setTitle("MESS"); synp->addMenu(synpMESS); } @@ -255,7 +257,7 @@ QMenu* populateAddSynth(QWidget* parent) if(synpDSSI) { synpDSSI->setIcon(*synthIcon); - synpDSSI->setTitle(QT_TRANSLATE_NOOP("@default", "DSSI")); + synpDSSI->setTitle("DSSI"); synp->addMenu(synpDSSI); } #endif @@ -264,7 +266,7 @@ QMenu* populateAddSynth(QWidget* parent) if(synpVST) { synpVST->setIcon(*synthIcon); - synpVST->setTitle(QT_TRANSLATE_NOOP("@default", "FST")); + synpVST->setTitle("FST"); synp->addMenu(synpVST); } #endif @@ -285,43 +287,55 @@ QMenu* populateAddSynth(QWidget* parent) // this is also used in "mixer" //--------------------------------------------------------- -QActionGroup* populateAddTrack(QMenu* addTrack) +QActionGroup* populateAddTrack(QMenu* addTrack, bool populateAll) { QActionGroup* grp = new QActionGroup(addTrack); QAction* midi = addTrack->addAction(QIcon(*addtrack_addmiditrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Midi Track")); + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Midi Track"))); midi->setData(MusECore::Track::MIDI); grp->addAction(midi); QAction* drum = addTrack->addAction(QIcon(*addtrack_drumtrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Drum Track")); + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Drum Track"))); drum->setData(MusECore::Track::DRUM); grp->addAction(drum); QAction* wave = addTrack->addAction(QIcon(*addtrack_wavetrackIcon), - QT_TRANSLATE_NOOP("@default", "Add Wave Track")); + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Wave Track"))); wave->setData(MusECore::Track::WAVE); grp->addAction(wave); - QAction* aoutput = addTrack->addAction(QIcon(*addtrack_audiooutputIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Output")); - aoutput->setData(MusECore::Track::AUDIO_OUTPUT); - grp->addAction(aoutput); - QAction* agroup = addTrack->addAction(QIcon(*addtrack_audiogroupIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Group")); - agroup->setData(MusECore::Track::AUDIO_GROUP); - grp->addAction(agroup); - QAction* ainput = addTrack->addAction(QIcon(*addtrack_audioinputIcon), - QT_TRANSLATE_NOOP("@default", "Add Audio Input")); - ainput->setData(MusECore::Track::AUDIO_INPUT); - grp->addAction(ainput); - QAction* aaux = addTrack->addAction(QIcon(*addtrack_auxsendIcon), - QT_TRANSLATE_NOOP("@default", "Add Aux Send")); - aaux->setData(MusECore::Track::AUDIO_AUX); - grp->addAction(aaux); + + if (populateAll || MusECore::AudioOutput::visible()) { + QAction* aoutput = addTrack->addAction(QIcon(*addtrack_audiooutputIcon), + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Audio Output"))); + aoutput->setData(MusECore::Track::AUDIO_OUTPUT); + grp->addAction(aoutput); + } + + if (populateAll || MusECore::AudioGroup::visible()) { + QAction* agroup = addTrack->addAction(QIcon(*addtrack_audiogroupIcon), + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Audio Group"))); + agroup->setData(MusECore::Track::AUDIO_GROUP); + grp->addAction(agroup); + } + + if (populateAll || MusECore::AudioInput::visible()) { + QAction* ainput = addTrack->addAction(QIcon(*addtrack_audioinputIcon), + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Audio Input"))); + ainput->setData(MusECore::Track::AUDIO_INPUT); + grp->addAction(ainput); + } + + if (populateAll || MusECore::AudioAux::visible()) { + QAction* aaux = addTrack->addAction(QIcon(*addtrack_auxsendIcon), + qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Aux Send"))); + aaux->setData(MusECore::Track::AUDIO_AUX); + grp->addAction(aaux); + } // Create a sub-menu and fill it with found synth types. Make addTrack the owner. QMenu* synp = populateAddSynth(addTrack); synp->setIcon(*synthIcon); - synp->setTitle(QT_TRANSLATE_NOOP("@default", "Add Synth")); + synp->setTitle(qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Add Synth"))); // Add the sub-menu to the given menu. addTrack->addMenu(synp); @@ -332,3 +346,12 @@ QActionGroup* populateAddTrack(QMenu* addTrack) } } // namespace MusEGui + +QStringList localizedStringListFromCharArray(const char** array, const char* context) +{ + QStringList temp; + for (int i=0;array[i];i++) + temp << qApp->translate(context, array[i]); + + return temp; +} diff --git a/muse2/muse/helper.h b/muse2/muse/helper.h index a2361ab5..e1bf93de 100644 --- a/muse2/muse/helper.h +++ b/muse2/muse/helper.h @@ -24,6 +24,7 @@ #define __HELPER_H__ #include <set> +#include <QStringList> class QActionGroup; class QString; @@ -40,8 +41,9 @@ bool any_event_selected(const std::set<Part*>&, bool in_range=false); namespace MusEGui { QMenu* populateAddSynth(QWidget* parent); -QActionGroup* populateAddTrack(QMenu* addTrack); +QActionGroup* populateAddTrack(QMenu* addTrack, bool populateAll=false); } +QStringList localizedStringListFromCharArray(const char** array, const char* context); #endif diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index e94a4ea8..ccd33b92 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -21,7 +21,6 @@ // //========================================================= -#include <assert.h> #include <errno.h> #include <values.h> @@ -409,7 +408,8 @@ void MusE::processTrack(MusECore::MidiTrack* track) i->second.dump(); } // all events should be processed: - assert(tevents->empty()); + if (!tevents->empty()) + printf("THIS SHOULD NEVER HAPPEN: not all events processed at the end of MusE::processTrack()!\n"); } //--------------------------------------------------------- diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index e4837bf9..f6a77b85 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -469,6 +469,8 @@ QString EventListItem::text(int col) const ListEdit::ListEdit(MusECore::PartList* pl) : MidiEditor(TopWin::LISTE, 0, pl) { + selectedTick=0; + insertItems = new QActionGroup(this); insertItems->setExclusive(false); insertNote = new QAction(QIcon(*note1Icon), tr("insert Note"), insertItems); @@ -591,7 +593,6 @@ ListEdit::ListEdit(MusECore::PartList* pl) mainGrid->setColumnStretch(0, 100); mainGrid->addWidget(liste, 1, 0, 2, 1); connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); - songChanged(-1); if(pl->empty()) { @@ -609,6 +610,8 @@ ListEdit::ListEdit(MusECore::PartList* pl) curPartId = -1; } } + + songChanged(-1); initShortcuts(); diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp index 27a8926e..0353d0d6 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -486,7 +486,9 @@ int main(int argc, char* argv[]) printf("locale de\n"); MusEGlobal::hIsB = false; } - + + MusEGui::retranslate_function_dialogs(); + if (MusEGlobal::loadPlugins) MusECore::initPlugins(); diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp index 50c3f518..02bef8a1 100644 --- a/muse2/muse/master/master.cpp +++ b/muse2/muse/master/master.cpp @@ -27,6 +27,8 @@ #include <QEvent> #include <QMouseEvent> #include <QPainter> +#include <QList> +#include <QPair> #include "globals.h" #include "master.h" @@ -52,6 +54,8 @@ Master::Master(MidiEditor* e, QWidget* parent, int xmag, int ymag) pos[0] = 0; pos[1] = 0; pos[2] = 0; + drag = DRAG_OFF; + tool = MusEGui::PointerTool; // should be overridden soon anyway, but to be sure... setFocusPolicy(Qt::StrongFocus); // Tim. setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); @@ -288,8 +292,8 @@ void Master::viewMouseReleaseEvent(QMouseEvent*) bool Master::deleteVal1(unsigned int x1, unsigned int x2) { - bool songChanged = false; - + QList< QPair<int,int> > stuff_to_do; + MusECore::TempoList* tl = &MusEGlobal::tempomap; for (MusECore::iTEvent i = tl->begin(); i != tl->end(); ++i) { if (i->first < x1) @@ -300,11 +304,17 @@ bool Master::deleteVal1(unsigned int x1, unsigned int x2) ++ii; if (ii != tl->end()) { int tempo = ii->second->tempo; - MusEGlobal::audio->msgDeleteTempo(i->first, tempo, false); - songChanged = true; + // changed by flo: postpone the actual delete operation + // to avoid race conditions and invalidating the iterator + //MusEGlobal::audio->msgDeleteTempo(i->first, tempo, false); + stuff_to_do.append(QPair<int,int>(i->first, tempo)); } } - return songChanged; + + for (QList< QPair<int,int> >::iterator it=stuff_to_do.begin(); it!=stuff_to_do.end(); it++) + MusEGlobal::audio->msgDeleteTempo(it->first, it->second, false); + + return !stuff_to_do.empty(); } void Master::deleteVal(int x1, int x2) diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index c3c66008..191f82ab 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -159,7 +159,7 @@ MasterEdit::MasterEdit() info->addWidget(tempo); const char* rastval[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "Bar", "1/2", "1/4", "1/8", "1/16" + QT_TRANSLATE_NOOP("MusEGui::MasterEdit", "Off"), QT_TRANSLATE_NOOP("MusEGui::MasterEdit", "Bar"), "1/2", "1/4", "1/8", "1/16" }; rasterLabel = new MusEGui::LabelCombo(tr("Snap"), 0); rasterLabel->setFocusPolicy(Qt::NoFocus); diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp index 0d81ff2c..754d19f3 100644 --- a/muse2/muse/midi.cpp +++ b/muse2/muse/midi.cpp @@ -25,7 +25,6 @@ #include <cmath> #include <errno.h> #include <values.h> -#include <assert.h> #include "song.h" #include "midi.h" diff --git a/muse2/muse/midictrl.cpp b/muse2/muse/midictrl.cpp index 11849ce7..c477297e 100644 --- a/muse2/muse/midictrl.cpp +++ b/muse2/muse/midictrl.cpp @@ -21,7 +21,6 @@ // //========================================================= -#include <assert.h> #include <stdio.h> #include "midictrl.h" @@ -241,7 +240,7 @@ QString midiCtrlName(int ctrl, bool fullyQualified) //--------------------------------------------------------- MidiController::MidiController() - : _name(QString(QT_TRANSLATE_NOOP("@default", "Velocity"))) + : _name(QString("Velocity")) { _num = CTRL_VELOCITY; _minVal = 0; diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index da94986b..7b5949a4 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -74,11 +74,11 @@ DEvent::DEvent(MusECore::Event e, MusECore::Part* p) // addItem //--------------------------------------------------------- -void DrumCanvas::addItem(MusECore::Part* part, MusECore::Event& event) +CItem* DrumCanvas::addItem(MusECore::Part* part, MusECore::Event& event) { if (signed(event.tick())<0) { printf("ERROR: trying to add event before current part!\n"); - return; + return NULL; } DEvent* ev = new DEvent(event, part); @@ -93,6 +93,8 @@ void DrumCanvas::addItem(MusECore::Part* part, MusECore::Event& event) //part = newPart; part->setLenTick(part->lenTick()+diff); } + + return ev; } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/dcanvas.h b/muse2/muse/midiedit/dcanvas.h index bc9dbdbc..5417a187 100644 --- a/muse2/muse/midiedit/dcanvas.h +++ b/muse2/muse/midiedit/dcanvas.h @@ -85,7 +85,7 @@ class DrumCanvas : public EventCanvas { void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent*); void dragLeaveEvent(QDragLeaveEvent*); - virtual void addItem(MusECore::Part*, MusECore::Event&); + virtual CItem* addItem(MusECore::Part*, MusECore::Event&); virtual void resizeEvent(QResizeEvent*); virtual void curPartChanged(); int getNextStep(unsigned int pos, int basicStep, int stepSize=1); diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp index 61891b2e..9189d177 100644 --- a/muse2/muse/midiedit/ecanvas.cpp +++ b/muse2/muse/midiedit/ecanvas.cpp @@ -150,6 +150,17 @@ void EventCanvas::songChanged(int flags) if (flags & ~SC_SELECTION) { //items.clear(); + bool curItemNeedsRestore=false; + MusECore::Event storedEvent; + int partSn; + if (curItem) + { + curItemNeedsRestore=true; + storedEvent=curItem->event(); + partSn=curItem->part()->sn(); + } + curItem=NULL; + items.clearDelete(); start_tick = MAXINT; end_tick = 0; @@ -176,7 +187,15 @@ void EventCanvas::songChanged(int flags) break; if (e.isNote()) { - addItem(part, e); + CItem* temp = addItem(part, e); + + if (temp && curItemNeedsRestore && e==storedEvent && part->sn()==partSn) + { + if (curItem!=NULL) + printf("THIS SHOULD NEVER HAPPEN: curItemNeedsRestore=true, event fits, but there was already a fitting event!?\n"); + + curItem=temp; + } } } } diff --git a/muse2/muse/midiedit/ecanvas.h b/muse2/muse/midiedit/ecanvas.h index 1c66e9b4..a67b7a14 100644 --- a/muse2/muse/midiedit/ecanvas.h +++ b/muse2/muse/midiedit/ecanvas.h @@ -71,7 +71,7 @@ class EventCanvas : public Canvas { bool _midiin; void updateSelection(); - virtual void addItem(MusECore::Part*, MusECore::Event&) = 0; + virtual CItem* addItem(MusECore::Part*, MusECore::Event&) = 0; // Added by T356. virtual QPoint raster(const QPoint&) const; virtual MusECore::Undo moveCanvasItems(CItemList&, int, int, DragType) = 0; diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 8a7356aa..926f4212 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -118,7 +118,7 @@ PianoRoll::PianoRoll(MusECore::PartList* pl, QWidget* parent, const char* name, mapper->setMapping(editPasteAction, PianoCanvas::CMD_PASTE); connect(editPasteAction, SIGNAL(triggered()), mapper, SLOT(map())); - editPasteDialogAction = menuEdit->addAction(QIcon(*editpasteIconSet), tr("&Paste (with dialog)")); + editPasteDialogAction = menuEdit->addAction(QIcon(*editpasteIconSet), tr("Paste (with dialog)")); mapper->setMapping(editPasteDialogAction, PianoCanvas::CMD_PASTE_DIALOG); connect(editPasteDialogAction, SIGNAL(triggered()), mapper, SLOT(map())); diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index a70c4a91..0348bcbe 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -29,6 +29,8 @@ #include <QDragMoveEvent> #include <QDropEvent> #include <QMouseEvent> +#include <QList> +#include <QPair> #include <set> @@ -74,11 +76,11 @@ NEvent::NEvent(MusECore::Event& e, MusECore::Part* p, int y) : MusEGui::CItem(e, // addItem //--------------------------------------------------------- -void PianoCanvas::addItem(MusECore::Part* part, MusECore::Event& event) +CItem* PianoCanvas::addItem(MusECore::Part* part, MusECore::Event& event) { if (signed(event.tick())<0) { printf("ERROR: trying to add event before current part!\n"); - return; + return NULL; } NEvent* ev = new NEvent(event, part, pitch2y(event.pitch())); @@ -93,6 +95,8 @@ void PianoCanvas::addItem(MusECore::Part* part, MusECore::Event& event) //part = newPart; part->setLenTick(part->lenTick()+diff); } + + return ev; } //--------------------------------------------------------- @@ -1080,6 +1084,7 @@ void PianoCanvas::curPartChanged() void PianoCanvas::modifySelected(MusEGui::NoteInfo::ValType type, int delta) { + QList< QPair<MusECore::EventList*,MusECore::Event> > already_done; MusEGlobal::audio->msgIdle(true); MusEGlobal::song->startUndo(); for (MusEGui::iCItem i = items.begin(); i != items.end(); ++i) { @@ -1091,6 +1096,10 @@ void PianoCanvas::modifySelected(MusEGui::NoteInfo::ValType type, int delta) continue; MusECore::MidiPart* part = (MusECore::MidiPart*)(e->part()); + + if (already_done.contains(QPair<MusECore::EventList*,MusECore::Event>(part->events(), event))) + continue; + MusECore::Event newEvent = event.clone(); switch (type) { @@ -1145,6 +1154,8 @@ void PianoCanvas::modifySelected(MusEGui::NoteInfo::ValType type, int delta) // Indicate do not do port controller values and clone parts. //MusEGlobal::song->addUndo(MusECore::UndoOp(MusECore::UndoOp::ModifyEvent, newEvent, event, part)); MusEGlobal::song->addUndo(MusECore::UndoOp(MusECore::UndoOp::ModifyEvent, newEvent, event, part, false, false)); + + already_done.append(QPair<MusECore::EventList*,MusECore::Event>(part->events(), event)); } MusEGlobal::song->endUndo(SC_EVENT_MODIFIED); MusEGlobal::audio->msgIdle(false); diff --git a/muse2/muse/midiedit/prcanvas.h b/muse2/muse/midiedit/prcanvas.h index 13effc19..42de7c95 100644 --- a/muse2/muse/midiedit/prcanvas.h +++ b/muse2/muse/midiedit/prcanvas.h @@ -82,7 +82,7 @@ class PianoCanvas : public EventCanvas { virtual void dragEnterEvent(QDragEnterEvent* event); virtual void dragMoveEvent(QDragMoveEvent*); virtual void dragLeaveEvent(QDragLeaveEvent*); - virtual void addItem(MusECore::Part*, MusECore::Event&); + virtual CItem* addItem(MusECore::Part*, MusECore::Event&); int y2pitch(int) const; int pitch2y(int) const; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 9ddf8fbb..e313c417 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -88,10 +88,6 @@ QString IntToQStr(int i); -#define APPLY_TO_SELECTED_STRING tr("Apply to selected notes:") -#define APPLY_TO_NEW_STRING tr("Apply to new notes:") - - //PIXELS_PER_NOTEPOS must be greater or equal to 3*NOTE_XLEN + 2*NOTE_SHIFT //because if tick 0 is at x=0: the notes can be shifted by NOTE_SHIFT. //additionally, they can be moved by NOTE_XLEN (collision avoiding) @@ -223,6 +219,8 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) xscroll->setMinimum(0); yscroll->setMinimum(0); + xscroll->setValue(0); + yscroll->setValue(0); menu_mapper=new QSignalMapper(this); connect(menu_mapper, SIGNAL(mapped(int)), SLOT(menu_command(int))); @@ -300,9 +298,9 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) note_settings_toolbar->addSeparator(); - apply_velo_to_label = new QLabel(APPLY_TO_NEW_STRING, note_settings_toolbar); - int w1 = apply_velo_to_label->fontMetrics().width(APPLY_TO_NEW_STRING); - int w2 = apply_velo_to_label->fontMetrics().width(APPLY_TO_SELECTED_STRING); + apply_velo_to_label = new QLabel(tr("Apply to new notes:"), note_settings_toolbar); + int w1 = apply_velo_to_label->fontMetrics().width(tr("Apply to new notes:")); + int w2 = apply_velo_to_label->fontMetrics().width(tr("Apply to selected notes:")); if (w1>w2) apply_velo_to_label->setFixedWidth(w1+5); else @@ -612,11 +610,11 @@ void ScoreEdit::song_changed(int flags) map<MusECore::Event*, MusECore::Part*> selection=get_events(score_canvas->get_all_parts(),1); if (selection.empty()) { - apply_velo_to_label->setText(APPLY_TO_NEW_STRING); + apply_velo_to_label->setText(tr("Apply to new notes:")); } else { - apply_velo_to_label->setText(APPLY_TO_SELECTED_STRING); + apply_velo_to_label->setText(tr("Apply to selected notes:")); int velo=-1; int velo_off=-1; @@ -662,6 +660,7 @@ void ScoreEdit::canvas_height_changed(int height) void ScoreEdit::viewport_height_changed(int height) { int val=score_canvas->canvas_height() - height; + // FINDMICHJETZT canvas_height() is uninitalized! if (val<0) val=0; yscroll->setPageStep(height * PAGESTEP); yscroll->setMaximum(val); @@ -1454,8 +1453,8 @@ void ScoreCanvas::fully_recalculate() void ScoreCanvas::song_changed(int flags) { - if(parent && parent->deleting()) // Ignore while while deleting to prevent crash. - return; + if(parent && parent->deleting()) // Ignore while while deleting to prevent crash. + return; if (flags & (SC_PART_MODIFIED | SC_PART_REMOVED | SC_PART_INSERTED | SC_TRACK_REMOVED)) { @@ -1506,7 +1505,7 @@ int ScoreCanvas::canvas_width() int ScoreCanvas::canvas_height() { - return staves.rbegin()->y_bottom; + return staves.empty() ? 0 : staves.rbegin()->y_bottom; } int ScoreCanvas::viewport_width() @@ -2796,6 +2795,7 @@ void ScoreCanvas::draw_note_lines(QPainter& p, int y, bool reserve_akkolade_spac { int xbegin = reserve_akkolade_space ? AKKOLADE_LEFTMARGIN+AKKOLADE_WIDTH+AKKOLADE_RIGHTMARGIN : 0; int xend=width(); + // FINDMICHJETZT y is uninitalized! p.setPen(Qt::black); @@ -4186,7 +4186,7 @@ void ScoreCanvas::pos_changed(int index, unsigned tick, bool scroll) { switch (MusEGlobal::song->follow()) { - case MusECore::Song::NO: break; + case MusECore::Song::NO: break; case MusECore::Song::JUMP: goto_tick(tick,false); break; case MusECore::Song::CONTINUOUS: goto_tick(tick,true); break; } @@ -4594,17 +4594,15 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo * changing "share" status, the changed state isn't stored * ? pasting in editors sometimes fails oO? ( ERROR: reading eventlist * from clipboard failed. ignoring this one... ) [ not reproducible ] + * > o non-mdi topwin states aren't restored when launching muse2 somefile.med * * CURRENT TODO - * ! o fix sigedit boxes (see also "important todo") - * o fix valgrind problems - * > o drum editor: channel-stuff + * > o fix valgrind problems (the two "FINDMICHJETZT" lines in scoreedit.cpp) + * > o newly created windows have to be focussed! * * IMPORTANT TODO - * ! o fix sigedit boxes (see also "current todo") * o add "dotted quarter" quantize option (for 6/8 beat) * o ticks-to-quarter spinboxes - * o newly created windows have to be focussed! * o mirror most menus to an additional right-click context menu to avoid the long mouse pointer * journey to the menu bar. try to find a way which does not involve duplicate code! * o implement borland-style maximize: free windows do not cover the main menu, even when maximized diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index 29ab258e..baea78e3 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -275,6 +275,9 @@ class FloEvent tick=ti; source_event=event; source_part=part; + + num=denom=0xdeadbeef; //unused, but valgrind complains if uninited + key=MusECore::KEY_C; } FloEvent(unsigned ti, typeEnum t, int num_, int denom_) { @@ -284,6 +287,9 @@ class FloEvent tick=ti; source_event=NULL; source_part=NULL; + + len=vel=pitch=0xdeadbeef; //unused, but valgrind complains if uninited + key=MusECore::KEY_C; } FloEvent(unsigned ti, typeEnum t, MusECore::key_enum k) { @@ -292,6 +298,8 @@ class FloEvent tick=ti; source_event=NULL; source_part=NULL; + + pitch=vel=len=num=denom=0xdeadbeef; //unused, but valgrind complains if uninited } }; class FloItem @@ -345,6 +353,7 @@ class FloItem begin_tick=beg; source_event=event; source_part=part; + is_active=false; } FloItem(typeEnum t, int num_, int denom_) diff --git a/muse2/muse/midifile.cpp b/muse2/muse/midifile.cpp index 2db2855d..1fc7e114 100644 --- a/muse2/muse/midifile.cpp +++ b/muse2/muse/midifile.cpp @@ -23,7 +23,6 @@ #include <errno.h> #include <values.h> -#include <assert.h> #include "song.h" #include "midi.h" diff --git a/muse2/muse/midiport.cpp b/muse2/muse/midiport.cpp index 71a90fe7..19fef51b 100644 --- a/muse2/muse/midiport.cpp +++ b/muse2/muse/midiport.cpp @@ -24,6 +24,7 @@ //#include "config.h" #include <QMenu> +#include <QApplication> #include "mididev.h" #include "midiport.h" @@ -337,12 +338,12 @@ QMenu* midiPortsPopup(QWidget* parent, int checkPort) } if(pi == MIDI_PORTS) { - act = p->addAction(p->tr("Warning: No output devices!")); + act = p->addAction(qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Warning: No output devices!"))); act->setCheckable(false); act->setData(-1); p->addSeparator(); } - act = p->addAction(QIcon(*MusEGui::settings_midiport_softsynthsIcon), p->tr("Open midi config...")); + act = p->addAction(QIcon(*MusEGui::settings_midiport_softsynthsIcon), qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Open midi config..."))); act->setCheckable(false); act->setData(MIDI_PORTS); p->addSeparator(); @@ -365,7 +366,7 @@ QMenu* midiPortsPopup(QWidget* parent, int checkPort) if(!subp) // No submenu yet? Create it now. { subp = new QMenu(p); - subp->setTitle(subp->tr("Empty ports")); + subp->setTitle(qApp->translate("@default", QT_TRANSLATE_NOOP("@default", "Empty ports"))); //subp->addAction(new MusEGui::MenuTitleItem("Empty Ports", subp)); } //act = subp->addAction(name); // No need for all those "<None>" names. diff --git a/muse2/muse/mpevent.cpp b/muse2/muse/mpevent.cpp index f72af528..8b65bce1 100644 --- a/muse2/muse/mpevent.cpp +++ b/muse2/muse/mpevent.cpp @@ -18,7 +18,6 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// //========================================================= #include "mpevent.h" @@ -42,6 +41,7 @@ MEvent::MEvent(unsigned t, int port, int tpe, const unsigned char* data, int len edata.setData(data, len); _type = tpe; _loopNum = 0; + setChannel(0); } MEvent::MEvent(unsigned tick, int port, int channel, const Event& e) diff --git a/muse2/muse/node.cpp b/muse2/muse/node.cpp index db11b7bd..dd41ba10 100644 --- a/muse2/muse/node.cpp +++ b/muse2/muse/node.cpp @@ -22,7 +22,6 @@ //========================================================= #include <cmath> -#include <assert.h> #include <sndfile.h> #include <stdlib.h> diff --git a/muse2/muse/osc.cpp b/muse2/muse/osc.cpp index bc64575a..6959803e 100644 --- a/muse2/muse/osc.cpp +++ b/muse2/muse/osc.cpp @@ -824,7 +824,7 @@ bool OscIF::oscInitGui(const QString& typ, const QString& baseName, const QStrin } QString oscUrl; - oscUrl = QString("%1%2/%3/%4").arg(QString(QT_TRANSLATE_NOOP("@default", url))).arg(typ).arg(baseName).arg(label); + oscUrl = QString("%1%2/%3/%4").arg(QString( url)).arg(typ).arg(baseName).arg(label); #ifdef _USE_QPROCESS_FOR_GUI_ @@ -1087,7 +1087,7 @@ bool OscDssiIF::oscInitGui() if(!_oscSynthIF) return false; - return OscIF::oscInitGui(QT_TRANSLATE_NOOP("@default", "dssi_synth"), _oscSynthIF->dssiSynth()->baseName(), + return OscIF::oscInitGui("dssi_synth", _oscSynthIF->dssiSynth()->baseName(), _oscSynthIF->dssiSynth()->name(), _oscSynthIF->dssiSynthI()->name(), _oscSynthIF->dssiSynth()->fileName(), _oscSynthIF->dssi_ui_filename()); } @@ -1160,7 +1160,7 @@ bool OscEffectIF::oscInitGui() if(!_oscPluginI) return false; - return OscIF::oscInitGui(QT_TRANSLATE_NOOP("@default", "ladspa_efx"), _oscPluginI->plugin()->lib(false), + return OscIF::oscInitGui("ladspa_efx", _oscPluginI->plugin()->lib(false), _oscPluginI->plugin()->label(), _oscPluginI->label(), _oscPluginI->plugin()->fileName(), _oscPluginI->dssi_ui_filename()); } diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 693512c5..eb5b1af6 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -23,7 +23,6 @@ //========================================================= #include <stdio.h> -#include <assert.h> #include <cmath> #include "song.h" @@ -805,7 +804,8 @@ void PartList::remove(Part* part) break; } } - assert(i != end()); + if (i == end()) + printf("THIS SHOULD NEVER HAPPEN: could not find the part in PartList::remove()!\n"); } //--------------------------------------------------------- diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index e6260749..132eef97 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -42,7 +42,7 @@ ShortCut shortcuts[SHRT_NUM_OF_ELEMENTS]; void defShrt(int shrt, int key, const char* descr, int type, const char* xml) { shortcuts[shrt].key = key; - shortcuts[shrt].descr = QT_TRANSLATE_NOOP("@default", descr); + shortcuts[shrt].descr = descr; shortcuts[shrt].type = type; shortcuts[shrt].xml = xml; } @@ -51,278 +51,278 @@ void defShrt(int shrt, int key, const char* descr, int type, const char* xml) void initShortCuts() { //Global: - defShrt(SHRT_PLAY_SONG, Qt::Key_Enter, "Transport: Start playback from current location", GLOBAL_SHRT, "play"); - defShrt(SHRT_TOGGLE_METRO, Qt::Key_C, "Transport: Toggle metronome", GLOBAL_SHRT,"toggle_metro"); - defShrt(SHRT_STOP, Qt::Key_Insert,"Transport: Stop Playback", GLOBAL_SHRT, "stop"); - defShrt(SHRT_GOTO_START, Qt::Key_W, "Transport: Goto Start", GLOBAL_SHRT, "goto_start"); - defShrt(SHRT_PLAY_TOGGLE, Qt::Key_Space, "Transport: Play, Stop, Rewind", GLOBAL_SHRT, "play_toggle"); - defShrt(SHRT_GOTO_LEFT, Qt::Key_End, "Transport: Goto left marker" , GLOBAL_SHRT, "goto_left"); - defShrt(SHRT_GOTO_RIGHT, Qt::Key_PageDown, "Transport: Goto right marker" , GLOBAL_SHRT, "goto_right"); - defShrt(SHRT_TOGGLE_LOOP, Qt::Key_Slash, "Transport: Toggle Loop section", GLOBAL_SHRT, "toggle_loop"); - defShrt(SHRT_START_REC, Qt::Key_Asterisk, "Transport: Toggle Record", GLOBAL_SHRT, "toggle_rec"); - defShrt(SHRT_REC_CLEAR, Qt::Key_Backspace, "Transport: Clear all rec enabled tracks", GLOBAL_SHRT, "rec_clear"); - defShrt(SHRT_FULLSCREEN, Qt::CTRL + Qt::Key_F, "Toggle fullscreen", GLOBAL_SHRT, "fullscreen"); - - defShrt(SHRT_COPY, Qt::CTRL + Qt::Key_C, "Edit: Copy", INVIS_SHRT, "copy"); - defShrt(SHRT_COPY_RANGE, Qt::CTRL + Qt::SHIFT + Qt::Key_C, "Edit: Copy in range", GLOBAL_SHRT, "copy_range"); - defShrt(SHRT_UNDO, Qt::CTRL + Qt::Key_Z, "Edit: Undo", INVIS_SHRT, "undo"); - defShrt(SHRT_REDO, Qt::CTRL + Qt::Key_Y, "Edit: Redo", INVIS_SHRT, "redo"); - defShrt(SHRT_CUT, Qt::CTRL + Qt::Key_X, "Edit: Cut", INVIS_SHRT, "cut"); - defShrt(SHRT_PASTE, Qt::CTRL + Qt::Key_V, "Edit: Paste", INVIS_SHRT, "paste"); - defShrt(SHRT_PASTE_DIALOG, Qt::CTRL + Qt::SHIFT + Qt::Key_V, "Edit: Paste (with dialog)", GLOBAL_SHRT, "paste_dialog"); - defShrt(SHRT_DELETE, Qt::Key_Delete, "Edit: Delete", INVIS_SHRT, "delete"); + defShrt(SHRT_PLAY_SONG, Qt::Key_Enter, QT_TRANSLATE_NOOP("shortcuts", "Transport: Start playback from current location"), GLOBAL_SHRT, "play"); + defShrt(SHRT_TOGGLE_METRO, Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle metronome"), GLOBAL_SHRT,"toggle_metro"); + defShrt(SHRT_STOP, Qt::Key_Insert,QT_TRANSLATE_NOOP("shortcuts", "Transport: Stop Playback"), GLOBAL_SHRT, "stop"); + defShrt(SHRT_GOTO_START, Qt::Key_W, QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto Start"), GLOBAL_SHRT, "goto_start"); + defShrt(SHRT_PLAY_TOGGLE, Qt::Key_Space, QT_TRANSLATE_NOOP("shortcuts", "Transport: Play, Stop, Rewind"), GLOBAL_SHRT, "play_toggle"); + defShrt(SHRT_GOTO_LEFT, Qt::Key_End, QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto left marker") , GLOBAL_SHRT, "goto_left"); + defShrt(SHRT_GOTO_RIGHT, Qt::Key_PageDown, QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto right marker") , GLOBAL_SHRT, "goto_right"); + defShrt(SHRT_TOGGLE_LOOP, Qt::Key_Slash, QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle Loop section"), GLOBAL_SHRT, "toggle_loop"); + defShrt(SHRT_START_REC, Qt::Key_Asterisk, QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle Record"), GLOBAL_SHRT, "toggle_rec"); + defShrt(SHRT_REC_CLEAR, Qt::Key_Backspace, QT_TRANSLATE_NOOP("shortcuts", "Transport: Clear all rec enabled tracks"), GLOBAL_SHRT, "rec_clear"); + defShrt(SHRT_FULLSCREEN, Qt::CTRL + Qt::Key_F, QT_TRANSLATE_NOOP("shortcuts", "Toggle fullscreen"), GLOBAL_SHRT, "fullscreen"); + + defShrt(SHRT_COPY, Qt::CTRL + Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy"), INVIS_SHRT, "copy"); + defShrt(SHRT_COPY_RANGE, Qt::CTRL + Qt::SHIFT + Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy in range"), GLOBAL_SHRT, "copy_range"); + defShrt(SHRT_UNDO, Qt::CTRL + Qt::Key_Z, QT_TRANSLATE_NOOP("shortcuts", "Edit: Undo"), INVIS_SHRT, "undo"); + defShrt(SHRT_REDO, Qt::CTRL + Qt::Key_Y, QT_TRANSLATE_NOOP("shortcuts", "Edit: Redo"), INVIS_SHRT, "redo"); + defShrt(SHRT_CUT, Qt::CTRL + Qt::Key_X, QT_TRANSLATE_NOOP("shortcuts", "Edit: Cut"), INVIS_SHRT, "cut"); + defShrt(SHRT_PASTE, Qt::CTRL + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste"), INVIS_SHRT, "paste"); + defShrt(SHRT_PASTE_DIALOG, Qt::CTRL + Qt::SHIFT + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste (with dialog)"), GLOBAL_SHRT, "paste_dialog"); + defShrt(SHRT_DELETE, Qt::Key_Delete, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete"), INVIS_SHRT, "delete"); //----------------------------------------------------------- // Arranger: - defShrt(SHRT_NEW, Qt::CTRL + Qt::Key_N, "File: New project", ARRANG_SHRT + DEDIT_SHRT, "new_project"); - defShrt(SHRT_OPEN, Qt::CTRL + Qt::Key_O, "File: Open from disk", ARRANG_SHRT + DEDIT_SHRT, "open_project"); - defShrt(SHRT_SAVE, Qt::CTRL + Qt::Key_S, "File: Save project", ARRANG_SHRT + DEDIT_SHRT, "save_project"); + defShrt(SHRT_NEW, Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "File: New project"), ARRANG_SHRT + DEDIT_SHRT, "new_project"); + defShrt(SHRT_OPEN, Qt::CTRL + Qt::Key_O, QT_TRANSLATE_NOOP("shortcuts", "File: Open from disk"), ARRANG_SHRT + DEDIT_SHRT, "open_project"); + defShrt(SHRT_SAVE, Qt::CTRL + Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "File: Save project"), ARRANG_SHRT + DEDIT_SHRT, "save_project"); //----------------------------------------------------------- - defShrt(SHRT_OPEN_RECENT, Qt::CTRL + Qt::Key_1, "File: Open recent file", ARRANG_SHRT, "open_recent"); - defShrt(SHRT_SAVE_AS, 0 , "File: Save as", ARRANG_SHRT, "save_project_as"); - defShrt(SHRT_LOAD_TEMPLATE, 0 , "File: Load template", ARRANG_SHRT, "load_template"); -// defShrt(SHRT_CONFIG_PRINTER, Qt::CTRL + Qt::Key_P, "Configure printer", ARRANG_SHRT, "config_printer"); - defShrt(SHRT_IMPORT_MIDI, 0 , "File: Import midi file", ARRANG_SHRT, "import_midi"); - defShrt(SHRT_EXPORT_MIDI, 0 , "File: Export midi file", ARRANG_SHRT, "export_midi"); - defShrt(SHRT_IMPORT_PART, 0 , "File: Import midi part", ARRANG_SHRT, "import_part"); - defShrt(SHRT_IMPORT_AUDIO, 0 , "File: Import audio file", ARRANG_SHRT, "import_audio"); - defShrt(SHRT_QUIT, Qt::CTRL + Qt::Key_Q, "File: Quit MusE", ARRANG_SHRT, "quit"); -// defShrt(SHRT_DESEL_PARTS, Qt::CTRL + Qt::Key_B, "Deselect all parts", ARRANG_SHRT, "deselect_parts"); - defShrt(SHRT_SELECT_PRTSTRACK, Qt::CTRL+ Qt::ALT + Qt::Key_P, "Edit: Select parts on track", ARRANG_SHRT, "select_parts_on_track"); - defShrt(SHRT_OPEN_PIANO, Qt::CTRL + Qt::Key_E, "Open pianoroll", ARRANG_SHRT, "open_pianoroll"); - defShrt(SHRT_OPEN_DRUMS, Qt::CTRL + Qt::Key_D, "Open drumeditor", ARRANG_SHRT, "open_drumedit"); - defShrt(SHRT_OPEN_LIST, Qt::CTRL + Qt::Key_L, "Open listeditor", ARRANG_SHRT, "open_listedit"); - defShrt(SHRT_OPEN_WAVE, Qt::CTRL + Qt::Key_W, "Open waveeditor", ARRANG_SHRT, "open_waveedit"); - defShrt(SHRT_OPEN_GRAPHIC_MASTER, Qt::CTRL + Qt::Key_M, "Open graphical mastertrack editor", ARRANG_SHRT, "open_graph_master"); - defShrt(SHRT_OPEN_LIST_MASTER, Qt::CTRL + Qt::SHIFT + Qt::Key_M, "Open list mastertrack editor", ARRANG_SHRT, "open_list_master"); - defShrt(SHRT_OPEN_MIDI_TRANSFORM, Qt::CTRL + Qt::Key_T, "Open midi transformer", ARRANG_SHRT, "open_midi_transform"); - defShrt(SHRT_ADD_MIDI_TRACK, Qt::CTRL + Qt::Key_J, "Add midi track", ARRANG_SHRT, "add_midi_track"); - defShrt(SHRT_ADD_DRUM_TRACK, 0, "Add drum track", ARRANG_SHRT, "add_drum_track"); - defShrt(SHRT_ADD_WAVE_TRACK, 0, "Add wave track", ARRANG_SHRT, "add_wave_track"); - defShrt(SHRT_ADD_AUDIO_OUTPUT, 0, "Add audio output", ARRANG_SHRT, "add_audio_output"); - defShrt(SHRT_ADD_AUDIO_GROUP, 0, "Add audio group", ARRANG_SHRT, "add_audio_group"); - defShrt(SHRT_ADD_AUDIO_INPUT, 0, "Add audio input", ARRANG_SHRT, "add_audio_input"); - defShrt(SHRT_ADD_AUDIO_AUX , 0, "Add audio aux", ARRANG_SHRT, "add_audio_aux"); - defShrt(SHRT_GLOBAL_CUT, 0, "Structure: Global cut", ARRANG_SHRT, "global_cut"); - defShrt(SHRT_GLOBAL_INSERT, 0, "Structure: Global insert", ARRANG_SHRT, "global_insert"); - defShrt(SHRT_GLOBAL_SPLIT, 0, "Structure: Global split", ARRANG_SHRT, "global_split"); - defShrt(SHRT_CUT_EVENTS, 0, "Structure: Cut events", ARRANG_SHRT, "cut_events"); - //defShrt(SHRT_OPEN_MIXER, Qt::Key_F10, "View: Open mixer window", ARRANG_SHRT, "toggle_mixer"); - defShrt(SHRT_OPEN_MIXER, Qt::Key_F10, "View: Open mixer #1 window", ARRANG_SHRT, "toggle_mixer"); - defShrt(SHRT_OPEN_MIXER2, Qt::CTRL + Qt::Key_F10, "View: Open mixer #2 window", ARRANG_SHRT, "toggle_mixer2"); - defShrt(SHRT_OPEN_TRANSPORT, Qt::Key_F11, "View: Toggle transport window", ARRANG_SHRT, "toggle_transport"); - defShrt(SHRT_OPEN_BIGTIME, Qt::Key_F12, "View: Toggle bigtime window", ARRANG_SHRT, "toggle_bigtime"); - defShrt(SHRT_OPEN_MARKER, Qt::Key_F9, "View: Open marker window", ARRANG_SHRT, "marker_window"); - - defShrt(SHRT_FOLLOW_JUMP, 0, "Settings: Follow song by page", ARRANG_SHRT, "follow_jump"); - defShrt(SHRT_FOLLOW_NO, 0, "Settings: Follow song off", ARRANG_SHRT, "follow_no"); - defShrt(SHRT_FOLLOW_CONTINUOUS, 0, "Settings: Follow song continuous", ARRANG_SHRT, "follow_continuous"); - - defShrt(SHRT_GLOBAL_CONFIG, 0, "Settings: Global configuration", ARRANG_SHRT, "configure_global"); - defShrt(SHRT_CONFIG_SHORTCUTS, 0, "Settings: Configure shortcuts", ARRANG_SHRT, "configure_shortcuts"); - defShrt(SHRT_CONFIG_METRONOME, 0, "Settings: Configure metronome", ARRANG_SHRT, "configure_metronome"); - defShrt(SHRT_CONFIG_MIDISYNC, 0, "Settings: Midi sync configuration", ARRANG_SHRT, "configure_midi_sync"); - defShrt(SHRT_MIDI_FILE_CONFIG, 0, "Settings: Midi file import/export configuration", ARRANG_SHRT, "configure_midi_file"); - defShrt(SHRT_APPEARANCE_SETTINGS, 0, "Settings: Appearance settings", ARRANG_SHRT, "configure_appearance_settings"); - defShrt(SHRT_CONFIG_MIDI_PORTS, 0, "Settings: Midi ports / Soft Synth", ARRANG_SHRT, "configure_midi_ports"); - defShrt(SHRT_CONFIG_AUDIO_PORTS, 0, "Settings: Audio subsystem configuration", ARRANG_SHRT, "configure_audio_ports"); - //defShrt(SHRT_SAVE_GLOBAL_CONFIG, 0, "Save global configuration", ARRANG_SHRT, "configure_save_global"); - - defShrt(SHRT_MIDI_EDIT_INSTRUMENTS, 0, "Midi: Edit midi instruments", ARRANG_SHRT, "midi_edit_instruments"); - defShrt(SHRT_MIDI_INPUT_TRANSFORM, 0, "Midi: Open midi input transform", ARRANG_SHRT, "midi_open_input_transform"); - defShrt(SHRT_MIDI_INPUT_FILTER, 0, "Midi: Open midi input filter", ARRANG_SHRT, "midi_open_input_filter"); - defShrt(SHRT_MIDI_INPUT_TRANSPOSE, 0, "Midi: Midi input transpose", ARRANG_SHRT, "midi_open_input_transpose"); - defShrt(SHRT_MIDI_REMOTE_CONTROL, 0, "Midi: Midi remote control", ARRANG_SHRT, "midi_remote_control"); + defShrt(SHRT_OPEN_RECENT, Qt::CTRL + Qt::Key_1, QT_TRANSLATE_NOOP("shortcuts", "File: Open recent file"), ARRANG_SHRT, "open_recent"); + defShrt(SHRT_SAVE_AS, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Save as"), ARRANG_SHRT, "save_project_as"); + defShrt(SHRT_LOAD_TEMPLATE, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Load template"), ARRANG_SHRT, "load_template"); +// defShrt(SHRT_CONFIG_PRINTER, Qt::CTRL + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Configure printer"), ARRANG_SHRT, "config_printer"); + defShrt(SHRT_IMPORT_MIDI, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import midi file"), ARRANG_SHRT, "import_midi"); + defShrt(SHRT_EXPORT_MIDI, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Export midi file"), ARRANG_SHRT, "export_midi"); + defShrt(SHRT_IMPORT_PART, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import midi part"), ARRANG_SHRT, "import_part"); + defShrt(SHRT_IMPORT_AUDIO, 0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import audio file"), ARRANG_SHRT, "import_audio"); + defShrt(SHRT_QUIT, Qt::CTRL + Qt::Key_Q, QT_TRANSLATE_NOOP("shortcuts", "File: Quit MusE"), ARRANG_SHRT, "quit"); +// defShrt(SHRT_DESEL_PARTS, Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Deselect all parts"), ARRANG_SHRT, "deselect_parts"); + defShrt(SHRT_SELECT_PRTSTRACK, Qt::CTRL+ Qt::ALT + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select parts on track"), ARRANG_SHRT, "select_parts_on_track"); + defShrt(SHRT_OPEN_PIANO, Qt::CTRL + Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Open pianoroll"), ARRANG_SHRT, "open_pianoroll"); + defShrt(SHRT_OPEN_DRUMS, Qt::CTRL + Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Open drumeditor"), ARRANG_SHRT, "open_drumedit"); + defShrt(SHRT_OPEN_LIST, Qt::CTRL + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Open listeditor"), ARRANG_SHRT, "open_listedit"); + defShrt(SHRT_OPEN_WAVE, Qt::CTRL + Qt::Key_W, QT_TRANSLATE_NOOP("shortcuts", "Open waveeditor"), ARRANG_SHRT, "open_waveedit"); + defShrt(SHRT_OPEN_GRAPHIC_MASTER, Qt::CTRL + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Open graphical mastertrack editor"), ARRANG_SHRT, "open_graph_master"); + defShrt(SHRT_OPEN_LIST_MASTER, Qt::CTRL + Qt::SHIFT + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Open list mastertrack editor"), ARRANG_SHRT, "open_list_master"); + defShrt(SHRT_OPEN_MIDI_TRANSFORM, Qt::CTRL + Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Open midi transformer"), ARRANG_SHRT, "open_midi_transform"); + defShrt(SHRT_ADD_MIDI_TRACK, Qt::CTRL + Qt::Key_J, QT_TRANSLATE_NOOP("shortcuts", "Add midi track"), ARRANG_SHRT, "add_midi_track"); + defShrt(SHRT_ADD_DRUM_TRACK, 0, QT_TRANSLATE_NOOP("shortcuts", "Add drum track"), ARRANG_SHRT, "add_drum_track"); + defShrt(SHRT_ADD_WAVE_TRACK, 0, QT_TRANSLATE_NOOP("shortcuts", "Add wave track"), ARRANG_SHRT, "add_wave_track"); + defShrt(SHRT_ADD_AUDIO_OUTPUT, 0, QT_TRANSLATE_NOOP("shortcuts", "Add audio output"), ARRANG_SHRT, "add_audio_output"); + defShrt(SHRT_ADD_AUDIO_GROUP, 0, QT_TRANSLATE_NOOP("shortcuts", "Add audio group"), ARRANG_SHRT, "add_audio_group"); + defShrt(SHRT_ADD_AUDIO_INPUT, 0, QT_TRANSLATE_NOOP("shortcuts", "Add audio input"), ARRANG_SHRT, "add_audio_input"); + defShrt(SHRT_ADD_AUDIO_AUX , 0, QT_TRANSLATE_NOOP("shortcuts", "Add audio aux"), ARRANG_SHRT, "add_audio_aux"); + defShrt(SHRT_GLOBAL_CUT, 0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global cut"), ARRANG_SHRT, "global_cut"); + defShrt(SHRT_GLOBAL_INSERT, 0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global insert"), ARRANG_SHRT, "global_insert"); + defShrt(SHRT_GLOBAL_SPLIT, 0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global split"), ARRANG_SHRT, "global_split"); + defShrt(SHRT_CUT_EVENTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Cut events"), ARRANG_SHRT, "cut_events"); + //defShrt(SHRT_OPEN_MIXER, Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer window"), ARRANG_SHRT, "toggle_mixer"); + defShrt(SHRT_OPEN_MIXER, Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer #1 window"), ARRANG_SHRT, "toggle_mixer"); + defShrt(SHRT_OPEN_MIXER2, Qt::CTRL + Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer #2 window"), ARRANG_SHRT, "toggle_mixer2"); + defShrt(SHRT_OPEN_TRANSPORT, Qt::Key_F11, QT_TRANSLATE_NOOP("shortcuts", "View: Toggle transport window"), ARRANG_SHRT, "toggle_transport"); + defShrt(SHRT_OPEN_BIGTIME, Qt::Key_F12, QT_TRANSLATE_NOOP("shortcuts", "View: Toggle bigtime window"), ARRANG_SHRT, "toggle_bigtime"); + defShrt(SHRT_OPEN_MARKER, Qt::Key_F9, QT_TRANSLATE_NOOP("shortcuts", "View: Open marker window"), ARRANG_SHRT, "marker_window"); + + defShrt(SHRT_FOLLOW_JUMP, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song by page"), ARRANG_SHRT, "follow_jump"); + defShrt(SHRT_FOLLOW_NO, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song off"), ARRANG_SHRT, "follow_no"); + defShrt(SHRT_FOLLOW_CONTINUOUS, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song continuous"), ARRANG_SHRT, "follow_continuous"); + + defShrt(SHRT_GLOBAL_CONFIG, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Global configuration"), ARRANG_SHRT, "configure_global"); + defShrt(SHRT_CONFIG_SHORTCUTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Configure shortcuts"), ARRANG_SHRT, "configure_shortcuts"); + defShrt(SHRT_CONFIG_METRONOME, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Configure metronome"), ARRANG_SHRT, "configure_metronome"); + defShrt(SHRT_CONFIG_MIDISYNC, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi sync configuration"), ARRANG_SHRT, "configure_midi_sync"); + defShrt(SHRT_MIDI_FILE_CONFIG, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi file import/export configuration"), ARRANG_SHRT, "configure_midi_file"); + defShrt(SHRT_APPEARANCE_SETTINGS, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Appearance settings"), ARRANG_SHRT, "configure_appearance_settings"); + defShrt(SHRT_CONFIG_MIDI_PORTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi ports / Soft Synth"), ARRANG_SHRT, "configure_midi_ports"); + defShrt(SHRT_CONFIG_AUDIO_PORTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Audio subsystem configuration"), ARRANG_SHRT, "configure_audio_ports"); + //defShrt(SHRT_SAVE_GLOBAL_CONFIG, 0, QT_TRANSLATE_NOOP("shortcuts", "Save global configuration"), ARRANG_SHRT, "configure_save_global"); + + defShrt(SHRT_MIDI_EDIT_INSTRUMENTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Edit midi instruments"), ARRANG_SHRT, "midi_edit_instruments"); + defShrt(SHRT_MIDI_INPUT_TRANSFORM, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Open midi input transform"), ARRANG_SHRT, "midi_open_input_transform"); + defShrt(SHRT_MIDI_INPUT_FILTER, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Open midi input filter"), ARRANG_SHRT, "midi_open_input_filter"); + defShrt(SHRT_MIDI_INPUT_TRANSPOSE, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi input transpose"), ARRANG_SHRT, "midi_open_input_transpose"); + defShrt(SHRT_MIDI_REMOTE_CONTROL, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi remote control"), ARRANG_SHRT, "midi_remote_control"); #ifdef BUILD_EXPERIMENTAL - defShrt(SHRT_RANDOM_RHYTHM_GENERATOR,0,"Midi: Random rhythm generator", ARRANG_SHRT, "midi_random_rhythm_generator"); + defShrt(SHRT_RANDOM_RHYTHM_GENERATOR,0,QT_TRANSLATE_NOOP("shortcuts", "Midi: Random rhythm generator"), ARRANG_SHRT, "midi_random_rhythm_generator"); #endif - defShrt(SHRT_MIDI_RESET, 0, "Midi: Reset midi", ARRANG_SHRT, "midi_reset"); - defShrt(SHRT_MIDI_INIT, 0, "Midi: Init midi", ARRANG_SHRT, "midi_init"); - defShrt(SHRT_MIDI_LOCAL_OFF, 0, "Midi: Midi local off", ARRANG_SHRT, "midi_local_off"); + defShrt(SHRT_MIDI_RESET, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Reset midi"), ARRANG_SHRT, "midi_reset"); + defShrt(SHRT_MIDI_INIT, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Init midi"), ARRANG_SHRT, "midi_init"); + defShrt(SHRT_MIDI_LOCAL_OFF, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi local off"), ARRANG_SHRT, "midi_local_off"); - defShrt(SHRT_AUDIO_BOUNCE_TO_TRACK, 0, "Audio: Bounce audio to track", ARRANG_SHRT, "audio_bounce_to_track"); - defShrt(SHRT_AUDIO_BOUNCE_TO_FILE, 0, "Audio: Bounce audio to file", ARRANG_SHRT, "audio_bounce_to_file"); - defShrt(SHRT_AUDIO_RESTART, 0, "Audio: Restart audio", ARRANG_SHRT, "audio_restart"); + defShrt(SHRT_AUDIO_BOUNCE_TO_TRACK, 0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Bounce audio to track"), ARRANG_SHRT, "audio_bounce_to_track"); + defShrt(SHRT_AUDIO_BOUNCE_TO_FILE, 0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Bounce audio to file"), ARRANG_SHRT, "audio_bounce_to_file"); + defShrt(SHRT_AUDIO_RESTART, 0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Restart audio"), ARRANG_SHRT, "audio_restart"); - defShrt(SHRT_MIXER_AUTOMATION, 0, "Automation: Mixer automation", ARRANG_SHRT, "mixer_automation"); - defShrt(SHRT_MIXER_SNAPSHOT, 0, "Automation: Take mixer snapshot", ARRANG_SHRT, "mixer_snapshot"); - defShrt(SHRT_MIXER_AUTOMATION_CLEAR,0, "Automation: Clear mixer automation", ARRANG_SHRT, "mixer_automation_clear"); + defShrt(SHRT_MIXER_AUTOMATION, 0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Mixer automation"), ARRANG_SHRT, "mixer_automation"); + defShrt(SHRT_MIXER_SNAPSHOT, 0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Take mixer snapshot"), ARRANG_SHRT, "mixer_snapshot"); + defShrt(SHRT_MIXER_AUTOMATION_CLEAR,0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Clear mixer automation"), ARRANG_SHRT, "mixer_automation_clear"); -// defShrt(SHRT_OPEN_CLIPS, 0, "View audio clips", ARRANG_SHRT, "view_audio_clips"); - defShrt(SHRT_OPEN_HELP, Qt::Key_F1, "Help: Open Manual", ARRANG_SHRT, "open_help"); - defShrt(SHRT_START_WHATSTHIS, Qt::SHIFT + Qt::Key_F1, "Help: Toggle whatsthis mode", ARRANG_SHRT, "toggle_whatsthis"); +// defShrt(SHRT_OPEN_CLIPS, 0, QT_TRANSLATE_NOOP("shortcuts", "View audio clips"), ARRANG_SHRT, "view_audio_clips"); + defShrt(SHRT_OPEN_HELP, Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Help: Open Manual"), ARRANG_SHRT, "open_help"); + defShrt(SHRT_START_WHATSTHIS, Qt::SHIFT + Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Help: Toggle whatsthis mode"), ARRANG_SHRT, "toggle_whatsthis"); - defShrt(SHRT_EDIT_PART, Qt::Key_Return, "Edit: Edit selected part", ARRANG_SHRT, "edit_selected_part"); - defShrt(SHRT_SEL_ABOVE, Qt::Key_Up, "Edit: Select nearest part on track above", ARRANG_SHRT, "sel_part_above"); - defShrt(SHRT_SEL_ABOVE_ADD, Qt::SHIFT + Qt::Key_Up, "Edit: Add nearest part on track above", ARRANG_SHRT, "sel_part_above_add"); - defShrt(SHRT_SEL_BELOW, Qt::Key_Down, "Edit: Select nearest part on track below", ARRANG_SHRT, "sel_part_below"); - defShrt(SHRT_SEL_BELOW_ADD, Qt::SHIFT + Qt::Key_Down, "Edit: Add nearest part on track below", ARRANG_SHRT, "sel_part_below_add"); + defShrt(SHRT_EDIT_PART, Qt::Key_Return, QT_TRANSLATE_NOOP("shortcuts", "Edit: Edit selected part"), ARRANG_SHRT, "edit_selected_part"); + defShrt(SHRT_SEL_ABOVE, Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part on track above"), ARRANG_SHRT, "sel_part_above"); + defShrt(SHRT_SEL_ABOVE_ADD, Qt::SHIFT + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part on track above"), ARRANG_SHRT, "sel_part_above_add"); + defShrt(SHRT_SEL_BELOW, Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part on track below"), ARRANG_SHRT, "sel_part_below"); + defShrt(SHRT_SEL_BELOW_ADD, Qt::SHIFT + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part on track below"), ARRANG_SHRT, "sel_part_below_add"); - defShrt(SHRT_INSERTMEAS, Qt::CTRL+Qt::SHIFT+ Qt::Key_O, "Edit: Insert empty measure", ARRANG_SHRT, "insert_measure"); + defShrt(SHRT_INSERTMEAS, Qt::CTRL+Qt::SHIFT+ Qt::Key_O, QT_TRANSLATE_NOOP("shortcuts", "Edit: Insert empty measure"), ARRANG_SHRT, "insert_measure"); - defShrt(SHRT_PASTE_CLONE, Qt::CTRL+Qt::Key_B, "Edit: Paste as clones", ARRANG_SHRT, "paste_as_clone"); // i changed "paste_clone" to "paste_as_clone" intendedly. otherwise muse would keep its old, conflicting definition (ctrl+shift+v instead of ctrl+b) (flo) - defShrt(SHRT_PASTE_CLONE_DIALOG, Qt::CTRL+Qt::SHIFT+Qt::Key_B, "Edit: Paste as clones (with dialog)", ARRANG_SHRT, "paste_as_clone_dialog"); + defShrt(SHRT_PASTE_CLONE, Qt::CTRL+Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste as clones"), ARRANG_SHRT, "paste_as_clone"); // i changed "paste_clone" to "paste_as_clone" intendedly. otherwise muse would keep its old, conflicting definition (ctrl+shift+v instead of ctrl+b) (flo) + defShrt(SHRT_PASTE_CLONE_DIALOG, Qt::CTRL+Qt::SHIFT+Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste as clones (with dialog)"), ARRANG_SHRT, "paste_as_clone_dialog"); - defShrt(SHRT_SEL_TRACK_ABOVE, Qt::CTRL + Qt::Key_Up, "Select track above", ARRANG_SHRT, "sel_track_above"); - defShrt(SHRT_SEL_TRACK_BELOW, Qt::CTRL + Qt::Key_Down, "Select track below", ARRANG_SHRT, "sel_track_below"); + defShrt(SHRT_SEL_TRACK_ABOVE, Qt::CTRL + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Select track above"), ARRANG_SHRT, "sel_track_above"); + defShrt(SHRT_SEL_TRACK_BELOW, Qt::CTRL + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Select track below"), ARRANG_SHRT, "sel_track_below"); //----------------------------------------------------------- - defShrt(SHRT_TRANSPOSE, 0, "Midi: Transpose", ARRANG_SHRT + PROLL_SHRT, "midi_transpose"); + defShrt(SHRT_TRANSPOSE, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Transpose"), ARRANG_SHRT + PROLL_SHRT, "midi_transpose"); //----------------------------------------------------------- - defShrt(SHRT_SELECT_ALL, Qt::CTRL + Qt::Key_A, "Edit: Select all", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_all"); - defShrt(SHRT_SELECT_NONE, Qt::CTRL + Qt::SHIFT + Qt::Key_A, "Edit: Select none", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_none"); - defShrt(SHRT_SELECT_INVERT, Qt::CTRL + Qt::Key_I, "Edit: Invert Selection", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_inv"); - defShrt(SHRT_SELECT_ILOOP, 0, "Edit: Select events/parts inside locators", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_ins_loc"); - defShrt(SHRT_SELECT_OLOOP, 0, "Edit: Select events/parts outside locators", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_out_loc"); - defShrt(SHRT_SELECT_PREV_PART, Qt::ALT + Qt::Key_Left, "Edit: Select previous part", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_prv_prt"); - defShrt(SHRT_SELECT_NEXT_PART, Qt::ALT + Qt::Key_Right, "Edit: Select next part", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_nxt_prt"); - defShrt(SHRT_SEL_LEFT, Qt::Key_Left, "Edit: Select nearest part/event to the left or move cursor", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_left"); - defShrt(SHRT_SEL_LEFT_ADD, Qt::Key_Left + Qt::SHIFT, "Edit: Add nearest part/event to the left to selection", PROLL_SHRT + DEDIT_SHRT, "sel_left_add"); - defShrt(SHRT_SEL_RIGHT, Qt::Key_Right, "Edit: Select nearest part/event to the right or move cursor", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,"sel_right"); - defShrt(SHRT_SEL_RIGHT_ADD, Qt::Key_Right + Qt::SHIFT, "Edit: Add nearest part/event to the right to selection", PROLL_SHRT + DEDIT_SHRT,"sel_right_add"); - defShrt(SHRT_LOCATORS_TO_SELECTION, Qt::ALT + Qt::Key_P, "Edit: Set locators to selection", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "loc_to_sel"); - defShrt(SHRT_INC_PITCH, Qt::CTRL + Qt::Key_Up, "Edit: Increase pitch", PROLL_SHRT + DEDIT_SHRT, "sel_inc_pitch"); - defShrt(SHRT_DEC_PITCH, Qt::CTRL + Qt::Key_Down, "Edit: Decrease pitch", PROLL_SHRT + DEDIT_SHRT, "sel_dec_pitch"); - defShrt(SHRT_INC_POS, Qt::CTRL + Qt::Key_Right, "Edit: Increase event position", PROLL_SHRT + DEDIT_SHRT, "sel_inc_pos"); - defShrt(SHRT_DEC_POS, Qt::CTRL + Qt::Key_Left, "Edit: Decrease event position", PROLL_SHRT + DEDIT_SHRT, "sel_dec_pos"); - defShrt(SHRT_ZOOM_IN, Qt::CTRL + Qt::Key_PageUp, "View: Zoom in", PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "zoom_in"); - defShrt(SHRT_ZOOM_OUT, Qt::CTRL + Qt::Key_PageDown, "View: Zoom out", PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "zoom_out"); - defShrt(SHRT_GOTO_CPOS, Qt::Key_C, "View: Goto Current Position", PROLL_SHRT + DEDIT_SHRT, "goto_cpos"); - defShrt(SHRT_SCROLL_LEFT, Qt::Key_H, "View: Scroll left", PROLL_SHRT + DEDIT_SHRT, "scroll_left"); - defShrt(SHRT_SCROLL_RIGHT, Qt::Key_L, "View: Scroll left", PROLL_SHRT + DEDIT_SHRT, "scroll_right"); + defShrt(SHRT_SELECT_ALL, Qt::CTRL + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select all"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_all"); + defShrt(SHRT_SELECT_NONE, Qt::CTRL + Qt::SHIFT + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select none"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_none"); + defShrt(SHRT_SELECT_INVERT, Qt::CTRL + Qt::Key_I, QT_TRANSLATE_NOOP("shortcuts", "Edit: Invert Selection"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_inv"); + defShrt(SHRT_SELECT_ILOOP, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select events/parts inside locators"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_ins_loc"); + defShrt(SHRT_SELECT_OLOOP, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select events/parts outside locators"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_out_loc"); + defShrt(SHRT_SELECT_PREV_PART, Qt::ALT + Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select previous part"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_prv_prt"); + defShrt(SHRT_SELECT_NEXT_PART, Qt::ALT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select next part"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_nxt_prt"); + defShrt(SHRT_SEL_LEFT, Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part/event to the left or move cursor"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "sel_left"); + defShrt(SHRT_SEL_LEFT_ADD, Qt::Key_Left + Qt::SHIFT, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part/event to the left to selection"), PROLL_SHRT + DEDIT_SHRT, "sel_left_add"); + defShrt(SHRT_SEL_RIGHT, Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part/event to the right or move cursor"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,"sel_right"); + defShrt(SHRT_SEL_RIGHT_ADD, Qt::Key_Right + Qt::SHIFT, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part/event to the right to selection"), PROLL_SHRT + DEDIT_SHRT,"sel_right_add"); + defShrt(SHRT_LOCATORS_TO_SELECTION, Qt::ALT + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Edit: Set locators to selection"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "loc_to_sel"); + defShrt(SHRT_INC_PITCH, Qt::CTRL + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase pitch"), PROLL_SHRT + DEDIT_SHRT, "sel_inc_pitch"); + defShrt(SHRT_DEC_PITCH, Qt::CTRL + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease pitch"), PROLL_SHRT + DEDIT_SHRT, "sel_dec_pitch"); + defShrt(SHRT_INC_POS, Qt::CTRL + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase event position"), PROLL_SHRT + DEDIT_SHRT, "sel_inc_pos"); + defShrt(SHRT_DEC_POS, Qt::CTRL + Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease event position"), PROLL_SHRT + DEDIT_SHRT, "sel_dec_pos"); + defShrt(SHRT_ZOOM_IN, Qt::CTRL + Qt::Key_PageUp, QT_TRANSLATE_NOOP("shortcuts", "View: Zoom in"), PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "zoom_in"); + defShrt(SHRT_ZOOM_OUT, Qt::CTRL + Qt::Key_PageDown, QT_TRANSLATE_NOOP("shortcuts", "View: Zoom out"), PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "zoom_out"); + defShrt(SHRT_GOTO_CPOS, Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "View: Goto Current Position"), PROLL_SHRT + DEDIT_SHRT, "goto_cpos"); + defShrt(SHRT_SCROLL_LEFT, Qt::Key_H, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT, "scroll_left"); + defShrt(SHRT_SCROLL_RIGHT, Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT, "scroll_right"); //----------------------------------------------------------- //Drum: //----------------------------------------------------------- - defShrt(SHRT_FIXED_LEN, Qt::ALT + Qt::Key_L, "Edit: Set Fixed Length on Midi Events", PROLL_SHRT + DEDIT_SHRT, "midi_fixed_len"); + defShrt(SHRT_FIXED_LEN, Qt::ALT + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Edit: Set Fixed Length on Midi Events"), PROLL_SHRT + DEDIT_SHRT, "midi_fixed_len"); //----------------------------------------------------------- //Pianoroll: //----------------------------------------------------------- - defShrt(SHRT_QUANTIZE, 0, "Quantize", PROLL_SHRT, "midi_quant"); - defShrt(SHRT_MODIFY_GATE_TIME, 0, "Modify Note Length", PROLL_SHRT, "midi_mod_gate_time"); - defShrt(SHRT_MODIFY_VELOCITY, 0, "Modify Velocity", PROLL_SHRT, "midi_mod_velo"); - defShrt(SHRT_CRESCENDO, 0, "Edit: Crescendo", PROLL_SHRT, "midi_crescendo"); - defShrt(SHRT_THIN_OUT, 0, "Edit: Thin Out", PROLL_SHRT, "midi_thin_out"); - defShrt(SHRT_ERASE_EVENT, 0, "Edit: Erase Event", PROLL_SHRT, "midi_erase_event"); - defShrt(SHRT_DELETE_OVERLAPS, 0, "Edit: Delete Overlaps", PROLL_SHRT, "midi_delete_overlaps"); - defShrt(SHRT_NOTE_SHIFT, 0, "Edit: Note Shift", PROLL_SHRT, "midi_note_shift"); - defShrt(SHRT_MOVE_CLOCK, 0, "Edit: Move Clock", PROLL_SHRT, "midi_move_clock"); - defShrt(SHRT_COPY_MEASURE, 0, "Edit: Copy Measure", PROLL_SHRT, "midi_copy_measure"); - defShrt(SHRT_ERASE_MEASURE, 0, "Edit: Erase Measure", PROLL_SHRT,"midi_erase_measure"); - defShrt(SHRT_DELETE_MEASURE, 0, "Edit: Delete Measure", PROLL_SHRT, "midi_delete_measure"); - defShrt(SHRT_CREATE_MEASURE, 0, "Edit: Create Measure", PROLL_SHRT, "midi_create_measure"); - defShrt(SHRT_EVENT_COLOR, Qt::Key_E, "Edit: Change Event Color", PROLL_SHRT, "change_event_color"); + defShrt(SHRT_QUANTIZE, 0, QT_TRANSLATE_NOOP("shortcuts", "Quantize"), PROLL_SHRT, "midi_quant"); + defShrt(SHRT_MODIFY_GATE_TIME, 0, QT_TRANSLATE_NOOP("shortcuts", "Modify Note Length"), PROLL_SHRT, "midi_mod_gate_time"); + defShrt(SHRT_MODIFY_VELOCITY, 0, QT_TRANSLATE_NOOP("shortcuts", "Modify Velocity"), PROLL_SHRT, "midi_mod_velo"); + defShrt(SHRT_CRESCENDO, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Crescendo"), PROLL_SHRT, "midi_crescendo"); + defShrt(SHRT_THIN_OUT, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Thin Out"), PROLL_SHRT, "midi_thin_out"); + defShrt(SHRT_ERASE_EVENT, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Erase Event"), PROLL_SHRT, "midi_erase_event"); + defShrt(SHRT_DELETE_OVERLAPS, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete Overlaps"), PROLL_SHRT, "midi_delete_overlaps"); + defShrt(SHRT_NOTE_SHIFT, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Note Shift"), PROLL_SHRT, "midi_note_shift"); + defShrt(SHRT_MOVE_CLOCK, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move Clock"), PROLL_SHRT, "midi_move_clock"); + defShrt(SHRT_COPY_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy Measure"), PROLL_SHRT, "midi_copy_measure"); + defShrt(SHRT_ERASE_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Erase Measure"), PROLL_SHRT,"midi_erase_measure"); + defShrt(SHRT_DELETE_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete Measure"), PROLL_SHRT, "midi_delete_measure"); + defShrt(SHRT_CREATE_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Create Measure"), PROLL_SHRT, "midi_create_measure"); + defShrt(SHRT_EVENT_COLOR, Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Edit: Change Event Color"), PROLL_SHRT, "change_event_color"); // Shortcuts for tools // global - defShrt(SHRT_TOOL_POINTER, Qt::Key_A, "Tool: Pointer", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "pointer_tool"); - defShrt(SHRT_TOOL_PENCIL, Qt::Key_D, "Tool: Pencil", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "pencil_tool"); - defShrt(SHRT_TOOL_RUBBER, Qt::Key_R, "Tool: Eraser", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "eraser_tool"); + defShrt(SHRT_TOOL_POINTER, Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Tool: Pointer"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "pointer_tool"); + defShrt(SHRT_TOOL_PENCIL, Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Tool: Pencil"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "pencil_tool"); + defShrt(SHRT_TOOL_RUBBER, Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Tool: Eraser"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "eraser_tool"); // piano roll & drum editor - defShrt(SHRT_TOOL_LINEDRAW, Qt::Key_F, "Tool: Line Draw", ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "line_draw_tool"); + defShrt(SHRT_TOOL_LINEDRAW, Qt::Key_F, QT_TRANSLATE_NOOP("shortcuts", "Tool: Line Draw"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "line_draw_tool"); // drum editor - defShrt(SHRT_TOOL_CURSOR, Qt::Key_U, "Tool: Cursor", DEDIT_SHRT, "cursor_tool"); - defShrt(SHRT_ADDNOTE_1, Qt::Key_V, "Add note velocity 1", DEDIT_SHRT, "add_note_velocity_1"); - defShrt(SHRT_ADDNOTE_2, Qt::Key_B, "Add note velocity 2", DEDIT_SHRT, "add_note_velocity_2"); - defShrt(SHRT_ADDNOTE_3, Qt::Key_N, "Add note velocity 3", DEDIT_SHRT, "add_note_velocity_3"); - defShrt(SHRT_ADDNOTE_4, Qt::Key_M, "Add note velocity 4", DEDIT_SHRT, "add_note_velocity_4"); + defShrt(SHRT_TOOL_CURSOR, Qt::Key_U, QT_TRANSLATE_NOOP("shortcuts", "Tool: Cursor"), DEDIT_SHRT, "cursor_tool"); + defShrt(SHRT_ADDNOTE_1, Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 1"), DEDIT_SHRT, "add_note_velocity_1"); + defShrt(SHRT_ADDNOTE_2, Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 2"), DEDIT_SHRT, "add_note_velocity_2"); + defShrt(SHRT_ADDNOTE_3, Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 3"), DEDIT_SHRT, "add_note_velocity_3"); + defShrt(SHRT_ADDNOTE_4, Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 4"), DEDIT_SHRT, "add_note_velocity_4"); - defShrt(SHRT_CURSOR_STEP_UP, Qt::Key_0, "Cursor step size: larger", DEDIT_SHRT, "cursor_step_up"); - defShrt(SHRT_CURSOR_STEP_DOWN, Qt::Key_9, "Cursor step size: smaller", DEDIT_SHRT, "cursor_step_down"); - defShrt(SHRT_INSTRUMENT_STEP_UP, Qt::Key_Up, "Instrument/Cursor up", DEDIT_SHRT, "instrument_up"); - defShrt(SHRT_INSTRUMENT_STEP_DOWN, Qt::Key_Down, "Instrument/Cursor down", DEDIT_SHRT, "instrument_down"); + defShrt(SHRT_CURSOR_STEP_UP, Qt::Key_0, QT_TRANSLATE_NOOP("shortcuts", "Cursor step size: larger"), DEDIT_SHRT, "cursor_step_up"); + defShrt(SHRT_CURSOR_STEP_DOWN, Qt::Key_9, QT_TRANSLATE_NOOP("shortcuts", "Cursor step size: smaller"), DEDIT_SHRT, "cursor_step_down"); + defShrt(SHRT_INSTRUMENT_STEP_UP, Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Instrument/Cursor up"), DEDIT_SHRT, "instrument_up"); + defShrt(SHRT_INSTRUMENT_STEP_DOWN, Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Instrument/Cursor down"), DEDIT_SHRT, "instrument_down"); // arranger - defShrt(SHRT_TOOL_SCISSORS, Qt::Key_S, "Tool: Scissor", ARRANG_SHRT, "scissor_tool"); - defShrt(SHRT_TOOL_GLUE, Qt::Key_G, "Tool: Glue", ARRANG_SHRT, "glue_tool"); - defShrt(SHRT_TOOL_MUTE, 0, "Tool: Mute", ARRANG_SHRT, "mute_tool"); + defShrt(SHRT_TOOL_SCISSORS, Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "Tool: Scissor"), ARRANG_SHRT, "scissor_tool"); + defShrt(SHRT_TOOL_GLUE, Qt::Key_G, QT_TRANSLATE_NOOP("shortcuts", "Tool: Glue"), ARRANG_SHRT, "glue_tool"); + defShrt(SHRT_TOOL_MUTE, 0, QT_TRANSLATE_NOOP("shortcuts", "Tool: Mute"), ARRANG_SHRT, "mute_tool"); //Increase/decrease current position, is going to be in arranger & drumeditor as well // p4.0.10 Editors and arranger handle these by themselves, otherwise global handler will now use them, too. - defShrt(SHRT_POS_INC, Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase"); - defShrt(SHRT_POS_DEC, Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease"); + defShrt(SHRT_POS_INC, Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase"); + defShrt(SHRT_POS_DEC, Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease"); - defShrt(SHRT_POS_INC_NOSNAP, Qt::SHIFT + Qt::Key_Plus, "Transport: Increase current position, no snap", GLOBAL_SHRT, "curpos_increase_nosnap"); - defShrt(SHRT_POS_DEC_NOSNAP, Qt::SHIFT + Qt::Key_Minus, "Transport: Decrease current position, no snap", GLOBAL_SHRT, "curpos_decrease_nosnap"); + defShrt(SHRT_POS_INC_NOSNAP, Qt::SHIFT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position, no snap"), GLOBAL_SHRT, "curpos_increase_nosnap"); + defShrt(SHRT_POS_DEC_NOSNAP, Qt::SHIFT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position, no snap"), GLOBAL_SHRT, "curpos_decrease_nosnap"); /* - defShrt(SHRT_POS_INC_BAR, Qt::CTRL + Qt::ALT + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_bar"); - defShrt(SHRT_POS_DEC_BAR, Qt::CTRL + Qt::ALT + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_bar"); - defShrt(SHRT_POS_INC_BAR_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_bar_nosnap"); - defShrt(SHRT_POS_DEC_BAR_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_bar_nosnap"); + defShrt(SHRT_POS_INC_BAR, Qt::CTRL + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_bar"); + defShrt(SHRT_POS_DEC_BAR, Qt::CTRL + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_bar"); + defShrt(SHRT_POS_INC_BAR_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_bar_nosnap"); + defShrt(SHRT_POS_DEC_BAR_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_bar_nosnap"); - defShrt(SHRT_POS_INC_BEAT, Qt::ALT + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_beat"); - defShrt(SHRT_POS_DEC_BEAT, Qt::ALT + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_beat"); - defShrt(SHRT_POS_INC_BEAT_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_beat_nosnap"); - defShrt(SHRT_POS_DEC_BEAT_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_beat_nosnap"); + defShrt(SHRT_POS_INC_BEAT, Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_beat"); + defShrt(SHRT_POS_DEC_BEAT, Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_beat"); + defShrt(SHRT_POS_INC_BEAT_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_beat_nosnap"); + defShrt(SHRT_POS_DEC_BEAT_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_beat_nosnap"); - defShrt(SHRT_POS_INC_TICK, Qt::CTRL + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_tick"); - defShrt(SHRT_POS_DEC_TICK, Qt::CTRL + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_tick"); - defShrt(SHRT_POS_INC_TICK_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_Plus, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_tick"); - defShrt(SHRT_POS_DEC_TICK_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_Minus, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_tick"); + defShrt(SHRT_POS_INC_TICK, Qt::CTRL + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_tick"); + defShrt(SHRT_POS_DEC_TICK, Qt::CTRL + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_tick"); + defShrt(SHRT_POS_INC_TICK_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_tick"); + defShrt(SHRT_POS_DEC_TICK_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_tick"); - defShrt(SHRT_POS_INC_FRAME, Qt::Key_N, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_frame"); - defShrt(SHRT_POS_DEC_FRAME, Qt::Key_B, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_frame"); + defShrt(SHRT_POS_INC_FRAME, Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_frame"); + defShrt(SHRT_POS_DEC_FRAME, Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_frame"); - defShrt(SHRT_POS_INC_SECOND, Qt::CTRL + Qt::Key_N, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_second"); - defShrt(SHRT_POS_DEC_SECOND, Qt::CTRL + Qt::Key_B, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_second"); - defShrt(SHRT_POS_INC_SECOND_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_N, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_second_nosnap"); - defShrt(SHRT_POS_DEC_SECOND_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_B, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_second_nosnap"); + defShrt(SHRT_POS_INC_SECOND, Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_second"); + defShrt(SHRT_POS_DEC_SECOND, Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_second"); + defShrt(SHRT_POS_INC_SECOND_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_second_nosnap"); + defShrt(SHRT_POS_DEC_SECOND_NOSNAP, Qt::SHIFT + Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_second_nosnap"); - defShrt(SHRT_POS_INC_MINUTE, Qt::ALT + Qt::Key_N, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_minute"); - defShrt(SHRT_POS_DEC_MINUTE, Qt::ALT + Qt::Key_B, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_minute"); - defShrt(SHRT_POS_INC_MINUTE_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_N, "Transport: Increase current position", GLOBAL_SHRT, "curpos_increase_minute_nosnap"); - defShrt(SHRT_POS_DEC_MINUTE_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_B, "Transport: Decrease current position", GLOBAL_SHRT, "curpos_decrease_minute_nosnap"); + defShrt(SHRT_POS_INC_MINUTE, Qt::ALT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_minute"); + defShrt(SHRT_POS_DEC_MINUTE, Qt::ALT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_minute"); + defShrt(SHRT_POS_INC_MINUTE_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_minute_nosnap"); + defShrt(SHRT_POS_DEC_MINUTE_NOSNAP, Qt::SHIFT + Qt::ALT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease_minute_nosnap"); */ - defShrt(SHRT_SET_QUANT_1, Qt::Key_1, "Quantize: Set quantize to 1/1 note", PROLL_SHRT, "midi_quant_1"); - defShrt(SHRT_SET_QUANT_2, Qt::Key_2, "Quantize: Set quantize to 1/2 note", PROLL_SHRT, "midi_quant_2"); - defShrt(SHRT_SET_QUANT_3, Qt::Key_3, "Quantize: Set quantize to 1/4 note", PROLL_SHRT, "midi_quant_3"); - defShrt(SHRT_SET_QUANT_4, Qt::Key_4, "Quantize: Set quantize to 1/8 note", PROLL_SHRT, "midi_quant_4"); - defShrt(SHRT_SET_QUANT_5, Qt::Key_5, "Quantize: Set quantize to 1/16 note", PROLL_SHRT, "midi_quant_5"); - defShrt(SHRT_SET_QUANT_6, Qt::Key_6, "Quantize: Set quantize to 1/32 note", PROLL_SHRT, "midi_quant_6"); - defShrt(SHRT_SET_QUANT_7, Qt::Key_7, "Quantize: Set quantize to 1/64 note", PROLL_SHRT, "midi_quant_7"); - - defShrt(SHRT_TOGGLE_TRIOL, Qt::Key_T, "Quantize: Toggle triol quantization", PROLL_SHRT, "midi_quant_triol"); - defShrt(SHRT_TOGGLE_PUNCT, Qt::Key_Period, "Quantize: Toggle punctuation quantization", PROLL_SHRT, "midi_quant_punct"); - defShrt(SHRT_TOGGLE_PUNCT2, Qt::Key_Comma, "Quantize: Toggle punctuation quantization (2)", PROLL_SHRT, "midi_quant_punct2"); - defShrt(SHRT_INSERT_AT_LOCATION, Qt::SHIFT + Qt::Key_Right, "Edit: Insert at location", PROLL_SHRT, "midi_insert_at_loc"); - - defShrt(SHRT_INCREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Right, "Edit: Increase length", PROLL_SHRT, "increase_len"); - defShrt(SHRT_DECREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Left, "Edit: Decrease length", PROLL_SHRT, "decrease_len"); + defShrt(SHRT_SET_QUANT_1, Qt::Key_1, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/1 note"), PROLL_SHRT, "midi_quant_1"); + defShrt(SHRT_SET_QUANT_2, Qt::Key_2, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/2 note"), PROLL_SHRT, "midi_quant_2"); + defShrt(SHRT_SET_QUANT_3, Qt::Key_3, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/4 note"), PROLL_SHRT, "midi_quant_3"); + defShrt(SHRT_SET_QUANT_4, Qt::Key_4, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/8 note"), PROLL_SHRT, "midi_quant_4"); + defShrt(SHRT_SET_QUANT_5, Qt::Key_5, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/16 note"), PROLL_SHRT, "midi_quant_5"); + defShrt(SHRT_SET_QUANT_6, Qt::Key_6, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/32 note"), PROLL_SHRT, "midi_quant_6"); + defShrt(SHRT_SET_QUANT_7, Qt::Key_7, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/64 note"), PROLL_SHRT, "midi_quant_7"); + + defShrt(SHRT_TOGGLE_TRIOL, Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle triol quantization"), PROLL_SHRT, "midi_quant_triol"); + defShrt(SHRT_TOGGLE_PUNCT, Qt::Key_Period, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle punctuation quantization"), PROLL_SHRT, "midi_quant_punct"); + defShrt(SHRT_TOGGLE_PUNCT2, Qt::Key_Comma, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle punctuation quantization (2)"), PROLL_SHRT, "midi_quant_punct2"); + defShrt(SHRT_INSERT_AT_LOCATION, Qt::SHIFT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Insert at location"), PROLL_SHRT, "midi_insert_at_loc"); + + defShrt(SHRT_INCREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase length"), PROLL_SHRT, "increase_len"); + defShrt(SHRT_DECREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease length"), PROLL_SHRT, "decrease_len"); //----------------------------------------------------------- // List edit: //----------------------------------------------------------- - defShrt(SHRT_LE_INS_NOTES, Qt::CTRL + Qt::Key_N, "Insert Note", LEDIT_SHRT, "le_ins_note"); - defShrt(SHRT_LE_INS_SYSEX, Qt::CTRL + Qt::Key_S, "Insert SysEx", LEDIT_SHRT, "le_ins_sysex"); - defShrt(SHRT_LE_INS_CTRL, Qt::CTRL + Qt::Key_T, "Insert Ctrl", LEDIT_SHRT, "le_ins_ctrl"); - defShrt(SHRT_LE_INS_META, 0, "Insert Meta", LEDIT_SHRT, "le_ins_meta"); - defShrt(SHRT_LE_INS_CHAN_AFTERTOUCH, Qt::CTRL + Qt::Key_A, "Insert Channel Aftertouch", LEDIT_SHRT, "le_ins_afttouch"); - defShrt(SHRT_LE_INS_POLY_AFTERTOUCH, Qt::CTRL + Qt::Key_P, "Insert Key Aftertouch", LEDIT_SHRT, "le_ins_poly"); + defShrt(SHRT_LE_INS_NOTES, Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Insert Note"), LEDIT_SHRT, "le_ins_note"); + defShrt(SHRT_LE_INS_SYSEX, Qt::CTRL + Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "Insert SysEx"), LEDIT_SHRT, "le_ins_sysex"); + defShrt(SHRT_LE_INS_CTRL, Qt::CTRL + Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Insert Ctrl"), LEDIT_SHRT, "le_ins_ctrl"); + defShrt(SHRT_LE_INS_META, 0, QT_TRANSLATE_NOOP("shortcuts", "Insert Meta"), LEDIT_SHRT, "le_ins_meta"); + defShrt(SHRT_LE_INS_CHAN_AFTERTOUCH, Qt::CTRL + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Insert Channel Aftertouch"), LEDIT_SHRT, "le_ins_afttouch"); + defShrt(SHRT_LE_INS_POLY_AFTERTOUCH, Qt::CTRL + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Insert Key Aftertouch"), LEDIT_SHRT, "le_ins_poly"); //----------------------------------------------------------- // List masteredit: //----------------------------------------------------------- - defShrt(SHRT_LM_INS_TEMPO, Qt::CTRL + Qt::Key_T, "Insert Tempo", LMEDIT_SHRT, "lm_ins_tempo"); - defShrt(SHRT_LM_INS_SIG , Qt::CTRL + Qt::Key_R, "Insert Signature", LMEDIT_SHRT, "lm_ins_sig"); - defShrt(SHRT_LM_EDIT_BEAT, Qt::CTRL + Qt::SHIFT+ Qt::Key_E, "Change Event Position", LMEDIT_SHRT, "lm_edit_beat"); - defShrt(SHRT_LM_EDIT_VALUE, Qt::CTRL + Qt::Key_E, "Edit Event Value", LMEDIT_SHRT, "lm_edit_val"); - defShrt(SHRT_LM_INS_KEY, Qt::CTRL + Qt::Key_K, "Insert Key", LMEDIT_SHRT, "lm_ins_key"); - - defShrt(SHRT_NEXT_MARKER, Qt::Key_F6, "Goto Next Marker", ARRANG_SHRT, "me_sel_next"); - defShrt(SHRT_PREV_MARKER, Qt::Key_F5, "Goto Prev Marker", ARRANG_SHRT, "me_sel_prev"); + defShrt(SHRT_LM_INS_TEMPO, Qt::CTRL + Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Insert Tempo"), LMEDIT_SHRT, "lm_ins_tempo"); + defShrt(SHRT_LM_INS_SIG , Qt::CTRL + Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Insert Signature"), LMEDIT_SHRT, "lm_ins_sig"); + defShrt(SHRT_LM_EDIT_BEAT, Qt::CTRL + Qt::SHIFT+ Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Change Event Position"), LMEDIT_SHRT, "lm_edit_beat"); + defShrt(SHRT_LM_EDIT_VALUE, Qt::CTRL + Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Edit Event Value"), LMEDIT_SHRT, "lm_edit_val"); + defShrt(SHRT_LM_INS_KEY, Qt::CTRL + Qt::Key_K, QT_TRANSLATE_NOOP("shortcuts", "Insert Key"), LMEDIT_SHRT, "lm_ins_key"); + + defShrt(SHRT_NEXT_MARKER, Qt::Key_F6, QT_TRANSLATE_NOOP("shortcuts", "Goto Next Marker"), ARRANG_SHRT, "me_sel_next"); + defShrt(SHRT_PREV_MARKER, Qt::Key_F5, QT_TRANSLATE_NOOP("shortcuts", "Goto Prev Marker"), ARRANG_SHRT, "me_sel_prev"); } diff --git a/muse2/muse/sig.cpp b/muse2/muse/sig.cpp index 0b62848c..b11aa622 100644 --- a/muse2/muse/sig.cpp +++ b/muse2/muse/sig.cpp @@ -22,7 +22,6 @@ //========================================================= #include <stdio.h> -#include <assert.h> #include "sig.h" #include "gconfig.h" #include "xml.h" @@ -51,14 +50,18 @@ SigList::SigList() void SigList::add(unsigned tick, int z, int n) { if (z == 0 || n == 0) { - printf("SigList::add illegal signature %d/%d\n", z, n); + printf("THIS SHOULD NEVER HAPPEN: SigList::add() illegal signature %d/%d\n", z, n); // Added p3.3.43 return; } tick = raster1(tick, 0); iSigEvent e = upper_bound(tick); - assert(e != end()); + if (e == end()) + { + printf("THIS SHOULD NEVER HAPPEN: could not find upper_bound(%i) in SigList::add()!\n", tick); + return; + } if (tick == e->second->tick) { e->second->z = z; @@ -185,7 +188,11 @@ int SigList::ticksMeasure(unsigned tick) const int SigList::ticksBeat(unsigned tick) const { ciSigEvent i = upper_bound(tick); - assert(i != end()); + if (i == end()) + { + printf("THIS SHOULD NEVER HAPPEN: couldn't find sig event for tick=%i in SigList::ticksBeat()!\n",tick); + return 0; + } return ticks_beat(i->second->n); } @@ -202,7 +209,7 @@ int SigList::ticks_beat(int n) const case 32: m >>= 3; break; // 48 case 64: m >>= 4; break; // 24 case 128: m >>= 5; break; // 12 - default: assert(false); break; + default: printf("THIS SHOULD NEVER HAPPEN: invalid function call in SigList::ticks_beat(): n=%i\n",n); break; } return m; } @@ -308,7 +315,11 @@ unsigned SigList::raster1(unsigned t, int raster) const if (raster == 1) return t; ciSigEvent e = upper_bound(t); - assert(e != end()); + if (e == end()) + { + printf("THIS SHOULD NEVER HAPPEN: couldn't find sig event for tick=%i in SigList::raster1()!\n", t); + return 0; + } int delta = t - e->second->tick; int ticksM = ticks_beat(e->second->n) * e->second->z; @@ -329,7 +340,11 @@ unsigned SigList::raster2(unsigned t, int raster) const if (raster == 1) return t; ciSigEvent e = upper_bound(t); - assert(e != end()); + if (e == end()) + { + printf("THIS SHOULD NEVER HAPPEN: couldn't find sig event for tick=%i in SigList::raster2()!\n", t); + return 0; + } int delta = t - e->second->tick; int ticksM = ticks_beat(e->second->n) * e->second->z; @@ -348,7 +363,11 @@ int SigList::rasterStep(unsigned t, int raster) const { if (raster == 0) { ciSigEvent e = upper_bound(t); - assert(e != end()); + if (e == end()) + { + printf("THIS SHOULD NEVER HAPPEN: couldn't find sig event for tick=%i in SigList::rasterStep()!\n", t); + return 0; + } return ticks_beat(e->second->n) * e->second->z; } return raster; diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 0f19c313..70314035 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -72,26 +72,6 @@ namespace MusECore { extern void clearMidiTransforms(); extern void clearMidiInputTransforms(); -/* -//--------------------------------------------------------- -// RoutingMenuItem -//--------------------------------------------------------- - -class RoutingMenuItem : public QCustomMenuItem -{ - Route route; - //virtual QSize sizeHint() { return QSize(80, h); } - virtual void paint(QPainter* p, const QColorGroup&, bool, bool, int x, int y, int w, int h) - { - p->fillRect(x, y, w, h, QBrush(lightGray)); - p->drawText(x, y, w, h, AlignCenter, route.name()); - } - - public: - RoutingMenuItem(const Route& r) : route(r) { } -}; -*/ - //--------------------------------------------------------- // Song //--------------------------------------------------------- @@ -108,6 +88,8 @@ Song::Song(const char* name) redoList = new UndoList; _markerList = new MarkerList; _globalPitchShift = 0; + bounceTrack = NULL; + bounceOutput = NULL; showSongInfo=true; clear(false); } @@ -430,45 +412,6 @@ void Song::changeTrack(Track* oldTrack, Track* newTrack) bool Song::addEvent(Event& event, Part* part) { - /* - if (event.type() == Controller) { - MidiTrack* track = (MidiTrack*)part->track(); - int ch = track->outChannel(); - int tick = event.tick() + part->tick(); - int cntrl = event.dataA(); - int val = event.dataB(); - MidiPort* mp = &MusEGlobal::midiPorts[track->outPort()]; - - // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) - { - MidiController* mc = mp->drumController(cntrl); - if(mc) - { - int note = cntrl & 0x7f; - cntrl &= ~0xff; - ch = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; - cntrl |= MusEGlobal::drumMap[note].anote; - } - } - - // Changed by T356. - //if (!mp->setCtrl(ch, tick, cntrl, val)) { - // mp->addManagedController(ch, cntrl); - // if (!mp->setCtrl(ch, tick, cntrl, val)) - // return false; - // } - // Changed again. Don't depend on return value of this - search for the event, below. - //if(!mp->setControllerVal(ch, tick, cntrl, val, part)) - // return false; - if(mp->setControllerVal(ch, tick, cntrl, val, part)) - updateFlags |= SC_MIDI_CONTROLLER; - } - */ - - //addPortCtrlEvents(event, part); - // Return false if the event is already found. // (But allow a port controller value, above, in case it is not already stored.) if(part->events()->find(event) != part->events()->end()) @@ -495,7 +438,6 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) // This can be normal for some (redundant) operations. if(MusEGlobal::debugMsg) printf("Song::changeEvent event not found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size()); - // abort(); // Removed by T356. Allow it to add the new event. // (And remove the old one from the midi port controller!) //return; @@ -504,59 +446,6 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) part->events()->erase(i); part->events()->add(newEvent); - - /* - if (oldEvent.type() == Controller) { - MidiTrack* track = (MidiTrack*)part->track(); - int ch = track->outChannel(); - int tick = oldEvent.tick() + part->tick(); - int cntrl = oldEvent.dataA(); - MidiPort* mp = &MusEGlobal::midiPorts[track->outPort()]; - // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) - { - MidiController* mc = mp->drumController(cntrl); - if(mc) - { - int note = cntrl & 0x7f; - cntrl &= ~0xff; - ch = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; - cntrl |= MusEGlobal::drumMap[note].anote; - } - } - - mp->deleteController(ch, tick, cntrl, part); - } - */ - //removePortCtrlEvents(oldEvent, part); - - /* - if (newEvent.type() == Controller) { - MidiTrack* track = (MidiTrack*)part->track(); - int ch = track->outChannel(); - int tick = newEvent.tick() + part->tick(); - int cntrl = newEvent.dataA(); - int val = newEvent.dataB(); - MidiPort* mp = &MusEGlobal::midiPorts[track->outPort()]; - // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) - { - MidiController* mc = mp->drumController(cntrl); - if(mc) - { - int note = cntrl & 0x7f; - cntrl &= ~0xff; - ch = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; - cntrl |= MusEGlobal::drumMap[note].anote; - } - } - - mp->setControllerVal(ch, tick, cntrl, val, part); - } - */ - //addPortCtrlEvents(newEvent, part); } //--------------------------------------------------------- @@ -565,33 +454,6 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part) void Song::deleteEvent(Event& event, Part* part) { - /* - if (event.type() == Controller) { - MidiTrack* track = (MidiTrack*)part->track(); - int ch = track->outChannel(); - int tick = event.tick() + part->tick(); - int cntrl = event.dataA(); - - MidiPort* mp = &MusEGlobal::midiPorts[track->outPort()]; - // Is it a drum controller event, according to the track port's instrument? - if(track->type() == Track::DRUM) - { - MidiController* mc = mp->drumController(cntrl); - if(mc) - { - int note = cntrl & 0x7f; - cntrl &= ~0xff; - ch = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; - cntrl |= MusEGlobal::drumMap[note].anote; - } - } - - mp->deleteController(ch, tick, cntrl, part); - } - */ - //removePortCtrlEvents(event, part); - iEvent ev = part->events()->find(event); if (ev == part->events()->end()) { // This can be normal for some (redundant) operations. @@ -934,88 +796,6 @@ void Song::cmdAddRecordedEvents(MidiTrack* mt, EventList* events, unsigned start // Add the event to the new part's port controller values, and do all clone parts. addPortCtrlEvents(event, newPart, true); } - - - /* - if (_recMode == REC_REPLACE) - { - iEvent si = part->events()->lower_bound(startTick - part->tick()); - iEvent ei = part->events()->lower_bound(part->endTick() - part->tick()); - - for (iEvent i = si; i != ei; ++i) - { - Event event = i->second; - // Create an undo op. Indicate do port controller values and clone parts. - //addUndo(UndoOp(UndoOp::DeleteEvent, event, part)); - addUndo(UndoOp(UndoOp::DeleteEvent, event, part, true, true)); - - //if (event.type() == Controller) { - // MidiTrack* track = (MidiTrack*)part->track(); - // int ch = track->outChannel(); - // int tick = event.tick() + part->tick(); - // int cntrl = event.dataA(); - // MusEGlobal::midiPorts[track->outPort()].deleteController(ch, tick, cntrl, part); - // } - - // Remove the event from the part's port controller values, and do all clone parts. - //removePortCtrlEvents(event, part, true); - } - part->events()->erase(si, ei); - } - - // Remove all of the part's port controller values, and do all clone parts. - removePortCtrlEvents(part, true); - - // Clone the part. This doesn't increment aref count, and doesn't chain clones. - // It also gives the new part a new serial number, but it is - // overwritten with the old one by Song::changePart(), below. - Part* newPart = part->clone(); - - endTick = 0; - for (iEvent i = s; i != e; ++i) { - Event event = i->second; - unsigned tick = event.tick() - partTick; - event.setTick(tick); - Event e; - // Create an undo op. Indicate do port controller values and clone parts. - //addUndo(UndoOp(UndoOp::AddEvent, e, event, newPart)); - addUndo(UndoOp(UndoOp::AddEvent, e, event, newPart, true, true)); - - // addEvent also adds port controller values. So does msgChangePart, below. Let msgChangePart handle them. - //addEvent(event, (MidiPart*)newPart); - if(newPart->events()->find(event) == newPart->events()->end()) - newPart->events()->add(event); - - if (endTick < event.tick() + event.lenTick()) - endTick = event.tick() + event.lenTick(); - } - newPart->setLenTick(endTick); // endTick - part->tick() - - //printf("Song::cmdAddRecordedEvents before changePart part:%p events:%p refs:%d Arefs:%d newPart:%p events:%p refs:%d Arefs:%d\n", part, part->events(), part->events()->refCount(), part->events()->arefCount(), newPart, newPart->events(), newPart->events()->refCount(), newPart->events()->arefCount()); - - // Change the part. - changePart(part, newPart); - // Manually adjust reference counts. - part->events()->incARef(-1); - newPart->events()->incARef(1); - // Replace the part in the clone chain with the new part. - replaceClone(part, newPart); - // Now add all of the new part's port controller values, and do all clone parts. - addPortCtrlEvents(newPart, true); - - //printf("Song::cmdAddRecordedEvents after changePart part:%p events:%p refs:%d Arefs:%d newPart:%p events:%p refs:%d Arefs:%d\n", part, part->events(), part->events()->refCount(), part->events()->arefCount(), newPart, newPart->events(), newPart->events()->refCount(), newPart->events()->arefCount()); - - //addUndo(UndoOp(UndoOp::ModifyPart, part, newPart)); - // Create an undo op. Indicate do not do port controller values and clone parts. - addUndo(UndoOp(UndoOp::ModifyPart, part, newPart, false, false)); - - // Removed by T356. - //part->events()->incARef(-1); - - updateFlags |= SC_PART_MODIFIED; - //printf("Song::cmdAddRecordedEvents final part:%p events:%p refs:%d Arefs:%d newPart:%p events:%p refs:%d Arefs:%d\n", part, part->events(), part->events()->refCount(), part->events()->arefCount(), newPart, newPart->events(), newPart->events()->refCount(), newPart->events()->arefCount()); - */ - } else { if (_recMode == REC_REPLACE) { @@ -1027,15 +807,6 @@ void Song::cmdAddRecordedEvents(MidiTrack* mt, EventList* events, unsigned start // Create an undo op. Indicate that controller values and clone parts were handled. //addUndo(UndoOp(UndoOp::DeleteEvent, event, part)); addUndo(UndoOp(UndoOp::DeleteEvent, event, part, true, true)); - /* - if (event.type() == Controller) { - MidiTrack* track = (MidiTrack*)part->track(); - int ch = track->outChannel(); - int tick = event.tick() + part->tick(); - int cntrl = event.dataA(); - MusEGlobal::midiPorts[track->outPort()].deleteController(ch, tick, cntrl, part); - } - */ // Remove the event from the part's port controller values, and do all clone parts. removePortCtrlEvents(event, part, true); } @@ -1707,6 +1478,7 @@ void Song::setMType(MType t) void Song::beat() { #if 0 + // Just a rate test... static double _heartbeatRateTimer = 0.0; double t = MusEUtil::curTime(); if(t - _heartbeatRateTimer > 0.0) @@ -2028,14 +1800,12 @@ void Song::processMsg(AudioMsg* msg) break; case SEQM_ADD_TEMPO: - //printf("processMsg (SEQM_ADD_TEMPO) UndoOp::AddTempo. adding tempo at: %d with tempo=%d\n", msg->a, msg->b); addUndo(UndoOp(UndoOp::AddTempo, msg->a, msg->b)); MusEGlobal::tempomap.addTempo(msg->a, msg->b); updateFlags = SC_TEMPO; break; case SEQM_SET_TEMPO: - //printf("processMsg (SEQM_SET_TEMPO) UndoOp::AddTempo. adding tempo at: %d with tempo=%d\n", msg->a, msg->b); addUndo(UndoOp(UndoOp::AddTempo, msg->a, msg->b)); MusEGlobal::tempomap.setTempo(msg->a, msg->b); updateFlags = SC_TEMPO; @@ -2046,7 +1816,6 @@ void Song::processMsg(AudioMsg* msg) break; case SEQM_REMOVE_TEMPO: - //printf("processMsg (SEQM_REMOVE_TEMPO) UndoOp::DeleteTempo. adding tempo at: %d with tempo=%d\n", msg->a, msg->b); addUndo(UndoOp(UndoOp::DeleteTempo, msg->a, msg->b)); MusEGlobal::tempomap.delTempo(msg->a); updateFlags = SC_TEMPO; @@ -2111,7 +1880,6 @@ void Song::cmdRemovePart(Part* part) // cmdChangePart //--------------------------------------------------------- -//void Song::cmdChangePart(Part* oldPart, Part* newPart) void Song::cmdChangePart(Part* oldPart, Part* newPart, bool doCtrls, bool doClones) { //printf("Song::cmdChangePart before changePart oldPart:%p events:%p refs:%d Arefs:%d sn:%d newPart:%p events:%p refs:%d Arefs:%d sn:%d\n", oldPart, oldPart->events(), oldPart->events()->refCount(), oldPart->events()->arefCount(), oldPart->sn(), newPart, newPart->events(), newPart->events()->refCount(), newPart->events()->arefCount(), newPart->sn()); @@ -2166,7 +1934,7 @@ void Song::clear(bool signal, bool /*clear_all*/) printf("Song::clear\n"); bounceTrack = 0; - + _tracks.clear(); _midis.clearDelete(); _waves.clearDelete(); @@ -2463,7 +2231,6 @@ void Song::seqSignal(int fd) if(MusEGlobal::debugMsg) printf("Song: seqSignal: case f: setFreewheel start\n"); - // Enabled by Tim. p3.3.6 if(MusEGlobal::config.freewheelMode) MusEGlobal::audioDevice->setFreewheel(true); @@ -2473,7 +2240,6 @@ void Song::seqSignal(int fd) if(MusEGlobal::debugMsg) printf("Song: seqSignal: case F: setFreewheel stop\n"); - // Enabled by Tim. p3.3.6 if(MusEGlobal::config.freewheelMode) MusEGlobal::audioDevice->setFreewheel(false); @@ -2490,7 +2256,6 @@ void Song::seqSignal(int fd) MusEGlobal::audioDevice->graphChanged(); break; - // p3.3.37 case 'R': // Registration changed if (MusEGlobal::audioDevice) MusEGlobal::audioDevice->registrationChanged(); @@ -2581,8 +2346,7 @@ void Song::recordEvent(MidiTrack* mt, Event& event) int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int acid) { - //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 }; + enum { PREV_EVENT, NEXT_EVENT, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; QMenu* menu = new QMenu; int count = 0; @@ -2627,14 +2391,8 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a } } - //menu->insertItem(tr("Automation:"), HEADER, HEADER); - //menu->setItemEnabled(HEADER, false); - //MenuTitleItem* title = new MenuTitleItem(tr("Automation:")); ddskrjo - //menu->insertItem(title, HEADER, HEADER); ddskrjo menu->addAction(new MusEGui::MenuTitleItem(tr("Automation:"), menu)); - //menu->insertSeparator(SEP1); - QAction* prevEvent = menu->addAction(tr("previous event")); prevEvent->setData(PREV_EVENT); prevEvent->setEnabled(canSeekPrev); @@ -2643,7 +2401,6 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a nextEvent->setData(NEXT_EVENT); nextEvent->setEnabled(canSeekNext); - //menu->insertSeparator(SEP2); menu->addSeparator(); QAction* addEvent = new QAction(menu); @@ -2726,8 +2483,8 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo if(!track && !part) return -1; - //enum { HEADER, SEP1, PREV_EVENT, NEXT_EVENT, SEP2, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; - enum { HEADER, ADD_EVENT, CLEAR_EVENT }; + //enum { PREV_EVENT, NEXT_EVENT, ADD_EVENT, CLEAR_EVENT, CLEAR_RANGE, CLEAR_ALL_EVENTS }; + enum { ADD_EVENT, CLEAR_EVENT }; QMenu* menu = new QMenu; //int count = 0; @@ -2813,22 +2570,8 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo } } - - //menu->insertItem(tr("Automation:"), HEADER, HEADER); - //menu->setItemEnabled(HEADER, false); - //MenuTitleItem* title = new MenuTitleItem(tr("Automation:")); ddskrjo - ///menu->insertItem(title, HEADER, HEADER); ddskrjo - - //menu->insertSeparator(SEP1); + menu->addAction(new MusEGui::MenuTitleItem(tr("Automation:"), menu)); -// menu->insertItem(tr("previous event"), PREV_EVENT, PREV_EVENT); -// menu->setItemEnabled(PREV_EVENT, canSeekPrev); - -// menu->insertItem(tr("next event"), NEXT_EVENT, NEXT_EVENT); -// menu->setItemEnabled(NEXT_EVENT, canSeekNext); - -// menu->insertSeparator(SEP2); - QAction* addEvent = new QAction(menu); menu->addAction(addEvent); if(isEvent) @@ -3089,220 +2832,6 @@ void Song::connectJackRoutes(AudioTrack* track, bool disconnect) } } -/* -//--------------------------------------------------------- -// chooseMidiRoutes -//--------------------------------------------------------- - -void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst) -{ - if(!track) - return; - - //if(!track->isMidiTrack()) - // return; - - QPoint ppt = QCursor::pos(); - //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); - pup->setCheckable(true); - - int gid = 0; - int n; - - // FIXME: - // 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(); - gid = 0; - - //MidiInPortList* tl = MusEGlobal::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 wth ports. - MidiPort* mp = &MusEGlobal::midiPorts[i]; - MidiDevice* md = mp->device(); - if(!md) - continue; - - if(!(md->rwFlags() & (dst ? 1 : 2))) - continue; - - //printf("MidiStrip::iRoutePressed adding submenu portnum:%d\n", i); - - //QMenu* m = menu->addMenu(track->name()); - QPopupMenu* subp = new QPopupMenu(parent); - - for(int ch = 0; ch < MIDI_CHANNELS; ++ch) - { - //QAction* a = m->addAction(QString("Channel %1").arg(ch+1)); - //subp->insertItem(QT_TRANSLATE_NOOP("@default", QString("Channel %1").arg(ch+1)), i * MIDI_CHANNELS + ch); - gid = i * MIDI_CHANNELS + ch; - - //printf("MidiStrip::iRoutePressed 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); - for(iRoute ir = rl->begin(); ir != rl->end(); ++ir) - { - //if(*ir == dst) - if(*ir == srcRoute) - { - subp->setItemChecked(gid, true); - break; - } - } - } - pup->insertItem(QT_TRANSLATE_NOOP("@default", 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").toLatin1().constData(), i+1); -// MenuTitleItem* titel = new MenuTitleItem(QString(buffer)); -// pup->insertItem(titel); - -// if (!MusEGlobal::checkAudioDevice()) return; -// std::list<QString> ol = MusEGlobal::audioDevice->outputPorts(); -// for (std::list<QString>::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; - return; - } - - //n = pup->exec(QCursor::pos()); - n = pup->exec(ppt); - ///delete pup; - if (n != -1) - { - int mdidx = n / MIDI_CHANNELS; - int ch = n % MIDI_CHANNELS; - - //if(MusEGlobal::debugMsg) - //printf("Song::chooseMidiRoutes mdidx:%d ch:%d\n", mdidx, ch); - - MidiPort* mp = &MusEGlobal::midiPorts[mdidx]; - MidiDevice* md = mp->device(); - if(!md) - { - delete pup; - return; - } - - //if(!(md->rwFlags() & 2)) - if(!(md->rwFlags() & (dst ? 1 : 2))) - { - delete pup; - return; - } - - //QString s(pup->text(n)); - //QT_TRANSLATE_NOOP("@default", md->name()) - - //Route srcRoute(s, false, -1); - Route aRoute(md, ch); - //Route srcRoute(md, -1); - //Route dstRoute(track, -1); - Route bRoute(track, ch); - - //if (track->type() == Track::AUDIO_INPUT) - // srcRoute.channel = dstRoute.channel = n & 0xf; - iRoute iir = rl->begin(); - for (; iir != rl->end(); ++iir) - { - //if(*iir == (dst ? bRoute : aRoute)) - if(*iir == aRoute) - break; - } - if (iir != rl->end()) - { - // disconnect - if(dst) - { - //printf("Song::chooseMidiRoutes removing route src track name: %s dst device name: %s\n", track->name().toLatin1().constData(), md->name().toLatin1().constData()); - MusEGlobal::audio->msgRemoveRoute(bRoute, aRoute); - } - else - { - //printf("Song::chooseMidiRoutes removing route src device name: %s dst track name: %s\n", md->name().toLatin1().constData(), track->name().toLatin1().constData()); - MusEGlobal::audio->msgRemoveRoute(aRoute, bRoute); - } - } - else - { - // connect - if(dst) - { - //printf("Song::chooseMidiRoutes adding route src track name: %s dst device name: %s\n", track->name().toLatin1().constData(), md->name().toLatin1().constData()); - MusEGlobal::audio->msgAddRoute(bRoute, aRoute); - } - else - { - //printf("Song::chooseMidiRoutes adding route src device name: %s dst track name: %s\n", md->name().toLatin1().constData(), track->name().toLatin1().constData()); - MusEGlobal::audio->msgAddRoute(aRoute, bRoute); - } - } - - //printf("Song::chooseMidiRoutes calling msgUpdateSoloStates\n"); - MusEGlobal::audio->msgUpdateSoloStates(); - //printf("Song::chooseMidiRoutes calling MusEGlobal::song->update\n"); - MusEGlobal::song->update(SC_ROUTE); - - // p3.3.46 - ///goto _redisplay; - } - delete pup; - parent->setDown(false); // pup->exec() catches mouse release event - //printf("Song::chooseMidiRoutes end\n"); - - //} -} -*/ - //--------------------------------------------------------- // insertTrack0 //--------------------------------------------------------- @@ -3413,37 +2942,6 @@ void Song::insertTrack2(Track* track, int idx) } } - /* - // - // add routes - // - - if (track->isMidiTrack()) - return; - AudioTrack* at = (AudioTrack*)track; - Route src(at, -1); - if (at->type() == Track::AUDIO_OUTPUT) { - const RouteList* rl = at->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->outRoutes()->push_back(src); - } - else if (at->type() == Track::AUDIO_INPUT) { - const RouteList* rl = at->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->inRoutes()->push_back(src); - } - else { - const RouteList* rl = at->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->outRoutes()->push_back(src); - rl = at->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->inRoutes()->push_back(src); - } - */ - - // p3.3.38 - // // add routes // @@ -3479,14 +2977,14 @@ void Song::insertTrack2(Track* track, int idx) const RouteList* rl = track->inRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::insertTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 + //printf("Song::insertTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); Route src(track, r->channel); MusEGlobal::midiPorts[r->midiPort].outRoutes()->push_back(src); } rl = track->outRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::insertTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 + //printf("Song::insertTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); Route src(track, r->channel); MusEGlobal::midiPorts[r->midiPort].inRoutes()->push_back(src); } @@ -3583,7 +3081,7 @@ void Song::removeTrack1(Track* track) SynthI* si = (SynthI*)track; if(si->hasGui()) si->showGui(false); - if(si->hasNativeGui()) // p4.0.20 + if(si->hasNativeGui()) si->showNativeGui(false); } break; @@ -3599,7 +3097,7 @@ void Song::removeTrack1(Track* track) void Song::removeTrack2(Track* track) { - //printf("Song::removeTrack2 track:%s\n", track->name().toLatin1().constData()); // p3.3.50 + //printf("Song::removeTrack2 track:%s\n", track->name().toLatin1().constData()); switch(track->type()) { case Track::MIDI: @@ -3639,38 +3137,6 @@ void Song::removeTrack2(Track* track) } _tracks.erase(track); - - /* - if (track->isMidiTrack()) - return; - // - // remove routes - // - - AudioTrack* at = (AudioTrack*)track; - Route src(at, -1); - if (at->type() == Track::AUDIO_OUTPUT) { - const RouteList* rl = at->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->outRoutes()->removeRoute(src); - } - else if (at->type() == Track::AUDIO_INPUT) { - const RouteList* rl = at->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->inRoutes()->removeRoute(src); - } - else { - const RouteList* rl = at->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->outRoutes()->removeRoute(src); - rl = at->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) - r->track->inRoutes()->removeRoute(src); - } - */ - - // p3.3.38 - // // remove routes // @@ -3682,7 +3148,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->outRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s audio out track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 + //printf("Song::removeTrack2 %s audio out track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3696,7 +3162,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->inRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s audio in track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 + //printf("Song::removeTrack2 %s audio in track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3708,14 +3174,14 @@ void Song::removeTrack2(Track* track) const RouteList* rl = track->inRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::removeTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 + //printf("Song::removeTrack2 %s in route port:%d\n", track->name().toLatin1().constData(), r->midiPort); Route src(track, r->channel); MusEGlobal::midiPorts[r->midiPort].outRoutes()->removeRoute(src); } rl = track->outRoutes(); for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - //printf("Song::removeTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); // p3.3.50 + //printf("Song::removeTrack2 %s out route port:%d\n", track->name().toLatin1().constData(), r->midiPort); Route src(track, r->channel); MusEGlobal::midiPorts[r->midiPort].inRoutes()->removeRoute(src); } @@ -3727,7 +3193,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->outRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s in route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 + //printf("Song::removeTrack2 %s in route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; @@ -3738,7 +3204,7 @@ void Song::removeTrack2(Track* track) { //if(r->track == track) // r->track->inRoutes()->removeRoute(*r); - //printf("Song::removeTrack2 %s out route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 + //printf("Song::removeTrack2 %s out route track:%s\n", track->name().toLatin1().constData(), r->track->name().toLatin1().constData()); // p3.3.50 Route src(track, r->channel, r->channels); src.remoteChannel = r->remoteChannel; diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index fbcb23cc..9adfd406 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -21,7 +21,6 @@ // //========================================================= -#include <assert.h> #include <uuid/uuid.h> #include <QProgressDialog> #include <QMessageBox> @@ -1294,10 +1293,10 @@ void MusE::readToplevels(MusECore::Xml& xml) } else if (tag == "scoreedit") { MusEGui::ScoreEdit* score = new MusEGui::ScoreEdit(this, 0, _arranger->cursorValue()); - score->show(); toplevels.push_back(score); connect(score, SIGNAL(isDeleting(MusEGui::TopWin*)), SLOT(toplevelDeleting(MusEGui::TopWin*))); connect(score, SIGNAL(name_changed()), arrangerView, SLOT(scoreNamingChanged())); + score->show(); score->readStatus(xml); } else if (tag == "drumedit") { diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp index fd526931..93067835 100644 --- a/muse2/muse/synth.cpp +++ b/muse2/muse/synth.cpp @@ -60,7 +60,7 @@ std::vector<MusECore::Synth*> synthis; // array of available MusEGlobal::synthi namespace MusECore { extern void connectNodes(AudioTrack*, AudioTrack*); -bool SynthI::_isVisible=true; +bool SynthI::_isVisible=false; /* //--------------------------------------------------------- diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp index 1ee1dfde..2091d03e 100644 --- a/muse2/muse/track.cpp +++ b/muse2/muse/track.cpp @@ -950,15 +950,15 @@ void Track::writeRouting(int level, Xml& xml) const // Support Midi Port to Audio Input track routes. p4.0.14 Tim. if(r->type == Route::MIDI_PORT_ROUTE) { - s = QT_TRANSLATE_NOOP("@default", "Route"); + s = "Route"; if(r->channel != -1 && r->channel != 0) - s += QString(QT_TRANSLATE_NOOP("@default", " channelMask=\"%1\"")).arg(r->channel); // Use new channel mask. + s += QString(" channelMask=\"%1\"").arg(r->channel); // Use new channel mask. xml.tag(level++, s.toLatin1().constData()); xml.tag(level, "source mport=\"%d\"/", r->midiPort); - s = QT_TRANSLATE_NOOP("@default", "dest"); - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(name())); + s = "dest"; + s += QString(" name=\"%1\"/").arg(Xml::xmlString(name())); xml.tag(level, s.toLatin1().constData()); xml.etag(level--, "Route"); @@ -966,17 +966,17 @@ void Track::writeRouting(int level, Xml& xml) const else if(!r->name().isEmpty()) { - s = QT_TRANSLATE_NOOP("@default", "Route"); + s = "Route"; if(r->channel != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel); + s += QString(" channel=\"%1\"").arg(r->channel); xml.tag(level++, s.toAscii().constData()); // p3.3.38 New routing scheme. - s = QT_TRANSLATE_NOOP("@default", "source"); + s = "source"; if(r->type != Route::TRACK_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type); - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name())); + s += QString(" type=\"%1\"").arg(r->type); + s += QString(" name=\"%1\"/").arg(Xml::xmlString(r->name())); xml.tag(level, s.toAscii().constData()); xml.tag(level, "dest name=\"%s\"/", Xml::xmlString(name()).toLatin1().constData()); @@ -996,40 +996,40 @@ void Track::writeRouting(int level, Xml& xml) const if(r->midiPort != -1 || !r->name().isEmpty()) // p3.3.49 { - s = QT_TRANSLATE_NOOP("@default", "Route"); + s = "Route"; if(r->type == Route::MIDI_PORT_ROUTE) // p3.3.50 { if(r->channel != -1 && r->channel != 0) - s += QString(QT_TRANSLATE_NOOP("@default", " channelMask=\"%1\"")).arg(r->channel); // Use new channel mask. + s += QString(" channelMask=\"%1\"").arg(r->channel); // Use new channel mask. } else { if(r->channel != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel); + s += QString(" channel=\"%1\"").arg(r->channel); } if(r->channels != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " channels=\"%1\"")).arg(r->channels); + s += QString(" channels=\"%1\"").arg(r->channels); if(r->remoteChannel != -1) - s += QString(QT_TRANSLATE_NOOP("@default", " remch=\"%1\"")).arg(r->remoteChannel); + s += QString(" remch=\"%1\"").arg(r->remoteChannel); xml.tag(level++, s.toAscii().constData()); // Allow for a regular mono or stereo track to feed a multi-channel synti. xml.tag(level, "source name=\"%s\"/", Xml::xmlString(name()).toLatin1().constData()); - s = QT_TRANSLATE_NOOP("@default", "dest"); + s = "dest"; //if(r->type == Route::MIDI_DEVICE_ROUTE) // p3.3.49 Obsolete since 1.1-RC2 // s += QString(QT_TRANSLATE_NOOP("@default", " devtype=\"%1\"")).arg(r->device->deviceType()); // //if(r->type != Route::TRACK_ROUTE) // if(r->type != Route::TRACK_ROUTE && r->type != Route::MIDI_PORT_ROUTE) - s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type); + s += QString(" type=\"%1\"").arg(r->type); //s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(r->name()); if(r->type == Route::MIDI_PORT_ROUTE) // p3.3.49 - s += QString(QT_TRANSLATE_NOOP("@default", " mport=\"%1\"/")).arg(r->midiPort); + s += QString(" mport=\"%1\"/").arg(r->midiPort); else - s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name())); + s += QString(" name=\"%1\"/").arg(Xml::xmlString(r->name())); xml.tag(level, s.toAscii().constData()); diff --git a/muse2/muse/transport.cpp b/muse2/muse/transport.cpp index 60494bc4..e978cb2e 100644 --- a/muse2/muse/transport.cpp +++ b/muse2/muse/transport.cpp @@ -45,13 +45,6 @@ namespace MusEGui { -static const char* recordTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to enable recording"); -static const char* stopTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to stop playback"); -static const char* playTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to start playback"); -static const char* startTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to rewind to start position"); -static const char* frewindTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to rewind"); -static const char* fforwardTransportText = QT_TRANSLATE_NOOP("@default", "Click this button to forward current play position"); - //--------------------------------------------------------- // toolButton //--------------------------------------------------------- @@ -401,25 +394,25 @@ Transport::Transport(QWidget* parent, const char* name) tb->setSpacing(0); buttons[0] = newButton(startIcon, tr("rewind to start")); - buttons[0]->setWhatsThis(tr(startTransportText)); + buttons[0]->setWhatsThis(tr("Click this button to rewind to start position")); buttons[1] = newButton(frewindIcon, tr("rewind")); buttons[1]->setAutoRepeat(true); - buttons[1]->setWhatsThis(tr(frewindTransportText)); + buttons[1]->setWhatsThis(tr("Click this button to rewind")); buttons[2] = newButton(fforwardIcon, tr("forward")); buttons[2]->setAutoRepeat(true); - buttons[2]->setWhatsThis(tr(fforwardTransportText)); + buttons[2]->setWhatsThis(tr("Click this button to forward current play position")); buttons[3] = newButton(stopIcon, tr("stop"), true); buttons[3]->setChecked(true); // set STOP - buttons[3]->setWhatsThis(tr(stopTransportText)); + buttons[3]->setWhatsThis(tr("Click this button to stop playback")); buttons[4] = newButton(playIcon, tr("play"), true); - buttons[4]->setWhatsThis(tr(playTransportText)); + buttons[4]->setWhatsThis(tr("Click this button to start playback")); buttons[5] = newButton(record_on_Icon, tr("record"), true); - buttons[5]->setWhatsThis(tr(recordTransportText)); + buttons[5]->setWhatsThis(tr("Click this button to enable recording")); for (int i = 0; i < 6; ++i) { diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 8d58cfb3..537d8529 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -94,23 +94,23 @@ WaveEdit::WaveEdit(MusECore::PartList* pl) menuGain = menuFunctions->addMenu(tr("&Gain")); - act = menuGain->addAction(tr("200%")); + act = menuGain->addAction("200%"); mapper->setMapping(act, CMD_GAIN_200); connect(act, SIGNAL(triggered()), mapper, SLOT(map())); - act = menuGain->addAction(tr("150%")); + act = menuGain->addAction("150%"); mapper->setMapping(act, CMD_GAIN_150); connect(act, SIGNAL(triggered()), mapper, SLOT(map())); - act = menuGain->addAction(tr("75%")); + act = menuGain->addAction("75%"); mapper->setMapping(act, CMD_GAIN_75); connect(act, SIGNAL(triggered()), mapper, SLOT(map())); - act = menuGain->addAction(tr("50%")); + act = menuGain->addAction("50%"); mapper->setMapping(act, CMD_GAIN_50); connect(act, SIGNAL(triggered()), mapper, SLOT(map())); - act = menuGain->addAction(tr("25%")); + act = menuGain->addAction("25%"); mapper->setMapping(act, CMD_GAIN_25); connect(act, SIGNAL(triggered()), mapper, SLOT(map())); diff --git a/muse2/muse/widgets/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp index aee7ad5c..6d8dc30c 100644 --- a/muse2/muse/widgets/comboQuant.cpp +++ b/muse2/muse/widgets/comboQuant.cpp @@ -37,9 +37,9 @@ static int quantTable[] = { }; static const char* quantStrings[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "64T", "32T", "16T", "8T", "4T", "2T", "1T", - QT_TRANSLATE_NOOP("@default", "Off"), "64", "32", "16", "8", "4", "2", "1", - QT_TRANSLATE_NOOP("@default", "Off"), "64.", "32.", "16.", "8.", "4.", "2.", "1." + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64T", "32T", "16T", "8T", "4T", "2T", "1T", + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64", "32", "16", "8", "4", "2", "1", + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64.", "32.", "16.", "8.", "4.", "2.", "1." }; //--------------------------------------------------------- diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index df391b45..68f2718f 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -33,6 +33,7 @@ #include "filedialog.h" #include "../globals.h" #include "gconfig.h" +#include "helper.h" namespace MusEGui { @@ -300,9 +301,11 @@ QString getFilterExtension(const QString &filter) //--------------------------------------------------------- // getOpenFileName //--------------------------------------------------------- -QString getOpenFileName(const QString &startWith, - const QStringList& filters, QWidget* parent, const QString& name, bool* all, MFileDialog::ViewType viewType) +QString getOpenFileName(const QString &startWith, const char** filters_chararray, + QWidget* parent, const QString& name, bool* all, MFileDialog::ViewType viewType) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); + QString initialSelection; // FIXME Tim. MFileDialog *dlg = new MFileDialog(startWith, QString::null, parent, false); dlg->setNameFilters(filters); @@ -339,9 +342,10 @@ QString getOpenFileName(const QString &startWith, //--------------------------------------------------------- QString getSaveFileName(const QString &startWith, - //const char** filters, QWidget* parent, const QString& name) - const QStringList& filters, QWidget* parent, const QString& name) + const char** filters_chararray, QWidget* parent, const QString& name) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); + MFileDialog *dlg = new MFileDialog(startWith, QString::null, parent, true); dlg->setNameFilters(filters); dlg->setWindowTitle(name); @@ -404,9 +408,9 @@ QString getSaveFileName(const QString &startWith, //--------------------------------------------------------- QString getImageFileName(const QString& startWith, - //const char** filters, QWidget* parent, const QString& name) - const QStringList& filters, QWidget* parent, const QString& name) + const char** filters_chararray, QWidget* parent, const QString& name) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); QString initialSelection; QString* workingDirectory = new QString(QDir::currentPath()); if (!startWith.isEmpty() ) { @@ -547,15 +551,14 @@ MFile::~MFile() // open //--------------------------------------------------------- -//FILE* MFile::open(const char* mode, const char** pattern, -FILE* MFile::open(const char* mode, const QStringList& pattern, +FILE* MFile::open(const char* mode, const char** patterns_chararray, QWidget* parent, bool noError, bool warnIfOverwrite, const QString& caption) { QString name; if (strcmp(mode, "r") == 0) - name = getOpenFileName(path, pattern, parent, caption, 0); + name = getOpenFileName(path, patterns_chararray, parent, caption, 0); else - name = getSaveFileName(path, pattern, parent, caption); + name = getSaveFileName(path, patterns_chararray, parent, caption); if (name.isEmpty()) return 0; f = fileOpen(parent, name, ext, mode, isPopen, noError, diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h index e5687494..b731b65a 100644 --- a/muse2/muse/widgets/filedialog.h +++ b/muse2/muse/widgets/filedialog.h @@ -24,8 +24,6 @@ #include "ui_fdialogbuttons.h" -class QStringList; - namespace MusEGui { //--------------------------------------------------------- @@ -91,14 +89,11 @@ class ContentsPreview : public QWidget, public Q3FilePreview { }; */ -//QString getSaveFileName(const QString& startWidth, const char** filter, -QString getSaveFileName(const QString& startWidth, const QStringList& filters, +QString getSaveFileName(const QString& startWidth, const char** filters, QWidget* parent, const QString& name); -//QString getOpenFileName(const QString& startWidth, const char** filter, -QString getOpenFileName(const QString& startWidth, const QStringList& filters, +QString getOpenFileName(const QString& startWidth, const char** filters, QWidget* parent, const QString& name, bool* openAll, MFileDialog::ViewType viewType = MFileDialog::PROJECT_VIEW); -//QString getImageFileName(const QString& startWith, const char** filters, -QString getImageFileName(const QString& startWith, const QStringList& filters, +QString getImageFileName(const QString& startWith, const char** filters, QWidget* parent, const QString& name); FILE* fileOpen(QWidget*, QString, const QString&, @@ -119,8 +114,7 @@ class MFile { public: MFile(const QString& path, const QString& ext); ~MFile(); - //FILE* open(const char* mode, const char** pattern, - FILE* open(const char* mode, const QStringList& pattern, + FILE* open(const char* mode, const char** patterns, QWidget* parent, bool noError, bool warnIfOverwrite, const QString& caption); }; diff --git a/muse2/muse/widgets/metronome.cpp b/muse2/muse/widgets/metronome.cpp index e6b7bd91..416e9e47 100644 --- a/muse2/muse/widgets/metronome.cpp +++ b/muse2/muse/widgets/metronome.cpp @@ -85,7 +85,7 @@ void MetronomeConfig::audioBeepRoutesClicked() int nn = 0; for(MusECore::iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) { - QAction* action = pup->addAction(QT_TRANSLATE_NOOP("@default", (*iao)->name())); + QAction* action = pup->addAction((*iao)->name()); action->setCheckable(true); action->setData(nn); if((*iao)->sendMetronome()) diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index df077102..c54ef1ad 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -45,6 +45,9 @@ MTScaleFlo::MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget) pos[0] = MusEGlobal::song->cpos(); pos[1] = MusEGlobal::song->lpos(); pos[2] = MusEGlobal::song->rpos(); + xpos=0; + xoffset=0; + button = Qt::NoButton; setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp index 73d29c25..80ae98bd 100644 --- a/muse2/muse/widgets/routepopup.cpp +++ b/muse2/muse/widgets/routepopup.cpp @@ -220,9 +220,9 @@ int RoutePopupMenu::addSyntiPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id { char buffer[128]; if(tchans == 2) - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); else - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setCheckable(true); @@ -347,7 +347,7 @@ int RoutePopupMenu::addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup if(chans > 1) { char buffer[128]; - snprintf(buffer, 128, "%s %d", pup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -425,7 +425,7 @@ int RoutePopupMenu::addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup if(chans > 2) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", pup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -482,7 +482,7 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setCheckable(true); @@ -535,7 +535,7 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); act = chpup->addAction(QString(buffer)); act->setCheckable(true); diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp index 46a3e75d..ad78a2ad 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.cpp +++ b/muse2/muse/widgets/shortcutcapturedialog.cpp @@ -30,7 +30,6 @@ // // Description: // Dialog window for capturing keyboard shortcuts -// #include "shortcutcapturedialog.h" #include "shortcuts.h" @@ -39,6 +38,7 @@ #include <QKeySequence> #include <QInputEvent> #include <QChar> +#include <QApplication> namespace MusEGui { @@ -105,7 +105,7 @@ void ShortcutCaptureDialog::keyPressEvent(QKeyEvent* e) (( shortcuts[i].type & (shortcuts[shortcutindex].type | INVIS_SHRT)) || shortcuts[i].type & GLOBAL_SHRT || shortcuts[shortcutindex].type & GLOBAL_SHRT)) { // affect the same scope - msgString = tr("Shortcut conflicts with %1").arg(shortcuts[i].descr); + msgString = tr("Shortcut conflicts with %1").arg(qApp->translate("shortcuts",shortcuts[i].descr)); conflict = true; break; } diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp index fc08e7ce..609564cc 100644 --- a/muse2/muse/widgets/shortcutconfig.cpp +++ b/muse2/muse/widgets/shortcutconfig.cpp @@ -30,12 +30,12 @@ // // Description: // Dialog for configuring keyboard shortcuts -// #include <QCloseEvent> #include <QKeySequence> #include <QString> #include <QSettings> +#include <QApplication> #include "shortcutconfig.h" #include "shortcutcapturedialog.h" @@ -86,12 +86,12 @@ void ShortcutConfig::updateSCListView(int category) for (int i=0; i < SHRT_NUM_OF_ELEMENTS; i++) { if (shortcuts[i].type & category) { newItem = new SCListViewItem(scListView, i); - newItem->setText(SHRT_DESCR_COL, tr(shortcuts[i].descr)); + newItem->setText(SHRT_DESCR_COL, qApp->translate("shortcuts", shortcuts[i].descr)); //if(category == ALL_SHRT) // catpre = QString(shortcut_category[shortcuts[i].type].name) + QString(": "); //else // catpre.clear(); - //newItem->setText(SHRT_DESCR_COL, catpre + tr(shortcuts[i].descr)); // Tim + //newItem->setText(SHRT_DESCR_COL, catpre + tr(qApp->translate("shortcuts", shortcuts[i].descr)); // Tim QKeySequence key = QKeySequence(shortcuts[i].key); newItem->setText(SHRT_SHRTCUT_COL, key); } diff --git a/muse2/muse/widgets/shortcutconfigbase.ui b/muse2/muse/widgets/shortcutconfigbase.ui index 119a7007..6dd5d5b7 100644 --- a/muse2/muse/widgets/shortcutconfigbase.ui +++ b/muse2/muse/widgets/shortcutconfigbase.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>466</width> - <height>403</height> + <width>512</width> + <height>452</height> </rect> </property> <property name="windowTitle"> @@ -16,67 +16,64 @@ <property name="sizeGripEnabled"> <bool>true</bool> </property> - <layout class="QVBoxLayout"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QGroupBox" name="groupBox3"> - <property name="title"> - <string/> + <widget class="QSplitter" name="splitter"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <layout class="QHBoxLayout"> - <property name="spacing"> - <number>3</number> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="childrenCollapsible"> + <bool>false</bool> + </property> + <widget class="QTreeWidget" name="cgListView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>105</width> + <height>200</height> + </size> + </property> + <column> + <property name="text"> + <string>Shortcut Category</string> + </property> + </column> + </widget> + <widget class="QTreeWidget" name="scListView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="margin"> - <number>0</number> + <property name="minimumSize"> + <size> + <width>170</width> + <height>230</height> + </size> </property> - <item> - <widget class="QTreeWidget" name="cgListView"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>105</width> - <height>200</height> - </size> - </property> - <column> - <property name="text"> - <string>Shortcut Category</string> - </property> - </column> - </widget> - </item> - <item> - <widget class="QTreeWidget" name="scListView"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>170</width> - <height>230</height> - </size> - </property> - <column> - <property name="text"> - <string>Shortcut</string> - </property> - </column> - <column> - <property name="text"> - <string>Description</string> - </property> - </column> - </widget> - </item> - </layout> + <column> + <property name="text"> + <string>Shortcut</string> + </property> + </column> + <column> + <property name="text"> + <string>Description</string> + </property> + </column> + </widget> </widget> </item> <item> diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index 3174260f..589726a9 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -20,7 +20,6 @@ // //========================================================= -//#include <assert.h> #include <stdio.h> #include <values.h> @@ -45,9 +44,9 @@ static int rasterTable[] = { }; static const char* rasterStrings[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "2pp", "5pp", "64T", "32T", "16T", "8T", "4T", "2T", "1T", - QT_TRANSLATE_NOOP("@default", "Off"), "3pp", "6pp", "64", "32", "16", "8", "4", "2", "1", - QT_TRANSLATE_NOOP("@default", "Off"), "4pp", "7pp", "64.", "32.", "16.", "8.", "4.", "2.", "1." + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "2pp", "5pp", "64T", "32T", "16T", "8T", "4T", "2T", "1T", + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "3pp", "6pp", "64", "32", "16", "8", "4", "2", "1", + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "4pp", "7pp", "64.", "32.", "16.", "8.", "4.", "2.", "1." }; diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp index 162d2b97..d46126a9 100644 --- a/muse2/muse/widgets/tools.cpp +++ b/muse2/muse/widgets/tools.cpp @@ -30,42 +30,42 @@ namespace MusEGui { -const char* infoPointer = QT_TRANSLATE_NOOP("@default", "select Pointer Tool:\n" +const char* infoPointer = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Pointer Tool:\n" "with the pointer tool you can:\n" " select parts\n" " move parts\n" " copy parts"); -const char* infoPencil = QT_TRANSLATE_NOOP("@default", "select Pencil Tool:\n" +const char* infoPencil = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Pencil Tool:\n" "with the pencil tool you can:\n" " create new parts\n" " modify length of parts"); -const char* infoDel = QT_TRANSLATE_NOOP("@default", "select Delete Tool:\n" +const char* infoDel = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Delete Tool:\n" "with the delete tool you can delete parts"); -const char* infoCut = QT_TRANSLATE_NOOP("@default", "select Cut Tool:\n" +const char* infoCut = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Cut Tool:\n" "with the cut tool you can split a part"); -const char* infoGlue = QT_TRANSLATE_NOOP("@default", "select Glue Tool:\n" +const char* infoGlue = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Glue Tool:\n" "with the glue tool you can glue two parts"); -const char* infoScore = QT_TRANSLATE_NOOP("@default", "select Score Tool:\n"); -const char* infoQuant = QT_TRANSLATE_NOOP("@default", "select Quantize Tool:\n" +const char* infoScore = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Score Tool:\n"); +const char* infoQuant = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Quantize Tool:\n" "insert display quantize event"); -const char* infoDraw = QT_TRANSLATE_NOOP("@default", "select Drawing Tool"); -const char* infoMute = QT_TRANSLATE_NOOP("@default", "select Muting Tool:\n" +const char* infoDraw = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Drawing Tool"); +const char* infoMute = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Muting Tool:\n" "click on part to mute/unmute"); -const char* infoAutomation = QT_TRANSLATE_NOOP("@default", "Manipulate automation"); -const char* infoCursor = QT_TRANSLATE_NOOP("@default", "Cursor tool"); +const char* infoAutomation = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "Manipulate automation"); +const char* infoCursor = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "Cursor tool"); ToolB toolList[] = { - {&pointerIcon, QT_TRANSLATE_NOOP("@default", "pointer"), infoPointer }, - {&pencilIcon, QT_TRANSLATE_NOOP("@default", "pencil"), infoPencil }, - {&deleteIcon, QT_TRANSLATE_NOOP("@default", "eraser"), infoDel }, - {&cutIcon, QT_TRANSLATE_NOOP("@default", "cutter"), infoCut }, - {¬e1Icon, QT_TRANSLATE_NOOP("@default", "score"), infoScore }, - {&glueIcon, QT_TRANSLATE_NOOP("@default", "glue"), infoGlue }, - {&quantIcon, QT_TRANSLATE_NOOP("@default", "quantize"), infoQuant }, - {&drawIcon, QT_TRANSLATE_NOOP("@default", "draw"), infoDraw }, - {&editmuteIcon, QT_TRANSLATE_NOOP("@default", "mute parts"), infoMute }, - {&drawIcon, QT_TRANSLATE_NOOP("@default", "edit automation"),infoAutomation}, - {&cursorIcon, QT_TRANSLATE_NOOP("@default", "cursor"), infoCursor}, + {&pointerIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "pointer"), infoPointer }, + {&pencilIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "pencil"), infoPencil }, + {&deleteIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "eraser"), infoDel }, + {&cutIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "cutter"), infoCut }, + {¬e1Icon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "score"), infoScore }, + {&glueIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "glue"), infoGlue }, + {&quantIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "quantize"), infoQuant }, + {&drawIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "draw"), infoDraw }, + {&editmuteIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "mute parts"), infoMute }, + {&drawIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "edit automation"),infoAutomation}, + {&cursorIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "cursor"), infoCursor}, }; //--------------------------------------------------------- @@ -94,7 +94,7 @@ EditToolBar::EditToolBar(QWidget* parent, int tools, const char*) continue; ToolB* t = &toolList[i]; - Action* a = new Action(action, 1<<i, t->tip, true); + Action* a = new Action(action, 1<<i, tr(t->tip).toAscii().data(), true); actions[n] = a; //a->setIconSet(QIcon(**(t->icon))); a->setIcon(QIcon(**(t->icon))); diff --git a/muse2/muse/widgets/visibletracks.cpp b/muse2/muse/widgets/visibletracks.cpp index 84e7dd42..f8ce06bf 100644 --- a/muse2/muse/widgets/visibletracks.cpp +++ b/muse2/muse/widgets/visibletracks.cpp @@ -32,22 +32,22 @@ namespace MusEGui { -const char* waveTrack = QT_TRANSLATE_NOOP("@default", "Show wave tracks"); -const char* groupTrack = QT_TRANSLATE_NOOP("@default", "Show group tracks"); -const char* auxTrack = QT_TRANSLATE_NOOP("@default", "Show aux tracks"); -const char* inputTrack = QT_TRANSLATE_NOOP("@default", "Show input tracks"); -const char* outputTrack = QT_TRANSLATE_NOOP("@default", "Show output tracks"); -const char* midiTrack = QT_TRANSLATE_NOOP("@default", "Show midi tracks"); -const char* synthTrack = QT_TRANSLATE_NOOP("@default", "Show synth tracks"); +const char* waveTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show wave tracks"); +const char* groupTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show group tracks"); +const char* auxTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show aux tracks"); +const char* inputTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show input tracks"); +const char* outputTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show output tracks"); +const char* midiTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show midi tracks"); +const char* synthTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show synth tracks"); VisibleToolB visTrackList[] = { - {&addtrack_wavetrackIcon, QT_TRANSLATE_NOOP("@default", "Show wave tracks"), waveTrack }, - {&addtrack_audiogroupIcon, QT_TRANSLATE_NOOP("@default", "Show group tracks"), groupTrack }, - {&addtrack_auxsendIcon, QT_TRANSLATE_NOOP("@default", "Show aux tracks"), auxTrack }, - {&addtrack_audioinputIcon, QT_TRANSLATE_NOOP("@default", "Show input tracks"), inputTrack }, - {&addtrack_audiooutputIcon, QT_TRANSLATE_NOOP("@default", "Show output tracks"), outputTrack }, - {&addtrack_addmiditrackIcon,QT_TRANSLATE_NOOP("@default", "Show midi tracks"), midiTrack }, - {&synthIcon, QT_TRANSLATE_NOOP("@default", "Show synth tracks"), midiTrack }, + {&addtrack_wavetrackIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show wave tracks"), waveTrack }, + {&addtrack_audiogroupIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show group tracks"), groupTrack }, + {&addtrack_auxsendIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show aux tracks"), auxTrack }, + {&addtrack_audioinputIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show input tracks"), inputTrack }, + {&addtrack_audiooutputIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show output tracks"), outputTrack }, + {&addtrack_addmiditrackIcon,QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show midi tracks"), midiTrack }, + {&synthIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show synth tracks"), midiTrack }, }; //--------------------------------------------------------- @@ -67,7 +67,7 @@ VisibleTracks::VisibleTracks(QWidget* parent, const char*) for (unsigned i = 0; i < sizeof(visTrackList)/sizeof(*visTrackList); ++i) { VisibleToolB* t = &visTrackList[i]; - Action* a = new Action(action, i, t->tip, true); + Action* a = new Action(action, i, tr(t->tip).toAscii().data(), true); actions[n] = a; //a->setIconSet(QIcon(**(t->icon))); a->setIcon(QIcon(**(t->icon))); |