diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2010-12-18 19:27:04 +0000 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2010-12-18 19:27:04 +0000 |
commit | 94c69b3c915c3fa8f8029e514240bca5bdb90def (patch) | |
tree | df8a37f0596992bc72219da5b53b2cb02f9f0eab /libs/ardour/export_format_specification.cc | |
parent | ffadfff6506e507b09853e4c7e50bcedffa29cce (diff) |
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
Diffstat (limited to 'libs/ardour/export_format_specification.cc')
-rw-r--r-- | libs/ardour/export_format_specification.cc | 21 |
1 files changed, 5 insertions, 16 deletions
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<AnyTime &>(*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; |