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)
5  2010, Hermann Vosseler <Ichthyostega@web.de>
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 
39 #ifndef ASSET_META_TIME_GRID_H
40 #define ASSET_META_TIME_GRID_H
41 
42 #include "steam/asset/meta.hpp"
43 #include "lib/idi/entry-id.hpp"
44 #include "lib/time/grid.hpp"
45 #include "lib/time/timevalue.hpp"
46 #include "lib/symbol.hpp"
47 
48 
49 
50 namespace steam {
51 namespace asset {
52 namespace meta {
53 
54  using lib::Symbol;
55  using lib::time::Time;
56  using lib::time::TimeVar;
59  using lib::time::FSecs;
60 
61 
62  class TimeGrid;
63  using PGrid = lib::P<TimeGrid>;
64  using GridID = lib::idi::EntryID<TimeGrid>;
65 
66 
77  class TimeGrid
78  : public Meta
79  , public virtual lib::time::Grid
80  {
81 
82  public:
83  /* === shortcut builder functions === */
84  static PGrid build (FrameRate frames_per_second);
85  static PGrid build (Symbol gridID, FrameRate frames_per_second);
86  static PGrid build (Symbol gridID, FrameRate frames_per_second, Time origin);
87 
88  protected:
89  TimeGrid (GridID const&);
90  };
91 
92 
93 
94 
95 
96  template<>
97  struct Builder<TimeGrid>
98  {
99  string id;
100 
101  FrameRate fps;
102  TimeVar origin;
103 
110 
116  Builder(string const& nameID ="")
117  : id {nameID}
118  , fps{1}
119  , origin{TimeValue(0)}
120  , predecessor{}
121  { }
122 
126  lib::P<TimeGrid> commit();
127 
128  };
129 
130 }}} // namespace steam::asset::meta
131 #endif
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Definition: timevalue.hpp:232
Interface: a grid and scale definition for time quantisation.
Definition: time-grid.hpp:77
Framerate specified as frames per second.
Definition: timevalue.hpp:655
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:109
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:126
static PGrid build(FrameRate frames_per_second)
Definition: time-grid.cpp:158
Steam-Layer implementation namespace root.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
TimeGrid(GridID const &)
Definition: time-grid.cpp:48
const ID< Asset > id
Asset primary key.
Definition: asset.hpp:212
Token or Atom with distinct identity.
Definition: symbol.hpp:117
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:220
Bare symbolic and hash ID used for accounting of asset like entries.
Building and configuring a meta asset.
Definition: asset/meta.hpp:100
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
Builder(string const &nameID="")
initialise to blank (zero).
Definition: time-grid.hpp:116
Abstraction of a value alignment grid.
Definition: grid.hpp:58
a family of time value like entities and their relationships.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
basic constant internal time value.
Definition: timevalue.hpp:133
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:109