2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
3 * Copyright (C) 2011 Paul Davis
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.
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.
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.
20 #include <boost/algorithm/string.hpp>
21 #ifndef __gtk2_ardour_ardour_spinner_h__
22 #define __gtk2_ardour_ardour_spinner_h__
26 #include "ardour/automatable.h"
27 #include "ardour/automation_control.h"
28 #include "ardour_button.h"
30 class ArdourSpinner : public Gtk::Alignment
34 boost::shared_ptr<ARDOUR::AutomationControl>,
36 boost::shared_ptr<ARDOUR::Automatable>);
38 virtual ~ArdourSpinner ();
41 bool on_button_press_event (GdkEventButton*);
42 bool on_button_release_event (GdkEventButton*);
43 bool on_scroll_event (GdkEventScroll* ev);
45 void controllable_changed ();
46 PBD::ScopedConnection watch_connection;
50 bool entry_focus_out (GdkEventFocus*);
51 void entry_activated ();
52 gint switch_to_button ();
53 gint switch_to_spinner ();
59 Gtk::Adjustment* _ctrl_adj;
60 Gtk::Adjustment _spin_adj;
61 Gtk::SpinButton _spinner;
63 bool _switch_on_release;
67 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
68 boost::shared_ptr<ARDOUR::Automatable> _printer;
72 #endif /* __gtk2_ardour_ardour_menu_h__ */