mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
Remove unused timecode offset stuff.
git-svn-id: svn://localhost/ardour2/branches/3.0@8143 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
93d65777b8
commit
f500846fd4
14 changed files with 36 additions and 159 deletions
|
|
@ -216,8 +216,6 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string&
|
||||||
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
|
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
|
||||||
clock_base.signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours));
|
clock_base.signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours));
|
||||||
|
|
||||||
Session::TimecodeOffsetChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::timecode_offset_changed, this), gui_context());
|
|
||||||
|
|
||||||
if (editable) {
|
if (editable) {
|
||||||
setup_events ();
|
setup_events ();
|
||||||
}
|
}
|
||||||
|
|
@ -474,25 +472,6 @@ AudioClock::set (nframes_t when, bool force, nframes_t offset, char which)
|
||||||
last_when = when;
|
last_when = when;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
AudioClock::timecode_offset_changed ()
|
|
||||||
{
|
|
||||||
nframes_t current;
|
|
||||||
|
|
||||||
switch (_mode) {
|
|
||||||
case Timecode:
|
|
||||||
if (is_duration) {
|
|
||||||
current = current_duration();
|
|
||||||
} else {
|
|
||||||
current = current_time ();
|
|
||||||
}
|
|
||||||
set (current, true);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_frames (nframes_t when, bool /*force*/)
|
AudioClock::set_frames (nframes_t when, bool /*force*/)
|
||||||
{
|
{
|
||||||
|
|
@ -1503,7 +1482,7 @@ AudioClock::timecode_frame_from_display () const
|
||||||
timecode.rate = _session->timecode_frames_per_second();
|
timecode.rate = _session->timecode_frames_per_second();
|
||||||
timecode.drop= _session->timecode_drop_frames();
|
timecode.drop= _session->timecode_drop_frames();
|
||||||
|
|
||||||
_session->timecode_to_sample( timecode, sample, false /* use_offset */, false /* use_subframes */ );
|
_session->timecode_to_sample (timecode, sample, false /* use_subframes */);
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,6 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||||
void build_ops_menu ();
|
void build_ops_menu ();
|
||||||
void setup_events ();
|
void setup_events ();
|
||||||
|
|
||||||
void timecode_offset_changed ();
|
|
||||||
void set_size_requests ();
|
void set_size_requests ();
|
||||||
|
|
||||||
static const uint32_t field_length[(int)AudioFrames+1];
|
static const uint32_t field_length[(int)AudioFrames+1];
|
||||||
|
|
|
||||||
|
|
@ -1090,7 +1090,6 @@ Editor::set_session (Session *t)
|
||||||
_session->PositionChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::map_position_change, this, _1), gui_context());
|
_session->PositionChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::map_position_change, this, _1), gui_context());
|
||||||
_session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Editor::handle_new_route, this, _1), gui_context());
|
_session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Editor::handle_new_route, this, _1), gui_context());
|
||||||
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_title, this), gui_context());
|
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_title, this), gui_context());
|
||||||
_session->TimecodeOffsetChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_just_timecode, this), gui_context());
|
|
||||||
_session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::tempo_map_changed, this, _1), gui_context());
|
_session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::tempo_map_changed, this, _1), gui_context());
|
||||||
_session->Located.connect (_session_connections, invalidator (*this), boost::bind (&Editor::located, this), gui_context());
|
_session->Located.connect (_session_connections, invalidator (*this), boost::bind (&Editor::located, this), gui_context());
|
||||||
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::parameter_changed, this, _1), gui_context());
|
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::parameter_changed, this, _1), gui_context());
|
||||||
|
|
@ -2429,44 +2428,19 @@ Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /*
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SnapToTimecodeSeconds:
|
case SnapToTimecodeSeconds:
|
||||||
if (_session->timecode_offset_negative())
|
|
||||||
{
|
|
||||||
start += _session->timecode_offset ();
|
|
||||||
} else {
|
|
||||||
start -= _session->timecode_offset ();
|
|
||||||
}
|
|
||||||
if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) {
|
if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) {
|
||||||
start = (framepos_t) ceil ((double) start / one_timecode_second) * one_timecode_second;
|
start = (framepos_t) ceil ((double) start / one_timecode_second) * one_timecode_second;
|
||||||
} else {
|
} else {
|
||||||
start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second;
|
start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_session->timecode_offset_negative())
|
|
||||||
{
|
|
||||||
start -= _session->timecode_offset ();
|
|
||||||
} else {
|
|
||||||
start += _session->timecode_offset ();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SnapToTimecodeMinutes:
|
case SnapToTimecodeMinutes:
|
||||||
if (_session->timecode_offset_negative())
|
|
||||||
{
|
|
||||||
start += _session->timecode_offset ();
|
|
||||||
} else {
|
|
||||||
start -= _session->timecode_offset ();
|
|
||||||
}
|
|
||||||
if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) {
|
if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) {
|
||||||
start = (framepos_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute;
|
start = (framepos_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute;
|
||||||
} else {
|
} else {
|
||||||
start = (framepos_t) floor ((double) start / one_timecode_minute) * one_timecode_minute;
|
start = (framepos_t) floor ((double) start / one_timecode_minute) * one_timecode_minute;
|
||||||
}
|
}
|
||||||
if (_session->timecode_offset_negative())
|
|
||||||
{
|
|
||||||
start -= _session->timecode_offset ();
|
|
||||||
} else {
|
|
||||||
start += _session->timecode_offset ();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg;
|
fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg;
|
||||||
|
|
|
||||||
|
|
@ -1009,10 +1009,10 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
|
||||||
case timecode_show_bits:
|
case timecode_show_bits:
|
||||||
|
|
||||||
// Find timecode time of this sample (pos) with subframe accuracy
|
// Find timecode time of this sample (pos) with subframe accuracy
|
||||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, true /* use_subframes */ );
|
_session->sample_to_timecode (pos, timecode, true /* use_subframes */);
|
||||||
|
|
||||||
for (n = 0; n < timecode_nmarks; n++) {
|
for (n = 0; n < timecode_nmarks; n++) {
|
||||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, true /* use_subframes */ );
|
_session->timecode_to_sample (timecode, pos, true /* use_subframes */);
|
||||||
if ((timecode.subframes % timecode_mark_modulo) == 0) {
|
if ((timecode.subframes % timecode_mark_modulo) == 0) {
|
||||||
if (timecode.subframes == 0) {
|
if (timecode.subframes == 0) {
|
||||||
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
||||||
|
|
@ -1035,12 +1035,12 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
|
||||||
break;
|
break;
|
||||||
case timecode_show_seconds:
|
case timecode_show_seconds:
|
||||||
// Find timecode time of this sample (pos)
|
// Find timecode time of this sample (pos)
|
||||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
_session->sample_to_timecode (pos, timecode, false /* use_subframes */);
|
||||||
// Go to next whole second down
|
// Go to next whole second down
|
||||||
Timecode::seconds_floor( timecode );
|
Timecode::seconds_floor( timecode );
|
||||||
|
|
||||||
for (n = 0; n < timecode_nmarks; n++) {
|
for (n = 0; n < timecode_nmarks; n++) {
|
||||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
_session->timecode_to_sample (timecode, pos, false /* use_subframes */);
|
||||||
if ((timecode.seconds % timecode_mark_modulo) == 0) {
|
if ((timecode.seconds % timecode_mark_modulo) == 0) {
|
||||||
if (timecode.seconds == 0) {
|
if (timecode.seconds == 0) {
|
||||||
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
||||||
|
|
@ -1062,12 +1062,12 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
|
||||||
break;
|
break;
|
||||||
case timecode_show_minutes:
|
case timecode_show_minutes:
|
||||||
// Find timecode time of this sample (pos)
|
// Find timecode time of this sample (pos)
|
||||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
_session->sample_to_timecode (pos, timecode, false /* use_subframes */);
|
||||||
// Go to next whole minute down
|
// Go to next whole minute down
|
||||||
Timecode::minutes_floor( timecode );
|
Timecode::minutes_floor( timecode );
|
||||||
|
|
||||||
for (n = 0; n < timecode_nmarks; n++) {
|
for (n = 0; n < timecode_nmarks; n++) {
|
||||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
_session->timecode_to_sample (timecode, pos, false /* use_subframes */);
|
||||||
if ((timecode.minutes % timecode_mark_modulo) == 0) {
|
if ((timecode.minutes % timecode_mark_modulo) == 0) {
|
||||||
if (timecode.minutes == 0) {
|
if (timecode.minutes == 0) {
|
||||||
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
||||||
|
|
@ -1088,12 +1088,12 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
|
||||||
break;
|
break;
|
||||||
case timecode_show_hours:
|
case timecode_show_hours:
|
||||||
// Find timecode time of this sample (pos)
|
// Find timecode time of this sample (pos)
|
||||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
_session->sample_to_timecode (pos, timecode, false /* use_subframes */);
|
||||||
// Go to next whole hour down
|
// Go to next whole hour down
|
||||||
Timecode::hours_floor( timecode );
|
Timecode::hours_floor( timecode );
|
||||||
|
|
||||||
for (n = 0; n < timecode_nmarks; n++) {
|
for (n = 0; n < timecode_nmarks; n++) {
|
||||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
_session->timecode_to_sample (timecode, pos, false /* use_subframes */);
|
||||||
if ((timecode.hours % timecode_mark_modulo) == 0) {
|
if ((timecode.hours % timecode_mark_modulo) == 0) {
|
||||||
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
||||||
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
||||||
|
|
@ -1110,12 +1110,12 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
|
||||||
break;
|
break;
|
||||||
case timecode_show_frames:
|
case timecode_show_frames:
|
||||||
// Find timecode time of this sample (pos)
|
// Find timecode time of this sample (pos)
|
||||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
_session->sample_to_timecode (pos, timecode, false /* use_subframes */);
|
||||||
// Go to next whole frame down
|
// Go to next whole frame down
|
||||||
Timecode::frames_floor( timecode );
|
Timecode::frames_floor( timecode );
|
||||||
|
|
||||||
for (n = 0; n < timecode_nmarks; n++) {
|
for (n = 0; n < timecode_nmarks; n++) {
|
||||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
_session->timecode_to_sample (timecode, pos, false /* use_subframes */);
|
||||||
if ((timecode.frames % timecode_mark_modulo) == 0) {
|
if ((timecode.frames % timecode_mark_modulo) == 0) {
|
||||||
if (timecode.frames == 0) {
|
if (timecode.frames == 0) {
|
||||||
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
(*marks)[n].style = GtkCustomRulerMarkMajor;
|
||||||
|
|
|
||||||
|
|
@ -450,8 +450,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
void sync_time_vars();
|
void sync_time_vars();
|
||||||
|
|
||||||
void bbt_time (nframes_t when, BBT_Time&);
|
void bbt_time (nframes_t when, BBT_Time&);
|
||||||
void timecode_to_sample(Timecode::Time& timecode, framepos_t& sample, bool use_offset, bool use_subframes) const;
|
void timecode_to_sample (Timecode::Time& timecode, framepos_t& sample, bool use_subframes) const;
|
||||||
void sample_to_timecode(framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
|
void sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_subframes) const;
|
||||||
void timecode_time (Timecode::Time &);
|
void timecode_time (Timecode::Time &);
|
||||||
void timecode_time (nframes_t when, Timecode::Time&);
|
void timecode_time (nframes_t when, Timecode::Time&);
|
||||||
void timecode_time_subframes (nframes_t when, Timecode::Time&);
|
void timecode_time_subframes (nframes_t when, Timecode::Time&);
|
||||||
|
|
@ -459,16 +459,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
void timecode_duration (framecnt_t, Timecode::Time&) const;
|
void timecode_duration (framecnt_t, Timecode::Time&) const;
|
||||||
void timecode_duration_string (char *, framecnt_t) const;
|
void timecode_duration_string (char *, framecnt_t) const;
|
||||||
|
|
||||||
void set_timecode_offset (nframes_t);
|
|
||||||
nframes_t timecode_offset () const { return _timecode_offset; }
|
|
||||||
void set_timecode_offset_negative (bool);
|
|
||||||
bool timecode_offset_negative () const { return _timecode_offset_negative; }
|
|
||||||
|
|
||||||
nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
|
nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
|
||||||
|
|
||||||
static PBD::Signal1<void, framepos_t> StartTimeChanged;
|
static PBD::Signal1<void, framepos_t> StartTimeChanged;
|
||||||
static PBD::Signal1<void, framepos_t> EndTimeChanged;
|
static PBD::Signal1<void, framepos_t> EndTimeChanged;
|
||||||
static PBD::Signal0<void> TimecodeOffsetChanged;
|
|
||||||
|
|
||||||
std::vector<SyncSource> get_available_sync_options() const;
|
std::vector<SyncSource> get_available_sync_options() const;
|
||||||
void request_sync_source (Slave*);
|
void request_sync_source (Slave*);
|
||||||
|
|
@ -1142,8 +1136,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
|
double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
|
||||||
nframes_t _frames_per_hour;
|
nframes_t _frames_per_hour;
|
||||||
nframes_t _timecode_frames_per_hour;
|
nframes_t _timecode_frames_per_hour;
|
||||||
nframes_t _timecode_offset;
|
|
||||||
bool _timecode_offset_negative;
|
|
||||||
|
|
||||||
/* cache the most-recently requested time conversions. This helps when we
|
/* cache the most-recently requested time conversions. This helps when we
|
||||||
* have multiple clocks showing the same time (e.g. the transport frame) */
|
* have multiple clocks showing the same time (e.g. the transport frame) */
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,8 @@ AudioRegionImporter::get_info () const
|
||||||
iss_position >> position;
|
iss_position >> position;
|
||||||
|
|
||||||
// Convert to timecode
|
// Convert to timecode
|
||||||
session.sample_to_timecode(length, length_time, true, false);
|
session.sample_to_timecode(length, length_time, false);
|
||||||
session.sample_to_timecode(position, position_time, true, false);
|
session.sample_to_timecode(position, position_time, false);
|
||||||
|
|
||||||
// return info
|
// return info
|
||||||
oss << _("Length: ") <<
|
oss << _("Length: ") <<
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,8 @@ LocationImporter::get_info () const
|
||||||
iss_end >> end;
|
iss_end >> end;
|
||||||
|
|
||||||
// Convert to timecode
|
// Convert to timecode
|
||||||
session.sample_to_timecode (start, start_time, true, false);
|
session.sample_to_timecode (start, start_time, false);
|
||||||
session.sample_to_timecode (end, end_time, true, false);
|
session.sample_to_timecode (end, end_time, false);
|
||||||
|
|
||||||
// return info
|
// return info
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now)
|
||||||
|
|
||||||
if (was_full || outside_window (mtc_frame)) {
|
if (was_full || outside_window (mtc_frame)) {
|
||||||
|
|
||||||
session.timecode_to_sample (timecode, mtc_frame, true, false);
|
session.timecode_to_sample (timecode, mtc_frame, false);
|
||||||
session.request_locate (mtc_frame, false);
|
session.request_locate (mtc_frame, false);
|
||||||
session.request_transport_speed (0);
|
session.request_transport_speed (0);
|
||||||
update_mtc_status (MIDI::MTC_Stopped);
|
update_mtc_status (MIDI::MTC_Stopped);
|
||||||
|
|
@ -204,7 +204,7 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now)
|
||||||
consideration.
|
consideration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
session.timecode_to_sample (timecode, mtc_frame, true, false);
|
session.timecode_to_sample (timecode, mtc_frame, false);
|
||||||
|
|
||||||
/* We received the last quarter frame 7 quarter frames (1.75 mtc
|
/* We received the last quarter frame 7 quarter frames (1.75 mtc
|
||||||
frames) after the instance when the contents of the mtc quarter
|
frames) after the instance when the contents of the mtc quarter
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ PBD::Signal2<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
|
||||||
PBD::Signal0<void> Session::SendFeedback;
|
PBD::Signal0<void> Session::SendFeedback;
|
||||||
PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
|
PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
|
||||||
|
|
||||||
PBD::Signal0<void> Session::TimecodeOffsetChanged;
|
|
||||||
PBD::Signal1<void, framepos_t> Session::StartTimeChanged;
|
PBD::Signal1<void, framepos_t> Session::StartTimeChanged;
|
||||||
PBD::Signal1<void, framepos_t> Session::EndTimeChanged;
|
PBD::Signal1<void, framepos_t> Session::EndTimeChanged;
|
||||||
PBD::Signal0<void> Session::AutoBindingOn;
|
PBD::Signal0<void> Session::AutoBindingOn;
|
||||||
|
|
|
||||||
|
|
@ -280,8 +280,7 @@ Session::mmc_locate (MIDI::MachineControl &/*mmc*/, const MIDI::byte* mmc_tc)
|
||||||
timecode.rate = timecode_frames_per_second();
|
timecode.rate = timecode_frames_per_second();
|
||||||
timecode.drop = timecode_drop_frames();
|
timecode.drop = timecode_drop_frames();
|
||||||
|
|
||||||
// Also takes timecode offset into account:
|
timecode_to_sample (timecode, target_frame, false /* use_subframes */);
|
||||||
timecode_to_sample( timecode, target_frame, true /* use_offset */, false /* use_subframes */ );
|
|
||||||
|
|
||||||
if (target_frame > max_framepos) {
|
if (target_frame > max_framepos) {
|
||||||
target_frame = max_framepos;
|
target_frame = max_framepos;
|
||||||
|
|
@ -364,7 +363,7 @@ Session::send_full_time_code (framepos_t const t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get timecode time for the given time
|
// Get timecode time for the given time
|
||||||
sample_to_timecode (t, timecode, true /* use_offset */, false /* no subframes */);
|
sample_to_timecode (t, timecode, false /* no subframes */);
|
||||||
|
|
||||||
transmitting_timecode_time = timecode;
|
transmitting_timecode_time = timecode;
|
||||||
outbound_mtc_timecode_frame = t;
|
outbound_mtc_timecode_frame = t;
|
||||||
|
|
|
||||||
|
|
@ -249,8 +249,6 @@ Session::first_stage_init (string fullpath, string snapshot_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
last_timecode_when = 0;
|
last_timecode_when = 0;
|
||||||
_timecode_offset = 0;
|
|
||||||
_timecode_offset_negative = true;
|
|
||||||
last_timecode_valid = false;
|
last_timecode_valid = false;
|
||||||
|
|
||||||
sync_time_vars ();
|
sync_time_vars ();
|
||||||
|
|
|
||||||
|
|
@ -187,27 +187,8 @@ Session::sync_time_vars ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::set_timecode_offset (nframes_t off)
|
Session::timecode_to_sample (Timecode::Time& timecode, framepos_t& sample, bool use_subframes) const
|
||||||
{
|
{
|
||||||
_timecode_offset = off;
|
|
||||||
last_timecode_valid = false;
|
|
||||||
|
|
||||||
TimecodeOffsetChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Session::set_timecode_offset_negative (bool neg)
|
|
||||||
{
|
|
||||||
_timecode_offset_negative = neg;
|
|
||||||
last_timecode_valid = false;
|
|
||||||
|
|
||||||
TimecodeOffsetChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool use_offset, bool use_subframes ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
if (timecode.drop) {
|
if (timecode.drop) {
|
||||||
// The drop frame format was created to better approximate the 30000/1001 = 29.97002997002997....
|
// The drop frame format was created to better approximate the 30000/1001 = 29.97002997002997....
|
||||||
// framerate of NTSC color TV. The used frame rate of drop frame is 29.97, which drifts by about
|
// framerate of NTSC color TV. The used frame rate of drop frame is 29.97, which drifts by about
|
||||||
|
|
@ -271,53 +252,16 @@ Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool
|
||||||
if (use_subframes) {
|
if (use_subframes) {
|
||||||
sample += (int32_t) (((double)timecode.subframes * _frames_per_timecode_frame) / config.get_subframes_per_frame());
|
sample += (int32_t) (((double)timecode.subframes * _frames_per_timecode_frame) / config.get_subframes_per_frame());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_offset) {
|
|
||||||
if (timecode_offset_negative()) {
|
|
||||||
if (sample >= timecode_offset()) {
|
|
||||||
sample -= timecode_offset();
|
|
||||||
} else {
|
|
||||||
/* Prevent song-time from becoming negative */
|
|
||||||
sample = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (timecode.negative) {
|
|
||||||
if (sample <= timecode_offset()) {
|
|
||||||
sample = timecode_offset() - sample;
|
|
||||||
} else {
|
|
||||||
sample = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sample += timecode_offset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes ) const
|
Session::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_subframes) const
|
||||||
{
|
{
|
||||||
framepos_t offset_sample;
|
framepos_t offset_sample;
|
||||||
|
|
||||||
if (!use_offset) {
|
offset_sample = sample;
|
||||||
offset_sample = sample;
|
timecode.negative = false;
|
||||||
timecode.negative = false;
|
|
||||||
} else {
|
|
||||||
if (_timecode_offset_negative) {
|
|
||||||
offset_sample = sample + _timecode_offset;
|
|
||||||
timecode.negative = false;
|
|
||||||
} else {
|
|
||||||
if (sample < _timecode_offset) {
|
|
||||||
offset_sample = (_timecode_offset - sample);
|
|
||||||
timecode.negative = true;
|
|
||||||
} else {
|
|
||||||
offset_sample = sample - _timecode_offset;
|
|
||||||
timecode.negative = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double timecode_frames_left_exact;
|
double timecode_frames_left_exact;
|
||||||
double timecode_frames_fraction;
|
double timecode_frames_fraction;
|
||||||
|
|
@ -401,7 +345,7 @@ Session::timecode_time (nframes_t when, Timecode::Time& timecode)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sample_to_timecode( when, timecode, true /* use_offset */, false /* use_subframes */ );
|
sample_to_timecode (when, timecode, false /* use_subframes */);
|
||||||
|
|
||||||
last_timecode_when = when;
|
last_timecode_when = when;
|
||||||
last_timecode = timecode;
|
last_timecode = timecode;
|
||||||
|
|
@ -416,7 +360,7 @@ Session::timecode_time_subframes (nframes_t when, Timecode::Time& timecode)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sample_to_timecode( when, timecode, true /* use_offset */, true /* use_subframes */ );
|
sample_to_timecode (when, timecode, true /* use_subframes */);
|
||||||
|
|
||||||
last_timecode_when = when;
|
last_timecode_when = when;
|
||||||
last_timecode = timecode;
|
last_timecode = timecode;
|
||||||
|
|
@ -426,7 +370,7 @@ Session::timecode_time_subframes (nframes_t when, Timecode::Time& timecode)
|
||||||
void
|
void
|
||||||
Session::timecode_duration (framecnt_t when, Timecode::Time& timecode) const
|
Session::timecode_duration (framecnt_t when, Timecode::Time& timecode) const
|
||||||
{
|
{
|
||||||
sample_to_timecode( when, timecode, false /* use_offset */, true /* use_subframes */ );
|
sample_to_timecode (when, timecode, true /* use_subframes */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -527,7 +471,7 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/,
|
||||||
#if 0
|
#if 0
|
||||||
/* Timecode info */
|
/* Timecode info */
|
||||||
|
|
||||||
pos->timecode_offset = _timecode_offset;
|
pos->timecode_offset = 0;
|
||||||
t.timecode_frame_rate = timecode_frames_per_second();
|
t.timecode_frame_rate = timecode_frames_per_second();
|
||||||
pos->valid = jack_position_bits_t (pos->valid | JackPositionTimecode;
|
pos->valid = jack_position_bits_t (pos->valid | JackPositionTimecode;
|
||||||
|
|
||||||
|
|
@ -580,14 +524,7 @@ Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
|
||||||
secs += any.timecode.minutes * 60;
|
secs += any.timecode.minutes * 60;
|
||||||
secs += any.timecode.seconds;
|
secs += any.timecode.seconds;
|
||||||
secs += any.timecode.frames / timecode_frames_per_second();
|
secs += any.timecode.frames / timecode_frames_per_second();
|
||||||
if (_timecode_offset_negative)
|
return (nframes_t) floor (secs * frame_rate());
|
||||||
{
|
|
||||||
return (nframes_t) floor (secs * frame_rate()) - _timecode_offset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (nframes_t) floor (secs * frame_rate()) + _timecode_offset;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AnyTime::Seconds:
|
case AnyTime::Seconds:
|
||||||
|
|
|
||||||
|
|
@ -285,15 +285,15 @@ BasicUI::timecode_time (nframes_t where, Timecode::Time& timecode)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicUI::timecode_to_sample (Timecode::Time& timecode, int64_t& sample, bool use_offset, bool use_subframes) const
|
BasicUI::timecode_to_sample (Timecode::Time& timecode, int64_t& sample, bool use_subframes) const
|
||||||
{
|
{
|
||||||
session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes);
|
session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_subframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicUI::sample_to_timecode (int64_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
|
BasicUI::sample_to_timecode (int64_t sample, Timecode::Time& timecode, bool use_subframes) const
|
||||||
{
|
{
|
||||||
session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
|
session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_subframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,8 @@ class BasicUI {
|
||||||
jack_nframes_t timecode_frames_per_hour ();
|
jack_nframes_t timecode_frames_per_hour ();
|
||||||
|
|
||||||
void timecode_time (jack_nframes_t where, Timecode::Time&);
|
void timecode_time (jack_nframes_t where, Timecode::Time&);
|
||||||
void timecode_to_sample (Timecode::Time& timecode, int64_t& sample, bool use_offset, bool use_subframes) const;
|
void timecode_to_sample (Timecode::Time& timecode, int64_t& sample, bool use_subframes) const;
|
||||||
void sample_to_timecode (int64_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
|
void sample_to_timecode (int64_t sample, Timecode::Time& timecode, bool use_subframes) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BasicUI ();
|
BasicUI ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue