Lumiera  0.pre.03
»edityourfreedom«
engine-config.cpp
Go to the documentation of this file.
1 /*
2  EngineConfig - access point to any kind of engine configuration parameters
3 
4  Copyright (C) Lumiera.org
5  2013, 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 
30 #include "lib/time/timevalue.hpp"
31 
32 #include <boost/rational.hpp>
33 
34 
35 using boost::rational;
37 using lib::time::FSecs;
38 
39 
40 namespace backend{
41 namespace engine {
42 
43  namespace { // Hard wired placeholder settings...
44 
45  const rational<uint> ONE_THIRD(1,3);
46  const rational<uint> EIGHTY_PERCENT(8,10);
47 
48  const Duration DEFAULT_ENGINE_LATENCY = EIGHTY_PERCENT * Duration(1, FrameRate{25});
49  const Duration DEFAULT_JOB_PLANNING_TURNOVER(FSecs(3,2));
50 
51  }//(End)hard wired settings
52 
53 
55 
56 
59 
60 
67  { }
68 
69 
70 
71 
72  Duration
74  {
75  return DEFAULT_ENGINE_LATENCY;
76  }
77 
78 
79  Duration
81  {
82  return DEFAULT_JOB_PLANNING_TURNOVER;
83  }
84 
85 }} // namespace backend::engine
86 
87 namespace {
89 
90  // any C adapter functions go here...
91 
92 }
93 
94 
95 
96 
97 extern "C" { /* ==== implementation C interface for engine configuration ======= */
98 
99 gavl_time_t
101 {
102  return _raw (EngineConfig::get().currentEngineLatency());
103 }
104 
105 }//extern "C"
static lib::Depend< EngineConfig > get
access point to the Engine Interface.
Definition: engine-config.h:79
Framerate specified as frames per second.
Definition: timevalue.hpp:547
Duration currentEngineLatency() const
reasonable guess of the current engine working delay.
access point to configuration of engine parameters
Duration currentJobPlanningRhythm() const
Time interval for ahead planning of render jobs.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
boost::rational< long > FSecs
rational representation of fractional seconds
Definition: timevalue.hpp:205
Point of access for any kind of engine configuration, setup and performance tweaks.
Definition: engine-config.h:67
gavl_time_t lumiera_engine_get_latency()
guess of the current effective engine calculation delay
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:380
a family of time value like entities and their relationships.
EngineConfig()
build up a new engine configuration set, based on reasonable default values