Ardour  9.0-pre0-582-g084a23a80d
basic_ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2010 David Robillard <d@drobilla.net>
3  * Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
5  * Copyright (C) 2015 Robin Gareus <robin@gareus.org>
6  * Copyright (C) 2016 Ben Loftis <ben@harrisonconsoles.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef __ardour_basic_ui_h__
24 #define __ardour_basic_ui_h__
25 
26 #include <string>
27 #include <stdint.h>
28 
29 #include "pbd/signals.h"
30 
31 #include "temporal/timeline.h"
32 
33 #include "ardour/types.h"
35 
36 #include "temporal/time.h"
37 
39 
40 namespace ARDOUR {
41  class Session;
42  class SessionEvent;
43  class Stripable;
44  class Trigger;
45 }
46 
48  public:
50  virtual ~BasicUI ();
51 
52  void add_marker (const std::string& = std::string());
54 
55 // void mark_in();
56 // void mark_out();
57 
58  void register_thread (std::string name);
59 
60  /* transport control */
61 
62  void loop_toggle ();
64  void access_action ( std::string action_path );
65  static PBD::Signal<void(std::string,std::string)> AccessAction;
66  void goto_zero ();
67  void goto_start (bool and_roll = false);
68  void goto_end ();
69  void button_varispeed (bool fwd);
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 
76  double get_transport_speed () const;
77  double transport_rolling () const;
78 
82 
85  void locate (ARDOUR::samplepos_t sample, bool);
86  bool locating ();
87  bool locked ();
88 
89  void save_state ();
90  void prev_marker ();
91  void next_marker ();
92  void undo ();
93  void redo ();
94  void toggle_punch_in ();
96 
97  void mark_in();
98  void mark_out();
99 
100  void toggle_click();
101  void midi_panic();
102 
103  void trigger_cue_row (int cue);
104  void trigger_stop_all (bool stop_now = false);
105  void trigger_stop_col (int col, bool immediately = false);
106 
107  void store_mixer_scene (int scn);
108  void apply_mixer_scene (int scn);
109 
113 
115 
118 
119  void toggle_roll(bool with_abort, bool roll_out_of_bounded_mode); //this provides the same operation as the "spacebar", it's a lot smarter than "play".
120 
121  void stop_forget();
122 
126 
127  void set_record_enable (bool yn);
129 
130  //editor visibility stuff (why do we have to make explicit numbers here? because "gui actions" don't accept args
131  void fit_1_track();
132  void fit_2_tracks();
133  void fit_4_tracks();
134  void fit_8_tracks();
138  void zoom_10_ms();
139  void zoom_100_ms();
140  void zoom_1_sec();
141  void zoom_10_sec();
142  void zoom_1_min();
143  void zoom_5_min();
144  void zoom_10_min();
148 
153 
156 
159 
160  void goto_nth_marker (int n);
161 
163 
165  void timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const;
166  void sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
167 
168  bool stop_button_onoff() const;
169  bool play_button_onoff() const;
170  bool ffwd_button_onoff() const;
171  bool rewind_button_onoff() const;
172  bool loop_button_onoff() const;
173 
174  /* These functions access Triggers in the order they are displayed on the Cue page, WITH an optional bank offset
175  Use this for a launchpad-style NxM (route x row) matrix that maps directly to the Cue page layout.
176  Trigger banking is separate from 'route' banking implemented by a fader surface.
177  To match a fader/mute/solo to the Trigger banking, the tentative plan is:
178  request trigger-tracks-only to be displayed on the surface
179  bank the faders using the offset reported here
180  */
181  void tbank_set_size (int route_width, int row_height);
182  void tbank_step_routes (int step_size);
183  void tbank_step_rows (int step_size);
184  float trigger_progress_at (int x); /* 0..1 or -1 for not playing; */
185  struct TriggerDisplay {
186  int state;
188  state = -1; /* -1=empty; 0=stopped; 1=playing */ /*potentially extend to include */
189  //potentially name, color, launch style, follow action(s) etc
190  }
191  };
193  void bang_trigger_at (int x, int y);
194  void unbang_trigger_at (int x, int y);
195 
196  /* it would be nice to use TriggerPtr here but that implies including ardour/triggerbox.h */
197  std::shared_ptr<ARDOUR::Trigger> find_trigger (int x, int y);
198 
199  protected:
202 
203  int _tbank_route_width, _tbank_row_height;
204  int _tbank_start_route, _tbank_start_row;
205 };
206 
207 #endif /* __ardour_basic_ui_h__ */
bool locked()
void ffwd()
void temporal_zoom_in()
void tbank_step_rows(int step_size)
void fit_16_tracks()
void mark_out()
void save_state()
void apply_mixer_scene(int scn)
void transport_stop()
double transport_rolling() const
void locate(ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd)
void remove_marker_at_playhead()
void trigger_stop_col(int col, bool immediately=false)
void midi_panic()
BasicUI(ARDOUR::Session &)
void trigger_cue_row(int cue)
void goto_end()
void zoom_10_ms()
bool ffwd_button_onoff() const
void add_marker(const std::string &=std::string())
void rec_enable_toggle()
void scroll_up_1_page()
void sample_to_timecode(samplepos_t sample, Timecode::Time &timecode, bool use_offset, bool use_subframes) const
void store_mixer_scene(int scn)
void set_record_enable(bool yn)
void quick_snapshot_stay()
void timecode_time(samplepos_t where, Timecode::Time &)
void bang_trigger_at(int x, int y)
bool get_record_enabled()
void scroll_up_1_track()
void fit_2_tracks()
float trigger_progress_at(int x)
void redo()
void all_tracks_rec_in()
void next_marker()
int _tbank_start_route
Definition: basic_ui.h:204
void unbang_trigger_at(int x, int y)
void scroll_dn_1_page()
void cancel_all_solo()
static PBD::Signal< void(std::string, std::string)> AccessAction
Definition: basic_ui.h:65
void loop_location(Temporal::timepos_t const &start, Temporal::timepos_t const &end)
void loop_toggle()
void set_punch_range()
void access_action(std::string action_path)
void goto_start(bool and_roll=false)
void prev_marker()
int _tbank_route_width
Definition: basic_ui.h:203
void zoom_1_sec()
void scroll_dn_1_track()
void toggle_punch_out()
void tbank_step_routes(int step_size)
void timecode_to_sample(Timecode::Time &timecode, samplepos_t &sample, bool use_offset, bool use_subframes) const
void fit_1_track()
void tbank_set_size(int route_width, int row_height)
bool play_button_onoff() const
bool loop_button_onoff() const
void goto_nth_marker(int n)
void locate(ARDOUR::samplepos_t sample, bool)
TriggerDisplay trigger_display_at(int x, int y)
void trigger_stop_all(bool stop_now=false)
void zoom_100_ms()
void goto_zero()
void zoom_5_min()
void stop_forget()
std::shared_ptr< ARDOUR::Trigger > find_trigger(int x, int y)
void zoom_to_session()
ARDOUR::samplecnt_t timecode_frames_per_hour()
void undo()
ARDOUR::Session * session
Definition: basic_ui.h:201
void fit_4_tracks()
void zoom_10_min()
void toggle_click()
void quick_snapshot_switch()
virtual ~BasicUI()
void zoom_1_min()
void toggle_all_rec_enables()
void jump_by_bars(int bars, ARDOUR::LocateTransportDisposition ltd=ARDOUR::RollIfAppropriate)
double get_transport_speed() const
void rewind()
ARDOUR::samplepos_t transport_sample()
void zoom_10_sec()
void jump_by_beats(int beats, ARDOUR::LocateTransportDisposition ltd=ARDOUR::RollIfAppropriate)
void register_thread(std::string name)
void fit_32_tracks()
void jump_by_seconds(double sec, ARDOUR::LocateTransportDisposition ltd=ARDOUR::RollIfAppropriate)
void button_varispeed(bool fwd)
void set_loop_range()
void set_transport_speed(double speed)
void mark_in()
void transport_play(bool jump_back=false)
bool locating()
void toggle_monitor_mono()
void toggle_roll(bool with_abort, bool roll_out_of_bounded_mode)
void temporal_zoom_out()
bool rewind_button_onoff() const
void fit_8_tracks()
void toggle_punch_in()
void fit_all_tracks()
void all_tracks_rec_out()
bool stop_button_onoff() const
void toggle_monitor_dim()
void set_session_range()
void toggle_monitor_mute()
GtkImageIconNameData name
Definition: gtkimage.h:6
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t