Merged with trunk revision 600
[ardour.git] / libs / ardour / session_time.cc
index 453f5d6d27452853a18c4d3b27d9e8c175dd8c54..d597860a5e799e9f53779b8d4e67cbff876bb571 100644 (file)
@@ -32,6 +32,7 @@
 #include <ardour/audioengine.h>
 #include <ardour/session.h>
 #include <ardour/tempo.h>
+#include <ardour/audiofilesource.h>
 
 #include "i18n.h"
 
@@ -95,6 +96,9 @@ Session::set_smpte_offset (jack_nframes_t off)
 {
        _smpte_offset = off;
        last_smpte_valid = false;
+
+       AudioFileSource::set_header_position_offset (_smpte_offset, _smpte_offset_negative);
+
        SMPTEOffsetChanged (); /* EMIT SIGNAL */
 }
 
@@ -103,6 +107,9 @@ Session::set_smpte_offset_negative (bool neg)
 {
        _smpte_offset_negative = neg;
        last_smpte_valid = false;
+
+       AudioFileSource::set_header_position_offset (_smpte_offset, _smpte_offset_negative);
+
        SMPTEOffsetChanged (); /* EMIT SIGNAL */
 }
 
@@ -194,7 +201,7 @@ void
 Session::sample_to_smpte( jack_nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes ) const
 {
        jack_nframes_t offset_sample;
-  
+
        if (!use_offset) {
                offset_sample = sample;
                smpte.negative = false;
@@ -326,7 +333,7 @@ Session::smpte_duration_string (char* buf, jack_nframes_t when) const
        SMPTE::Time smpte;
 
        smpte_duration (when, smpte);
-       snprintf (buf, sizeof (buf), "%02ld:%02ld:%02ld:%02ld", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+       snprintf (buf, sizeof (buf), "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
 }
 
 void