Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
demo-controller.cpp
Go to the documentation of this file.
1/*
2 DemoController - playback controller object
3
4 Copyright (C)
5 2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 2025, Hermann Vosseler <Ichthyostega@web.de>
7
8  **Lumiera** is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by the
10  Free Software Foundation; either version 2 of the License, or (at your
11  option) any later version. See the file COPYING for further details.
12
13* *****************************************************************/
14
15
25
26#include <utility>
27
28
29namespace stage {
30namespace ctrl {
31 namespace error = lumiera::error;
32
33 namespace {
34 const uint FPS = 4;
35 }
36
37 using std::make_unique;
41
42
44 : imageGen_{make_unique<DummyImageGenerator>(FPS)}
45 , tick_{}
46 , output_{}
47 , playing_{false}
48 { }
49
51
56 void
58 {
59 REQUIRE (imageGen_);
60 imageGen_->configure (displayFormat);
61 }
62
63 void
65 {
66 REQUIRE (tick_);
67 REQUIRE (imageGen_);
68
69 if (playing_)
70 output_(imageGen_->next());
71 else
72 output_(imageGen_->current());
73 }
74
75
76 void
78 {
79 if (not tick_)
80 tick_.reset (new DummyTickService{[this]{ processFrame(); }});
81 ASSERT (tick_);
82 tick_->activate (FPS);
83 playing_ = true;
84 }
85
86 void
88 {
89 if (tick_)
90 tick_->activate(0);
91 playing_ = false;
92 }
93
94 void
96 {
97 tick_.reset(); // blocks for one cycle to join()
98 playing_ = false;
99 }
100
101
102}} // namespace stage::ctrl
103
unique_ptr< steam::node::DummyImageGenerator > imageGen_
unique_ptr< steam::node::DummyTickService > tick_
void activate(lumiera::DisplayerInput)
Signal slot to be called after the output window was created and the actually usable video display te...
sigc::signal< void(void *const)> output_
Tick generating service for a periodic callback, with adjustable frequency.
This file contains the definition of the playback controller object.
Generator for test dummy video frames to simulate playback of rendered output.
A timer service invoking a given callback periodically.
unsigned int uint
Definition integral.hpp:29
DisplayerInput
Supported Displayer formats.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37