Lumiera  0.pre.03
»edit your freedom«
time-grid.hpp
Go to the documentation of this file.
1 /*
2  TIME-GRID.hpp - reference scale for quantised time
3 
4  Copyright (C) Lumiera.org
5  2010, Hermann Vosseler <Ichthyostega@web.de>
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 
23 
48 #ifndef ASSET_META_TIME_GRID_H
49 #define ASSET_META_TIME_GRID_H
50 
51 #include "steam/asset/meta.hpp"
52 #include "lib/idi/entry-id.hpp"
53 #include "lib/time/grid.hpp"
54 #include "lib/time/timevalue.hpp"
55 #include "lib/symbol.hpp"
56 
57 
58 
59 namespace steam {
60 namespace asset {
61 namespace meta {
62 
63  using lib::Symbol;
64  using lib::time::Time;
65  using lib::time::TimeVar;
68  using lib::time::FSecs;
69 
70 
71  class TimeGrid;
72  using PGrid = lib::P<TimeGrid>;
73  using GridID = lib::idi::EntryID<TimeGrid>;
74 
75 
86  class TimeGrid
87  : public Meta
88  , public virtual lib::time::Grid
89  {
90 
91  public:
92  /* === shortcut builder functions === */
93  static PGrid build (FrameRate frames_per_second);
94  static PGrid build (Symbol gridID, FrameRate frames_per_second);
95  static PGrid build (Symbol gridID, FrameRate frames_per_second, Time origin);
96 
97  protected:
98  TimeGrid (GridID const&);
99  };
100 
101 
102 
103 
104 
105  template<>
107  {
108  string id;
109 
110  FrameRate fps;
111  TimeVar origin;
112 
119 
125  Builder(string const& nameID ="")
126  : id {nameID}
127  , fps{1}
128  , origin{TimeValue(0)}
129  , predecessor{}
130  { }
131 
135  lib::P<TimeGrid> commit();
136 
137  };
138 
139 }}} // namespace steam::asset::meta
140 #endif
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Definition: timevalue.hpp:241
Interface: a grid and scale definition for time quantisation.
Definition: time-grid.hpp:86
Framerate specified as frames per second.
Definition: timevalue.hpp:664
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:118
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:135
static PGrid build(FrameRate frames_per_second)
Definition: time-grid.cpp:167
Steam-Layer implementation namespace root.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
TimeGrid(GridID const &)
Definition: time-grid.cpp:57
const ID< Asset > id
Asset primary key.
Definition: asset.hpp:221
Token or Atom with distinct identity.
Definition: symbol.hpp:126
Internal and organisational metadata.
definition of a time grid abstraction for time and timecode handling.
Marker types to indicate a literal string and a Symbol.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Definition: timevalue.hpp:229
Bare symbolic and hash ID used for accounting of asset like entries.
Building and configuring a meta asset.
Definition: asset/meta.hpp:109
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
Builder(string const &nameID="")
initialise to blank (zero).
Definition: time-grid.hpp:125
Abstraction of a value alignment grid.
Definition: grid.hpp:67
a family of time value like entities and their relationships.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
basic constant internal time value.
Definition: timevalue.hpp:142
lib::P< TimeGrid > predecessor
when building a compound or variable grid, the predecessor is the grid active before the origin of th...
Definition: time-grid.hpp:118