diff options
Diffstat (limited to 'muse2')
38 files changed, 98 insertions, 60 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 13ccfd37..1bfd0e97 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,4 +1,13 @@ 04.08.2012: + * Introducing: More bits for Song Changed SC_* flags. (Tim) + Added member Song::updateFlags2. (Various song commands and undo/redo use the update flags). + Song::update() now takes an extra 'flags2' param, default is zero, with a HACK: If flags is -1 + (as in a call to update() with no params), it is highly unlikely someone actually wanted + all 32 flags bits set but not flags2, so flags2 is also forced to -1 in that case. + - Please beware these possible extra flags when writing songChanged handlers and setting updateFlags. + No place uses them yet. We can recognize them as necessary, as we go, by adding an extra flags2 + param to the various songChanged handlers. +04.08.2012: - Optimizations: Added Master::songChanged and ArrangerView::songChanged to filter some SCs. (Tim) 01.08.2012: - Finished the Sysex Editor in the Instrument Editor. (Tim) diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index 000faf91..62c405d3 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -524,7 +524,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name) connect(canvas, SIGNAL(dclickPart(MusECore::Track*)), SIGNAL(editPart(MusECore::Track*))); connect(canvas, SIGNAL(startEditor(MusECore::PartList*,int)), SIGNAL(startEditor(MusECore::PartList*, int))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(canvas, SIGNAL(followEvent(int)), hscroll, SLOT(setOffset(int))); connect(canvas, SIGNAL(selectionChanged()), SIGNAL(selectionChanged())); connect(canvas, SIGNAL(dropSongFile(const QString&)), SIGNAL(dropSongFile(const QString&))); @@ -1198,7 +1198,7 @@ void Arranger::switchInfo(int n) delete w; w = new AudioStrip(trackInfo, (MusECore::AudioTrack*)selected); //w->setFocusPolicy(Qt::TabFocus); // p4.0.9 - connect(MusEGlobal::song, SIGNAL(songChanged(int)), w, SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), w, SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), w, SLOT(configChanged())); w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); trackInfo->addWidget(w, 2); diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 6fe38b69..14a0d8ef 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -113,7 +113,7 @@ ArrangerView::ArrangerView(QWidget* parent) connect(MusEGlobal::muse, SIGNAL(configChanged()), arranger, SLOT(configChanged())); connect(arranger, SIGNAL(setUsedTool(int)), editTools, SLOT(set(int))); connect(arranger, SIGNAL(selectionChanged()), SLOT(selectionChanged())); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(songChanged(int))); diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 05e23321..4d2a1251 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -113,7 +113,7 @@ TList::TList(Header* hdr, QWidget* parent, const char* name) //setAttribute(Qt::WA_OpaquePaintEvent); resizeFlag = false; - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(redraw())); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(maybeUpdateVolatileCustomColumns())); } diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp index 1f54f9b4..f32fabbc 100644 --- a/muse2/muse/cliplist/cliplist.cpp +++ b/muse2/muse/cliplist/cliplist.cpp @@ -146,7 +146,7 @@ ClipListEdit::ClipListEdit(QWidget* parent) connect(editor->view, SIGNAL(itemSelectionChanged()), SLOT(clipSelectionChanged())); connect(editor->view, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(clicked(QTreeWidgetItem*, int))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(editor->start, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(startChanged(const MusECore::Pos&))); connect(editor->len, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(lenChanged(const MusECore::Pos&))); diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index 32e1dc91..2281f134 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -1107,7 +1107,7 @@ MPConfig::MPConfig(QWidget* parent) this, SLOT(rbClicked(QTableWidgetItem*))); connect(mdevView, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(mdevViewItemRenamed(QTableWidgetItem*))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(synthList, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged())); connect(instanceList, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged())); diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp index aa6fbf38..b1e8753c 100644 --- a/muse2/muse/ctrl/ctrlcanvas.cpp +++ b/muse2/muse/ctrl/ctrlcanvas.cpp @@ -216,7 +216,7 @@ CtrlCanvas::CtrlCanvas(MidiEditor* e, QWidget* parent, int xmag, if (!editor->parts()->empty()) setCurTrackAndPart(); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); setCurDrumPitch(editor->curDrumInstrument()); diff --git a/muse2/muse/instruments/midictrledit.cpp b/muse2/muse/instruments/midictrledit.cpp index 44f1a150..03aa2f76 100644 --- a/muse2/muse/instruments/midictrledit.cpp +++ b/muse2/muse/instruments/midictrledit.cpp @@ -132,7 +132,7 @@ MidiControllerEditDialog::MidiControllerEditDialog(QWidget* parent, const char* updateViewController(); _modified = false; buttonApply->setEnabled(false); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); } //--------------------------------------------------------- diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 2747de85..62b2004d 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -588,7 +588,7 @@ ListEdit::ListEdit(MusECore::PartList* pl) mainGrid->setRowStretch(1, 100); mainGrid->setColumnStretch(0, 100); mainGrid->addWidget(liste, 1, 0, 2, 1); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); if(pl->empty()) { diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp index 062f4385..037c0ff3 100644 --- a/muse2/muse/marker/markerview.cpp +++ b/muse2/muse/marker/markerview.cpp @@ -271,7 +271,7 @@ MarkerView::MarkerView(QWidget* parent) // Rest //--------------------------------------------------- - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); updateList(); diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 154b5e1f..23c39bc7 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -267,7 +267,7 @@ LMaster::LMaster() connect(view, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(select(QTreeWidgetItem*, QTreeWidgetItem*))); connect(view, SIGNAL(itemPressed(QTreeWidgetItem*, int)), SLOT(itemPressed(QTreeWidgetItem*, int))); connect(view, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), SLOT(itemDoubleClicked(QTreeWidgetItem*))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(this, SIGNAL(seekTo(int)), MusEGlobal::song, SLOT(seekTo(int))); connect(tempoButton, SIGNAL(clicked()), SLOT(tempoButtonClicked())); connect(timeSigButton, SIGNAL(clicked()), SLOT(timeSigButtonClicked())); diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp index 88dcc8a7..9f692465 100644 --- a/muse2/muse/master/master.cpp +++ b/muse2/muse/master/master.cpp @@ -60,7 +60,7 @@ Master::Master(MidiEditor* e, QWidget* parent, int xmag, int ymag) setFocusPolicy(Qt::StrongFocus); setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(songChanged(int))); } //--------------------------------------------------------- diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 53ebf953..68ba5168 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -246,7 +246,7 @@ MasterEdit::MasterEdit() connect(tscale, SIGNAL(tempoChanged(int)), SLOT(setTempo(int))); connect(canvas, SIGNAL(tempoChanged(int)), SLOT(setTempo(int))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::song, SIGNAL(posChanged(int,unsigned,bool)), SLOT(posChanged(int,unsigned,bool))); connect(canvas, SIGNAL(followEvent(int)), hscroll, SLOT(setOffset(int))); diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index 42eda0fd..e06fd40a 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -1670,7 +1670,7 @@ void DrumCanvas::rebuildOurDrumMap() emit ourDrumMapChanged(false); if (need_update) - MusEGlobal::song->update(SC_DRUMMAP, true); // i know, this causes a recursion, which possibly + MusEGlobal::song->update(SC_DRUMMAP, 0, true); // i know, this causes a recursion, which possibly // isn't the most elegant solution here. but it will // never be an infinite recursion } diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index ae8ece29..196e7ffc 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -562,8 +562,8 @@ DrumEdit::DrumEdit(MusECore::PartList* pl, QWidget* parent, const char* name, un connect(canvas, SIGNAL(verticalScroll(unsigned)), vscroll, SLOT(setPos(unsigned))); connect(canvas, SIGNAL(horizontalScroll(unsigned)),hscroll, SLOT(setPos(unsigned))); connect(canvas, SIGNAL(horizontalScrollNoLimit(unsigned)),hscroll, SLOT(setPosNoLimit(unsigned))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), dlist, SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged1(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), dlist, SLOT(songChanged(int))); connect(vscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setYPos(int))); connect(vscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setYMag(int))); connect(vscroll, SIGNAL(scaleChanged(int)), dlist, SLOT(setYMag(int))); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index d53867bd..7fce2e30 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -442,7 +442,7 @@ PianoRoll::PianoRoll(MusECore::PartList* pl, QWidget* parent, const char* name, vscroll->setPos(KH * 30); info->setEnabled(false); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged1(int))); setWindowTitle(canvas->getCaption()); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 9630fc7c..8a252d74 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -212,7 +212,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) connect(score_canvas, SIGNAL(canvas_height_changed(int)), SLOT(canvas_height_changed(int))); connect(score_canvas, SIGNAL(viewport_height_changed(int)), SLOT(viewport_height_changed(int))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), score_canvas, SLOT(song_changed(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), score_canvas, SLOT(song_changed(int))); connect(xscroll, SIGNAL(valueChanged(int)), time_bar, SLOT(set_xpos(int))); connect(score_canvas, SIGNAL(pos_add_changed()), time_bar, SLOT(pos_add_changed())); @@ -518,7 +518,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) clipboard_changed(); selection_changed(); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(song_changed(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(song_changed(int))); connect(MusEGlobal::song, SIGNAL(newPartsCreated(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&)), score_canvas, SLOT(add_new_parts(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&))); score_canvas->fully_recalculate(); diff --git a/muse2/muse/miditransform.cpp b/muse2/muse/miditransform.cpp index 9f068882..4692e5d9 100644 --- a/muse2/muse/miditransform.cpp +++ b/muse2/muse/miditransform.cpp @@ -421,7 +421,7 @@ MidiTransformerDialog::MidiTransformerDialog(QDialog* parent, Qt::WFlags fl) //--------------------------------------------------- updatePresetList(); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); } //--------------------------------------------------------- diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 1f8aa27f..1dd09c4f 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -238,7 +238,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEGlobal::MixerConfig* c) connect(view, SIGNAL(layoutRequest()), SLOT(setSizing())); ///connect(this, SIGNAL(layoutRequest()), SLOT(setSizing())); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); //MusEGlobal::song->update(); // calls update mixer diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp index 744d15b0..8b5bc716 100644 --- a/muse2/muse/mixer/rack.cpp +++ b/muse2/muse/mixer/rack.cpp @@ -174,7 +174,7 @@ EffectRack::EffectRack(QWidget* parent, MusECore::AudioTrack* t) connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(doubleClicked(QListWidgetItem*))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); EffectRackDelegate* er_delegate = new EffectRackDelegate(this, track); setItemDelegate(er_delegate); diff --git a/muse2/muse/mixer/routedialog.cpp b/muse2/muse/mixer/routedialog.cpp index a0b00278..2d73a6c0 100644 --- a/muse2/muse/mixer/routedialog.cpp +++ b/muse2/muse/mixer/routedialog.cpp @@ -47,7 +47,7 @@ RouteDialog::RouteDialog(QWidget* parent) connect(newDstList, SIGNAL(itemSelectionChanged()), SLOT(dstSelectionChanged())); connect(removeButton, SIGNAL(clicked()), SLOT(removeRoute())); connect(connectButton, SIGNAL(clicked()), SLOT(addRoute())); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); routingChanged(); } diff --git a/muse2/muse/mplugins/midiitransform.cpp b/muse2/muse/mplugins/midiitransform.cpp index 978e381e..232c6f99 100644 --- a/muse2/muse/mplugins/midiitransform.cpp +++ b/muse2/muse/mplugins/midiitransform.cpp @@ -918,7 +918,7 @@ MidiInputTransformDialog::MidiInputTransformDialog(QDialog* parent, Qt::WFlags f updatePresetList(); presetList->setCurrentItem(presetList->item(0)); presetChanged(presetList->item(0)); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); } //--------------------------------------------------------- diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 020d620c..b738c795 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -1370,17 +1370,22 @@ void Song::rewindStart() // update //--------------------------------------------------------- -void Song::update(int flags, bool allowRecursion) +void Song::update(int flags, int flags2, bool allowRecursion) { + // HACK: If flags is -1, it is very highly likely the caller wanted flags2 = -1 as well. + // Highly improbable someone only wanted all 32 flags set and not flags2. + if(flags == -1) + flags2 = -1; + static int level = 0; // DEBUG if (level && !allowRecursion) { - printf("THIS SHOULD NEVER HAPPEN: unallowed recursion in Song::update(%08x), level %d!\n" + printf("THIS SHOULD NEVER HAPPEN: unallowed recursion in Song::update(%08x %08x), level %d!\n" " the songChanged() signal is NOT emitted. this will\n" - " probably cause windows being not up-to-date.\n", flags, level); + " probably cause windows being not up-to-date.\n", flags, flags2, level); return; } ++level; - emit songChanged(flags); + emit songChanged(flags, flags2); --level; } @@ -1774,11 +1779,11 @@ void Song::rescanAlsaPorts() void Song::endMsgCmd() { - if (updateFlags) { + if (updateFlags || updateFlags2) { redoList->clearDelete(); MusEGlobal::undoAction->setEnabled(true); MusEGlobal::redoAction->setEnabled(false); - emit songChanged(updateFlags); + emit songChanged(updateFlags, updateFlags2); } } @@ -1789,6 +1794,7 @@ void Song::endMsgCmd() void Song::undo() { updateFlags = 0; + updateFlags2 = 0; if (doUndo1()) return; MusEGlobal::audio->msgUndo(); @@ -1799,7 +1805,7 @@ void Song::undo() if(updateFlags && (SC_TRACK_REMOVED | SC_TRACK_INSERTED)) MusEGlobal::audio->msgUpdateSoloStates(); - emit songChanged(updateFlags); + emit songChanged(updateFlags, updateFlags2); } //--------------------------------------------------------- @@ -1809,6 +1815,7 @@ void Song::undo() void Song::redo() { updateFlags = 0; + updateFlags2 = 0; if (doRedo1()) return; MusEGlobal::audio->msgRedo(); @@ -1819,7 +1826,7 @@ void Song::redo() if(updateFlags && (SC_TRACK_REMOVED | SC_TRACK_INSERTED)) MusEGlobal::audio->msgUpdateSoloStates(); - emit songChanged(updateFlags); + emit songChanged(updateFlags, updateFlags2); } //--------------------------------------------------------- @@ -1851,15 +1858,20 @@ void Song::processMsg(AudioMsg* msg) } } updateFlags = SC_TRACK_MODIFIED; + updateFlags2 = 0; break; case SEQM_ADD_EVENT: updateFlags = SC_EVENT_INSERTED; + updateFlags2 = 0; if (addEvent(msg->ev1, (MidiPart*)msg->p2)) { Event ev; addUndo(UndoOp(UndoOp::AddEvent, ev, msg->ev1, (Part*)msg->p2, msg->a, msg->b)); } else + { updateFlags = 0; + updateFlags2 = 0; + } if(msg->a) addPortCtrlEvents(msg->ev1, (Part*)msg->p2, msg->b); break; @@ -1873,6 +1885,7 @@ void Song::processMsg(AudioMsg* msg) addUndo(UndoOp(UndoOp::DeleteEvent, e, event, (Part*)part, msg->a, msg->b)); deleteEvent(event, part); updateFlags = SC_EVENT_REMOVED; + updateFlags2 = 0; } break; case SEQM_CHANGE_EVENT: @@ -1883,6 +1896,7 @@ void Song::processMsg(AudioMsg* msg) addPortCtrlEvents(msg->ev2, (Part*)msg->p3, msg->b); addUndo(UndoOp(UndoOp::ModifyEvent, msg->ev2, msg->ev1, (Part*)msg->p3, msg->a, msg->b)); updateFlags = SC_EVENT_MODIFIED; + updateFlags2 = 0; break; // Moved here from MidiSeq::processMsg p4.0.34 @@ -1909,12 +1923,14 @@ void Song::processMsg(AudioMsg* msg) addUndo(UndoOp(UndoOp::AddTempo, msg->a, msg->b)); MusEGlobal::tempomap.addTempo(msg->a, msg->b); updateFlags = SC_TEMPO; + updateFlags2 = 0; break; case SEQM_SET_TEMPO: addUndo(UndoOp(UndoOp::AddTempo, msg->a, msg->b)); MusEGlobal::tempomap.setTempo(msg->a, msg->b); updateFlags = SC_TEMPO; + updateFlags2 = 0; break; case SEQM_SET_GLOBAL_TEMPO: @@ -1925,30 +1941,35 @@ void Song::processMsg(AudioMsg* msg) addUndo(UndoOp(UndoOp::DeleteTempo, msg->a, msg->b)); MusEGlobal::tempomap.delTempo(msg->a); updateFlags = SC_TEMPO; + updateFlags2 = 0; break; case SEQM_ADD_SIG: addUndo(UndoOp(UndoOp::AddSig, msg->a, msg->b, msg->c)); AL::sigmap.add(msg->a, AL::TimeSignature(msg->b, msg->c)); updateFlags = SC_SIG; + updateFlags2 = 0; break; case SEQM_REMOVE_SIG: addUndo(UndoOp(UndoOp::DeleteSig, msg->a, msg->b, msg->c)); AL::sigmap.del(msg->a); updateFlags = SC_SIG; + updateFlags2 = 0; break; case SEQM_ADD_KEY: addUndo(UndoOp(UndoOp::AddKey, msg->a, msg->b)); MusEGlobal::keymap.addKey(msg->a, (key_enum) msg->b); updateFlags = SC_KEY; + updateFlags2 = 0; break; case SEQM_REMOVE_KEY: addUndo(UndoOp(UndoOp::DeleteKey, msg->a, msg->b)); MusEGlobal::keymap.delKey(msg->a); updateFlags = SC_KEY; + updateFlags2 = 0; break; default: @@ -1966,6 +1987,7 @@ void Song::cmdAddPart(Part* part) addPart(part); addUndo(UndoOp(UndoOp::AddPart, part)); updateFlags = SC_PART_INSERTED; + updateFlags2 = 0; } //--------------------------------------------------------- @@ -1979,6 +2001,7 @@ void Song::cmdRemovePart(Part* part) part->events()->incARef(-1); unchainClone(part); updateFlags = SC_PART_REMOVED; + updateFlags2 = 0; } //--------------------------------------------------------- @@ -2005,6 +2028,7 @@ void Song::cmdChangePart(Part* oldPart, Part* newPart, bool doCtrls, bool doClon addPortCtrlEvents(newPart, doClones); updateFlags = SC_PART_MODIFIED; + updateFlags2 = 0; } //--------------------------------------------------------- @@ -2139,7 +2163,7 @@ void Song::clear(bool signal, bool clear_all) if (signal) { emit loopChanged(false); recordChanged(false); - emit songChanged(-1); + emit songChanged(-1, -1); } } diff --git a/muse2/muse/song.h b/muse2/muse/song.h index 6570ad8d..44d5efa6 100644 --- a/muse2/muse/song.h +++ b/muse2/muse/song.h @@ -129,6 +129,7 @@ class Song : public QObject { TempoFifo _tempoFifo; // External tempo changes, processed in heartbeat. int updateFlags; + int updateFlags2; // Extra room for more flags TrackList _tracks; // tracklist as seen by arranger MidiTrackList _midis; @@ -345,7 +346,7 @@ class Song : public QObject { //----------------------------------------- void startUndo(); - void endUndo(int); + void endUndo(int /*flags*/, int /*flags2*/ = 0); void undoOp(UndoOp::UndoType type, const char* changedFile, const char* changeData, int startframe, int endframe); @@ -371,7 +372,7 @@ class Song : public QObject { //----------------------------------------- void dumpMaster(); - void addUpdateFlags(int f) { updateFlags |= f; } + void addUpdateFlags(int f, int f2 = 0) { updateFlags |= f; updateFlags2 |= f2; } //----------------------------------------- // Python bridge related @@ -383,9 +384,9 @@ class Song : public QObject { public slots: void seekTo(int tick); - void update(int flags = -1, bool allowRecursion=false); // use allowRecursion with care! this - // could lock up muse if you aren't sure - // that your recursion will be finite! + // use allowRecursion with care! this could lock up muse if you + // aren't sure that your recursion will be finite! + void update(int flags = -1, int flags2 = 0, bool allowRecursion=false); void beat(); void undo(); @@ -419,7 +420,7 @@ class Song : public QObject { void populateScriptMenu(QMenu* menuPlugins, QObject* receiver); signals: - void songChanged(int); + void songChanged(int /*flags*/, int /*flags2*/ = 0); void posChanged(int, unsigned, bool); void loopChanged(bool); void recordChanged(bool); diff --git a/muse2/muse/trackdrummapupdater.cpp b/muse2/muse/trackdrummapupdater.cpp index 35d5c056..5fce2587 100644 --- a/muse2/muse/trackdrummapupdater.cpp +++ b/muse2/muse/trackdrummapupdater.cpp @@ -31,7 +31,7 @@ using MusEGlobal::song; TrackDrummapUpdater::TrackDrummapUpdater() { - connect(song,SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + connect(song,SIGNAL(songChanged(int, int)), this, SLOT(songChanged(int))); } void TrackDrummapUpdater::songChanged(int flags) @@ -52,7 +52,7 @@ void TrackDrummapUpdater::songChanged(int flags) { // allow recursion. there will be no more recursion, because this // is only executed when something other than SC_DRUMMAP happens - song->update(SC_DRUMMAP, true); + song->update(SC_DRUMMAP, 0, true); } } diff --git a/muse2/muse/transport.cpp b/muse2/muse/transport.cpp index 5ed83800..f88bed1b 100644 --- a/muse2/muse/transport.cpp +++ b/muse2/muse/transport.cpp @@ -501,7 +501,7 @@ Transport::Transport(QWidget* parent, const char* name) connect(tempo, SIGNAL(tempoChanged(int)), MusEGlobal::song, SLOT(setTempo(int))); connect(tempo, SIGNAL(sigChanged(const AL::TimeSignature&)), SLOT(sigChange(const AL::TimeSignature&))); connect(MusEGlobal::song, SIGNAL(playChanged(bool)), SLOT(setPlay(bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp index b81de33d..38582d58 100644 --- a/muse2/muse/undo.cpp +++ b/muse2/muse/undo.cpp @@ -217,6 +217,7 @@ void Song::startUndo() undoList->push_back(Undo()); updateFlags = 0; + updateFlags2 = 0; undoMode = true; } @@ -224,9 +225,10 @@ void Song::startUndo() // endUndo //--------------------------------------------------------- -void Song::endUndo(int flags) +void Song::endUndo(int flags, int flags2) { updateFlags |= flags; + updateFlags2 |= flags2; endMsgCmd(); undoMode = false; } @@ -396,7 +398,8 @@ void Song::doUndo2() break; case UndoOp::ModifySongLen: _len=i->b; - updateFlags = -1; // set all flags + updateFlags = -1; // set all flags // TODO Refine this! Too many flags. // REMOVE Tim. + updateFlags2 = -1; // set all flags break; case UndoOp::ModifyClip: case UndoOp::ModifyMarker: @@ -506,7 +509,8 @@ void Song::doRedo2() break; case UndoOp::ModifySongLen: _len=i->a; - updateFlags = -1; // set all flags + updateFlags = -1; // set all flags // TODO Refine this! Too many flags. // REMOVE Tim. + updateFlags2 = -1; // set all flags break; case UndoOp::ModifyClip: case UndoOp::ModifyMarker: diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 1504958a..67c46ad2 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -267,7 +267,7 @@ WaveEdit::WaveEdit(MusECore::PartList* pl) connect(view, SIGNAL(horizontalScroll(unsigned)),hscroll, SLOT(setPos(unsigned))); connect(hscroll, SIGNAL(scaleChanged(int)), SLOT(updateHScrollRange())); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged1(int))); initShortcuts(); diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp index 5b143e22..1af1d83a 100644 --- a/muse2/muse/waveedit/waveview.cpp +++ b/muse2/muse/waveedit/waveview.cpp @@ -79,7 +79,7 @@ WaveView::WaveView(MidiEditor* pr, QWidget* parent, int xscale, int yscale) connect(MusEGlobal::song, SIGNAL(posChanged(int,unsigned,bool)), SLOT(setPos(int,unsigned,bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); songChanged(SC_SELECTION); } diff --git a/muse2/muse/widgets/comment.cpp b/muse2/muse/widgets/comment.cpp index f070cac0..ea08c5b3 100644 --- a/muse2/muse/widgets/comment.cpp +++ b/muse2/muse/widgets/comment.cpp @@ -57,7 +57,7 @@ TrackComment::TrackComment(MusECore::Track* t, QWidget* parent) setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("MusE: Track Comment")); track = t; - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); textentry->setText(track->comment()); textentry->moveCursor(QTextCursor::End); connect(textentry, SIGNAL(textChanged()), SLOT(textChanged())); diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp index e286ca74..44d3ca04 100644 --- a/muse2/muse/widgets/midisyncimpl.cpp +++ b/muse2/muse/widgets/midisyncimpl.cpp @@ -262,7 +262,7 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent) connect(syncDelaySpinBox, SIGNAL(valueChanged(int)), SLOT(syncChanged())); // Done in show(). - //connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + //connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); //connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); } @@ -578,7 +578,7 @@ void MidiSyncConfig::cancel() void MidiSyncConfig::show() { songChanged(-1); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); QDialog::show(); } @@ -607,7 +607,7 @@ void MidiSyncConfig::closeEvent(QCloseEvent* e) } disconnect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat())); - disconnect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + disconnect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(songChanged(int))); e->accept(); } diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index 427ac41d..fc28f5d2 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -265,7 +265,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, MusECore::Track* sel_track) : QWid //oRButton->setVisible(false); connect(oRButton, SIGNAL(pressed()), SLOT(outRoutesPressed())); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); diff --git a/muse2/muse/widgets/mtscale.cpp b/muse2/muse/widgets/mtscale.cpp index 76822bdd..f0e5ba8d 100644 --- a/muse2/muse/widgets/mtscale.cpp +++ b/muse2/muse/widgets/mtscale.cpp @@ -58,7 +58,7 @@ MTScale::MTScale(int* r, QWidget* parent, int xs, bool _mode) button = Qt::NoButton; setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); setFixedHeight(28); diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index d0d10e8c..787d9030 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -51,7 +51,7 @@ MTScaleFlo::MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget) button = Qt::NoButton; setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); parent=parent_editor; diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp index 72bcb05d..84b98d79 100644 --- a/muse2/muse/widgets/routepopup.cpp +++ b/muse2/muse/widgets/routepopup.cpp @@ -737,7 +737,7 @@ RoutePopupMenu::RoutePopupMenu(const QString& title, QWidget* parent, MusECore:: void RoutePopupMenu::init() { //printf("RoutePopupMenu::init this:%p\n", this); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); } void RoutePopupMenu::songChanged(int val) diff --git a/muse2/muse/widgets/sig_tempo_toolbar.cpp b/muse2/muse/widgets/sig_tempo_toolbar.cpp index 4ccf2092..22296df2 100644 --- a/muse2/muse/widgets/sig_tempo_toolbar.cpp +++ b/muse2/muse/widgets/sig_tempo_toolbar.cpp @@ -46,7 +46,7 @@ namespace MusEGui layout->addWidget(label); layout->addWidget(tempo_edit); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(song_changed(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(song_changed(int))); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(pos_changed(int,unsigned,bool))); connect(tempo_edit, SIGNAL(tempoChanged(double)), MusEGlobal::song, SLOT(setTempo(double))); @@ -92,7 +92,7 @@ namespace MusEGui layout->addWidget(label); layout->addWidget(sig_edit); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(song_changed(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(song_changed(int))); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(pos_changed(int,unsigned,bool))); connect(sig_edit, SIGNAL(valueChanged(const AL::TimeSignature&)), MusEGlobal::song, SLOT(setSig(const AL::TimeSignature&))); diff --git a/muse2/muse/widgets/songpos_toolbar.cpp b/muse2/muse/widgets/songpos_toolbar.cpp index 1ffd0242..ef87f378 100644 --- a/muse2/muse/widgets/songpos_toolbar.cpp +++ b/muse2/muse/widgets/songpos_toolbar.cpp @@ -33,7 +33,7 @@ namespace MusEGui { _raster=0; setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(song_changed(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), this, SLOT(song_changed(int))); song_changed(0); } diff --git a/muse2/muse/widgets/wtscale.cpp b/muse2/muse/widgets/wtscale.cpp index 82ab0ca4..b41e7b83 100644 --- a/muse2/muse/widgets/wtscale.cpp +++ b/muse2/muse/widgets/wtscale.cpp @@ -54,7 +54,7 @@ WTScale::WTScale(int* r, QWidget* parent, int xs) button = Qt::NoButton; setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int, int)), SLOT(songChanged(int))); connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); setFixedHeight(28); setBg(QColor(0xe0, 0xe0, 0xe0)); @@ -254,7 +254,7 @@ void WTScale::pdraw(QPainter& p, const QRect& r) int b = MusEGlobal::song->tick2samples(stick); int tpix = rmapx(a - b); if (tpix < 64) { - // don´t show beats if measure is this small + // don�t show beats if measure is this small int n = 1; if (tpix < 32) n = 2; |