diff options
Diffstat (limited to 'muse2/muse/song.h')
-rw-r--r-- | muse2/muse/song.h | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/muse2/muse/song.h b/muse2/muse/song.h index 6621de35..a25f1d55 100644 --- a/muse2/muse/song.h +++ b/muse2/muse/song.h @@ -171,9 +171,27 @@ class Song : public QObject { Song(const char* name = 0); ~Song(); - bool applyOperationGroup(Undo& group, bool doUndo=true); - void informAboutNewParts(const std::map< Part*, std::set<Part*> >&); - void informAboutNewParts(Part* orig, Part* p1, Part* p2=NULL, Part* p3=NULL, Part* p4=NULL, Part* p5=NULL, Part* p6=NULL, Part* p7=NULL, Part* p8=NULL, Part* p9=NULL); + /** It is not allowed nor checked(!) to AddPart a clone, and + * to AddEvent/DeleteEvent/ModifyEvent/SelectEvent events which + * would need to be replicated to the newly added clone part! + */ + bool applyOperationGroup(Undo& group, bool doUndo=true); // group may be changed! prepareOperationGroup is called on group! + bool applyOperation(const UndoOp& op, bool doUndo=true); + + /** this sends emits a signal to each MidiEditor or whoever is interested. + * For each part which is 1) opened in this MidiEditor and 2) which is + * a key in this map, the Editors shall no more edit this part, but instead + * all parts in the_map[old_part] (which is a std::set<Part*>) + */ + void informAboutNewParts(const std::map< const Part*, std::set<const Part*> >&); + /** this sends emits a signal to each MidiEditor or whoever is interested. + * For each part which is 1) opened in this MidiEditor and 2) which is + * a key in this map, the Editors shall no more edit this part, but instead + * all parts in the_map[old_part] (which is a std::set<Part*>) + * this is a special case of the general function, which only replaces one part + * by up to nine different. + */ + void informAboutNewParts(const Part* orig, const Part* p1, const Part* p2=NULL, const Part* p3=NULL, const Part* p4=NULL, const Part* p5=NULL, const Part* p6=NULL, const Part* p7=NULL, const Part* p8=NULL, const Part* p9=NULL); void putEvent(int pv); void endMsgCmd(); @@ -263,36 +281,29 @@ class Song : public QObject { //----------------------------------------- void cmdAddRecordedWave(WaveTrack* track, Pos, Pos); - void cmdAddRecordedEvents(MidiTrack*, EventList*, unsigned); - bool addEvent(Event&, Part*); - void changeEvent(Event&, Event&, Part*); - void deleteEvent(Event&, Part*); - void cmdChangeWave(QString original, QString tmpfile, unsigned sx, unsigned ex); - void remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int newport); - void changeAllPortDrumCtrlEvents(bool add, bool drumonly = false); + void cmdAddRecordedEvents(MidiTrack*, const EventList&, unsigned); + bool addEvent(Event&, Part*); // only called from audio thread. FIXME TODO: move functionality into undo.cpp + void changeEvent(Event&, Event&, Part*); // only called from audio thread. FIXME TODO: move functionality into undo.cpp + void deleteEvent(Event&, Part*); // only called from audio thread. FIXME TODO: move functionality into undo.cpp + void cmdChangeWave(QString original, QString tmpfile, unsigned sx, unsigned ex); // FIXME TODO broken, fix that. + void remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int newport); // called from GUI thread + void changeAllPortDrumCtrlEvents(bool add, bool drumonly = false); // called from GUI thread - void addACEvent(AudioTrack* t, int acid, int frame, double val); - void changeACEvent(AudioTrack* t, int acid, int frame, int newFrame, double val); void addExternalTempo(const TempoRecEvent& e) { _tempoFifo.put(e); } //----------------------------------------- // part manipulations //----------------------------------------- - void cmdResizePart(Track* t, Part* p, unsigned int size, bool doClones=false); - void cmdSplitPart(Track* t, Part* p, int tick); - void cmdGluePart(Track* t, Part* p); + void cmdResizePart(Track* t, Part* p, unsigned int size, bool doClones=false); // called from GUI thread, calls applyOperationGroup. FIXME TODO: better move that into functions.cpp or whatever. void addPart(Part* part); void removePart(Part* part); - void changePart(Part*, Part*); - PartList* getSelectedMidiParts() const; + + + PartList* getSelectedMidiParts() const; // FIXME TODO move functionality into function.cpp PartList* getSelectedWaveParts() const; - bool msgRemoveParts(); - void cmdChangePart(Part* oldPart, Part* newPart, bool doCtrls, bool doClones); - void cmdRemovePart(Part* part); - void cmdAddPart(Part* part); int arrangerRaster() { return _arrangerRaster; } // Used by Song::cmdAddRecordedWave to snap new wave parts void setArrangerRaster(int r) { _arrangerRaster = r; } // Used by Arranger snap combo box @@ -309,17 +320,12 @@ class Song : public QObject { AuxList* auxs() { return &_auxs; } SynthIList* syntis() { return &_synthIs; } - void cmdRemoveTrack(Track* track); - void removeTrack0(Track* track); void removeTrack1(Track* track); void removeTrack2(Track* track); void removeTrack3(Track* track); - void removeMarkedTracks(); - //void changeTrack(Track* oldTrack, Track* newTrack); DELETETHIS MidiTrack* findTrack(const Part* part) const; Track* findTrack(const QString& name) const; void swapTracks(int i1, int i2); - void setChannelMute(int channel, bool flag); void setRecordFlag(Track*, bool); void insertTrack0(Track*, int idx); void insertTrack1(Track*, int idx); @@ -328,7 +334,6 @@ class Song : public QObject { void deselectTracks(); void readRoute(Xml& xml); void recordEvent(MidiTrack*, Event&); - void msgInsertTrack(Track* track, int idx, bool u = true); // Enable all track and plugin controllers, and synth controllers if applicable, which are NOT in AUTO_WRITE mode. void reenableTouchedControllers(); void clearRecAutomation(bool clearList); @@ -340,20 +345,20 @@ class Song : public QObject { void updateSoloStates(); //----------------------------------------- - // undo, redo + // undo, redo, operation groups //----------------------------------------- void startUndo(); void endUndo(MusECore::SongChangedFlags_t); - void undoOp(UndoOp::UndoType type, const char* changedFile, const char* changeData, int startframe, int endframe); + void undoOp(UndoOp::UndoType type, const char* changedFile, const char* changeData, int startframe, int endframe); // FIXME FINDMICHJETZT what's that?! remove it! - bool doUndo1(); - void doUndo2(); - void doUndo3(); - bool doRedo1(); - void doRedo2(); - void doRedo3(); + void executeOperationGroup1(Undo& operations); + void executeOperationGroup2(Undo& operations); + void executeOperationGroup3(Undo& operations); + void revertOperationGroup1(Undo& operations); + void revertOperationGroup2(Undo& operations); + void revertOperationGroup3(Undo& operations); void addUndo(UndoOp i); void setUndoRedoText(); @@ -412,7 +417,7 @@ class Song : public QObject { void setQuantize(bool val); void panic(); void seqSignal(int fd); - Track* addTrack(Undo& operations, Track::TrackType type, Track* insertAt = 0); + Track* addTrack(Track::TrackType type, Track* insertAt = 0); Track* addNewTrack(QAction* action, Track* insertAt = 0); void duplicateTracks(); QString getScriptPath(int id, bool delivered); @@ -432,7 +437,7 @@ class Song : public QObject { void midiPortsChanged(); void midiNote(int pitch, int velo); void controllerChanged(MusECore::Track*, int); - void newPartsCreated(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&); + void newPartsCreated(const std::map< const MusECore::Part*, std::set<const MusECore::Part*> >&); void sigDirty(); }; |