Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dummy-player-service.hpp
Go to the documentation of this file.
1 /*
2  DUMMY-PLAYER-SERVICE.hpp - service implementing a dummy test player
3 
4  Copyright (C) Lumiera.org
5  2009, 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 
40 #ifndef PROC_DUMMYPLAYER_SERVICE_H
41 #define PROC_DUMMYPLAYER_SERVICE_H
42 
43 
45 #include "include/display-facade.h"
47 #include "lib/nocopy.hpp"
48 
49 #include <memory>
50 #include <string>
51 
52 
53 namespace proc {
54  namespace node {
55  class DummyImageGenerator;
56  class TickService;
57  }
58 
59  namespace play {
60 
61  using std::string;
62  using lumiera::Subsys;
63  using lumiera::Display;
65 
68 
69 
70 
71  /****************************************************************/
82  {
83  uint fps_;
84  bool play_;
85 
87  std::unique_ptr<DummyImageGenerator> imageGen_;
88  std::unique_ptr<TickService> tick_;
89 
90 
91  public:
93  ~ProcessImpl() ;
94 
95 
96  /* Implementation-level API */
97 
100  void setRate (uint fps);
101 
102  bool isActive () { return fps_ != 0; }
103  bool isPlaying() { return play_; }
104 
105  void doPlay(bool yes);
106 
107 
108  /* Lifecycle */
109 
112 
113  private:
114  void doFrame ();
115  };
116 
117 
118 
119  /**************************************************/
129  {
130 
131  string error_;
133 
134 
135  /* === Interface Lifecycle === */
136 
137  typedef lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0)
138  , DummyPlayer
141 
142  public:
143  DummyPlayerService(Subsys::SigTerm terminationHandle);
145 
146 
147 
152  ProcessImpl* start (LumieraDisplaySlot viewerHandle);
153 
154  };
155 
156 
157 
158 
159  } // namespace play
160 
161 } // namespace proc
162 #endif
163 
DummyPlayerService(Subsys::SigTerm terminationHandle)
void setRate(uint fps)
activate a playback process with given specification
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Definition: subsys.hpp:70
Interface for outputting frames to an (already allocated) viewer or display.
DummyPlayer::Process createHandle()
activate a forwarding smart-Handle to be used by client code for communication with the play process ...
Playback process, front-end to be used by client code.
Handle tracking the registration of an interface, deregistering it on deletion.
lumiera_displaySlot * LumieraDisplaySlot
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Actual implementation of the DummyPlayer service.
void doPlay(bool yes)
forward the play/pause toggle to the play process implementation
Experimental Interface, allowing the Dummy-Player to access the video display widget in the GUI...
Mix-Ins to allow or prohibit various degrees of copying and cloning.
std::unique_ptr< TickService > tick_
void doFrame()
periodically invoked while playing
ProcessImpl(LumieraDisplaySlot)
static void terminate(DummyPlayer::ProcessImplementationLink *)
deleter function for lib::Handle
ProcessImpl * start(LumieraDisplaySlot viewerHandle)
conceptually, this serves as implementation of the DummyPlayer::start() function. ...
Tick generating service for a periodic callback, with adjustable frequency.
DummyPlayConnection< PlayTestFrames_Strategy > DummyPlayer
function< void(string *)> SigTerm
Definition: subsys.hpp:74
#define LUMIERA_INTERFACE_INAME(name, version)
Construct a type identifier for an interface.
Definition: interface.h:102
Experimental Interface Proc-Layer (or maybe the backend?): Global access point for starting a dummy p...
std::unique_ptr< DummyImageGenerator > imageGen_
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
A handle template for automatically dealing with interface and plugin registration and deregistration...
lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0), DummyPlayer > ServiceInstanceHandle
Actual implementation of a single (dummy) playback process.
Functor for pushing frames to the display.