NAP
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SequenceController Class Referenceabstract

#include <sequencecontroller.h>

Public Member Functions

 SequenceController (SequenceService &service, SequencePlayer &player, SequenceEditor &editor)
 
virtual ~SequenceController ()=default
 
void changeTrackName (const std::string &trackID, const std::string &name)
 
void changeSegmentLabel (const std::string &trackID, const std::string &segmentID, const std::string &newLabel)
 
void assignNewOutputID (const std::string &trackID, const std::string &outputID)
 
void deleteTrack (const std::string &deleteTrackID)
 
void moveTrackUp (const std::string &trackID)
 
void moveTrackDown (const std::string &trackID)
 
virtual void insertTrack (rttr::type type)=0
 
virtual const SequenceTrackSegmentinsertSegment (const std::string &trackID, double time)=0
 
virtual void deleteSegment (const std::string &trackID, const std::string &segmentID)=0
 
const SequenceTrackgetTrack (const std::string &trackID) const
 
const SequenceTrackSegmentgetSegment (const std::string &trackID, const std::string &segmentID) const
 
void changeTrackHeight (const std::string &trackID, float newHeight)
 

Protected Member Functions

SequencegetSequence ()
 
SequenceTrackSegmentfindSegment (const std::string &trackID, const std::string &segmentID)
 
SequenceTrackfindTrack (const std::string &trackID)
 
void deleteObjectFromSequencePlayer (const std::string &id)
 
void updateTracks ()
 
void performEditAction (std::function< void()> action)
 
std::vector< std::unique_ptr< rtti::Object > > & getPlayerOwnedObjects ()
 
std::unordered_set< std::string > & getPlayerReadObjectIDs ()
 

Protected Attributes

SequencePlayermPlayer
 
SequenceEditormEditor
 
SequenceServicemService
 

Description

Base class for controllers for specific track types

Inheritance diagram for SequenceController:
[legend]
Collaboration diagram for SequenceController:
[legend]

Constructor & Destructor Documentation

◆ SequenceController()

SequenceController ( SequenceService service,
SequencePlayer player,
SequenceEditor editor 
)

Constructor

Parameters
servicereference to service
playerreference to player being used
editorreference to editor

◆ ~SequenceController()

virtual ~SequenceController ( )
virtualdefault

Deconstructor

Member Function Documentation

◆ assignNewOutputID()

void assignNewOutputID ( const std::string &  trackID,
const std::string &  outputID 
)

assign track to specific output, the SequencePlayer will create an adapter linking the track to output with given id

Parameters
trackIDthe track id that gets an assigned object
outputIDthe output id that is assigned to the track and used to create the adapter

◆ changeSegmentLabel()

void changeSegmentLabel ( const std::string &  trackID,
const std::string &  segmentID,
const std::string &  newLabel 
)

Change segment label

Parameters
trackIDthe track id
segmentIDthe segment id
newLabelthe new segment label

◆ changeTrackHeight()

void changeTrackHeight ( const std::string &  trackID,
float  newHeight 
)

Change a track height

Parameters
trackIDthe track id
newHeightthe new track height

◆ changeTrackName()

void changeTrackName ( const std::string &  trackID,
const std::string &  name 
)

Change track name

Parameters
trackIDthe track id
namethe new track name

◆ deleteObjectFromSequencePlayer()

void deleteObjectFromSequencePlayer ( const std::string &  id)
protected

deletes an object owned by sequenceplayer from sequenceplayer

Parameters
idobject id

◆ deleteSegment()

virtual void deleteSegment ( const std::string &  trackID,
const std::string &  segmentID 
)
pure virtual

deleted segment from track, must be overloaded

Parameters
trackIDthe track
segmentIDthe segment

Implemented in SequenceControllerCurve, SequenceControllerEvent, and SequenceControllerAudio.

◆ deleteTrack()

void deleteTrack ( const std::string &  deleteTrackID)

deletes a track

Parameters
deleteTrackIDthe id of the track that needs to be deleted

◆ findSegment()

SequenceTrackSegment* findSegment ( const std::string &  trackID,
const std::string &  segmentID 
)
protected

finds segment

Parameters
trackIDthe trackID
segmentIDthe segmentID
Returns
raw pointer to SequenceTrackSegment, returns nullptr when not found

◆ findTrack()

SequenceTrack* findTrack ( const std::string &  trackID)
protected

finds segment

Parameters
trackIDthe trackID
Returns
raw pointer to track, returns nullptr when not found

◆ getPlayerOwnedObjects()

std::vector<std::unique_ptr<rtti::Object> >& getPlayerOwnedObjects ( )
protected

◆ getPlayerReadObjectIDs()

std::unordered_set<std::string>& getPlayerReadObjectIDs ( )
protected

◆ getSegment()

const SequenceTrackSegment* getSegment ( const std::string &  trackID,
const std::string &  segmentID 
) const

returns const pointer to SequenceTrackSegment, nullptr when not found

Parameters
trackIDthe trackID
segmentIDthe segmentID
Returns
const pointer to SequenceTrackSegment, returns nullptr when not found

◆ getSequence()

Sequence& getSequence ( )
protected
Returns
returns reference to sequence of player

◆ getTrack()

const SequenceTrack* getTrack ( const std::string &  trackID) const

returns const pointer to sequence track, null if not found

Parameters
trackIDid of track to find
Returns
const pointer to found SequenceTrack

◆ insertSegment()

virtual const SequenceTrackSegment* insertSegment ( const std::string &  trackID,
double  time 
)
pure virtual

inserts segment in track, must be overloaded

Parameters
trackIDthe trackID in which to insert new segment
timethe time at which to insert the segment
Returns
const pointer to newly created segment

Implemented in SequenceControllerCurve, SequenceControllerEvent, and SequenceControllerAudio.

◆ insertTrack()

virtual void insertTrack ( rttr::type  type)
pure virtual

inserts track that corresponds to type of controller, must be overloaded

Parameters
typethe type of track

Implemented in SequenceControllerAudio, SequenceControllerEvent, and SequenceControllerCurve.

◆ moveTrackDown()

void moveTrackDown ( const std::string &  trackID)

moves track up in the array of tracks

Parameters
trackIDthe id of the track that needs to be moved

◆ moveTrackUp()

void moveTrackUp ( const std::string &  trackID)

moves track up in the array of tracks

Parameters
trackIDthe id of the track that needs to be moved

◆ performEditAction()

void performEditAction ( std::function< void()>  action)
protected

calls perform edit action on editor class

Parameters
actionthe edit action

◆ updateTracks()

void updateTracks ( )
protected

updates duration of sequence by longest track

Member Data Documentation

◆ mEditor

SequenceEditor& mEditor
protected

◆ mPlayer

SequencePlayer& mPlayer
protected

◆ mService

SequenceService& mService
protected