Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
play-panel.cpp
Go to the documentation of this file.
1/*
2 PlayPanel - Dockable panel to hold the play control and switchboard
3
4 Copyright (C)
5 2025, 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
24#include "stage/gtk-base.hpp"
27
29#include "stage/ui-bus.hpp"
30
31
32namespace stage {
33namespace panel {
34
35 using Gtk::StockID;
36 using sigc::mem_fun;
37
38
40 ,Gdl::DockItem& dockItem)
41 : Panel{panelManager, dockItem, getTitle(), getStockID()}
42 , buttons_{}
43 , buttonStop_{StockID(GTK_STOCK_MEDIA_STOP)}
44 , buttonPlay_{StockID(GTK_STOCK_MEDIA_PLAY)}
45 , buttonPause_{StockID(GTK_STOCK_MEDIA_PAUSE)}
46 {
50 pack_start(buttons_, Gtk::PACK_SHRINK);
51 }
52
53 const char*
55 {
56 return _("Play");
57 }
58
59 const gchar*
61 {
62 return "panel_play";
63 }
64
65
66 /* === create an internal wiring to the Controller === */
67
68 // Preliminary workaround -- use a shortcut /////////////////////////////////////////////////////TICKET #1105 : need a generic scheme to access UI components
69 // Directly grab into the first ViewerPanel we can get hold off
70 // The real solution should use the UI-Bus!
71
74 {
75 if (not viewer_)
76 {
77 int panelID = workspace::PanelManager::findPanelID<ViewerPanel>();
78 if (panelManager_.hasPanel (panelID))
79 viewer_.connect (dynamic_cast<ViewerPanel&> (panelManager_.showPanel (panelID)));
80 }
81 return viewer_;
82 }
83
84 void
86 {
87 auto& view{accessViewer()};
88 if (view)
89 view->demoPlayback_.stop();
90 }
91
92 void
94 {
95 auto& view{accessViewer()};
96 if (view)
97 view->demoPlayback_.play();
98 }
99
100 void
102 {
103 auto& view{accessViewer()};
104 if (view)
105 view->demoPlayback_.pause();
106 }
107
108
109}}// namespace stage::panel
The base class for all dockable panels.
Definition panel.hpp:42
workspace::PanelManager & panelManager_
The owner panel manager object.
Definition panel.hpp:94
widget::MiniButton buttonPause_
widget::MiniButton buttonPlay_
static const char * getTitle()
ViewLink & accessViewer()
static const gchar * getStockID()
widget::ButtonBar buttons_
widget::MiniButton buttonStop_
PlayPanel(workspace::PanelManager &, Gdl::DockItem &)
A panel to display the video output.
ctrl::DemoController demoPlayback_
void append(Widget &)
Append a widget to the button bar.
A class to manage DockItem objects for WorkspaceWindow.
bool hasPanel(const int description_index)
was the indicated panel already allocated within this PanelManager's realm?
panel::Panel & showPanel(const int description_index)
Shows a panel given a description index.
A set of basic GTK includes for the UI.
#define _(String)
Definition gtk-base.hpp:68
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
Definition of a dockable panel for playback control //////////////////////////////////////////////TIC...
Under construction: the top level UI controller.
Definition of a dockable panel to hold a video viewer.
This file contains the definition of the main workspace window parent, which is the toplevel parent o...