X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fexport_format_specification.h;h=d473d202346b90c216c12b66f53d8b3862097f80;hb=11a68f7dd38e72c3e497569a60cb0740a33b78cf;hp=52ed9769a781cd4e655505297186136f6ec27a1c;hpb=73192bc1a7ea55fa1864dc3826845b15c00dd2ec;p=ardour.git diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h index 52ed9769a7..d473d20234 100644 --- a/libs/ardour/ardour/export_format_specification.h +++ b/libs/ardour/ardour/export_format_specification.h @@ -25,6 +25,7 @@ #include "pbd/uuid.h" +#include "ardour/libardour_visibility.h" #include "ardour/types.h" #include "ardour/export_format_base.h" @@ -37,7 +38,7 @@ class ExportFormat; class ExportFormatCompatibility; class Session; -class ExportFormatSpecification : public ExportFormatBase { +class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { private: @@ -47,7 +48,7 @@ class ExportFormatSpecification : public ExportFormatBase { Time (Session & session) : AnyTime (), session (session) {} Time & operator= (AnyTime const & other); - framecnt_t get_frames (framecnt_t target_rate) const; + framecnt_t get_frames_at (framepos_t position, framecnt_t target_rate) const; /* Serialization */ @@ -64,7 +65,7 @@ class ExportFormatSpecification : public ExportFormatBase { ExportFormatSpecification (Session & s, XMLNode const & state); public: - ExportFormatSpecification (ExportFormatSpecification const & other); + ExportFormatSpecification (ExportFormatSpecification const & other, bool modify_name = true); ~ExportFormatSpecification (); /* compatibility */ @@ -90,9 +91,18 @@ class ExportFormatSpecification : public ExportFormatBase { void set_trim_beginning (bool value) { _trim_beginning = value; } void set_trim_end (bool value) { _trim_end = value; } void set_normalize (bool value) { _normalize = value; } - void set_normalize_target (float value) { _normalize_target = value; } + void set_normalize_loudness (bool value) { _normalize_loudness = value; } + void set_normalize_dbfs (float value) { _normalize_dbfs = value; } + void set_normalize_lufs (float value) { _normalize_lufs = value; } + void set_normalize_dbtp (float value) { _normalize_dbtp = value; } void set_tag (bool tag_it) { _tag = tag_it; } + void set_with_cue (bool yn) { _with_cue = yn; } + void set_with_toc (bool yn) { _with_toc = yn; } + void set_with_mp4chaps (bool yn) { _with_mp4chaps = yn; } + void set_soundcloud_upload (bool yn) { _soundcloud_upload = yn; } + void set_command (std::string command) { _command = command; } + void set_analyse (bool yn) { _analyse = yn; } void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; } void set_silence_end (AnyTime const & value) { _silence_end = value; } @@ -101,33 +111,73 @@ class ExportFormatSpecification : public ExportFormatBase { PBD::UUID const & id () { return _id; } std::string const & name () const { return _name; } - std::string description (); + std::string description (bool include_name = true); bool has_broadcast_info () const { return _has_broadcast_info; } uint32_t channel_limit () const { return _channel_limit; } std::string format_name () const { return _format_name; } Type type () const { return _type; } - FormatId format_id () const { return *format_ids.begin(); } - Endianness endianness () const { return *endiannesses.begin(); } - SampleFormat sample_format () const { return *sample_formats.begin(); } - SampleRate sample_rate () const { return *sample_rates.begin(); } - Quality quality () const { return *qualities.begin(); } + + FormatId format_id () const { + if (!format_ids.empty() ) + return *format_ids.begin(); + else + return FormatId(0); + } + + Endianness endianness () const { + if (!endiannesses.empty() ) + return *endiannesses.begin(); + else + return Endianness(0); + } + + SampleFormat sample_format () const { + if (!sample_formats.empty() ) + return *sample_formats.begin(); + else + return SampleFormat(0); + } + + SampleRate sample_rate () const { + if (!sample_rates.empty() ) + return *sample_rates.begin(); + else + return SampleRate(0); + + } + + Quality quality () const { + if (!qualities.empty() ) + return *qualities.begin(); + else + return Quality(0); + } DitherType dither_type () const { return _dither_type; } SRCQuality src_quality () const { return _src_quality; } bool trim_beginning () const { return _trim_beginning; } bool trim_end () const { return _trim_end; } bool normalize () const { return _normalize; } - float normalize_target () const { return _normalize_target; } + bool normalize_loudness () const { return _normalize_loudness; } + float normalize_dbfs () const { return _normalize_dbfs; } + float normalize_lufs () const { return _normalize_lufs; } + float normalize_dbtp () const { return _normalize_dbtp; } + bool with_toc() const { return _with_toc; } + bool with_cue() const { return _with_cue; } + bool with_mp4chaps() const { return _with_mp4chaps; } + + bool soundcloud_upload() const { return _soundcloud_upload; } + std::string command() const { return _command; } + bool analyse() const { return _analyse; } bool tag () const { return _tag && supports_tagging; } - framecnt_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); } - framecnt_t silence_end () const { return _silence_end.get_frames (sample_rate()); } - - framecnt_t silence_beginning (framecnt_t samplerate) const { return _silence_beginning.get_frames (samplerate); } - framecnt_t silence_end (framecnt_t samplerate) const { return _silence_end.get_frames (samplerate); } + framecnt_t silence_beginning_at (framepos_t position, framecnt_t samplerate) const + { return _silence_beginning.get_frames_at (position, samplerate); } + framecnt_t silence_end_at (framepos_t position, framecnt_t samplerate) const + { return _silence_end.get_frames_at (position, samplerate); } AnyTime silence_beginning_time () const { return _silence_beginning; } AnyTime silence_end_time () const { return _silence_end; } @@ -167,7 +217,17 @@ class ExportFormatSpecification : public ExportFormatBase { Time _silence_end; bool _normalize; - float _normalize_target; + bool _normalize_loudness; + float _normalize_dbfs; + float _normalize_lufs; + float _normalize_dbtp; + bool _with_toc; + bool _with_cue; + bool _with_mp4chaps; + bool _soundcloud_upload; + + std::string _command; + bool _analyse; /* serialization helpers */