c919223e2cc0ab8ca06ad916650992802e072734
[ardour.git] / libs / surfaces / control_protocol / control_protocol / basic_ui.h
1 /*
2     Copyright (C) 2006 Paul Davis
3
4     This program is free software; you can redistribute it
5     and/or modify it under the terms of the GNU Lesser
6     General Public License as published by the Free Software
7     Foundation; either version 2 of the License, or (at your
8     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., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #ifndef __ardour_basic_ui_h__
22 #define __ardour_basic_ui_h__
23
24 #include <string>
25 #include <stdint.h>
26
27 #include "pbd/signals.h"
28
29 #include "ardour/types.h"
30 #include "ardour/presentation_info.h"
31
32 #include "timecode/time.h"
33
34 #include "control_protocol/visibility.h"
35
36 namespace ARDOUR {
37         class Session;
38         class SessionEvent;
39         class Stripable;
40 }
41
42 class LIBCONTROLCP_API BasicUI {
43   public:
44         BasicUI (ARDOUR::Session&);
45         virtual ~BasicUI ();
46
47         void add_marker (const std::string& = std::string());
48         void remove_marker_at_playhead ();
49
50         void clear_stripable_selection ();
51         void toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
52         void add_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
53         void set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
54         void toggle_selection (ARDOUR::PresentationInfo::order_t, ARDOUR::PresentationInfo::Flag);
55
56 //      void mark_in();
57 //      void mark_out();
58
59         void register_thread (std::string name);
60
61         /* transport control */
62
63         void loop_toggle ();
64         void loop_location (framepos_t start, framepos_t end);
65         void access_action ( std::string action_path );
66         static PBD::Signal2<void,std::string,std::string> AccessAction;
67         void goto_zero ();
68         void goto_start ();
69         void goto_end ();
70         void rewind ();
71         void ffwd ();
72         void transport_stop ();
73         void transport_play (bool jump_back = false);
74         void set_transport_speed (double speed);
75         double get_transport_speed ();
76
77         void jump_by_seconds( double sec );
78         void jump_by_bars(double bars);
79
80         ARDOUR::framepos_t transport_frame ();
81         void locate (ARDOUR::framepos_t frame, bool play = false);
82         bool locating ();
83         bool locked ();
84
85         void save_state ();
86         void prev_marker ();
87         void next_marker ();
88         void undo ();
89         void redo ();
90         void toggle_punch_in ();
91         void toggle_punch_out ();
92         
93         void mark_in();
94         void mark_out();
95
96         void toggle_click();
97         void midi_panic();
98
99         void toggle_monitor_mute();
100         void toggle_monitor_dim();
101         void toggle_monitor_mono();
102
103         void quick_snapshot_stay ();
104         void quick_snapshot_switch ();
105
106         void toggle_roll();  //this provides the same operation as the "spacebar", it's a lot smarter than "play".
107
108         void stop_forget();
109
110         void set_punch_range();
111         void set_loop_range();
112         void set_session_range();
113
114         void set_record_enable (bool yn);
115         bool get_record_enabled ();
116
117         //editor visibility stuff  (why do we have to make explicit numbers here?  because "gui actions" don't accept args 
118         void fit_1_track();
119         void fit_2_tracks();
120         void fit_4_tracks();
121         void fit_8_tracks();
122         void fit_16_tracks();
123         void fit_32_tracks();
124         void fit_all_tracks();
125         void zoom_10_ms();
126         void zoom_100_ms();
127         void zoom_1_sec();
128         void zoom_10_sec();
129         void zoom_1_min();
130         void zoom_5_min();
131         void zoom_10_min();
132         void zoom_to_session();
133         void temporal_zoom_in();
134         void temporal_zoom_out();
135
136         void scroll_up_1_track();
137         void scroll_dn_1_track();
138         void scroll_up_1_page();
139         void scroll_dn_1_page();
140
141         void rec_enable_toggle ();
142         void toggle_all_rec_enables ();
143
144         void all_tracks_rec_in ();
145         void all_tracks_rec_out ();
146
147         ARDOUR::framecnt_t timecode_frames_per_hour ();
148
149         void timecode_time (framepos_t where, Timecode::Time&);
150         void timecode_to_sample (Timecode::Time& timecode, framepos_t & sample, bool use_offset, bool use_subframes) const;
151         void sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
152
153   protected:
154         BasicUI ();
155         ARDOUR::Session* session;
156 };
157
158 #endif /* __ardour_basic_ui_h__ */