add virtual Delivery::pan_outs() so that internal sends correctly configure their...
[ardour.git] / libs / ardour / export_format_specification.cc
index e1e6776a1b8f84979e4f52ef319c25bad3dc8396..619c50b9f98f33a10302403094b9b7329a8f6495 100644 (file)
@@ -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;
 }
 
-nframes_t
-ExportFormatSpecification::Time::get_frames (nframes_t target_rate) const
+framecnt_t
+ExportFormatSpecification::Time::get_frames_at (framepos_t position, framecnt_t target_rate) const
 {
-       //TODO position
-       nframes_t duration = session.convert_to_frames_at (0, *this);
-
+       framecnt_t duration = session.any_duration_to_frames (position, *this);
        return ((double) target_rate / session.frame_rate()) * duration + 0.5;
 }
 
@@ -230,6 +219,8 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification
 
        set_silence_beginning (other.silence_beginning_time());
        set_silence_end (other.silence_end_time());
+
+       set_extension(other.extension());
 }
 
 ExportFormatSpecification::~ExportFormatSpecification ()
@@ -281,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;
@@ -512,10 +503,10 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
        }
 }
 
-Glib::ustring
+string
 ExportFormatSpecification::description ()
 {
-       Glib::ustring desc;
+       string desc;
 
        desc = _name + ": ";
 
@@ -528,7 +519,7 @@ ExportFormatSpecification::description ()
        } else if (_trim_beginning) {
                desc += _("trim start, ");
        } else if (_trim_end) {
-               desc += "trim end, ";
+               desc += _("trim end, ");
        }
 
        desc += _format_name + ", ";
@@ -556,6 +547,9 @@ ExportFormatSpecification::description ()
          case SR_192:
                desc += "192 kHz";
                break;
+         case SR_Session:
+               desc += _("Session rate");
+               break;
          case SR_None:
                break;
        }