diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-16 13:57:51 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-16 13:57:51 +0000 |
commit | cd44c8241c868b47c11ea8a669e5c37484fee25f (patch) | |
tree | 44fe6243c3e04fdfe983cb9a449bc4a09782888e /gtk2_ardour/ardour_ui.cc | |
parent | 5f61efff8f4d80c9576fb8524f37cb8905ba51a8 (diff) |
add GotoWallClock command; switch Editor class to use nframes64_t throughout; fix up some glitches in playhead/screen handling when locating ; never save keybindings to user's ~/.ardour2 dir unless the user changed them (well, nearly)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3361 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 29 |
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) { |