replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / gtk2_ardour / transport_control.h
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3  * Copyright (C) 1999-2017 Paul Davis
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef _gtkardour_transport_control_h_
21 #define _gtkardour_transport_control_h_
22
23 #include <gtkmm/widget.h>
24 #include "pbd/controllable.h"
25
26 /* This is an API implemenetd by AROUR_UI,
27  * and made available to transport-control-UIs
28  */
29 class TransportControlProvider
30 {
31 public:
32         TransportControlProvider ();
33         virtual ~TransportControlProvider () {}
34
35         /* show metronome preferences */
36         virtual bool click_button_clicked (GdkEventButton *) = 0;
37
38         struct TransportControllable : public PBD::Controllable {
39                 enum ToggleType {
40                         Roll = 0,
41                         Stop,
42                         RecordEnable,
43                         GotoStart,
44                         GotoEnd,
45                         AutoLoop,
46                         PlaySelection,
47                 };
48
49                 TransportControllable (std::string name, ToggleType);
50                 void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
51                 double get_value (void) const { return 0; }
52
53                 ToggleType type;
54         };
55
56         boost::shared_ptr<TransportControllable> roll_controllable;
57         boost::shared_ptr<TransportControllable> stop_controllable;
58         boost::shared_ptr<TransportControllable> goto_start_controllable;
59         boost::shared_ptr<TransportControllable> goto_end_controllable;
60         boost::shared_ptr<TransportControllable> auto_loop_controllable;
61         boost::shared_ptr<TransportControllable> play_selection_controllable;
62         boost::shared_ptr<TransportControllable> rec_controllable;
63 };
64
65 #endif