diff options
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/ChangeLog | 13 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.cpp | 9 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.h | 2 | ||||
-rw-r--r-- | muse2/muse/arranger/arrangerview.cpp | 31 | ||||
-rw-r--r-- | muse2/muse/arranger/arrangerview.h | 4 | ||||
-rw-r--r-- | muse2/muse/arranger/pcanvas.cpp | 8 | ||||
-rw-r--r-- | muse2/muse/arranger/pcanvas.h | 2 | ||||
-rw-r--r-- | muse2/muse/audiotrack.cpp | 1 | ||||
-rw-r--r-- | muse2/muse/dialogs.cpp | 42 | ||||
-rw-r--r-- | muse2/muse/dialogs.h | 3 | ||||
-rw-r--r-- | muse2/muse/main.cpp | 3 | ||||
-rw-r--r-- | muse2/muse/midiedit/dcanvas.cpp | 22 | ||||
-rw-r--r-- | muse2/muse/midiedit/drumedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/pianoroll.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/part.cpp | 7 | ||||
-rw-r--r-- | muse2/muse/shortcuts.cpp | 8 | ||||
-rw-r--r-- | muse2/muse/shortcuts.h | 8 | ||||
-rw-r--r-- | muse2/muse/track.cpp | 42 | ||||
-rw-r--r-- | muse2/muse/track.h | 8 | ||||
-rw-r--r-- | muse2/muse/wavetrack.cpp | 63 | ||||
-rw-r--r-- | muse2/share/templates/MusE.cfg | 7 |
22 files changed, 214 insertions, 75 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 2b504abf..81329e66 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,16 @@ +15.01.2013: + - Reinstate old Arranger "Paste to track" (Ctl+Shift+V) and "Paste clone to track" (Ctl+Shift+B). (Tim...) + - Changed default shortcut of Arranger "Paste clone" to Ctl+B. + - Changed default shortcut of Arranger "Paste (show dialog)" to Ctl+G. + - Removed Arranger "Paste clone with dialog". Instead, paste dialog now remembers 'clone' checkbox setting. + - Fixed Pianoroll/Drum Ctl+V paste bug was pasting into other parts: Always paste into current part. + TODO: Score Editor still not working because there never seems to be a current part! Must ask Florian... + - Fixed Pr/Dr Function dialogs bring main window to front: Don't give them a parent, add destroy_function_dialogs(). + - Fixed "Duplicate Track" feature: If selected 'copy parts', it was quietly cloning. Re-wrote ASSIGN_PARTS sections. + Now it copies both clone and non-clone parts. Tests OK but needs a good workout. (Maybe push Parts to Undo list?) + TODO: Found C.O.W. bug when de-cloning a part on a duplicated Wave Track - it's still a clone. Investigating... + - Fixed Old-style Drum Editor: Was not playing new notes as they were drawn. Re-wrote a DrumCanvas::newItem(), + and eliminated dynamic_casts. 13.01.2013: - remote should depend on widgets through #including app.h otherwise Python bindings don't compile (Orcan) 03.01.2013: diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index 942a5013..18886bd1 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -870,12 +870,15 @@ void Arranger::cmd(int cmd) case CMD_PASTE_CLONE_PART: ncmd = PartCanvas::CMD_PASTE_CLONE_PART; break; + case CMD_PASTE_PART_TO_TRACK: + ncmd = PartCanvas::CMD_PASTE_PART_TO_TRACK; + break; + case CMD_PASTE_CLONE_PART_TO_TRACK: + ncmd = PartCanvas::CMD_PASTE_CLONE_PART_TO_TRACK; + break; case CMD_PASTE_DIALOG: ncmd = PartCanvas::CMD_PASTE_DIALOG; break; - case CMD_PASTE_CLONE_DIALOG: - ncmd = PartCanvas::CMD_PASTE_CLONE_DIALOG; - break; case CMD_INSERT_EMPTYMEAS: ncmd = PartCanvas::CMD_INSERT_EMPTYMEAS; break; diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h index e7d48d70..80f1b24c 100644 --- a/muse2/muse/arranger/arranger.h +++ b/muse2/muse/arranger/arranger.h @@ -191,7 +191,7 @@ class Arranger : public QWidget { public: enum { CMD_CUT_PART, CMD_COPY_PART, CMD_COPY_PART_IN_RANGE, CMD_PASTE_PART, CMD_PASTE_CLONE_PART, - CMD_PASTE_DIALOG, CMD_PASTE_CLONE_DIALOG, CMD_INSERT_EMPTYMEAS }; + CMD_PASTE_PART_TO_TRACK, CMD_PASTE_CLONE_PART_TO_TRACK, CMD_PASTE_DIALOG, CMD_INSERT_EMPTYMEAS }; struct custom_col_t { diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index e91d05f6..7974369a 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -125,9 +125,10 @@ ArrangerView::ArrangerView(QWidget* parent) editCopyAction = new QAction(QIcon(*editcopyIconSet), tr("&Copy"), this); editCopyRangeAction = new QAction(QIcon(*editcopyIconSet), tr("Copy in range"), this); editPasteAction = new QAction(QIcon(*editpasteIconSet), tr("&Paste"), this); - editPasteDialogAction = new QAction(QIcon(*editpasteIconSet), tr("Paste (show dialog)"), this); editPasteCloneAction = new QAction(QIcon(*editpasteCloneIconSet), tr("Paste c&lone"), this); - editPasteCloneDialogAction = new QAction(QIcon(*editpasteCloneIconSet), tr("Paste clone (show dialog)"), this); + editPasteToTrackAction = new QAction(QIcon(*editpaste2TrackIconSet), tr("Paste to selected &track"), this); + editPasteCloneToTrackAction = new QAction(QIcon(*editpasteClone2TrackIconSet), tr("Paste clone to selected trac&k"), this); + editPasteDialogAction = new QAction(QIcon(*editpasteIconSet), tr("Paste (show dialo&g)"), this); editInsertEMAction = new QAction(QIcon(*editpasteIconSet), tr("&Insert Empty Measure"), this); editDeleteSelectedAction = new QAction(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), this); editDuplicateSelTrackAction = new QAction(QIcon(*edit_track_addIcon), tr("Duplicate Selected Tracks"), this); @@ -197,9 +198,10 @@ ArrangerView::ArrangerView(QWidget* parent) menuEdit->addAction(editCopyAction); menuEdit->addAction(editCopyRangeAction); menuEdit->addAction(editPasteAction); - menuEdit->addAction(editPasteDialogAction); + menuEdit->addAction(editPasteToTrackAction); menuEdit->addAction(editPasteCloneAction); - menuEdit->addAction(editPasteCloneDialogAction); + menuEdit->addAction(editPasteCloneToTrackAction); + menuEdit->addAction(editPasteDialogAction); menuEdit->addAction(editInsertEMAction); menuEdit->addSeparator(); menuEdit->addAction(editShrinkPartsAction); @@ -282,8 +284,9 @@ ArrangerView::ArrangerView(QWidget* parent) connect(editCopyRangeAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editPasteAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editPasteCloneAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); + connect(editPasteToTrackAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); + connect(editPasteCloneToTrackAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editPasteDialogAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); - connect(editPasteCloneDialogAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editInsertEMAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editDeleteSelectedAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); connect(editDuplicateSelTrackAction, SIGNAL(triggered()), editSignalMapper, SLOT(map())); @@ -304,8 +307,9 @@ ArrangerView::ArrangerView(QWidget* parent) editSignalMapper->setMapping(editCopyRangeAction, CMD_COPY_RANGE); editSignalMapper->setMapping(editPasteAction, CMD_PASTE); editSignalMapper->setMapping(editPasteCloneAction, CMD_PASTE_CLONE); + editSignalMapper->setMapping(editPasteToTrackAction, CMD_PASTE_TO_TRACK); + editSignalMapper->setMapping(editPasteCloneToTrackAction, CMD_PASTE_CLONE_TO_TRACK); editSignalMapper->setMapping(editPasteDialogAction, CMD_PASTE_DIALOG); - editSignalMapper->setMapping(editPasteCloneDialogAction, CMD_PASTE_CLONE_DIALOG); editSignalMapper->setMapping(editInsertEMAction, CMD_INSERTMEAS); editSignalMapper->setMapping(editDeleteSelectedAction, CMD_DELETE_TRACK); editSignalMapper->setMapping(editDuplicateSelTrackAction, CMD_DUPLICATE_TRACK); @@ -502,12 +506,15 @@ void ArrangerView::cmd(int cmd) case CMD_PASTE_CLONE: arranger->cmd(Arranger::CMD_PASTE_CLONE_PART); break; + case CMD_PASTE_TO_TRACK: + arranger->cmd(Arranger::CMD_PASTE_PART_TO_TRACK); + break; + case CMD_PASTE_CLONE_TO_TRACK: + arranger->cmd(Arranger::CMD_PASTE_CLONE_PART_TO_TRACK); + break; case CMD_PASTE_DIALOG: arranger->cmd(Arranger::CMD_PASTE_DIALOG); break; - case CMD_PASTE_CLONE_DIALOG: - arranger->cmd(Arranger::CMD_PASTE_CLONE_DIALOG); - break; case CMD_INSERTMEAS: arranger->cmd(Arranger::CMD_INSERT_EMPTYMEAS); break; @@ -690,8 +697,9 @@ void ArrangerView::updateShortcuts() editCopyRangeAction->setShortcut(shortcuts[SHRT_COPY_RANGE].key); editPasteAction->setShortcut(shortcuts[SHRT_PASTE].key); editPasteCloneAction->setShortcut(shortcuts[SHRT_PASTE_CLONE].key); + editPasteToTrackAction->setShortcut(shortcuts[SHRT_PASTE_TO_TRACK].key); + editPasteCloneToTrackAction->setShortcut(shortcuts[SHRT_PASTE_CLONE_TO_TRACK].key); editPasteDialogAction->setShortcut(shortcuts[SHRT_PASTE_DIALOG].key); - editPasteCloneDialogAction->setShortcut(shortcuts[SHRT_PASTE_CLONE_DIALOG].key); editInsertEMAction->setShortcut(shortcuts[SHRT_INSERTMEAS].key); //editDeleteSelectedAction has no acceleration @@ -740,8 +748,9 @@ void ArrangerView::clipboardChanged() editPasteAction->setEnabled(flag); editPasteCloneAction->setEnabled(flag); + editPasteToTrackAction->setEnabled(flag); + editPasteCloneToTrackAction->setEnabled(flag); editPasteDialogAction->setEnabled(flag); - editPasteCloneDialogAction->setEnabled(flag); } //--------------------------------------------------------- diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index 6a8f47c9..34695ace 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -68,7 +68,7 @@ class ArrangerView : public TopWin enum cmd_enum {CMD_CUT, CMD_COPY, CMD_COPY_RANGE, CMD_PASTE, CMD_INSERTMEAS, CMD_PASTE_CLONE, - CMD_PASTE_DIALOG, CMD_PASTE_CLONE_DIALOG, CMD_DELETE, + CMD_PASTE_TO_TRACK, CMD_PASTE_CLONE_TO_TRACK, CMD_PASTE_DIALOG, CMD_DELETE, CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT, CMD_SELECT_ILOOP, CMD_SELECT_OLOOP, CMD_SELECT_PARTS, CMD_DELETE_TRACK, CMD_DUPLICATE_TRACK, CMD_EXPAND_PART, CMD_SHRINK_PART, CMD_CLEAN_PART, @@ -95,7 +95,7 @@ class ArrangerView : public TopWin QAction *trackMidiAction, *trackDrumAction, *trackNewStyleDrumAction, *trackWaveAction, *trackAOutputAction, *trackAGroupAction; QAction *trackAInputAction, *trackAAuxAction; QAction *editCutAction, *editCopyAction, *editCopyRangeAction; - QAction *editPasteAction, *editPasteCloneAction, *editPasteDialogAction, *editPasteCloneDialogAction; + QAction *editPasteAction, *editPasteCloneAction, *editPasteToTrackAction, *editPasteCloneToTrackAction, *editPasteDialogAction; QAction *editInsertEMAction, *editPasteC2TAction, *editDeleteSelectedAction, *editSelectAllAction, *editDeselectAllAction; QAction *editDuplicateSelTrackAction; QAction *editInvertSelectionAction, *editInsideLoopAction, *editOutsideLoopAction, *editAllPartsAction; diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index b842a532..6a97bc99 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -2685,13 +2685,17 @@ void PartCanvas::cmd(int cmd) case CMD_PASTE_CLONE_PART: paste(true); break; + case CMD_PASTE_PART_TO_TRACK: + paste(false, PASTEMODE_MIX, true); + break; + case CMD_PASTE_CLONE_PART_TO_TRACK: + paste(true, PASTEMODE_MIX, true); + break; case CMD_PASTE_DIALOG: - case CMD_PASTE_CLONE_DIALOG: { unsigned temp_begin = AL::sigmap.raster1(MusEGlobal::song->vcpos(),0); unsigned temp_end = AL::sigmap.raster2(temp_begin + MusECore::get_paste_len(), 0); paste_dialog->raster = temp_end - temp_begin; - paste_dialog->clone = (cmd == CMD_PASTE_CLONE_DIALOG); if (paste_dialog->exec()) { diff --git a/muse2/muse/arranger/pcanvas.h b/muse2/muse/arranger/pcanvas.h index c9e4c946..00ae2373 100644 --- a/muse2/muse/arranger/pcanvas.h +++ b/muse2/muse/arranger/pcanvas.h @@ -175,7 +175,7 @@ class PartCanvas : public Canvas { public: enum { CMD_CUT_PART, CMD_COPY_PART, CMD_COPY_PART_IN_RANGE, CMD_PASTE_PART, CMD_PASTE_CLONE_PART, - CMD_PASTE_DIALOG, CMD_PASTE_CLONE_DIALOG, CMD_INSERT_EMPTYMEAS }; + CMD_PASTE_PART_TO_TRACK, CMD_PASTE_CLONE_PART_TO_TRACK, CMD_PASTE_DIALOG, CMD_INSERT_EMPTYMEAS }; PartCanvas(int* raster, QWidget* parent, int, int); virtual ~PartCanvas(); diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp index 0b1e94b2..44f72750 100644 --- a/muse2/muse/audiotrack.cpp +++ b/muse2/muse/audiotrack.cpp @@ -266,7 +266,6 @@ void AudioTrack::internal_assign(const Track& t, int flags) } } } - } void AudioTrack::assign(const Track& t, int flags) diff --git a/muse2/muse/dialogs.cpp b/muse2/muse/dialogs.cpp index ff93b877..a39f7c10 100644 --- a/muse2/muse/dialogs.cpp +++ b/muse2/muse/dialogs.cpp @@ -55,20 +55,36 @@ Legato* legato_dialog=NULL; PasteDialog* paste_dialog=NULL; PasteEventsDialog* paste_events_dialog=NULL; -void init_function_dialogs(QWidget* parent) +void init_function_dialogs() { - gatetime_dialog = new GateTime(parent); - velocity_dialog = new Velocity(parent); - quantize_dialog = new Quantize(parent); - erase_dialog = new Remove(parent); - del_overlaps_dialog = new DelOverlaps(parent); - set_notelen_dialog = new Setlen(parent); - move_notes_dialog = new Move(parent); - transpose_dialog = new Transpose(parent); - crescendo_dialog = new Crescendo(parent); - legato_dialog = new Legato(parent); - paste_dialog = new PasteDialog(parent); - paste_events_dialog = new PasteEventsDialog(parent); + gatetime_dialog = new GateTime(); + velocity_dialog = new Velocity(); + quantize_dialog = new Quantize(); + erase_dialog = new Remove(); + del_overlaps_dialog = new DelOverlaps(); + set_notelen_dialog = new Setlen(); + move_notes_dialog = new Move(); + transpose_dialog = new Transpose(); + crescendo_dialog = new Crescendo(); + legato_dialog = new Legato(); + paste_dialog = new PasteDialog(); + paste_events_dialog = new PasteEventsDialog(); +} + +void destroy_function_dialogs() +{ + delete gatetime_dialog; + delete velocity_dialog; + delete quantize_dialog; + delete erase_dialog; + delete del_overlaps_dialog; + delete set_notelen_dialog; + delete move_notes_dialog; + delete transpose_dialog; + delete crescendo_dialog; + delete legato_dialog; + delete paste_dialog; + delete paste_events_dialog; } void retranslate_function_dialogs() diff --git a/muse2/muse/dialogs.h b/muse2/muse/dialogs.h index f2d28f8c..d9d00748 100644 --- a/muse2/muse/dialogs.h +++ b/muse2/muse/dialogs.h @@ -58,7 +58,8 @@ extern Legato* legato_dialog; extern PasteDialog* paste_dialog; extern PasteEventsDialog* paste_events_dialog; -void init_function_dialogs(QWidget* parent); +void init_function_dialogs(); +void destroy_function_dialogs(); 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/main.cpp b/muse2/muse/main.cpp index 644fe65d..f1bf4f57 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -563,7 +563,7 @@ int main(int argc, char* argv[]) MusEGlobal::muse = new MusEGui::MusE(); app.setMuse(MusEGlobal::muse); - MusEGui::init_function_dialogs(MusEGlobal::muse); + MusEGui::init_function_dialogs(); MusEGui::retranslate_function_dialogs(); // SHOW MUSE SPLASH SCREEN @@ -733,6 +733,7 @@ int main(int argc, char* argv[]) if(MusEGlobal::debugMsg) printf("app.exec() returned:%d\nDeleting main MusE object\n", rv); delete MusEGlobal::muse; + MusEGui::destroy_function_dialogs(); if(MusEGlobal::debugMsg) printf("Finished! Exiting main, return value:%d\n", rv); return rv; diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index 3be0abbf..300f6927 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -58,6 +58,7 @@ using MusEGlobal::debugMsg; using MusEGlobal::heavyDebugMsg; +using MusECore::Track; using MusECore::MidiTrack; namespace MusEGui { @@ -415,11 +416,24 @@ CItem* DrumCanvas::newItem(int tick, int instrument, int velocity) e.setLenTick(ourDrumMap[instrument].len); if(_playEvents) { - int port = old_style_drummap_mode ? ourDrumMap[instrument].port : dynamic_cast<MidiTrack*>(*instrument_map[instrument].tracks.begin())->outPort(); - int channel = old_style_drummap_mode ? ourDrumMap[instrument].channel : dynamic_cast<MidiTrack*>(*instrument_map[instrument].tracks.begin())->outChannel(); - startPlayEvent(e.pitch(),e.velo(), port, channel); + int pitch = old_style_drummap_mode ? ourDrumMap[instrument].anote : instrument_map[instrument].pitch; + int port, channel; + if(old_style_drummap_mode) + { + port = ourDrumMap[instrument].port; + channel = ourDrumMap[instrument].channel; + } + else + { + Track* t = *instrument_map[instrument].tracks.begin(); + if(!t->isMidiTrack()) + return NULL; + MidiTrack* mt = static_cast<MidiTrack*>(t); + port = mt->outPort(); + channel = mt->outChannel(); + } + startPlayEvent(pitch, e.velo(), port, channel); } - return new DEvent(e, curPart, instrument); } diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index 08c5bec7..e52bc687 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -1180,7 +1180,7 @@ void DrumEdit::cmd(int cmd) case DrumCanvas::CMD_COPY_RANGE: copy_notes(partlist_to_set(parts()), MusECore::any_event_selected(partlist_to_set(parts())) ? 3 : 2); break; case DrumCanvas::CMD_PASTE: ((DrumCanvas*)canvas)->cmd(DrumCanvas::CMD_SELECT_NONE); - MusECore::paste_notes(3072); + MusECore::paste_notes(3072, false, true, canvas->part()); break; case DrumCanvas::CMD_PASTE_DIALOG: ((DrumCanvas*)canvas)->cmd(DrumCanvas::CMD_SELECT_NONE); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 14e1ce73..740a5773 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -601,7 +601,7 @@ void PianoRoll::cmd(int cmd) case PianoCanvas::CMD_COPY_RANGE: copy_notes(partlist_to_set(parts()), MusECore::any_event_selected(partlist_to_set(parts())) ? 3 : 2); break; case PianoCanvas::CMD_PASTE: ((PianoCanvas*)canvas)->cmd(PianoCanvas::CMD_SELECT_NONE); - MusECore::paste_notes(3072); + MusECore::paste_notes(3072, false, true, canvas->part()); break; case PianoCanvas::CMD_PASTE_DIALOG: ((PianoCanvas*)canvas)->cmd(PianoCanvas::CMD_SELECT_NONE); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index e274769d..3e4fd5c8 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -763,7 +763,7 @@ void ScoreEdit::menu_command(int cmd) case CMD_COPY_RANGE: copy_notes(score_canvas->get_all_parts(), MusECore::any_event_selected(score_canvas->get_all_parts()) ? 3 : 2); break; case CMD_PASTE: menu_command(CMD_SELECT_NONE); - MusECore::paste_notes(3072); + MusECore::paste_notes(3072, false, true, score_canvas->get_selected_part()); break; case CMD_PASTE_DIALOG: menu_command(CMD_SELECT_NONE); diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 65ca93b4..3f9fbd62 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -743,12 +743,7 @@ Part::~Part() if (_prevClone!=this || _nextClone!=this) { if (MusEGlobal::debugMsg) { - printf("THIS MIGHT BE A HINT FOR BUGS: Part isn't unchained in ~Part()! i'll do that now. this is\n" - "not an actual bug, actually that manual unchain should be unneccessary if this was coded\n" - "properly. but as it wasn't, and the unchain was always done manually, this might be an\n" - "indicator that it have been forgotten. either your computer will explode in 3..2..1..now,\n" - "or you can ignore this message.\n" - "\n"); + fprintf(stderr, "Part isn't unchained in ~Part()! Unchaining now...\n"); } unchainClone(this); } diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index f48eb8fe..60a264f5 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -69,7 +69,10 @@ void initShortCuts() defShrt(SHRT_REDO, Qt::CTRL + Qt::SHIFT + Qt::Key_Z, 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_PASTE_TO_TRACK, Qt::CTRL + Qt::SHIFT + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste to selected track"), ARRANG_SHRT, "paste_to_track"); + defShrt(SHRT_PASTE_CLONE, Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste clone"), ARRANG_SHRT, "paste_clones"); + defShrt(SHRT_PASTE_CLONE_TO_TRACK, Qt::CTRL + Qt::SHIFT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste clone to selected track"), ARRANG_SHRT, "paste_clones_to_track"); + defShrt(SHRT_PASTE_DIALOG, Qt::CTRL + Qt::Key_G, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste (with dialog)"), GLOBAL_SHRT, "paste_with_dialog"); defShrt(SHRT_DELETE, Qt::Key_Delete, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete"), INVIS_SHRT, "delete"); //----------------------------------------------------------- @@ -162,9 +165,6 @@ void initShortCuts() 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, 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, 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"); diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h index 3e01788b..2b84093d 100644 --- a/muse2/muse/shortcuts.h +++ b/muse2/muse/shortcuts.h @@ -102,7 +102,10 @@ enum { SHRT_COPY_RANGE, //Ctrl+Shift+C SHRT_CUT, //Ctrl+X SHRT_PASTE, //Ctrl+V - SHRT_PASTE_DIALOG, //Ctrl+Shift+V + SHRT_PASTE_CLONE, //CTRL+Shift+V + SHRT_PASTE_TO_TRACK, //CTRL+Key_B + SHRT_PASTE_CLONE_TO_TRACK, //CTRL+SHIFT+Key_B + SHRT_PASTE_DIALOG, //Ctrl+G SHRT_DELETE,//Delete @@ -194,9 +197,6 @@ enum { SHRT_INSERTMEAS, //Ctrl+Shift+M - insert measures - SHRT_PASTE_CLONE, //CTRL+B - SHRT_PASTE_CLONE_DIALOG, //CTRL+SHIFT+B - //Arranger tracks SHRT_SEL_TRACK_BELOW, SHRT_SEL_TRACK_ABOVE, diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp index b17515fe..bed2938d 100644 --- a/muse2/muse/track.cpp +++ b/muse2/muse/track.cpp @@ -297,16 +297,6 @@ void Track::internal_assign(const Track& t, int flags) } } } - - if(flags & ASSIGN_PARTS) - { - const PartList* pl = t.cparts(); - for (ciPart ip = pl->begin(); ip != pl->end(); ++ip) { - Part* newPart = ip->second->clone(); - newPart->setTrack(this); - _parts.add(newPart); - } - } } //--------------------------------------------------------- @@ -623,6 +613,38 @@ void MidiTrack::internal_assign(const Track& t, int flags) _drummap_ordering_tied_to_patch=mt._drummap_ordering_tied_to_patch; // TODO FINDMICH "assign" ordering as well } + + if(flags & ASSIGN_PARTS) + { + const PartList* pl = t.cparts(); + for (ciPart ip = pl->begin(); ip != pl->end(); ++ip) { + Part* spart = ip->second; + bool clone = spart->events()->arefCount() > 1; + // This increments aref count if cloned, and chains clones. + // It also gives the new part a new serial number. + Part* dpart = newPart(spart, clone); + if(!clone) { + // Copy Events + MusECore::EventList* se = spart->events(); + MusECore::EventList* de = dpart->events(); + for (MusECore::iEvent i = se->begin(); i != se->end(); ++i) { + MusECore::Event oldEvent = i->second; + MusECore::Event ev = oldEvent.clone(); + de->add(ev); + } + } + + // TODO: Should we include the parts in the undo? + // dpart->events()->incARef(-1); // the later MusEGlobal::song->applyOperationGroup() will increment it + // // so we must decrement it first :/ + // // These will not increment ref count, and will not chain clones... + // // DELETETHIS: is the above comment still correct (by flo93)? i doubt it! + // operations.push_back(MusECore::UndoOp(MusECore::UndoOp::AddPart,dpart)); + + parts()->add(dpart); + } + } + } void MidiTrack::assign(const Track& t, int flags) diff --git a/muse2/muse/track.h b/muse2/muse/track.h index a0996c1e..61326b4a 100644 --- a/muse2/muse/track.h +++ b/muse2/muse/track.h @@ -592,11 +592,15 @@ class WaveTrack : public AudioTrack { Fifo _prefetchFifo; // prefetch Fifo static bool _isVisible; + void internal_assign(const Track&, int flags); + public: - WaveTrack() : AudioTrack(Track::WAVE) { setChannels(1); } - WaveTrack(const WaveTrack& wt, int flags) : AudioTrack(wt, flags) {} + WaveTrack(); + WaveTrack(const WaveTrack& wt, int flags); + virtual void assign(const Track&, int flags); + virtual WaveTrack* clone(int flags) const { return new WaveTrack(*this, flags); } virtual WaveTrack* newTrack() const { return new WaveTrack(); } virtual Part* newPart(Part*p=0, bool clone=false); diff --git a/muse2/muse/wavetrack.cpp b/muse2/muse/wavetrack.cpp index b55a67d6..6f38a6d4 100644 --- a/muse2/muse/wavetrack.cpp +++ b/muse2/muse/wavetrack.cpp @@ -31,19 +31,76 @@ #include "gconfig.h" #include "al/dsp.h" -// Added by Tim. p3.3.18 //#define WAVETRACK_DEBUG namespace MusECore { //--------------------------------------------------------- +// WaveTrack +//--------------------------------------------------------- + +WaveTrack::WaveTrack() : AudioTrack(Track::WAVE) +{ + setChannels(1); +} + +WaveTrack::WaveTrack(const WaveTrack& wt, int flags) : AudioTrack(wt, flags) +{ + internal_assign(wt, flags | Track::ASSIGN_PROPERTIES); +} + +void WaveTrack::internal_assign(const Track& t, int flags) +{ + if(t.type() != WAVE) + return; + //const WaveTrack& wt = (const WaveTrack&)t; + + if(flags & ASSIGN_PARTS) + { + const PartList* pl = t.cparts(); + for (ciPart ip = pl->begin(); ip != pl->end(); ++ip) { + Part* spart = ip->second; + bool clone = spart->events()->arefCount() > 1; + // This increments aref count if cloned, and chains clones. + // It also gives the new part a new serial number. + Part* dpart = newPart(spart, clone); + if(!clone) { + // Copy Events + MusECore::EventList* se = spart->events(); + MusECore::EventList* de = dpart->events(); + for (MusECore::iEvent i = se->begin(); i != se->end(); ++i) { + MusECore::Event oldEvent = i->second; + MusECore::Event ev = oldEvent.clone(); + de->add(ev); + } + } + + // TODO: Should we include the parts in the undo? + // dpart->events()->incARef(-1); // the later MusEGlobal::song->applyOperationGroup() will increment it + // // so we must decrement it first :/ + // // These will not increment ref count, and will not chain clones... + // // DELETETHIS: is the above comment still correct (by flo93)? i doubt it! + // operations.push_back(MusECore::UndoOp(MusECore::UndoOp::AddPart,dpart)); + + parts()->add(dpart); + } + } + +} + +void WaveTrack::assign(const Track& t, int flags) +{ + AudioTrack::assign(t, flags); + internal_assign(t, flags); +} + +//--------------------------------------------------------- // fetchData // called from prefetch thread //--------------------------------------------------------- void WaveTrack::fetchData(unsigned pos, unsigned samples, float** bp, bool doSeek) { - // Added by Tim. p3.3.17 #ifdef WAVETRACK_DEBUG printf("WaveTrack::fetchData %s samples:%lu pos:%u\n", name().toLatin1().constData(), samples, pos); #endif @@ -245,7 +302,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float* return false; // DELETETHIS 43 - // Removed by T356. Multiple out route cacheing now handled by AudioTrack::copyData and ::addData. + // Removed by T356. Multiple out route cacheing now handled by AudioTrack::copyData and ::addData. // REMOVE Tim. /* if (outRoutes()->size() > 1) { if (bufferPos != framePos) { diff --git a/muse2/share/templates/MusE.cfg b/muse2/share/templates/MusE.cfg index 7df28f44..daf6da4a 100644 --- a/muse2/share/templates/MusE.cfg +++ b/muse2/share/templates/MusE.cfg @@ -568,7 +568,10 @@ fff000000000000000000000002000000030000000a00540065006d0070006f0100000000fffffff <open_project>67108943</open_project> <save_project>67108947</save_project> <copy_range>100663363</copy_range> - <paste_dialog>100663382</paste_dialog> + <paste_clones>67108930</paste_clones> + <paste_to_track>100663382</paste_to_track> + <paste_clones_to_track>100663362</paste_clones_to_track> + <paste_with_dialog>67108935</paste_with_dialog> <save_project_as>0</save_project_as> <open_recent>67108913</open_recent> <load_template>0</load_template> @@ -634,8 +637,6 @@ fff000000000000000000000002000000030000000a00540065006d0070006f0100000000fffffff <sel_part_below>16777237</sel_part_below> <sel_part_below_add>50331669</sel_part_below_add> <insert_measure>100663375</insert_measure> - <paste_as_clone>67108930</paste_as_clone> - <paste_as_clone_dialog>100663362</paste_as_clone_dialog> <sel_track_below>83886101</sel_track_below> <sel_track_above>83886099</sel_track_above> <sel_all>67108929</sel_all> |