2 Copyright (C) 1999 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <cstdio> // for sprintf
23 #include <pbd/convert.h>
24 #include <pbd/enumwriter.h>
26 #include <gtkmm2ext/utils.h>
28 #include <ardour/ardour.h>
29 #include <ardour/session.h>
30 #include <ardour/tempo.h>
31 #include <ardour/profile.h>
32 #include <sigc++/bind.h>
34 #include "ardour_ui.h"
35 #include "audio_clock.h"
40 using namespace ARDOUR;
49 sigc::signal<void> AudioClock::ModeChanged;
50 vector<AudioClock*> AudioClock::clocks;
52 const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
54 2, /* SMPTE_Minutes */
55 2, /* SMPTE_Seconds */
66 AudioClock::AudioClock (std::string clock_name, bool transient, std::string widget_name, bool allow_edit, bool duration, bool with_info)
68 is_transient (transient),
69 is_duration (duration),
70 editable (allow_edit),
87 bbt_reference_time = -1;
90 frames_upper_info_label = manage (new Label);
91 frames_lower_info_label = manage (new Label);
92 smpte_upper_info_label = manage (new Label);
93 smpte_lower_info_label = manage (new Label);
94 bbt_upper_info_label = manage (new Label);
95 bbt_lower_info_label = manage (new Label);
97 frames_upper_info_label->set_name ("AudioClockFramesUpperInfo");
98 frames_lower_info_label->set_name ("AudioClockFramesLowerInfo");
99 smpte_upper_info_label->set_name ("AudioClockSMPTEUpperInfo");
100 smpte_lower_info_label->set_name ("AudioClockSMPTELowerInfo");
101 bbt_upper_info_label->set_name ("AudioClockBBTUpperInfo");
102 bbt_lower_info_label->set_name ("AudioClockBBTLowerInfo");
104 Gtkmm2ext::set_size_request_to_display_given_text(*smpte_upper_info_label, "23.98",0,0);
105 Gtkmm2ext::set_size_request_to_display_given_text(*smpte_lower_info_label, "NDF",0,0);
107 frames_info_box.pack_start (*frames_upper_info_label, true, true);
108 frames_info_box.pack_start (*frames_lower_info_label, true, true);
109 smpte_info_box.pack_start (*smpte_upper_info_label, true, true);
110 smpte_info_box.pack_start (*smpte_lower_info_label, true, true);
111 bbt_info_box.pack_start (*bbt_upper_info_label, true, true);
112 bbt_info_box.pack_start (*bbt_lower_info_label, true, true);
115 frames_upper_info_label = 0;
116 frames_lower_info_label = 0;
117 smpte_upper_info_label = 0;
118 smpte_lower_info_label = 0;
119 bbt_upper_info_label = 0;
120 bbt_lower_info_label = 0;
123 audio_frames_ebox.add (audio_frames_label);
125 frames_packer.set_homogeneous (false);
126 frames_packer.set_border_width (2);
127 frames_packer.pack_start (audio_frames_ebox, false, false);
130 frames_packer.pack_start (frames_info_box, false, false, 5);
133 frames_packer_hbox.pack_start (frames_packer, true, false);
135 hours_ebox.add (hours_label);
136 minutes_ebox.add (minutes_label);
137 seconds_ebox.add (seconds_label);
138 frames_ebox.add (frames_label);
139 bars_ebox.add (bars_label);
140 beats_ebox.add (beats_label);
141 ticks_ebox.add (ticks_label);
142 ms_hours_ebox.add (ms_hours_label);
143 ms_minutes_ebox.add (ms_minutes_label);
144 ms_seconds_ebox.add (ms_seconds_label);
146 smpte_packer.set_homogeneous (false);
147 smpte_packer.set_border_width (2);
148 smpte_packer.pack_start (hours_ebox, false, false);
149 smpte_packer.pack_start (colon1, false, false);
150 smpte_packer.pack_start (minutes_ebox, false, false);
151 smpte_packer.pack_start (colon2, false, false);
152 smpte_packer.pack_start (seconds_ebox, false, false);
153 smpte_packer.pack_start (colon3, false, false);
154 smpte_packer.pack_start (frames_ebox, false, false);
157 smpte_packer.pack_start (smpte_info_box, false, false, 5);
160 smpte_packer_hbox.pack_start (smpte_packer, true, false);
162 bbt_packer.set_homogeneous (false);
163 bbt_packer.set_border_width (2);
164 bbt_packer.pack_start (bars_ebox, false, false);
165 bbt_packer.pack_start (b1, false, false);
166 bbt_packer.pack_start (beats_ebox, false, false);
167 bbt_packer.pack_start (b2, false, false);
168 bbt_packer.pack_start (ticks_ebox, false, false);
171 bbt_packer.pack_start (bbt_info_box, false, false, 5);
174 bbt_packer_hbox.pack_start (bbt_packer, true, false);
176 minsec_packer.set_homogeneous (false);
177 minsec_packer.set_border_width (2);
178 minsec_packer.pack_start (ms_hours_ebox, false, false);
179 minsec_packer.pack_start (colon4, false, false);
180 minsec_packer.pack_start (ms_minutes_ebox, false, false);
181 minsec_packer.pack_start (colon5, false, false);
182 minsec_packer.pack_start (ms_seconds_ebox, false, false);
184 minsec_packer_hbox.pack_start (minsec_packer, true, false);
186 clock_frame.set_shadow_type (Gtk::SHADOW_IN);
187 clock_frame.set_name ("BaseFrame");
189 clock_frame.add (clock_base);
191 set_widget_name (widget_name);
193 _mode = BBT; /* lie to force mode switch */
196 pack_start (clock_frame, true, true);
198 /* the clock base handles button releases for menu popup regardless of
199 editable status. if the clock is editable, the clock base is where
200 we pass focus to after leaving the last editable "field", which
201 will then shutdown editing till the user starts it up again.
203 it does this because the focus out event on the field disables
204 keyboard event handling, and we don't connect anything up to
205 notice focus in on the clock base. hence, keyboard event handling
209 clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
210 clock_base.signal_button_release_event().connect (bind (mem_fun (*this, &AudioClock::field_button_release_event), SMPTE_Hours));
212 Session::SMPTEOffsetChanged.connect (mem_fun (*this, &AudioClock::smpte_offset_changed));
218 set (last_when, true);
221 clocks.push_back (this);
226 AudioClock::set_widget_name (string name)
228 Widget::set_name (name);
230 clock_base.set_name (name);
232 audio_frames_label.set_name (name);
233 hours_label.set_name (name);
234 minutes_label.set_name (name);
235 seconds_label.set_name (name);
236 frames_label.set_name (name);
237 bars_label.set_name (name);
238 beats_label.set_name (name);
239 ticks_label.set_name (name);
240 ms_hours_label.set_name (name);
241 ms_minutes_label.set_name (name);
242 ms_seconds_label.set_name (name);
243 hours_ebox.set_name (name);
244 minutes_ebox.set_name (name);
245 seconds_ebox.set_name (name);
246 frames_ebox.set_name (name);
247 audio_frames_ebox.set_name (name);
248 bars_ebox.set_name (name);
249 beats_ebox.set_name (name);
250 ticks_ebox.set_name (name);
251 ms_hours_ebox.set_name (name);
252 ms_minutes_ebox.set_name (name);
253 ms_seconds_ebox.set_name (name);
255 colon1.set_name (name);
256 colon2.set_name (name);
257 colon3.set_name (name);
258 colon4.set_name (name);
259 colon5.set_name (name);
267 AudioClock::setup_events ()
269 clock_base.set_flags (Gtk::CAN_FOCUS);
271 hours_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
272 minutes_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
273 seconds_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
274 frames_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
275 bars_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
276 beats_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
277 ticks_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
278 ms_hours_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
279 ms_minutes_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
280 ms_seconds_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
281 audio_frames_ebox.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
283 hours_ebox.set_flags (Gtk::CAN_FOCUS);
284 minutes_ebox.set_flags (Gtk::CAN_FOCUS);
285 seconds_ebox.set_flags (Gtk::CAN_FOCUS);
286 frames_ebox.set_flags (Gtk::CAN_FOCUS);
287 audio_frames_ebox.set_flags (Gtk::CAN_FOCUS);
288 bars_ebox.set_flags (Gtk::CAN_FOCUS);
289 beats_ebox.set_flags (Gtk::CAN_FOCUS);
290 ticks_ebox.set_flags (Gtk::CAN_FOCUS);
291 ms_hours_ebox.set_flags (Gtk::CAN_FOCUS);
292 ms_minutes_ebox.set_flags (Gtk::CAN_FOCUS);
293 ms_seconds_ebox.set_flags (Gtk::CAN_FOCUS);
295 hours_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Hours));
296 minutes_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Minutes));
297 seconds_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Seconds));
298 frames_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Frames));
299 audio_frames_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), AudioFrames));
300 bars_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Bars));
301 beats_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Beats));
302 ticks_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Ticks));
303 ms_hours_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), MS_Hours));
304 ms_minutes_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), MS_Minutes));
305 ms_seconds_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), MS_Seconds));
307 hours_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Hours));
308 minutes_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Minutes));
309 seconds_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Seconds));
310 frames_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Frames));
311 audio_frames_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), AudioFrames));
312 bars_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Bars));
313 beats_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Beats));
314 ticks_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Ticks));
315 ms_hours_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), MS_Hours));
316 ms_minutes_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), MS_Minutes));
317 ms_seconds_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), MS_Seconds));
319 hours_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Hours));
320 minutes_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Minutes));
321 seconds_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Seconds));
322 frames_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Frames));
323 audio_frames_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), AudioFrames));
324 bars_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Bars));
325 beats_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Beats));
326 ticks_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Ticks));
327 ms_hours_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), MS_Hours));
328 ms_minutes_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), MS_Minutes));
329 ms_seconds_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), MS_Seconds));
331 hours_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Hours));
332 minutes_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Minutes));
333 seconds_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Seconds));
334 frames_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Frames));
335 audio_frames_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), AudioFrames));
336 bars_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Bars));
337 beats_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Beats));
338 ticks_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Ticks));
339 ms_hours_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), MS_Hours));
340 ms_minutes_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), MS_Minutes));
341 ms_seconds_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), MS_Seconds));
343 hours_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Hours));
344 minutes_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Minutes));
345 seconds_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Seconds));
346 frames_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Frames));
347 audio_frames_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), AudioFrames));
348 bars_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Bars));
349 beats_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Beats));
350 ticks_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Ticks));
351 ms_hours_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), MS_Hours));
352 ms_minutes_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), MS_Minutes));
353 ms_seconds_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), MS_Seconds));
355 hours_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Hours));
356 minutes_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Minutes));
357 seconds_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Seconds));
358 frames_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Frames));
359 audio_frames_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), AudioFrames));
360 bars_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Bars));
361 beats_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Beats));
362 ticks_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Ticks));
363 ms_hours_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), MS_Hours));
364 ms_minutes_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), MS_Minutes));
365 ms_seconds_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), MS_Seconds));
367 hours_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Hours));
368 minutes_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Minutes));
369 seconds_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Seconds));
370 frames_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Frames));
371 audio_frames_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), AudioFrames));
372 bars_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Bars));
373 beats_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Beats));
374 ticks_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Ticks));
375 ms_hours_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), MS_Hours));
376 ms_minutes_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), MS_Minutes));
377 ms_seconds_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), MS_Seconds));
379 hours_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Hours));
380 minutes_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Minutes));
381 seconds_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Seconds));
382 frames_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Frames));
383 audio_frames_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), AudioFrames));
384 bars_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Bars));
385 beats_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Beats));
386 ticks_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Ticks));
387 ms_hours_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), MS_Hours));
388 ms_minutes_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), MS_Minutes));
389 ms_seconds_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), MS_Seconds));
391 clock_base.signal_focus_in_event().connect (mem_fun (*this, &AudioClock::drop_focus_handler));
395 AudioClock::drop_focus_handler (GdkEventFocus* ignored)
397 Keyboard::magic_widget_drop_focus ();
402 AudioClock::on_realize ()
406 /* styles are not available until the widgets are bound to a window */
408 set_size_requests ();
412 AudioClock::set (nframes_t when, bool force, nframes_t offset, char which)
415 if ((!force && !is_visible()) || session == 0) {
419 if (when == last_when && !offset && !force) {
423 bool pdelta = Config->get_primary_clock_delta_edit_cursor();
424 bool sdelta = Config->get_secondary_clock_delta_edit_cursor();
426 if (offset && which == 'p' && pdelta) {
427 when = (when > offset) ? when - offset : offset - when;
428 } else if (offset && which == 's' && sdelta) {
429 when = (when > offset) ? when - offset : offset - when;
432 if (which == 'p' && pdelta && !last_pdelta) {
433 set_widget_name("TransportClockDisplayDelta");
435 } else if (which == 'p' && !pdelta && last_pdelta) {
436 set_widget_name("TransportClockDisplay");
438 } else if (which == 's' && sdelta && !last_sdelta) {
439 set_widget_name("SecondaryClockDisplayDelta");
441 } else if (which == 's' && !sdelta && last_sdelta) {
442 set_widget_name("SecondaryClockDisplay");
448 set_smpte (when, force);
452 set_bbt (when, force);
456 set_minsec (when, force);
460 set_frames (when, force);
471 AudioClock::smpte_offset_changed ()
478 current = current_duration();
480 current = current_time ();
490 AudioClock::set_frames (nframes_t when, bool force)
493 snprintf (buf, sizeof (buf), "%u", when);
494 audio_frames_label.set_text (buf);
496 if (frames_upper_info_label) {
497 nframes_t rate = session->frame_rate();
499 if (fmod (rate, 1000.0) == 0.000) {
500 sprintf (buf, "%uK", rate/1000);
502 sprintf (buf, "%.3fK", rate/1000.0f);
505 if (frames_upper_info_label->get_text() != buf) {
506 frames_upper_info_label->set_text (buf);
509 float vid_pullup = Config->get_video_pullup();
511 if (vid_pullup == 0.0) {
512 if (frames_lower_info_label->get_text () != _("none")) {
513 frames_lower_info_label->set_text(_("none"));
516 sprintf (buf, "%-6.4f", vid_pullup);
517 if (frames_lower_info_label->get_text() != buf) {
518 frames_lower_info_label->set_text (buf);
525 AudioClock::set_minsec (nframes_t when, bool force)
534 hrs = (int) floor (left / (session->frame_rate() * 60.0f * 60.0f));
535 left -= (nframes_t) floor (hrs * session->frame_rate() * 60.0f * 60.0f);
536 mins = (int) floor (left / (session->frame_rate() * 60.0f));
537 left -= (nframes_t) floor (mins * session->frame_rate() * 60.0f);
538 secs = left / (float) session->frame_rate();
540 if (force || hrs != ms_last_hrs) {
541 sprintf (buf, "%02d", hrs);
542 ms_hours_label.set_text (buf);
546 if (force || mins != ms_last_mins) {
547 sprintf (buf, "%02d", mins);
548 ms_minutes_label.set_text (buf);
552 if (force || secs != ms_last_secs) {
553 sprintf (buf, "%06.3f", secs);
554 ms_seconds_label.set_text (buf);
560 AudioClock::set_smpte (nframes_t when, bool force)
566 session->smpte_duration (when, smpte);
568 session->smpte_time (when, smpte);
571 if (force || smpte.hours != last_hrs || smpte.negative != last_negative) {
572 if (smpte.negative) {
573 sprintf (buf, "-%02" PRIu32, smpte.hours);
575 sprintf (buf, " %02" PRIu32, smpte.hours);
577 hours_label.set_text (buf);
578 last_hrs = smpte.hours;
579 last_negative = smpte.negative;
582 if (force || smpte.minutes != last_mins) {
583 sprintf (buf, "%02" PRIu32, smpte.minutes);
584 minutes_label.set_text (buf);
585 last_mins = smpte.minutes;
588 if (force || smpte.seconds != last_secs) {
589 sprintf (buf, "%02" PRIu32, smpte.seconds);
590 seconds_label.set_text (buf);
591 last_secs = smpte.seconds;
594 if (force || smpte.frames != last_frames) {
595 sprintf (buf, "%02" PRIu32, smpte.frames);
596 frames_label.set_text (buf);
597 last_frames = smpte.frames;
600 if (smpte_upper_info_label) {
601 double smpte_frames = session->smpte_frames_per_second();
603 if ( fmod(smpte_frames, 1.0) == 0.0) {
604 sprintf (buf, "%u", int (smpte_frames));
606 sprintf (buf, "%.2f", smpte_frames);
609 if (smpte_upper_info_label->get_text() != buf) {
610 smpte_upper_info_label->set_text (buf);
613 if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
614 if (session->smpte_drop_frames()) {
617 sprintf (buf, "NDF");
620 // there is no drop frame alternative
624 if (smpte_lower_info_label->get_text() != buf) {
625 smpte_lower_info_label->set_text (buf);
631 AudioClock::set_bbt (nframes_t when, bool force)
636 session->tempo_map().bbt_time (when, bbt);
638 /* handle a common case */
640 if (is_duration && when == 0) {
646 sprintf (buf, "%03" PRIu32, bbt.bars);
647 bars_label.set_text (buf);
648 sprintf (buf, "%02" PRIu32, bbt.beats);
649 beats_label.set_text (buf);
650 sprintf (buf, "%04" PRIu32, bbt.ticks);
651 ticks_label.set_text (buf);
653 if (bbt_upper_info_label) {
656 if (bbt_reference_time < 0) {
659 pos = bbt_reference_time;
662 TempoMap::Metric m (session->tempo_map().metric_at (pos));
664 sprintf (buf, "%-5.2f", m.tempo().beats_per_minute());
665 if (bbt_lower_info_label->get_text() != buf) {
666 bbt_lower_info_label->set_text (buf);
668 sprintf (buf, "%g|%g", m.meter().beats_per_bar(), m.meter().note_divisor());
669 if (bbt_upper_info_label->get_text() != buf) {
670 bbt_upper_info_label->set_text (buf);
676 AudioClock::set_session (Session *s)
683 XMLNode* node = session->extra_xml (X_("ClockModes"));
684 AudioClock::Mode amode;
687 if ((prop = node->property (_name)) != 0) {
688 amode = AudioClock::Mode (string_2_enum (prop->value(), amode));
693 set (last_when, true);
702 hours_ebox.grab_focus ();
706 bars_ebox.grab_focus ();
710 ms_hours_ebox.grab_focus ();
714 frames_ebox.grab_focus ();
724 AudioClock::field_key_press_event (GdkEventKey *ev, Field field)
726 /* all key activity is handled on key release */
731 AudioClock::field_key_release_event (GdkEventKey *ev, Field field)
736 bool move_on = false;
740 label = &hours_label;
743 label = &minutes_label;
746 label = &seconds_label;
749 label = &frames_label;
753 label = &audio_frames_label;
757 label = &ms_hours_label;
760 label = &ms_minutes_label;
763 label = &ms_seconds_label;
770 label = &beats_label;
773 label = &ticks_label;
779 switch (ev->keyval) {
823 if (_mode == MinSec && field == MS_Seconds) {
838 clock_base.grab_focus ();
839 ChangeAborted(); /* EMIT SIGNAL */
848 if (key_entry_state == 0) {
850 /* initialize with a fresh new string */
852 if (field != AudioFrames) {
853 for (uint32_t xn = 0; xn < field_length[field] - 1; ++xn) {
862 string existing = label->get_text();
863 if (existing.length() >= field_length[field]) {
864 new_text = existing.substr (1, field_length[field] - 1);
866 new_text = existing.substr (0, field_length[field] - 1);
870 new_text += new_char;
871 label->set_text (new_text);
875 if (key_entry_state == field_length[field]) {
881 if (key_entry_state) {
888 // Check SMPTE fields for sanity (may also adjust fields)
889 smpte_sanitize_display();
894 // Bars should never be, unless this clock is for a duration
895 if (atoi(bars_label.get_text()) == 0 && !is_duration) {
896 bars_label.set_text("001");
898 // beats should never be 0, unless this clock is for a duration
899 if (atoi(beats_label.get_text()) == 0 && !is_duration) {
900 beats_label.set_text("01");
907 ValueChanged(); /* EMIT_SIGNAL */
910 /* move on to the next field.
918 minutes_ebox.grab_focus ();
921 seconds_ebox.grab_focus ();
924 frames_ebox.grab_focus ();
927 clock_base.grab_focus ();
932 clock_base.grab_focus ();
938 ms_minutes_ebox.grab_focus ();
941 ms_seconds_ebox.grab_focus ();
944 clock_base.grab_focus ();
950 beats_ebox.grab_focus ();
953 ticks_ebox.grab_focus ();
956 clock_base.grab_focus ();
965 //if user hit Enter, lose focus
966 switch (ev->keyval) {
969 clock_base.grab_focus ();
976 AudioClock::field_focus_in_event (GdkEventFocus *ev, Field field)
980 Keyboard::magic_widget_grab_focus ();
984 hours_ebox.set_flags (Gtk::HAS_FOCUS);
985 hours_ebox.set_state (Gtk::STATE_ACTIVE);
988 minutes_ebox.set_flags (Gtk::HAS_FOCUS);
989 minutes_ebox.set_state (Gtk::STATE_ACTIVE);
992 seconds_ebox.set_flags (Gtk::HAS_FOCUS);
993 seconds_ebox.set_state (Gtk::STATE_ACTIVE);
996 frames_ebox.set_flags (Gtk::HAS_FOCUS);
997 frames_ebox.set_state (Gtk::STATE_ACTIVE);
1001 audio_frames_ebox.set_flags (Gtk::HAS_FOCUS);
1002 audio_frames_ebox.set_state (Gtk::STATE_ACTIVE);
1006 ms_hours_ebox.set_flags (Gtk::HAS_FOCUS);
1007 ms_hours_ebox.set_state (Gtk::STATE_ACTIVE);
1010 ms_minutes_ebox.set_flags (Gtk::HAS_FOCUS);
1011 ms_minutes_ebox.set_state (Gtk::STATE_ACTIVE);
1014 ms_seconds_ebox.set_flags (Gtk::HAS_FOCUS);
1015 ms_seconds_ebox.set_state (Gtk::STATE_ACTIVE);
1018 bars_ebox.set_flags (Gtk::HAS_FOCUS);
1019 bars_ebox.set_state (Gtk::STATE_ACTIVE);
1022 beats_ebox.set_flags (Gtk::HAS_FOCUS);
1023 beats_ebox.set_state (Gtk::STATE_ACTIVE);
1026 ticks_ebox.set_flags (Gtk::HAS_FOCUS);
1027 ticks_ebox.set_state (Gtk::STATE_ACTIVE);
1035 AudioClock::field_focus_out_event (GdkEventFocus *ev, Field field)
1040 hours_ebox.unset_flags (Gtk::HAS_FOCUS);
1041 hours_ebox.set_state (Gtk::STATE_NORMAL);
1044 minutes_ebox.unset_flags (Gtk::HAS_FOCUS);
1045 minutes_ebox.set_state (Gtk::STATE_NORMAL);
1048 seconds_ebox.unset_flags (Gtk::HAS_FOCUS);
1049 seconds_ebox.set_state (Gtk::STATE_NORMAL);
1052 frames_ebox.unset_flags (Gtk::HAS_FOCUS);
1053 frames_ebox.set_state (Gtk::STATE_NORMAL);
1057 audio_frames_ebox.unset_flags (Gtk::HAS_FOCUS);
1058 audio_frames_ebox.set_state (Gtk::STATE_NORMAL);
1062 ms_hours_ebox.unset_flags (Gtk::HAS_FOCUS);
1063 ms_hours_ebox.set_state (Gtk::STATE_NORMAL);
1066 ms_minutes_ebox.unset_flags (Gtk::HAS_FOCUS);
1067 ms_minutes_ebox.set_state (Gtk::STATE_NORMAL);
1070 ms_seconds_ebox.unset_flags (Gtk::HAS_FOCUS);
1071 ms_seconds_ebox.set_state (Gtk::STATE_NORMAL);
1075 bars_ebox.unset_flags (Gtk::HAS_FOCUS);
1076 bars_ebox.set_state (Gtk::STATE_NORMAL);
1079 beats_ebox.unset_flags (Gtk::HAS_FOCUS);
1080 beats_ebox.set_state (Gtk::STATE_NORMAL);
1083 ticks_ebox.unset_flags (Gtk::HAS_FOCUS);
1084 ticks_ebox.set_state (Gtk::STATE_NORMAL);
1088 Keyboard::magic_widget_drop_focus ();
1094 AudioClock::field_button_release_event (GdkEventButton *ev, Field field)
1097 gdk_pointer_ungrab (GDK_CURRENT_TIME);
1099 if (ev->y > drag_start_y+1 || ev->y < drag_start_y-1 || Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)){
1100 // we actually dragged so return without setting editing focus, or we shift clicked
1106 if (ops_menu == 0) {
1109 ops_menu->popup (1, ev->time);
1113 if (Keyboard::is_context_menu_event (ev)) {
1114 if (ops_menu == 0) {
1117 ops_menu->popup (1, ev->time);
1121 switch (ev->button) {
1125 hours_ebox.grab_focus();
1128 minutes_ebox.grab_focus();
1131 seconds_ebox.grab_focus();
1134 frames_ebox.grab_focus();
1138 audio_frames_ebox.grab_focus();
1142 ms_hours_ebox.grab_focus();
1145 ms_minutes_ebox.grab_focus();
1148 ms_seconds_ebox.grab_focus();
1152 bars_ebox.grab_focus ();
1155 beats_ebox.grab_focus ();
1158 ticks_ebox.grab_focus ();
1171 AudioClock::field_button_press_event (GdkEventButton *ev, Field field)
1173 if (session == 0) return false;
1175 nframes_t frames = 0;
1177 switch (ev->button) {
1179 if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
1181 ValueChanged (); /* EMIT_SIGNAL */
1184 /* make absolutely sure that the pointer is grabbed */
1185 gdk_pointer_grab(ev->window,false ,
1186 GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
1187 NULL,NULL,ev->time);
1190 drag_start_y = ev->y;
1195 if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
1197 ValueChanged (); /* EMIT_SIGNAL */
1202 /* used for context sensitive menu */
1215 AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
1221 nframes_t frames = 0;
1223 switch (ev->direction) {
1226 frames = get_frames (field);
1228 if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
1231 set (current_time() + frames, true);
1232 ValueChanged (); /* EMIT_SIGNAL */
1236 case GDK_SCROLL_DOWN:
1237 frames = get_frames (field);
1239 if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
1243 if ((double)current_time() - (double)frames < 0.0) {
1246 set (current_time() - frames, true);
1249 ValueChanged (); /* EMIT_SIGNAL */
1262 AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
1264 if (session == 0 || !dragging) {
1268 float pixel_frame_scale_factor = 0.2f;
1271 if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
1272 pixel_frame_scale_factor = 0.1f;
1276 if (Keyboard::modifier_state_contains (ev->state,
1277 Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
1279 pixel_frame_scale_factor = 0.025f;
1282 double y_delta = ev->y - drag_y;
1284 drag_accum += y_delta*pixel_frame_scale_factor;
1288 if (trunc(drag_accum) != 0) {
1293 dir = (drag_accum < 0 ? 1:-1);
1294 pos = current_time();
1295 frames = get_frames (field,pos,dir);
1297 if (frames != 0 && frames * drag_accum < current_time()) {
1299 set ((nframes_t) floor (pos - drag_accum * frames), false); // minus because up is negative in computer-land
1307 ValueChanged(); /* EMIT_SIGNAL */
1316 AudioClock::get_frames (Field field,nframes_t pos,int dir)
1319 nframes_t frames = 0;
1323 frames = (nframes_t) floor (3600.0 * session->frame_rate());
1326 frames = (nframes_t) floor (60.0 * session->frame_rate());
1329 frames = session->frame_rate();
1332 frames = (nframes_t) floor (session->frame_rate() / session->smpte_frames_per_second());
1340 frames = (nframes_t) floor (3600.0 * session->frame_rate());
1343 frames = (nframes_t) floor (60.0 * session->frame_rate());
1346 frames = session->frame_rate();
1353 frames = session->tempo_map().bbt_duration_at(pos,bbt,dir);
1359 frames = session->tempo_map().bbt_duration_at(pos,bbt,dir);
1365 frames = session->tempo_map().bbt_duration_at(pos,bbt,dir);
1373 AudioClock::current_time (nframes_t pos) const
1379 ret = smpte_frame_from_display ();
1382 ret = bbt_frame_from_display (pos);
1386 ret = minsec_frame_from_display ();
1390 ret = audio_frame_from_display ();
1401 AudioClock::current_duration (nframes_t pos) const
1407 ret = smpte_frame_from_display ();
1410 ret = bbt_frame_duration_from_display (pos);
1414 ret = minsec_frame_from_display ();
1418 ret = audio_frame_from_display ();
1429 AudioClock::smpte_sanitize_display()
1431 // Check SMPTE fields for sanity, possibly adjusting values
1432 if (atoi(minutes_label.get_text()) > 59) {
1433 minutes_label.set_text("59");
1436 if (atoi(seconds_label.get_text()) > 59) {
1437 seconds_label.set_text("59");
1440 switch ((long)rint(session->smpte_frames_per_second())) {
1442 if (atoi(frames_label.get_text()) > 23) {
1443 frames_label.set_text("23");
1447 if (atoi(frames_label.get_text()) > 24) {
1448 frames_label.set_text("24");
1452 if (atoi(frames_label.get_text()) > 29) {
1453 frames_label.set_text("29");
1460 if (session->smpte_drop_frames()) {
1461 if ((atoi(minutes_label.get_text()) % 10) && (atoi(seconds_label.get_text()) == 0) && (atoi(frames_label.get_text()) < 2)) {
1462 frames_label.set_text("02");
1468 AudioClock::smpte_frame_from_display () const
1477 smpte.hours = atoi (hours_label.get_text());
1478 smpte.minutes = atoi (minutes_label.get_text());
1479 smpte.seconds = atoi (seconds_label.get_text());
1480 smpte.frames = atoi (frames_label.get_text());
1481 smpte.rate = session->smpte_frames_per_second();
1482 smpte.drop= session->smpte_drop_frames();
1484 session->smpte_to_sample( smpte, sample, false /* use_offset */, false /* use_subframes */ );
1488 #define SMPTE_SAMPLE_TEST_1
1489 #define SMPTE_SAMPLE_TEST_2
1490 #define SMPTE_SAMPLE_TEST_3
1491 #define SMPTE_SAMPLE_TEST_4
1492 #define SMPTE_SAMPLE_TEST_5
1493 #define SMPTE_SAMPLE_TEST_6
1494 #define SMPTE_SAMPLE_TEST_7
1496 // Testcode for smpte<->sample conversions (P.S.)
1499 nframes_t oldsample = 0;
1501 nframes_t sample_increment;
1503 sample_increment = (long)rint(session->frame_rate() / session->smpte_frames_per_second);
1505 #ifdef SMPTE_SAMPLE_TEST_1
1506 // Test 1: use_offset = false, use_subframes = false
1507 cout << "use_offset = false, use_subframes = false" << endl;
1508 for (int i = 0; i < 108003; i++) {
1509 session->smpte_to_sample( smpte1, sample1, false /* use_offset */, false /* use_subframes */ );
1510 session->sample_to_smpte( sample1, smpte2, false /* use_offset */, false /* use_subframes */ );
1512 if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
1513 cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1514 cout << "smpte1: " << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1515 cout << "sample: " << sample1 << endl;
1516 cout << "sample: " << sample1 << " -> ";
1517 cout << "smpte2: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1521 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1522 cout << "ERROR: smpte2 not equal smpte1" << endl;
1523 cout << "smpte1: " << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1524 cout << "sample: " << sample1 << endl;
1525 cout << "sample: " << sample1 << " -> ";
1526 cout << "smpte2: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1529 oldsample = sample1;
1530 session->smpte_increment( smpte1 );
1533 cout << "sample_increment: " << sample_increment << endl;
1534 cout << "sample: " << sample1 << " -> ";
1535 cout << "smpte: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1538 #ifdef SMPTE_SAMPLE_TEST_2
1539 // Test 2: use_offset = true, use_subframes = false
1540 cout << "use_offset = true, use_subframes = false" << endl;
1546 smpte1.subframes = 0;
1547 sample1 = oldsample = 0;
1549 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
1550 cout << "Starting at sample: " << sample1 << " -> ";
1551 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1553 for (int i = 0; i < 108003; i++) {
1554 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
1555 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
1557 // cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1558 // cout << "sample: " << sample1 << endl;
1559 // cout << "sample: " << sample1 << " -> ";
1560 // cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1562 if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
1563 cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1564 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1565 cout << "sample: " << sample1 << endl;
1566 cout << "sample: " << sample1 << " -> ";
1567 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1571 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1572 cout << "ERROR: smpte2 not equal smpte1" << endl;
1573 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1574 cout << "sample: " << sample1 << endl;
1575 cout << "sample: " << sample1 << " -> ";
1576 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1579 oldsample = sample1;
1580 session->smpte_increment( smpte1 );
1583 cout << "sample_increment: " << sample_increment << endl;
1584 cout << "sample: " << sample1 << " -> ";
1585 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1588 #ifdef SMPTE_SAMPLE_TEST_3
1589 // Test 3: use_offset = true, use_subframes = false, decrement
1590 cout << "use_offset = true, use_subframes = false, decrement" << endl;
1592 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
1593 cout << "Starting at sample: " << sample1 << " -> ";
1594 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1596 for (int i = 0; i < 108003; i++) {
1597 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
1598 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
1600 // cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1601 // cout << "sample: " << sample1 << endl;
1602 // cout << "sample: " << sample1 << " -> ";
1603 // cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1605 if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
1606 cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
1607 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1608 cout << "sample: " << sample1 << endl;
1609 cout << "sample: " << sample1 << " -> ";
1610 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1614 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1615 cout << "ERROR: smpte2 not equal smpte1" << endl;
1616 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1617 cout << "sample: " << sample1 << endl;
1618 cout << "sample: " << sample1 << " -> ";
1619 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1622 oldsample = sample1;
1623 session->smpte_decrement( smpte1 );
1626 cout << "sample_decrement: " << sample_increment << endl;
1627 cout << "sample: " << sample1 << " -> ";
1628 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1632 #ifdef SMPTE_SAMPLE_TEST_4
1633 // Test 4: use_offset = true, use_subframes = true
1634 cout << "use_offset = true, use_subframes = true" << endl;
1636 for (long sub = 5; sub < 80; sub += 5) {
1641 smpte1.subframes = 0;
1642 sample1 = oldsample = (sample_increment * sub) / 80;
1644 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, true /* use_subframes */ );
1646 cout << "starting at sample: " << sample1 << " -> ";
1647 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1649 for (int i = 0; i < 108003; i++) {
1650 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
1651 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
1653 if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
1654 cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1655 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1656 cout << "sample: " << sample1 << endl;
1657 cout << "sample: " << sample1 << " -> ";
1658 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1662 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
1663 cout << "ERROR: smpte2 not equal smpte1" << endl;
1664 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1665 cout << "sample: " << sample1 << endl;
1666 cout << "sample: " << sample1 << " -> ";
1667 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1670 oldsample = sample1;
1671 session->smpte_increment( smpte1 );
1674 cout << "sample_increment: " << sample_increment << endl;
1675 cout << "sample: " << sample1 << " -> ";
1676 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1678 for (int i = 0; i < 108003; i++) {
1679 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
1680 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
1682 if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
1683 cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
1684 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1685 cout << "sample: " << sample1 << endl;
1686 cout << "sample: " << sample1 << " -> ";
1687 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1691 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
1692 cout << "ERROR: smpte2 not equal smpte1" << endl;
1693 cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1694 cout << "sample: " << sample1 << endl;
1695 cout << "sample: " << sample1 << " -> ";
1696 cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1699 oldsample = sample1;
1700 session->smpte_decrement( smpte1 );
1703 cout << "sample_decrement: " << sample_increment << endl;
1704 cout << "sample: " << sample1 << " -> ";
1705 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1710 #ifdef SMPTE_SAMPLE_TEST_5
1711 // Test 5: use_offset = true, use_subframes = false, increment seconds
1712 cout << "use_offset = true, use_subframes = false, increment seconds" << endl;
1718 smpte1.subframes = 0;
1719 sample1 = oldsample = 0;
1720 sample_increment = session->frame_rate();
1722 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
1723 cout << "Starting at sample: " << sample1 << " -> ";
1724 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1726 for (int i = 0; i < 3600; i++) {
1727 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
1728 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
1730 // cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1731 // cout << "sample: " << sample1 << endl;
1732 // cout << "sample: " << sample1 << " -> ";
1733 // cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1735 // if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
1737 // cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1741 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1742 cout << "ERROR: smpte2 not equal smpte1" << endl;
1743 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1744 cout << "sample: " << sample1 << endl;
1745 cout << "sample: " << sample1 << " -> ";
1746 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1749 oldsample = sample1;
1750 session->smpte_increment_seconds( smpte1 );
1753 cout << "sample_increment: " << sample_increment << endl;
1754 cout << "sample: " << sample1 << " -> ";
1755 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1759 #ifdef SMPTE_SAMPLE_TEST_6
1760 // Test 6: use_offset = true, use_subframes = false, increment minutes
1761 cout << "use_offset = true, use_subframes = false, increment minutes" << endl;
1767 smpte1.subframes = 0;
1768 sample1 = oldsample = 0;
1769 sample_increment = session->frame_rate() * 60;
1771 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
1772 cout << "Starting at sample: " << sample1 << " -> ";
1773 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1775 for (int i = 0; i < 60; i++) {
1776 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
1777 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
1779 // cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1780 // cout << "sample: " << sample1 << endl;
1781 // cout << "sample: " << sample1 << " -> ";
1782 // cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1784 // if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
1786 // cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1790 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1791 cout << "ERROR: smpte2 not equal smpte1" << endl;
1792 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1793 cout << "sample: " << sample1 << endl;
1794 cout << "sample: " << sample1 << " -> ";
1795 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1798 oldsample = sample1;
1799 session->smpte_increment_minutes( smpte1 );
1802 cout << "sample_increment: " << sample_increment << endl;
1803 cout << "sample: " << sample1 << " -> ";
1804 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1807 #ifdef SMPTE_SAMPLE_TEST_7
1808 // Test 7: use_offset = true, use_subframes = false, increment hours
1809 cout << "use_offset = true, use_subframes = false, increment hours" << endl;
1815 smpte1.subframes = 0;
1816 sample1 = oldsample = 0;
1817 sample_increment = session->frame_rate() * 60 * 60;
1819 session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
1820 cout << "Starting at sample: " << sample1 << " -> ";
1821 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
1823 for (int i = 0; i < 10; i++) {
1824 session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
1825 session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
1827 // cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1828 // cout << "sample: " << sample1 << endl;
1829 // cout << "sample: " << sample1 << " -> ";
1830 // cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1832 // if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
1834 // cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
1838 if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
1839 cout << "ERROR: smpte2 not equal smpte1" << endl;
1840 cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
1841 cout << "sample: " << sample1 << endl;
1842 cout << "sample: " << sample1 << " -> ";
1843 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1846 oldsample = sample1;
1847 session->smpte_increment_hours( smpte1 );
1850 cout << "sample_increment: " << sample_increment << endl;
1851 cout << "sample: " << sample1 << " -> ";
1852 cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
1861 AudioClock::minsec_frame_from_display () const
1867 int hrs = atoi (ms_hours_label.get_text());
1868 int mins = atoi (ms_minutes_label.get_text());
1869 float secs = atof (ms_seconds_label.get_text());
1871 nframes_t sr = session->frame_rate();
1873 return (nframes_t) floor ((hrs * 60.0f * 60.0f * sr) + (mins * 60.0f * sr) + (secs * sr));
1877 AudioClock::bbt_frame_from_display (nframes_t pos) const
1880 error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
1885 any.type = AnyTime::BBT;
1887 any.bbt.bars = atoi (bars_label.get_text());
1888 any.bbt.beats = atoi (beats_label.get_text());
1889 any.bbt.ticks = atoi (ticks_label.get_text());
1891 nframes_t ret = session->convert_to_frames_at (pos, any);
1898 AudioClock::bbt_frame_duration_from_display (nframes_t pos) const
1901 error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
1908 bbt.bars = atoi (bars_label.get_text());
1909 bbt.beats = atoi (beats_label.get_text());
1910 bbt.ticks = atoi (ticks_label.get_text());
1912 return session->tempo_map().bbt_duration_at(pos,bbt,1);
1916 AudioClock::audio_frame_from_display () const
1918 return (nframes_t) atoi (audio_frames_label.get_text());
1922 AudioClock::build_ops_menu ()
1924 using namespace Menu_Helpers;
1925 ops_menu = new Menu;
1926 MenuList& ops_items = ops_menu->items();
1927 ops_menu->set_name ("ArdourContextMenu");
1929 if (!Profile->get_sae()) {
1930 ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE)));
1932 ops_items.push_back (MenuElem (_("Bars:Beats"), bind (mem_fun(*this, &AudioClock::set_mode), BBT)));
1933 ops_items.push_back (MenuElem (_("Minutes:Seconds"), bind (mem_fun(*this, &AudioClock::set_mode), MinSec)));
1934 ops_items.push_back (MenuElem (_("Samples"), bind (mem_fun(*this, &AudioClock::set_mode), Frames)));
1935 ops_items.push_back (MenuElem (_("Off"), bind (mem_fun(*this, &AudioClock::set_mode), Off)));
1939 AudioClock::set_mode (Mode m)
1941 /* slightly tricky: this is called from within the ARDOUR_UI
1942 constructor by some of its clock members. at that time
1943 the instance pointer is unset, so we have to be careful.
1944 the main idea is to drop keyboard focus in case we had
1945 started editing the clock and then we switch clock mode.
1948 clock_base.grab_focus ();
1954 clock_base.remove ();
1960 clock_base.add (smpte_packer_hbox);
1964 clock_base.add (bbt_packer_hbox);
1968 clock_base.add (minsec_packer_hbox);
1972 clock_base.add (frames_packer_hbox);
1976 clock_base.add (off_hbox);
1980 set_size_requests ();
1982 set (last_when, true);
1983 clock_base.show_all ();
1984 key_entry_state = 0;
1986 if (!is_transient) {
1987 ModeChanged (); /* EMIT SIGNAL */
1992 AudioClock::set_size_requests ()
1994 /* note that in some fonts, "88" is narrower than "00", hence the 2 pixel padding */
1998 Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-00", 5, 5);
1999 Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "00", 5, 5);
2000 Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "00", 5, 5);
2001 Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "00", 5, 5);
2005 Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-000", 5, 5);
2006 Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "00", 5, 5);
2007 Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "0000", 5, 5);
2011 Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "00", 5, 5);
2012 Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "00", 5, 5);
2013 Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "00.000", 5, 5);
2017 Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "0000000000", 5, 5);
2021 Gtkmm2ext::set_size_request_to_display_given_text (off_hbox, "00000", 5, 5);
2028 AudioClock::set_bbt_reference (nframes64_t pos)
2030 bbt_reference_time = pos;