summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 16dd93f771..a5e1f0b46a 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
+#include <time.h>
#include <cerrno>
#include <fstream>
@@ -1305,6 +1306,34 @@ ARDOUR_UI::transport_goto_zero ()
}
void
+ARDOUR_UI::transport_goto_wallclock ()
+{
+ if (session && editor) {
+
+ time_t now;
+ struct tm tmnow;
+ nframes64_t frames;
+
+ time (&now);
+ localtime_r (&now, &tmnow);
+
+ frames = tmnow.tm_hour * (60 * 60 * session->frame_rate());
+ frames += tmnow.tm_min * (60 * session->frame_rate());
+ frames += tmnow.tm_sec * session->frame_rate();
+
+ session->request_locate (frames);
+
+ /* force displayed area in editor to start no matter
+ what "follow playhead" setting is.
+ */
+
+ if (editor) {
+ editor->reset_x_origin (frames - (editor->current_page_frames()/2));
+ }
+ }
+}
+
+void
ARDOUR_UI::transport_goto_end ()
{
if (session) {