track scrolling and zooming
[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
31 #include "timecode/time.h"
32
33 #include "control_protocol/visibility.h"
34
35 namespace ARDOUR {
36         class Session;
37         class SessionEvent;
38 }
39
40 class LIBCONTROLCP_API BasicUI {
41   public:
42         BasicUI (ARDOUR::Session&);
43         virtual ~BasicUI ();
44
45         void add_marker (const std::string& = std::string());
46         void remove_marker_at_playhead ();
47         
48 //      void mark_in();
49 //      void mark_out();
50
51         void register_thread (std::string name);
52
53         /* transport control */
54
55         void loop_toggle ();
56         void loop_location (framepos_t start, framepos_t end);
57         void access_action ( std::string action_path );
58         static PBD::Signal2<void,std::string,std::string> AccessAction;
59         void goto_zero ();
60         void goto_start ();
61         void goto_end ();
62         void rewind ();
63         void ffwd ();
64         void transport_stop ();
65         void transport_play (bool jump_back = true);
66         void set_transport_speed (double speed);
67         double get_transport_speed ();
68
69         void jump_by_seconds( double sec );
70         void jump_by_bars(double bars);
71
72         ARDOUR::framepos_t transport_frame ();
73         void locate (ARDOUR::framepos_t frame, bool play = false);
74         bool locating ();
75         bool locked ();
76
77         void save_state ();
78         void prev_marker ();
79         void next_marker ();
80         void undo ();
81         void redo ();
82         void toggle_punch_in ();
83         void toggle_punch_out ();
84         
85         void mark_in();
86         void mark_out();
87
88         void toggle_click();
89         void midi_panic();
90
91         void toggle_monitor_mute();
92         void toggle_monitor_dim();
93         void toggle_monitor_mono();
94
95         void quick_snapshot_stay ();
96         void quick_snapshot_switch ();
97
98         void toggle_roll();  //this provides the same operation as the "spacebar", it's a lot smarter than "play".
99
100         void stop_forget();
101
102         void set_punch_range();
103         void set_loop_range();
104         void set_session_range();
105
106         void set_record_enable (bool yn);
107         bool get_record_enabled ();
108
109         //editor visibility stuff  (why do we have to make explicit numbers here?  because "gui actions" don't accept args 
110         void fit_1_track();
111         void fit_2_tracks();
112         void fit_4_tracks();
113         void fit_8_tracks();
114         void fit_16_tracks();
115         void fit_32_tracks();
116         void fit_all_tracks();
117         void zoom_10_ms();
118         void zoom_100_ms();
119         void zoom_1_sec();
120         void zoom_10_sec();
121         void zoom_1_min();
122         void zoom_5_min();
123         void zoom_10_min();
124         void zoom_to_session();
125         void temporal_zoom_in();
126         void temporal_zoom_out();
127
128         void scroll_up_1_track();
129         void scroll_dn_1_track();
130         void scroll_up_1_page();
131         void scroll_dn_1_page();
132
133         void rec_enable_toggle ();
134         void toggle_all_rec_enables ();
135
136         ARDOUR::framecnt_t timecode_frames_per_hour ();
137
138         void timecode_time (framepos_t where, Timecode::Time&);
139         void timecode_to_sample (Timecode::Time& timecode, framepos_t & sample, bool use_offset, bool use_subframes) const;
140         void sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
141
142   protected:
143         BasicUI ();
144         ARDOUR::Session* session;
145 };
146
147 #endif /* __ardour_basic_ui_h__ */