From 94c69b3c915c3fa8f8029e514240bca5bdb90def Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Sat, 18 Dec 2010 19:27:04 +0000 Subject: Finally implement position aware silence adding in export (i.e. bbt times are converted to frames correctly) This will work when Session::convert_to_frames_at is fixed :) git-svn-id: svn://localhost/ardour2/branches/3.0@8295 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/export_format_specification.cc | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'libs/ardour/export_format_specification.cc') diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc index c5e63733c8..b85d060e2f 100644 --- a/libs/ardour/export_format_specification.cc +++ b/libs/ardour/export_format_specification.cc @@ -42,25 +42,14 @@ using std::string; ExportFormatSpecification::Time & ExportFormatSpecification::Time::operator= (AnyTime const & other) { - type = other.type; - timecode = other.timecode; - bbt = other.bbt; - - if (type == Frames) { - frames = other.frames; - } else { - seconds = other.seconds; - } - + static_cast(*this) = other; return *this; } framecnt_t -ExportFormatSpecification::Time::get_frames (framecnt_t target_rate) const +ExportFormatSpecification::Time::get_frames_at (framepos_t position, framecnt_t target_rate) const { - //TODO position - framecnt_t duration = session.convert_to_frames_at (0, *this); - + framecnt_t duration = session.convert_to_frames_at (position, *this); return ((double) target_rate / session.frame_rate()) * duration + 0.5; } @@ -283,14 +272,14 @@ ExportFormatSpecification::get_state () node->add_property ("enabled", trim_beginning() ? "true" : "false"); node = start->add_child ("Add"); - node->add_property ("enabled", silence_beginning() > 0 ? "true" : "false"); + node->add_property ("enabled", _silence_beginning.not_zero() ? "true" : "false"); node->add_child_nocopy (_silence_beginning.get_state()); node = end->add_child ("Trim"); node->add_property ("enabled", trim_end() ? "true" : "false"); node = end->add_child ("Add"); - node->add_property ("enabled", silence_end() > 0 ? "true" : "false"); + node->add_property ("enabled", _silence_end.not_zero() ? "true" : "false"); node->add_child_nocopy (_silence_end.get_state()); return *root; -- cgit v1.2.3