Lumiera  0.pre.03
»edityourfreedom«
gui/model/clip.hpp
Go to the documentation of this file.
1 /*
2  clip.hpp - Definition of the Clip class
3 
4  Copyright (C) Lumiera.org
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
30 #ifndef GUI_MODEL_CLIP_H
31 #define GUI_MODEL_CLIP_H
32 
33 #include "gui/gtk-base.hpp"
34 #include "lib/time/timevalue.hpp"
35 
36 #include <string>
37 
38 
39 namespace gui {
40 namespace model {
41 
42  using std::string;
43  using lib::time::Time;
44  using lib::time::TimeSpan;
45  using lib::time::Duration;
46  using Cairo::Pattern;
47 
48 
49  class Clip
50  {
52  string name_;
53 
55  sigc::signal<void, string> nameChangedSignal_;
56 
57 
58  public:
59 
60  Clip();
61 
62  Time getBegin() const { return timeCoord_.start();}
63  Time getEnd() const { return timeCoord_.end(); }
64 
65  string const& getName() const { return name_; }
66 
67 
71  bool
72  isPlayingAt (Time const& position) const
73  {
74  return timeCoord_.contains (position);
75  }
76 
77 
82  void setBegin (Time);
83 
88  void setDuration (Duration);
89 
94  void setName (string const&);
95 
100  sigc::signal<void, std::string>
101  signalNameChanged() const;
102 
103  };
104 
105 
106 }} // namespace gui::model
107 #endif // CLIP_HPP
void setDuration(Duration)
Sets the end time of this clip.
bool contains(TimeValue const &tp) const
Definition: timevalue.hpp:524
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:47
sigc::signal< void, string > nameChangedSignal_
fires when the name changes.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:226
Time start() const
Definition: timevalue.hpp:512
void setBegin(Time)
Sets the begin time of this clip.
sigc::signal< void, std::string > signalNameChanged() const
A signal which fires when the name changes.
Time getEnd() const
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:380
Time end() const
Definition: timevalue.hpp:518
bool isPlayingAt(Time const &position) const
Check whether or not the clip will be playing during the given time.
A time interval anchored at a specific point in time.
Definition: timevalue.hpp:467
a family of time value like entities and their relationships.
void setName(string const &)
Sets the name of this clip.
string const & getName() const
A set of basic GTK includes for the UI.
Time getBegin() const