43 ExportFormatSpecification::Time &
46 static_cast<AnyTime &
>(*this) = other;
53 framecnt_t duration = session.any_duration_to_frames (position, *
this);
54 return ((
double) target_rate / session.frame_rate()) * duration + 0.5;
95 if (!prop) {
return -1; }
101 if ((prop = node.
property (
"hours"))) {
105 if ((prop = node.
property (
"minutes"))) {
109 if ((prop = node.
property (
"seconds"))) {
113 if ((prop = node.
property (
"frames"))) {
120 if ((prop = node.
property (
"bars"))) {
124 if ((prop = node.
property (
"beats"))) {
128 if ((prop = node.
property (
"ticks"))) {
135 if ((prop = node.
property (
"frames"))) {
136 std::istringstream iss (prop->
value());
143 if ((prop = node.
property (
"seconds"))) {
156 , has_sample_format (false)
157 , supports_tagging (false)
158 , _has_broadcast_info (false)
160 , _dither_type (D_None)
161 , _src_quality (SRC_SincBest)
164 , _trim_beginning (false)
165 , _silence_beginning (s)
173 , _with_mp4chaps (false)
174 , _soundcloud_upload (false)
186 , _silence_beginning (s)
188 , _soundcloud_upload (false)
198 , session (other.session)
199 , _silence_beginning (other.session)
200 , _silence_end (other.session)
201 , _soundcloud_upload (false)
279 node = processing->
add_child (
"Normalize");
311 if ((prop = root.
property (
"name"))) {
315 if ((prop = root.
property (
"id"))) {
319 if ((prop = root.
property (
"with-cue"))) {
325 if ((prop = root.
property (
"with-toc"))) {
331 if ((prop = root.
property (
"with-mp4chaps"))) {
337 if ((prop = root.
property (
"command"))) {
345 if ((child = root.
child (
"Encoding"))) {
346 if ((prop = child->
property (
"id"))) {
350 if ((prop = child->
property (
"type"))) {
354 if ((prop = child->
property (
"extension"))) {
358 if ((prop = child->
property (
"name"))) {
362 if ((prop = child->
property (
"has-sample-format"))) {
366 if ((prop = child->
property (
"has-sample-format"))) {
370 if ((prop = child->
property (
"channel-limit"))) {
375 if ((child = root.
child (
"SampleRate"))) {
376 if ((prop = child->
property (
"rate"))) {
381 if ((child = root.
child (
"SRCQuality"))) {
382 if ((prop = child->
property (
"quality"))) {
389 if ((child = root.
child (
"EncodingOptions"))) {
400 if (!proc) { std::cerr <<
X_(
"Could not load processing for export format") << std::endl;
return -1; }
402 if ((child = proc->
child (
"Normalize"))) {
403 if ((prop = child->
property (
"enabled"))) {
407 if ((prop = child->
property (
"target"))) {
413 if (!silence) { std::cerr <<
X_(
"Could not load silence for export format") << std::endl;
return -1; }
417 if (!start || !end) { std::cerr <<
X_(
"Could not load end or start silence for export format") << std::endl;
return -1; }
421 if ((child = start->
child (
"Trim"))) {
422 if ((prop = child->
property (
"enabled"))) {
427 if ((child = start->
child (
"Add"))) {
428 if ((prop = child->
property (
"enabled"))) {
429 if (!prop->
value().compare (
"true")) {
430 if ((child = child->
child (
"Duration"))) {
441 if ((child = end->
child (
"Trim"))) {
442 if ((prop = child->
property (
"enabled"))) {
447 if ((child = end->
child (
"Add"))) {
448 if ((prop = child->
property (
"enabled"))) {
449 if (!prop->
value().compare (
"true")) {
450 if ((child = child->
child (
"Duration"))) {
467 if (intersection->formats_empty() &&
format_id() != 0) {
483 if (intersection->qualities_empty() &&
quality() !=
Q_None) {
522 if (format->get_explicit_sample_format()) {
526 if (format->has_sample_format()) {
530 if (format->has_broadcast_info()) {
553 list<string> components;
556 components.push_back (
_(
"normalize"));
560 components.push_back (
_(
"trim"));
562 components.push_back (
_(
"trim start"));
564 components.push_back (
_(
"trim end"));
577 components.push_back (
"8 kHz");
580 components.push_back (
"22,5 kHz");
583 components.push_back (
"44,1 kHz");
586 components.push_back (
"48 kHz");
589 components.push_back (
"88,2 kHz");
592 components.push_back (
"96 kHz");
595 components.push_back (
"192 kHz");
598 components.push_back (
_(
"Session rate"));
605 components.push_back (
"TOC");
609 components.push_back (
"CUE");
613 components.push_back (
"MP4ch");
617 components.push_back (
"+");
625 for (list<string>::const_iterator it = components.begin(); it != components.end(); ++it) {
626 if (it != components.begin()) { desc +=
", "; }
645 for (XMLNodeList::iterator it = list.begin(); it != list.end(); ++it) {
647 if (prop && !name.compare (prop->
value())) {
648 prop = (*it)->property (
"value");
650 return prop->
value();
655 std::cerr <<
"Could not load encoding option \"" << name <<
"\" for export format" << std::endl;
std::string to_string(T t, std::ios_base &(*f)(std::ios_base &))
int atoi(const string &s)
const std::string & value() const
const XMLNodeList & children(const std::string &str=std::string()) const
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
XMLNode * add_child(const char *)
std::list< XMLNode * > XMLNodeList
XMLProperty * property(const char *)
#define string_2_enum(str, e)
bool string_is_affirmative(const std::string &str)
XMLProperty * add_property(const char *name, const std::string &value)
void add_child_nocopy(XMLNode &)
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
XMLNode * child(const char *) const
double atof(const string &s)