Lumiera  0.pre.03
»edit your freedom«
timeline-state.hpp
Go to the documentation of this file.
1 /*
2  TIMELINE-STATE.hpp - timeline presentation state holder
3 
4  Copyright (C)
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
26 #ifndef STAGE_WIDGET_TIMELINE_STATE_H
27 #define STAGE_WIDGET_TIMELINE_STATE_H
28 
29 #include "stage/gtk-base.hpp"
30 //#include "stage/widget/timeline/timeline-view-window.hpp"////////////////////////////TODO : obsolete and removed 3/23
31 
32 #include "lib/time/timevalue.hpp"
33 #include "lib/time/mutation.hpp"
34 #include "lib/time/control.hpp"
35 
36 #include <memory>
37 
38 
39 namespace stage {
40  namespace model {
41  class Sequence;
42  }
43  namespace widget {
44  namespace timeline {
45 
46  using lib::time::Time;
47  using lib::time::Offset;
48  using lib::time::TimeVar;
49  using lib::time::TimeSpan;
51  using lib::time::Mutation;
52  using lib::time::Control;
53 
54  using std::shared_ptr;
55 
56  typedef Control<TimeSpan> SelectionControl;
57 
60  {
61  public:
62  TimelineViewWindow (Offset offset, int64_t scale)
63  {
64  NOTREACHED ("3/23: this code is dead and left in-tree for later reference only");
65  }
66  };
68 
69 
78  template<class TI>
81  {
82  sigc::signal<void, TI> valueChangedSignal_;
83 
84  public:
85  SelectionListener() { }
86 
87  void
88  operator() (TI const& changeValue) const
89  {
90  valueChangedSignal_.emit (changeValue);
91  }
92 
93 
94  void connect (const sigc::slot<void, TI> &connection)
95  {
96  valueChangedSignal_.connect (connection);
97  }
98  };
99 
100 
101 
108  {
109  public:
110 
116 
117 
118  public:
123  shared_ptr<model::Sequence> getSequence() const;
124 
129  timeline::TimelineViewWindow& getViewWindow();
130 
131 
133  getSelectionListener() { return selectionListener_; }
134 
135  Time getSelectionStart() const { return selection_.start();}
136  Time getSelectionEnd() const { return selection_.end(); }
137  Time getPlaybackPeriodStart() const { return selection_.start();}
138  Time getPlaybackPeriodEnd() const { return selection_.end(); }
139 
140  Time getPlaybackPoint() const { return playbackPoint_; }
141 
142 
145  bool isPlaying() const { return isPlayback_; }
146 
147  void setSelectionControl (SelectionControl &control);
148 
154  void setSelection(Mutation const& change,
155  bool resetPlaybackPeriod = true);
156 
157  void setPlaybackPeriod(Mutation const& change);
158 
166  void setPlaybackPoint(Time newPos);
167 
171  sigc::signal<void> selectionChangedSignal() const;
172 
177  sigc::signal<void> playbackChangedSignal() const;
178 
179 
180 
181  private: /* ========= Event Handlers ========== */
185  void on_selection_changed (TimeSpan selection);
186 
187 
188  private:
195 
196 
197 
198  /* == View State == */
199 
202 
203 
204  /* == Selection State == */
205 
208 
211 
214 
220 
221  bool isPlayback_;
222 
223 
224  /* == Signals == */
225 
229  sigc::signal<void> selectionChangedSignal_;
230 
235  sigc::signal<void> playbackChangedSignal_;
236  };
237 
238 
239 }}}// namespace stage::widget::timeline
240 #endif /*STAGE_WIDGET_TIMELINE_STATE_H*/
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Definition: timevalue.hpp:232
Modifying time and timecode values.
Frontend/Interface: controller-element to retrieve and change running time values.
Definition: control.hpp:125
SelectionListener< TimeSpan > selectionListener_
listens for a selection change
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
Interface: an opaque change imposed onto some time value.
Definition: mutation.hpp:91
shared_ptr< model::Sequence > sequence_
A pointer to the sequence object which this timeline_widget will represent.
TimeSpan playbackPeriod_
current playback period.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
sigc::signal< void > playbackChangedSignal_
A signal to notify when the playback point or playback periods have changed.
TimelineState is a container for the state data for TimelineWidget.
TimeVar playbackPoint_
current playback position.
bool isPlaying() const
is there currently any ongoing playback process? Otherwise the #getPlaybackPoint() is meaningless ...
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
SelectionListener is a template class which emits a signal when the value is changed by it&#39;s associat...
Offset measures a distance in time.
Definition: timevalue.hpp:358
Manipulating and monitoring time entities with life changes.
TimeSpan selection_
currently selected time period.
timeline::TimelineViewWindow viewWindow_
ViewWindow for the TimelineWidget display.
A time interval anchored at a specific point in time.
Definition: timevalue.hpp:573
a family of time value like entities and their relationships.
basic constant internal time value.
Definition: timevalue.hpp:133
A set of basic GTK includes for the UI.
sigc::signal< void > selectionChangedSignal_
A signal to notify when the selected period has changed.