X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Fsession_time.cc;h=32a94adee106c4d3e5da729953e453a382a4a25d;hb=498afeb63edeb8a5ce0103296ffda4216d64186d;hp=281c3a3315c75bb2d9470c985d4a44fe2d6f1031;hpb=959a7909c1adca430a63f783fd16687242a7be3d;p=ardour.git diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index 281c3a3315..32a94adee1 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -22,20 +22,21 @@ #include #include -#include +#include "ardour/timestamps.h" -#include -#include -#include +#include "pbd/error.h" +#include "pbd/enumwriter.h" +#include "pbd/stacktrace.h" -#include -#include -#include -#include -#include +#include "ardour/ardour.h" +#include "ardour/configuration.h" +#include "ardour/audioengine.h" +#include "ardour/session.h" +#include "ardour/tempo.h" #include "i18n.h" +using namespace std; using namespace ARDOUR; using namespace PBD; @@ -51,7 +52,7 @@ Session::bbt_time (nframes_t when, BBT_Time& bbt) float Session::smpte_frames_per_second() const { - switch (Config->get_smpte_format()) { + switch (config.get_smpte_format()) { case smpte_23976: return 23.976; @@ -100,7 +101,7 @@ Session::smpte_frames_per_second() const bool Session::smpte_drop_frames() const { - switch (Config->get_smpte_format()) { + switch (config.get_smpte_format()) { case smpte_23976: return false; @@ -149,7 +150,7 @@ Session::smpte_drop_frames() const void Session::sync_time_vars () { - _current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (Config->get_video_pullup()/100.0))); + _current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0))); _frames_per_smpte_frame = (double) _current_frame_rate / (double) smpte_frames_per_second(); if (smpte_drop_frames()) { _frames_per_hour = (long)(107892 * _frames_per_smpte_frame); @@ -158,14 +159,6 @@ Session::sync_time_vars () } _smpte_frames_per_hour = (nframes_t)rint(smpte_frames_per_second() * 3600.0); -} - -int -Session::set_smpte_format (SmpteFormat format) -{ - - Config->set_smpte_format (format); - last_smpte_valid = false; // smpte type bits are the middle two in the upper nibble switch ((int) ceil (smpte_frames_per_second())) { @@ -186,8 +179,6 @@ Session::set_smpte_format (SmpteFormat format) } break; }; - - return 0; } void @@ -273,7 +264,7 @@ Session::smpte_to_sample( SMPTE::Time& smpte, nframes_t& sample, bool use_offset } if (use_subframes) { - sample += (long) (((double)smpte.subframes * _frames_per_smpte_frame) / Config->get_subframes_per_frame()); + sample += (long) (((double)smpte.subframes * _frames_per_smpte_frame) / config.get_subframes_per_frame()); } if (use_offset) { @@ -335,10 +326,10 @@ Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset, // Calculate exact number of (exceeding) smpte frames and fractional frames smpte_frames_left_exact = (double) offset_sample / _frames_per_smpte_frame; smpte_frames_fraction = smpte_frames_left_exact - floor( smpte_frames_left_exact ); - smpte.subframes = (long) rint(smpte_frames_fraction * Config->get_subframes_per_frame()); + smpte.subframes = (long) rint(smpte_frames_fraction * config.get_subframes_per_frame()); // XXX Not sure if this is necessary anymore... - if (smpte.subframes == Config->get_subframes_per_frame()) { + if (smpte.subframes == config.get_subframes_per_frame()) { // This can happen with 24 fps (and 29.97 fps ?) smpte_frames_left_exact = ceil( smpte_frames_left_exact ); smpte.subframes = 0; @@ -570,7 +561,7 @@ Session::jack_timebase_callback (jack_transport_state_t state, } ARDOUR::nframes_t -Session::convert_to_frames_at (nframes_t position, AnyTime& any) +Session::convert_to_frames_at (nframes_t position, AnyTime const & any) { double secs;