mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-30 18:37:40 +01:00
NO-OP: whitespace and private variable-name
This pipes export source-code though clang-format, and some manual cleanup step.
This commit is contained in:
parent
f7cb1b0b48
commit
a95d87ef6e
5 changed files with 285 additions and 188 deletions
|
|
@ -30,26 +30,21 @@
|
|||
|
||||
namespace ARDOUR
|
||||
{
|
||||
|
||||
class SessionMetadata;
|
||||
|
||||
/// Class with static functions for tagging audiofiles
|
||||
class LIBARDOUR_API AudiofileTagger
|
||||
{
|
||||
public:
|
||||
|
||||
public:
|
||||
/* Tags file with metadata, return true on success */
|
||||
|
||||
static bool tag_file (std::string const & filename, SessionMetadata const & metadata);
|
||||
static bool tag_file (std::string const& filename, SessionMetadata const& metadata);
|
||||
|
||||
private:
|
||||
|
||||
static bool tag_generic (TagLib::Tag & tag, SessionMetadata const & metadata);
|
||||
static bool tag_vorbis_comment (TagLib::Ogg::XiphComment & tag, SessionMetadata const & metadata);
|
||||
private:
|
||||
static bool tag_generic (TagLib::Tag& tag, SessionMetadata const& metadata);
|
||||
static bool tag_vorbis_comment (TagLib::Ogg::XiphComment& tag, SessionMetadata const& metadata);
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
#endif /* __ardour_audiofile_tagger_h__ */
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
|||
bool analyse() const { return _analyse; }
|
||||
int codec_quality() const { return _codec_quality; }
|
||||
|
||||
bool tag () const { return _tag && supports_tagging; }
|
||||
bool tag () const { return _tag && _supports_tagging; }
|
||||
|
||||
samplecnt_t silence_beginning_at (samplepos_t position, samplecnt_t samplerate) const
|
||||
{ return _silence_beginning.get_samples_at (position, samplerate); }
|
||||
|
|
@ -208,11 +208,11 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
|||
/* The variables below do not have setters (usually set via set_format) */
|
||||
|
||||
std::string _format_name;
|
||||
bool has_sample_format;
|
||||
bool supports_tagging;
|
||||
bool _has_codec_quality;
|
||||
bool _has_broadcast_info;
|
||||
uint32_t _channel_limit;
|
||||
bool _has_sample_format;
|
||||
bool _supports_tagging;
|
||||
bool _has_codec_quality;
|
||||
bool _has_broadcast_info;
|
||||
uint32_t _channel_limit;
|
||||
|
||||
/* The variables below have getters and setters */
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
#ifndef __ardour_export_formats_h__
|
||||
#define __ardour_export_formats_h__
|
||||
|
||||
#include <list>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <list>
|
||||
|
||||
#include "pbd/failed_constructor.h"
|
||||
#include "pbd/signals.h"
|
||||
|
|
@ -31,26 +31,37 @@
|
|||
#include "ardour/export_format_base.h"
|
||||
#include "ardour/export_format_compatibility.h"
|
||||
|
||||
namespace ARDOUR
|
||||
{
|
||||
namespace ARDOUR {
|
||||
|
||||
class LIBARDOUR_API ExportFormatIncompatible : public failed_constructor {
|
||||
public:
|
||||
virtual const char *what() const throw() { return "Export format constructor failed: Format incompatible with system"; }
|
||||
class LIBARDOUR_API ExportFormatIncompatible : public failed_constructor
|
||||
{
|
||||
public:
|
||||
virtual const char* what () const throw ()
|
||||
{
|
||||
return "Export format constructor failed: Format incompatible with system";
|
||||
}
|
||||
};
|
||||
|
||||
/// Base class for formats
|
||||
class LIBARDOUR_API ExportFormat : public ExportFormatBase, public ExportFormatBase::SelectableCompatible {
|
||||
class LIBARDOUR_API ExportFormat : public ExportFormatBase, public ExportFormatBase::SelectableCompatible
|
||||
{
|
||||
public:
|
||||
ExportFormat (){};
|
||||
~ExportFormat (){};
|
||||
|
||||
public:
|
||||
ExportFormat () {};
|
||||
~ExportFormat () {};
|
||||
virtual bool set_compatibility_state (ExportFormatCompatibility const& compatibility) = 0;
|
||||
|
||||
virtual bool set_compatibility_state (ExportFormatCompatibility const & compatibility) = 0;
|
||||
virtual Type get_type () const = 0;
|
||||
|
||||
FormatId get_format_id () const { return *format_ids.begin(); }
|
||||
Quality get_quality () const { return *qualities.begin(); }
|
||||
FormatId get_format_id () const
|
||||
{
|
||||
return *format_ids.begin ();
|
||||
}
|
||||
|
||||
Quality get_quality () const
|
||||
{
|
||||
return *qualities.begin ();
|
||||
}
|
||||
|
||||
bool has_sample_format ();
|
||||
bool has_codec_quality ();
|
||||
|
|
@ -60,36 +71,61 @@ class LIBARDOUR_API ExportFormat : public ExportFormatBase, public ExportFormatB
|
|||
/* If the format has a specific sample format, this function should be overridden
|
||||
* if the format has a selectable sample format, do not override this!
|
||||
*/
|
||||
|
||||
virtual SampleFormat get_explicit_sample_format () const { return SF_None; }
|
||||
virtual SampleFormat get_explicit_sample_format () const
|
||||
{
|
||||
return SF_None;
|
||||
}
|
||||
|
||||
/* If the above is not overridden, this one should be */
|
||||
|
||||
virtual ExportFormat::SampleFormat default_sample_format () const { return SF_None; }
|
||||
virtual ExportFormat::SampleFormat default_sample_format () const
|
||||
{
|
||||
return SF_None;
|
||||
}
|
||||
|
||||
/* If the format has a channel count limit, override this */
|
||||
|
||||
virtual uint32_t get_channel_limit () const { return 256; }
|
||||
virtual uint32_t get_channel_limit () const
|
||||
{
|
||||
return 256;
|
||||
}
|
||||
|
||||
/* If the format can be tagged with metadata override this */
|
||||
|
||||
virtual bool supports_tagging () const { return false; }
|
||||
virtual bool supports_tagging () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If the format contains broadcast info override this */
|
||||
virtual bool has_broadcast_info () const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool has_broadcast_info () const { return false; }
|
||||
protected:
|
||||
void add_sample_rate (SampleRate rate)
|
||||
{
|
||||
sample_rates.insert (rate);
|
||||
}
|
||||
|
||||
void add_endianness (Endianness endianness)
|
||||
{
|
||||
endiannesses.insert (endianness);
|
||||
}
|
||||
|
||||
protected:
|
||||
void set_format_id (FormatId id)
|
||||
{
|
||||
format_ids.clear ();
|
||||
format_ids.insert (id);
|
||||
}
|
||||
|
||||
void add_sample_rate (SampleRate rate) { sample_rates.insert (rate); }
|
||||
void add_endianness (Endianness endianness) { endiannesses.insert (endianness); }
|
||||
|
||||
void set_format_id (FormatId id) { format_ids.clear (); format_ids.insert (id); }
|
||||
void set_quality (Quality value) { qualities.clear(); qualities.insert (value); }
|
||||
void set_quality (Quality value)
|
||||
{
|
||||
qualities.clear ();
|
||||
qualities.insert (value);
|
||||
}
|
||||
};
|
||||
|
||||
class LIBARDOUR_API HasCodecQuality {
|
||||
class LIBARDOUR_API HasCodecQuality
|
||||
{
|
||||
public:
|
||||
struct CodecQuality {
|
||||
CodecQuality (std::string const& n, int q)
|
||||
|
|
@ -102,16 +138,18 @@ public:
|
|||
};
|
||||
|
||||
typedef boost::shared_ptr<CodecQuality> CodecQualityPtr;
|
||||
typedef std::list<CodecQualityPtr> CodecQualityList;
|
||||
typedef std::list<CodecQualityPtr> CodecQualityList;
|
||||
|
||||
virtual ~HasCodecQuality () {}
|
||||
|
||||
void add_codec_quality (std::string const& name, int q) {
|
||||
void add_codec_quality (std::string const& name, int q)
|
||||
{
|
||||
CodecQualityPtr ptr (new CodecQuality (name, q));
|
||||
_codec_qualties.push_back (ptr);
|
||||
}
|
||||
|
||||
CodecQualityList const & get_codec_qualities () const {
|
||||
CodecQualityList const& get_codec_qualities () const
|
||||
{
|
||||
return _codec_qualties;
|
||||
}
|
||||
|
||||
|
|
@ -122,143 +160,211 @@ protected:
|
|||
};
|
||||
|
||||
/// Class to be inherited by export formats that have a selectable sample format
|
||||
class LIBARDOUR_API HasSampleFormat : public PBD::ScopedConnectionList {
|
||||
public:
|
||||
|
||||
class SampleFormatState : public ExportFormatBase::SelectableCompatible {
|
||||
public:
|
||||
class LIBARDOUR_API HasSampleFormat : public PBD::ScopedConnectionList
|
||||
{
|
||||
public:
|
||||
class SampleFormatState : public ExportFormatBase::SelectableCompatible
|
||||
{
|
||||
public:
|
||||
SampleFormatState (ExportFormatBase::SampleFormat format, std::string name)
|
||||
: format (format)
|
||||
{
|
||||
set_name (name);
|
||||
}
|
||||
|
||||
ExportFormatBase::SampleFormat format;
|
||||
ExportFormatBase::SampleFormat format;
|
||||
};
|
||||
|
||||
class DitherTypeState : public ExportFormatBase::SelectableCompatible {
|
||||
public:
|
||||
DitherTypeState (ExportFormatBase::DitherType type, Glib::ustring name) :
|
||||
type (type) { set_name (name); }
|
||||
class DitherTypeState : public ExportFormatBase::SelectableCompatible
|
||||
{
|
||||
public:
|
||||
DitherTypeState (ExportFormatBase::DitherType type, Glib::ustring name)
|
||||
: type (type)
|
||||
{
|
||||
set_name (name);
|
||||
}
|
||||
|
||||
ExportFormatBase::DitherType type;
|
||||
ExportFormatBase::DitherType type;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<SampleFormatState> SampleFormatPtr;
|
||||
typedef boost::weak_ptr<SampleFormatState> WeakSampleFormatPtr;
|
||||
typedef std::list<SampleFormatPtr> SampleFormatList;
|
||||
typedef boost::weak_ptr<SampleFormatState> WeakSampleFormatPtr;
|
||||
typedef std::list<SampleFormatPtr> SampleFormatList;
|
||||
|
||||
typedef boost::shared_ptr<DitherTypeState> DitherTypePtr;
|
||||
typedef boost::weak_ptr<DitherTypeState> WeakDitherTypePtr;
|
||||
typedef std::list<DitherTypePtr> DitherTypeList;
|
||||
typedef boost::weak_ptr<DitherTypeState> WeakDitherTypePtr;
|
||||
typedef std::list<DitherTypePtr> DitherTypeList;
|
||||
|
||||
public:
|
||||
|
||||
HasSampleFormat (ExportFormatBase::SampleFormatSet & sample_formats);
|
||||
virtual ~HasSampleFormat () {};
|
||||
public:
|
||||
HasSampleFormat (ExportFormatBase::SampleFormatSet& sample_formats);
|
||||
virtual ~HasSampleFormat (){};
|
||||
|
||||
void add_sample_format (ExportFormatBase::SampleFormat format);
|
||||
|
||||
SampleFormatList const & get_sample_formats () const { return sample_format_states; }
|
||||
DitherTypeList const & get_dither_types () const { return dither_type_states; }
|
||||
SampleFormatList const& get_sample_formats () const
|
||||
{
|
||||
return sample_format_states;
|
||||
}
|
||||
|
||||
DitherTypeList const& get_dither_types () const
|
||||
{
|
||||
return dither_type_states;
|
||||
}
|
||||
|
||||
SampleFormatPtr get_selected_sample_format ();
|
||||
DitherTypePtr get_selected_dither_type ();
|
||||
DitherTypePtr get_selected_dither_type ();
|
||||
|
||||
/* Proxies for signals from sample formats and dither types */
|
||||
PBD::Signal2<void, bool, WeakSampleFormatPtr> SampleFormatSelectChanged;
|
||||
PBD::Signal2<void, bool, WeakSampleFormatPtr> SampleFormatCompatibleChanged;
|
||||
|
||||
PBD::Signal2<void,bool, WeakSampleFormatPtr> SampleFormatSelectChanged;
|
||||
PBD::Signal2<void,bool, WeakSampleFormatPtr> SampleFormatCompatibleChanged;
|
||||
|
||||
PBD::Signal2<void,bool, WeakDitherTypePtr> DitherTypeSelectChanged;
|
||||
PBD::Signal2<void,bool, WeakDitherTypePtr> DitherTypeCompatibleChanged;
|
||||
PBD::Signal2<void, bool, WeakDitherTypePtr> DitherTypeSelectChanged;
|
||||
PBD::Signal2<void, bool, WeakDitherTypePtr> DitherTypeCompatibleChanged;
|
||||
|
||||
static std::string get_sample_format_name (ExportFormatBase::SampleFormat format);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/* State lists */
|
||||
DitherTypeList dither_type_states;
|
||||
SampleFormatList sample_format_states;
|
||||
|
||||
DitherTypeList dither_type_states;
|
||||
SampleFormatList sample_format_states;
|
||||
|
||||
private:
|
||||
private:
|
||||
/* Connected to signals */
|
||||
|
||||
void add_dither_type (ExportFormatBase::DitherType type, std::string name);
|
||||
void update_sample_format_selection (bool);
|
||||
void update_dither_type_selection (bool);
|
||||
|
||||
/* Reference to ExportFormatBase::sample_formats */
|
||||
ExportFormatBase::SampleFormatSet & _sample_formats;
|
||||
ExportFormatBase::SampleFormatSet& _sample_formats;
|
||||
};
|
||||
|
||||
class LIBARDOUR_API ExportFormatLinear : public ExportFormat, public HasSampleFormat {
|
||||
public:
|
||||
|
||||
class LIBARDOUR_API ExportFormatLinear : public ExportFormat, public HasSampleFormat
|
||||
{
|
||||
public:
|
||||
ExportFormatLinear (std::string name, FormatId format_id);
|
||||
~ExportFormatLinear () {};
|
||||
~ExportFormatLinear (){};
|
||||
|
||||
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
|
||||
Type get_type () const { return T_Sndfile; }
|
||||
bool set_compatibility_state (ExportFormatCompatibility const& compatibility);
|
||||
Type get_type () const
|
||||
{
|
||||
return T_Sndfile;
|
||||
}
|
||||
|
||||
void add_endianness (Endianness endianness) { endiannesses.insert (endianness); }
|
||||
void add_endianness (Endianness endianness)
|
||||
{
|
||||
endiannesses.insert (endianness);
|
||||
}
|
||||
|
||||
void set_default_sample_format (SampleFormat sf) { _default_sample_format = sf; }
|
||||
SampleFormat default_sample_format () const { return _default_sample_format; }
|
||||
void set_default_sample_format (SampleFormat sf)
|
||||
{
|
||||
_default_sample_format = sf;
|
||||
}
|
||||
|
||||
protected:
|
||||
SampleFormat default_sample_format () const
|
||||
{
|
||||
return _default_sample_format;
|
||||
}
|
||||
|
||||
protected:
|
||||
SampleFormat _default_sample_format;
|
||||
};
|
||||
|
||||
class LIBARDOUR_API ExportFormatOggVorbis : public ExportFormat, public HasCodecQuality {
|
||||
public:
|
||||
class LIBARDOUR_API ExportFormatOggVorbis : public ExportFormat, public HasCodecQuality
|
||||
{
|
||||
public:
|
||||
ExportFormatOggVorbis ();
|
||||
~ExportFormatOggVorbis () {};
|
||||
~ExportFormatOggVorbis (){};
|
||||
|
||||
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
|
||||
Type get_type () const { return T_Sndfile; }
|
||||
SampleFormat get_explicit_sample_format () const { return SF_Vorbis; }
|
||||
virtual bool supports_tagging () const { return true; }
|
||||
|
||||
int default_codec_quality () const { return 40; }
|
||||
bool set_compatibility_state (ExportFormatCompatibility const& compatibility);
|
||||
Type get_type () const
|
||||
{
|
||||
return T_Sndfile;
|
||||
}
|
||||
SampleFormat get_explicit_sample_format () const
|
||||
{
|
||||
return SF_Vorbis;
|
||||
}
|
||||
virtual bool supports_tagging () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int default_codec_quality () const
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
};
|
||||
|
||||
class LIBARDOUR_API ExportFormatFLAC : public ExportFormat, public HasSampleFormat {
|
||||
public:
|
||||
class LIBARDOUR_API ExportFormatFLAC : public ExportFormat, public HasSampleFormat
|
||||
{
|
||||
public:
|
||||
ExportFormatFLAC ();
|
||||
~ExportFormatFLAC () {};
|
||||
~ExportFormatFLAC (){};
|
||||
|
||||
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
|
||||
Type get_type () const { return T_Sndfile; }
|
||||
|
||||
uint32_t get_channel_limit () const { return 8; }
|
||||
SampleFormat default_sample_format () const { return SF_16; }
|
||||
virtual bool supports_tagging () const { return true; }
|
||||
bool set_compatibility_state (ExportFormatCompatibility const& compatibility);
|
||||
Type get_type () const
|
||||
{
|
||||
return T_Sndfile;
|
||||
}
|
||||
uint32_t get_channel_limit () const
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
SampleFormat default_sample_format () const
|
||||
{
|
||||
return SF_16;
|
||||
}
|
||||
virtual bool supports_tagging () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class LIBARDOUR_API ExportFormatBWF : public ExportFormat, public HasSampleFormat {
|
||||
public:
|
||||
class LIBARDOUR_API ExportFormatBWF : public ExportFormat, public HasSampleFormat
|
||||
{
|
||||
public:
|
||||
ExportFormatBWF ();
|
||||
~ExportFormatBWF () {};
|
||||
~ExportFormatBWF (){};
|
||||
|
||||
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
|
||||
Type get_type () const { return T_Sndfile; }
|
||||
bool set_compatibility_state (ExportFormatCompatibility const& compatibility);
|
||||
|
||||
SampleFormat default_sample_format () const { return SF_16; }
|
||||
virtual bool has_broadcast_info () const { return true; }
|
||||
Type get_type () const
|
||||
{
|
||||
return T_Sndfile;
|
||||
}
|
||||
SampleFormat default_sample_format () const
|
||||
{
|
||||
return SF_16;
|
||||
}
|
||||
virtual bool has_broadcast_info () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class LIBARDOUR_API ExportFormatFFMPEG : public ExportFormat, public HasCodecQuality {
|
||||
public:
|
||||
class LIBARDOUR_API ExportFormatFFMPEG : public ExportFormat, public HasCodecQuality
|
||||
{
|
||||
public:
|
||||
ExportFormatFFMPEG (std::string const& name, std::string const& ext);
|
||||
~ExportFormatFFMPEG () {};
|
||||
~ExportFormatFFMPEG (){};
|
||||
|
||||
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
|
||||
Type get_type () const { return T_FFMPEG; }
|
||||
SampleFormat get_explicit_sample_format () const { return SF_Float; }
|
||||
int default_codec_quality () const { return -2; }
|
||||
virtual bool supports_tagging () const { return true; }
|
||||
bool set_compatibility_state (ExportFormatCompatibility const& compatibility);
|
||||
|
||||
Type get_type () const
|
||||
{
|
||||
return T_FFMPEG;
|
||||
}
|
||||
SampleFormat get_explicit_sample_format () const
|
||||
{
|
||||
return SF_Float;
|
||||
}
|
||||
int default_codec_quality () const
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
virtual bool supports_tagging () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
|
|
|||
|
|
@ -38,33 +38,31 @@ using namespace PBD;
|
|||
|
||||
namespace ARDOUR
|
||||
{
|
||||
|
||||
bool
|
||||
AudiofileTagger::tag_file (std::string const & filename, SessionMetadata const & metadata)
|
||||
AudiofileTagger::tag_file (std::string const& filename, SessionMetadata const& metadata)
|
||||
{
|
||||
/* see also SessionMetadata::av_export_tag () for ffmpeg/liblame */
|
||||
|
||||
TagLib::FileRef file (filename.c_str());
|
||||
if (file.isNull()) {
|
||||
std::cerr << "TagLib::FileRef is null for file" << filename << std::endl;
|
||||
TagLib::FileRef file (filename.c_str ());
|
||||
if (file.isNull ()) {
|
||||
std::cerr << "TagLib::FileRef is null for file" << filename << std::endl;
|
||||
return true; // continue anyway?!
|
||||
}
|
||||
|
||||
if (!file.tag()) {
|
||||
std::cerr << "TagLib::Tag is null for file" << filename << std::endl;
|
||||
if (!file.tag ()) {
|
||||
std::cerr << "TagLib::Tag is null for file" << filename << std::endl;
|
||||
return true; // continue anyway?!
|
||||
}
|
||||
|
||||
TagLib::Tag & tag (*file.tag());
|
||||
TagLib::Tag& tag (*file.tag ());
|
||||
|
||||
tag_generic (tag, metadata);
|
||||
|
||||
/* FLAC */
|
||||
|
||||
TagLib::FLAC::File * flac_file;
|
||||
if ((flac_file = dynamic_cast<TagLib::FLAC::File *> (file.file()))) {
|
||||
TagLib::Ogg::XiphComment * vorbis_tag;
|
||||
if ((vorbis_tag = dynamic_cast<TagLib::Ogg::XiphComment *> (flac_file->xiphComment (true)))) {
|
||||
TagLib::FLAC::File* flac_file;
|
||||
if ((flac_file = dynamic_cast<TagLib::FLAC::File*> (file.file ()))) {
|
||||
TagLib::Ogg::XiphComment* vorbis_tag;
|
||||
if ((vorbis_tag = dynamic_cast<TagLib::Ogg::XiphComment*> (flac_file->xiphComment (true)))) {
|
||||
tag_vorbis_comment (*vorbis_tag, metadata);
|
||||
} else {
|
||||
std::cerr << "Could not get Xiph comment for FLAC file!" << std::endl;
|
||||
|
|
@ -72,55 +70,54 @@ AudiofileTagger::tag_file (std::string const & filename, SessionMetadata const &
|
|||
}
|
||||
|
||||
/* Ogg */
|
||||
|
||||
TagLib::Ogg::File * ogg_file;
|
||||
if ((ogg_file = dynamic_cast<TagLib::Ogg::File *> (file.file()))) {
|
||||
TagLib::Ogg::XiphComment * vorbis_tag;
|
||||
if ((vorbis_tag = dynamic_cast<TagLib::Ogg::XiphComment *> (ogg_file->tag()))) {
|
||||
TagLib::Ogg::File* ogg_file;
|
||||
if ((ogg_file = dynamic_cast<TagLib::Ogg::File*> (file.file ()))) {
|
||||
TagLib::Ogg::XiphComment* vorbis_tag;
|
||||
if ((vorbis_tag = dynamic_cast<TagLib::Ogg::XiphComment*> (ogg_file->tag ()))) {
|
||||
tag_vorbis_comment (*vorbis_tag, metadata);
|
||||
} else {
|
||||
std::cerr << "Could not get Xiph comment for Ogg file!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
file.save();
|
||||
file.save ();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudiofileTagger::tag_generic (TagLib::Tag & tag, SessionMetadata const & metadata)
|
||||
AudiofileTagger::tag_generic (TagLib::Tag& tag, SessionMetadata const& metadata)
|
||||
{
|
||||
tag.setTitle (TL_STR(metadata.title()));
|
||||
tag.setArtist (TL_STR(metadata.artist()));
|
||||
tag.setAlbum (TL_STR(metadata.album()));
|
||||
tag.setComment (TL_STR(metadata.comment()));
|
||||
tag.setGenre (TL_STR(metadata.genre()));
|
||||
tag.setYear (metadata.year());
|
||||
tag.setTrack (metadata.track_number());
|
||||
tag.setTitle (TL_STR (metadata.title ()));
|
||||
tag.setArtist (TL_STR (metadata.artist ()));
|
||||
tag.setAlbum (TL_STR (metadata.album ()));
|
||||
tag.setComment (TL_STR (metadata.comment ()));
|
||||
tag.setGenre (TL_STR (metadata.genre ()));
|
||||
tag.setYear (metadata.year ());
|
||||
tag.setTrack (metadata.track_number ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudiofileTagger::tag_vorbis_comment (TagLib::Ogg::XiphComment & tag, SessionMetadata const & metadata)
|
||||
AudiofileTagger::tag_vorbis_comment (TagLib::Ogg::XiphComment& tag, SessionMetadata const& metadata)
|
||||
{
|
||||
tag.addField ("COPYRIGHT", TL_STR(metadata.copyright()));
|
||||
tag.addField ("ISRC", TL_STR(metadata.isrc()));
|
||||
tag.addField ("GROUPING ", TL_STR(metadata.grouping()));
|
||||
tag.addField ("SUBTITLE", TL_STR(metadata.subtitle()));
|
||||
tag.addField ("ALBUMARTIST", TL_STR(metadata.album_artist()));
|
||||
tag.addField ("LYRICIST", TL_STR(metadata.lyricist()));
|
||||
tag.addField ("COMPOSER", TL_STR(metadata.composer()));
|
||||
tag.addField ("CONDUCTOR", TL_STR(metadata.conductor()));
|
||||
tag.addField ("REMIXER", TL_STR(metadata.remixer()));
|
||||
tag.addField ("ARRANGER", TL_STR(metadata.arranger()));
|
||||
tag.addField ("ENGINEER", TL_STR(metadata.engineer()));
|
||||
tag.addField ("PRODUCER", TL_STR(metadata.producer()));
|
||||
tag.addField ("DJMIXER", TL_STR(metadata.dj_mixer()));
|
||||
tag.addField ("MIXER", TL_STR(metadata.mixer()));
|
||||
tag.addField ("COMPILATION", TL_STR(metadata.compilation()));
|
||||
tag.addField ("DISCSUBTITLE", TL_STR(metadata.disc_subtitle()));
|
||||
tag.addField ("DISCNUMBER", to_string (metadata.disc_number()));
|
||||
tag.addField ("COPYRIGHT", TL_STR (metadata.copyright ()));
|
||||
tag.addField ("ISRC", TL_STR (metadata.isrc ()));
|
||||
tag.addField ("GROUPING ", TL_STR (metadata.grouping ()));
|
||||
tag.addField ("SUBTITLE", TL_STR (metadata.subtitle ()));
|
||||
tag.addField ("ALBUMARTIST", TL_STR (metadata.album_artist ()));
|
||||
tag.addField ("LYRICIST", TL_STR (metadata.lyricist ()));
|
||||
tag.addField ("COMPOSER", TL_STR (metadata.composer ()));
|
||||
tag.addField ("CONDUCTOR", TL_STR (metadata.conductor ()));
|
||||
tag.addField ("REMIXER", TL_STR (metadata.remixer ()));
|
||||
tag.addField ("ARRANGER", TL_STR (metadata.arranger ()));
|
||||
tag.addField ("ENGINEER", TL_STR (metadata.engineer ()));
|
||||
tag.addField ("PRODUCER", TL_STR (metadata.producer ()));
|
||||
tag.addField ("DJMIXER", TL_STR (metadata.dj_mixer ()));
|
||||
tag.addField ("MIXER", TL_STR (metadata.mixer ()));
|
||||
tag.addField ("COMPILATION", TL_STR (metadata.compilation ()));
|
||||
tag.addField ("DISCSUBTITLE", TL_STR (metadata.disc_subtitle ()));
|
||||
tag.addField ("DISCNUMBER", to_string (metadata.disc_number ()));
|
||||
|
||||
// No field for total discs or tracks
|
||||
|
||||
|
|
@ -129,4 +126,3 @@ AudiofileTagger::tag_vorbis_comment (TagLib::Ogg::XiphComment & tag, SessionMeta
|
|||
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ ExportFormatSpecification::Time::set_state (const XMLNode & node)
|
|||
|
||||
ExportFormatSpecification::ExportFormatSpecification (Session & s)
|
||||
: session (s)
|
||||
, has_sample_format (false)
|
||||
, supports_tagging (false)
|
||||
, _has_sample_format (false)
|
||||
, _supports_tagging (false)
|
||||
, _has_codec_quality (false)
|
||||
, _has_broadcast_info (false)
|
||||
, _channel_limit (0)
|
||||
|
|
@ -173,8 +173,8 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s)
|
|||
|
||||
ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const & state)
|
||||
: session (s)
|
||||
, has_sample_format (false)
|
||||
, supports_tagging (false)
|
||||
, _has_sample_format (false)
|
||||
, _supports_tagging (false)
|
||||
, _has_codec_quality (false)
|
||||
, _has_broadcast_info (false)
|
||||
, _channel_limit (0)
|
||||
|
|
@ -232,8 +232,8 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification
|
|||
}
|
||||
|
||||
_format_name = other._format_name;
|
||||
has_sample_format = other.has_sample_format;
|
||||
supports_tagging = other.supports_tagging;
|
||||
_has_sample_format = other._has_sample_format;
|
||||
_supports_tagging = other._supports_tagging;
|
||||
_has_codec_quality = other._has_codec_quality;
|
||||
_has_broadcast_info = other._has_broadcast_info;
|
||||
_channel_limit = other._channel_limit;
|
||||
|
|
@ -287,7 +287,7 @@ ExportFormatSpecification::get_state ()
|
|||
node->set_property ("type", type());
|
||||
node->set_property ("extension", extension());
|
||||
node->set_property ("name", _format_name);
|
||||
node->set_property ("has-sample-format", has_sample_format);
|
||||
node->set_property ("has-sample-format", _has_sample_format);
|
||||
node->set_property ("channel-limit", _channel_limit);
|
||||
|
||||
node = root->add_child ("SampleRate");
|
||||
|
|
@ -311,7 +311,7 @@ ExportFormatSpecification::get_state ()
|
|||
add_option (enc_opts, "sample-format", to_string(sample_format()));
|
||||
add_option (enc_opts, "dithering", to_string (dither_type()));
|
||||
add_option (enc_opts, "tag-metadata", to_string (_tag));
|
||||
add_option (enc_opts, "tag-support", to_string (supports_tagging));
|
||||
add_option (enc_opts, "tag-support", to_string (_supports_tagging));
|
||||
add_option (enc_opts, "broadcast-info", to_string (_has_broadcast_info));
|
||||
|
||||
XMLNode * processing = root->add_child ("Processing");
|
||||
|
|
@ -398,7 +398,7 @@ ExportFormatSpecification::set_state (const XMLNode & root)
|
|||
}
|
||||
|
||||
child->get_property ("name", _format_name);
|
||||
child->get_property ("has-sample-format", has_sample_format);
|
||||
child->get_property ("has-sample-format", _has_sample_format);
|
||||
child->get_property ("channel-limit", _channel_limit);
|
||||
}
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ ExportFormatSpecification::set_state (const XMLNode & root)
|
|||
set_sample_format ((SampleFormat) string_2_enum (get_option (child, "sample-format"), SampleFormat));
|
||||
set_dither_type ((DitherType) string_2_enum (get_option (child, "dithering"), DitherType));
|
||||
set_tag (string_to<bool>(get_option (child, "tag-metadata")));
|
||||
supports_tagging = string_to<bool>(get_option (child, "tag-support"));
|
||||
_supports_tagging = string_to<bool>(get_option (child, "tag-support"));
|
||||
_has_broadcast_info = string_to<bool>(get_option (child, "broadcast-info"));
|
||||
}
|
||||
|
||||
|
|
@ -552,7 +552,7 @@ ExportFormatSpecification::is_complete () const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (has_sample_format) {
|
||||
if (_has_sample_format) {
|
||||
if (sample_format() == SF_None) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -577,7 +577,7 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
|
|||
}
|
||||
|
||||
if (format->has_sample_format()) {
|
||||
has_sample_format = true;
|
||||
_has_sample_format = true;
|
||||
}
|
||||
|
||||
if (format->has_broadcast_info()) {
|
||||
|
|
@ -591,7 +591,7 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
|
|||
_codec_quality = boost::dynamic_pointer_cast<HasCodecQuality> (format)->default_codec_quality();
|
||||
}
|
||||
|
||||
supports_tagging = format->supports_tagging ();
|
||||
_supports_tagging = format->supports_tagging ();
|
||||
_channel_limit = format->get_channel_limit();
|
||||
|
||||
_format_name = format->name();
|
||||
|
|
@ -600,8 +600,8 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
|
|||
set_type (T_None);
|
||||
set_extension ("");
|
||||
_has_broadcast_info = false;
|
||||
has_sample_format = false;
|
||||
supports_tagging = false;
|
||||
_has_sample_format = false;
|
||||
_supports_tagging = false;
|
||||
_channel_limit = 0;
|
||||
_codec_quality = 0;
|
||||
_format_name = "";
|
||||
|
|
@ -633,7 +633,7 @@ ExportFormatSpecification::description (bool include_name)
|
|||
components.push_back (_format_name);
|
||||
}
|
||||
|
||||
if (has_sample_format) {
|
||||
if (_has_sample_format) {
|
||||
components.push_back (HasSampleFormat::get_sample_format_name (sample_format()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue