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