Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TimelineState Class Reference

#include "gui/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 96 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::SequencegetSequence () 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 More...
 
sigc::signal< void > playbackChangedSignal () const
 A signal to notify when the playback point or playback periods have changed. More...
 
sigc::signal< void > selectionChangedSignal () const
 A signal to notify when the selected period has changed. More...
 
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. More...
 

Private Attributes

bool isPlayback_
 
sigc::signal< void > playbackChangedSignal_
 A signal to notify when the playback point or playback periods have changed. More...
 
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. More...
 
SelectionListener< TimeSpanselectionListener_
 listens for a selection change More...
 
shared_ptr< model::Sequencesequence_
 A pointer to the sequence object which this timeline_widget will represent. More...
 
timeline::TimelineViewWindow viewWindow_
 ViewWindow for the TimelineWidget display. More...
 

Constructor & Destructor Documentation

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

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

References Mutation::changeDuration(), Mutation::changeTime(), Duration::NIL, TimelineState::on_selection_changed(), TimelineState::selectionListener_, TimelineState::sequence_, TimelineViewWindow::set_time_scale(), TimelineState::setSelection(), TimelineState::viewWindow_, and Time::ZERO.

+ Here is the call graph for this function:

Member Function Documentation

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 78 of file timeline-state.cpp.

References TimelineState::sequence_.

TimelineViewWindow & getViewWindow ( )

Gets a reference to the timeline view window object.

Returns
Returns the timeline view window object.

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

References TimelineState::viewWindow_.

SelectionListener<TimeSpan>& getSelectionListener ( )
inline

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

References TimelineState::selectionListener_.

Time getSelectionStart ( ) const
inline

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

References TimelineState::selection_, and TimeSpan::start().

+ Here is the call graph for this function:

Time getSelectionEnd ( ) const
inline

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

References TimeSpan::end(), and TimelineState::selection_.

+ Here is the call graph for this function:

Time getPlaybackPeriodStart ( ) const
inline

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

References TimelineState::selection_, and TimeSpan::start().

+ Here is the call graph for this function:

Time getPlaybackPeriodEnd ( ) const
inline

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

References TimeSpan::end(), and TimelineState::selection_.

+ Here is the call graph for this function:

Time getPlaybackPoint ( ) const
inline

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

References TimelineState::playbackPoint_.

bool isPlaying ( ) const
inline

is there currently any ongoing playback process? Otherwise the getPlaybackPoint() is meaningless

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

References TimelineState::isPlayback_.

void setSelectionControl ( SelectionControl control)

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

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

+ Here is the call graph for this function:

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 92 of file timeline-state.cpp.

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

Referenced by TimelineState::TimelineState().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setPlaybackPeriod ( Mutation const &  change)

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

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

Referenced by TimelineState::setSelection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 112 of file timeline-state.cpp.

References TimelineState::playbackChangedSignal_, and TimelineState::playbackPoint_.

sigc::signal< void > selectionChangedSignal ( ) const

A signal to notify when the selected period has changed.

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

References TimelineState::selectionChangedSignal_.

sigc::signal< void > playbackChangedSignal ( ) const

A signal to notify when the playback point or playback periods have changed.

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

References TimelineState::playbackChangedSignal_.

void on_selection_changed ( TimeSpan  selection)
private

Event handler for when the selection is changed.

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

References TimelineState::selectionChangedSignal_.

Referenced by TimelineState::TimelineState().

+ Here is the caller graph for this function:

Member Data Documentation

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 183 of file timeline-state.hpp.

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

timeline::TimelineViewWindow viewWindow_
private

ViewWindow for the TimelineWidget display.

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

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

SelectionListener<TimeSpan> selectionListener_
private

listens for a selection change

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

Referenced by TimelineState::getSelectionListener(), TimelineState::setSelectionControl(), and TimelineState::TimelineState().

TimeSpan playbackPeriod_
private

current playback period.

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

Referenced by TimelineState::setPlaybackPeriod().

TimeVar playbackPoint_
private

current playback position.

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

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

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

bool isPlayback_
private

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

Referenced by TimelineState::isPlaying().

sigc::signal<void> selectionChangedSignal_
private

A signal to notify when the selected period has changed.

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

Referenced by TimelineState::on_selection_changed(), TimelineState::selectionChangedSignal(), and TimelineState::setSelection().

sigc::signal<void> playbackChangedSignal_
private

A signal to notify when the playback point or playback periods have changed.

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

Referenced by TimelineState::playbackChangedSignal(), TimelineState::setPlaybackPeriod(), and TimelineState::setPlaybackPoint().

+ Collaboration diagram for TimelineState:

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