globally change all use of "frame" to refer to audio into "sample".
[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 mark_in();
51 //      void mark_out();
52
53         void register_thread (std::string name);
54
55         /* transport control */
56
57         void loop_toggle ();
58         void loop_location (samplepos_t start, samplepos_t end);
59         void access_action ( std::string action_path );
60         static PBD::Signal2<void,std::string,std::string> AccessAction;
61         void goto_zero ();
62         void goto_start (bool and_roll = false);
63         void goto_end ();
64         void rewind ();
65         void ffwd ();
66         void transport_stop ();
67         void transport_play (bool jump_back = false);
68         void set_transport_speed (double speed);
69         double get_transport_speed ();
70
71         void jump_by_seconds( double sec );
72         void jump_by_bars(double bars);
73
74         ARDOUR::samplepos_t transport_sample ();
75         void locate (ARDOUR::samplepos_t sample, bool play = false);
76         bool locating ();
77         bool locked ();
78
79         void save_state ();
80         void prev_marker ();
81         void next_marker ();
82         void undo ();
83         void redo ();
84         void toggle_punch_in ();
85         void toggle_punch_out ();
86
87         void mark_in();
88         void mark_out();
89
90         void toggle_click();
91         void midi_panic();
92
93         void toggle_monitor_mute();
94         void toggle_monitor_dim();
95         void toggle_monitor_mono();
96
97         void cancel_all_solo ();
98
99         void quick_snapshot_stay ();
100         void quick_snapshot_switch ();
101
102         void toggle_roll();  //this provides the same operation as the "spacebar", it's a lot smarter than "play".
103
104         void stop_forget();
105
106         void set_punch_range();
107         void set_loop_range();
108         void set_session_range();
109
110         void set_record_enable (bool yn);
111         bool get_record_enabled ();
112
113         //editor visibility stuff  (why do we have to make explicit numbers here?  because "gui actions" don't accept args
114         void fit_1_track();
115         void fit_2_tracks();
116         void fit_4_tracks();
117         void fit_8_tracks();
118         void fit_16_tracks();
119         void fit_32_tracks();
120         void fit_all_tracks();
121         void zoom_10_ms();
122         void zoom_100_ms();
123         void zoom_1_sec();
124         void zoom_10_sec();
125         void zoom_1_min();
126         void zoom_5_min();
127         void zoom_10_min();
128         void zoom_to_session();
129         void temporal_zoom_in();
130         void temporal_zoom_out();
131
132         void scroll_up_1_track();
133         void scroll_dn_1_track();
134         void scroll_up_1_page();
135         void scroll_dn_1_page();
136
137         void rec_enable_toggle ();
138         void toggle_all_rec_enables ();
139
140         void all_tracks_rec_in ();
141         void all_tracks_rec_out ();
142
143         void goto_nth_marker (int n);
144
145         ARDOUR::samplecnt_t timecode_frames_per_hour ();
146
147         void timecode_time (samplepos_t where, Timecode::Time&);
148         void timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const;
149         void sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
150
151   protected:
152         BasicUI ();
153         ARDOUR::Session* session;
154 };
155
156 #endif /* __ardour_basic_ui_h__ */