Lumiera  0.pre.03
»edit your freedom«
TimelineState Class Reference

#include "stage/widget/timeline/timeline-state.hpp"

Description

TimelineState is a container for the state data for TimelineWidget.

Remarks
TimelineStates can be swapped out so that TimelineWidget can flip between different views.

Definition at line 116 of file timeline-state.hpp.

Public Member Functions

 TimelineState (shared_ptr< model::Sequence > sourceSequence)
 
Time getPlaybackPeriodEnd () const
 
Time getPlaybackPeriodStart () const
 
Time getPlaybackPoint () const
 
Time getSelectionEnd () const
 
SelectionListener< TimeSpan > & getSelectionListener ()
 
Time getSelectionStart () const
 
shared_ptr< model::Sequence > getSequence () const
 Gets the sequence that is attached to this timeline state object. More...
 
timeline::TimelineViewWindowgetViewWindow ()
 Gets a reference to the timeline view window object. More...
 
bool isPlaying () const
 is there currently any ongoing playback process? Otherwise the #getPlaybackPoint() is meaningless
 
sigc::signal< void > playbackChangedSignal () const
 A signal to notify when the playback point or playback periods have changed.
 
sigc::signal< void > selectionChangedSignal () const
 A signal to notify when the selected period has changed.
 
void setPlaybackPeriod (Mutation const &change)
 
void setPlaybackPoint (Time newPos)
 Sets the time which is currently being played back. More...
 
void setSelection (Mutation const &change, bool resetPlaybackPeriod=true)
 Sets the period of the selection. More...
 
void setSelectionControl (SelectionControl &control)
 

Private Member Functions

void on_selection_changed (TimeSpan selection)
 Event handler for when the selection is changed.
 

Private Attributes

bool isPlayback_
 
sigc::signal< void > playbackChangedSignal_
 A signal to notify when the playback point or playback periods have changed.
 
TimeSpan playbackPeriod_
 current playback period. More...
 
TimeVar playbackPoint_
 current playback position. More...
 
TimeSpan selection_
 currently selected time period. More...
 
sigc::signal< void > selectionChangedSignal_
 A signal to notify when the selected period has changed.
 
SelectionListener< TimeSpanselectionListener_
 listens for a selection change
 
shared_ptr< model::Sequence > sequence_
 A pointer to the sequence object which this timeline_widget will represent. More...
 
timeline::TimelineViewWindow viewWindow_
 ViewWindow for the TimelineWidget display.
 

Constructor & Destructor Documentation

◆ TimelineState()

TimelineState ( shared_ptr< model::Sequence >  sourceSequence)
Parameters
source_sequenceThe sequence on which the TimelineWidget will operate when this TimelineState is attached.

Definition at line 53 of file timeline-state.cpp.

References Mutation::changeTime(), Duration::NIL, TimelineState::on_selection_changed(), TimelineState::selectionListener_, TimelineState::sequence_, and TimelineState::setSelection().

+ Here is the call graph for this function:

Member Function Documentation

◆ getSequence()

shared_ptr< model::Sequence > getSequence ( ) const

Gets the sequence that is attached to this timeline state object.

Returns
Returns a shared_ptr to the sequence object.

Definition at line 82 of file timeline-state.cpp.

References TimelineState::sequence_.

◆ getViewWindow()

TimelineViewWindow & getViewWindow ( )

Gets a reference to the timeline view window object.

Returns
Returns the timeline view window object.

Definition at line 89 of file timeline-state.cpp.

References TimelineState::viewWindow_.

◆ setSelection()

void setSelection ( Mutation const &  change,
bool  resetPlaybackPeriod = true 
)

Sets the period of the selection.

Parameters
resetPlaybackPeriodSpecifies whether to set the playback period to the same as this new selection.

Definition at line 96 of file timeline-state.cpp.

References TimeSpan::accept(), TimelineState::playbackChangedSignal_, TimelineState::playbackPeriod_, TimelineState::selection_, and TimelineState::selectionChangedSignal_.

Referenced by TimelineState::TimelineState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPlaybackPoint()

void setPlaybackPoint ( Time  newPos)

Sets the time which is currently being played back.

Parameters
pointThe time index being played.
Todo:

do we ever get the situation that we don't have such a position?

very likely to be handled differently, once the GUI is really connected to the Player

Definition at line 116 of file timeline-state.cpp.

References TimeSpan::accept(), Control< TI >::connectChangeNotification(), Control< TI >::disconnect(), TimelineState::playbackChangedSignal_, TimelineState::playbackPoint_, TimelineState::selection_, and TimelineState::selectionListener_.

+ Here is the call graph for this function:

Member Data Documentation

◆ sequence_

shared_ptr<model::Sequence> sequence_
private

A pointer to the sequence object which this timeline_widget will represent.

Remarks
This pointer is set by the constructor and is constant, so will not change in value during the lifetime of the class.

Definition at line 203 of file timeline-state.hpp.

Referenced by TimelineState::getSequence(), and TimelineState::TimelineState().

◆ selection_

TimeSpan selection_
private

currently selected time period.

Definition at line 216 of file timeline-state.hpp.

Referenced by TimelineState::setPlaybackPoint(), and TimelineState::setSelection().

◆ playbackPeriod_

TimeSpan playbackPeriod_
private

current playback period.

Definition at line 222 of file timeline-state.hpp.

Referenced by TimelineState::setSelection().

◆ playbackPoint_

TimeVar playbackPoint_
private

current playback position.

Todo:
very likely to be handled differently when actually integrated with the Player

Definition at line 228 of file timeline-state.hpp.

Referenced by TimelineState::setPlaybackPoint().

+ Collaboration diagram for TimelineState:

The documentation for this class was generated from the following files: