NAP
Public Member Functions | List of all members
SequenceControllerAudio Class Referencefinal

#include <sequencecontrolleraudio.h>

Public Member Functions

 SequenceControllerAudio (SequenceService &service, SequencePlayer &player, SequenceEditor &editor)
 
double segmentAudioStartTimeChange (const std::string &trackID, const std::string &segmentID, double time)
 
const SequenceTrackSegmentinsertSegment (const std::string &trackID, double time) override
 
void deleteSegment (const std::string &trackID, const std::string &segmentID) override
 
std::string insertAudioSegment (const std::string &trackID, double time, const std::string &audioBufferID)
 
std::string insertAudioSegment (const std::string &trackID, double time, const std::string &audioBufferID, double duration, double startTimeInSegment)
 
void addNewAudioTrack ()
 
void insertTrack (rttr::type type) override
 
void changeAudioSegmentAudioBuffer (const std::string &trackID, const std::string &segmentID, const std::string &audioBufferID)
 
double segmentAudioStartTimeInSegmentChange (const std::string &trackID, const std::string &segmentID, double time)
 
double segmentAudioDurationChange (const std::string &trackID, const std::string &segmentID, double newDuration)
 
- Public Member Functions inherited from SequenceController
 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)
 
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)
 

Additional Inherited Members

- Protected Member Functions inherited from SequenceController
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 inherited from SequenceController
SequencePlayermPlayer
 
SequenceEditormEditor
 
SequenceServicemService
 

Description

The SequenceControllerAudio is responsible for manipulating, editing and inserting audio segments on an audio track

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

Constructor & Destructor Documentation

◆ SequenceControllerAudio()

SequenceControllerAudio ( SequenceService service,
SequencePlayer player,
SequenceEditor editor 
)

Constructor

Parameters
servicereference to sequence service
playerreference to sequence player
editorreference to sequence editor

Member Function Documentation

◆ addNewAudioTrack()

void addNewAudioTrack ( )

Adds a new audio track to the sequence

◆ changeAudioSegmentAudioBuffer()

void changeAudioSegmentAudioBuffer ( const std::string &  trackID,
const std::string &  segmentID,
const std::string &  audioBufferID 
)

Changes to buffer the audio segment points to

Parameters
trackIDtrack id of the track containing the segment
segmentIDthe segment id
audioBufferIDthe new audio segment buffer id

◆ deleteSegment()

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

Deletes a segment from the track

Parameters
trackIDthe id of the track containing the segment
segmentIDthe id of the segment to delete

Implements SequenceController.

◆ insertAudioSegment() [1/2]

std::string insertAudioSegment ( const std::string &  trackID,
double  time,
const std::string &  audioBufferID 
)

Inserts an audio segment at given time with a certain buffer id. Returns id of newly inserted segment

Parameters
trackIDthe id of the track where to insert the segment
timethe time at when to insert the segment
audioBufferIDthe buffer id of the audio segment
Returns
id of the newly inserted segment

◆ insertAudioSegment() [2/2]

std::string insertAudioSegment ( const std::string &  trackID,
double  time,
const std::string &  audioBufferID,
double  duration,
double  startTimeInSegment 
)

Inserts an audio segment at given time with a certain buffer id, certain duration and a certain start time in segment

Parameters
trackIDtrackID the id of the track where to insert the segment
timethe time at when to insert the segment
audioBufferIDthe buffer id of the audio segment
durationthe duration of the segment
startTimeInSegmentthe start time within the segment
Returns
id of the newly inserted segment

◆ insertSegment()

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

Inserts a segment, don;t use this function. Instead use insertAudioSegment

Parameters
trackIDtrack id of the track
timethe time at which to insert the segment
Returns
raw pointer to newly inserted segment

Implements SequenceController.

◆ insertTrack()

void insertTrack ( rttr::type  type)
overridevirtual

Inserts new track, type must be of SequenceTrackAudio

Parameters
typethe type of track to insert, type must be of SequenceTrackAudio

Implements SequenceController.

◆ segmentAudioDurationChange()

double segmentAudioDurationChange ( const std::string &  trackID,
const std::string &  segmentID,
double  newDuration 
)

Changes the duration of the audio segment

Parameters
trackIDtrackID track id of the track containing the segment
segmentIDsegmentID the segment id
newDurationthe new duration of the audio buffer
Returns
the adjusted duration time

◆ segmentAudioStartTimeChange()

double segmentAudioStartTimeChange ( const std::string &  trackID,
const std::string &  segmentID,
double  time 
)

Changes the start time of an audio segment on the track

Parameters
trackIDthe track id of the track containing the segment
segmentIDthe segment id
timethe new start time of the segment
Returns
the new start time of the segment

◆ segmentAudioStartTimeInSegmentChange()

double segmentAudioStartTimeInSegmentChange ( const std::string &  trackID,
const std::string &  segmentID,
double  time 
)

Changes the start time within the audio buffer of the audio segment

Parameters
trackIDtrackID track id of the track containing the segment
segmentIDsegmentID the segment id
timethe new start time within the audio buffer
Returns
the adjusted start time within the audio buffer