#include <sequenceeditor.h>
Public Member Functions | |
SequenceEditor (SequenceService &service) | |
bool | init (utility::ErrorState &errorState) override |
void | save (const std::string &file) |
void | load (const std::string &file) |
void | changeSequenceDuration (double newDuration) |
SequenceController * | getControllerWithTrackType (rtti::TypeInfo trackType) |
SequenceController * | getControllerWithTrackID (const std::string &trackID) |
template<typename T > | |
T & | getController () |
void | insertMarker (double time, const std::string &message) |
void | changeMarkerTime (const std::string &markerID, double time) |
void | deleteMarker (const std::string &markerID) |
void | changeMarkerMessage (const std::string &markerID, const std::string &markerMessage) |
void | takeSnapshot (rtti::TypeInfo actionType) |
void | undo () |
void | redo () |
void | jumpToHistoryPointIndex (int index) |
void | clearHistory () |
const std::deque< std::unique_ptr< SequenceEditorHistoryPoint > > & | getHistory () const |
size_t | getHistoryIndex () const |
size_t | getHistorySize () const |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
ResourcePtr< SequencePlayer > | mSequencePlayer = nullptr |
Property: 'Sequence Player' ResourcePtr to the sequence player. More... | |
int | mUndoSteps = 100 |
Property: 'Undo Steps' number of undo steps to store. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
The SequenceEditor is responsible for editing the sequence (model) and makes sure the model stays valid during editing. It also holds a resource ptr to a player, to make sure that editing the sequence stays thread safe.
SequenceEditor | ( | SequenceService & | service | ) |
void changeMarkerMessage | ( | const std::string & | markerID, |
const std::string & | markerMessage | ||
) |
changes marker message of specified marker id, asserts when marker not found
markerID | the id of the marker to edit |
markerMessage | const reference to string value of marker message |
void changeMarkerTime | ( | const std::string & | markerID, |
double | time | ||
) |
changes marker time, assert when markerID not found
markerID | the id of the marker |
time | the new time in seconds for the marker |
void changeSequenceDuration | ( | double | newDuration | ) |
changes sequence duration
newDuration | new duration of sequence |
void clearHistory | ( | ) |
Clears all stored history points
void deleteMarker | ( | const std::string & | markerID | ) |
deletes marker with specified id, assert when markerID not found
markerID | the id of the marker to delete |
T& getController | ( | ) |
Gets reference the controller for a type, performs static cast
T | type of controller |
SequenceController* getControllerWithTrackID | ( | const std::string & | trackID | ) |
Returns pointer to base class of controller type that is used for specified track type of track id Return null when track is not found, or controller is not found
trackID | the track id of the track to find controller for |
SequenceController* getControllerWithTrackType | ( | rtti::TypeInfo | trackType | ) |
Returns pointer to base class of controller type, asserts when type not found
trackType | rttr::type information of controller type to be returned |
const std::deque<std::unique_ptr<SequenceEditorHistoryPoint> >& getHistory | ( | ) | const |
Returns const reference to history
size_t getHistoryIndex | ( | ) | const |
Returns current history index
size_t getHistorySize | ( | ) | const |
Returns history size
|
overridevirtual |
initializes editor
errorState | contains any errors |
Reimplemented from Object.
void insertMarker | ( | double | time, |
const std::string & | message | ||
) |
inserts marker at given time in seconds
time | the time at where to insert the new marker in seconds |
message | const reference to the message that the new marker should contain |
void jumpToHistoryPointIndex | ( | int | index | ) |
Jumps to given index of history. If index is not valid, does nothing
index |
void load | ( | const std::string & | file | ) |
loads sequence of file
file | filename |
void redo | ( | ) |
Loads next history point and deserializes the binary sequence
void save | ( | const std::string & | file | ) |
saves sequence of player to file
file | filename |
void takeSnapshot | ( | rtti::TypeInfo | actionType | ) |
Serializes current sequence into binary format. Creates history point with current date and time and takes type info and stores it.
actionType | action that calls the method |
void undo | ( | ) |
Loads previous history point and deserializes the binary sequence
ResourcePtr<SequencePlayer> mSequencePlayer = nullptr |
Property: 'Sequence Player' ResourcePtr to the sequence player.
int mUndoSteps = 100 |
Property: 'Undo Steps' number of undo steps to store.