case TagLib_File_MPEG:
return reinterpret_cast<TagLib_File *>(new MPEG::File(filename));
case TagLib_File_OggVorbis:
- return reinterpret_cast<TagLib_File *>(new Vorbis::File(filename));
+ return reinterpret_cast<TagLib_File *>(new Ogg::Vorbis::File(filename));
case TagLib_File_FLAC:
return reinterpret_cast<TagLib_File *>(new FLAC::File(filename));
case TagLib_File_MPC:
case TagLib_File_WavPack:
return reinterpret_cast<TagLib_File *>(new WavPack::File(filename));
case TagLib_File_Speex:
- return reinterpret_cast<TagLib_File *>(new Speex::File(filename));
+ return reinterpret_cast<TagLib_File *>(new Ogg::Speex::File(filename));
case TagLib_File_TrueAudio:
return reinterpret_cast<TagLib_File *>(new TrueAudio::File(filename));
}
if(s.size() > 4) {
if(s.substr(s.size() - 4, 4).upper() == ".OGG")
- return new Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
+ return new Ogg::Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
if(s.substr(s.size() - 4, 4).upper() == ".MP3")
return new MPEG::File(fileName, readAudioProperties, audioPropertiesStyle);
if(s.substr(s.size() - 4, 4).upper() == ".OGA")
if(s.substr(s.size() - 3, 3).upper() == ".WV")
return new WavPack::File(fileName, readAudioProperties, audioPropertiesStyle);
if(s.substr(s.size() - 4, 4).upper() == ".SPX")
- return new Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
+ return new Ogg::Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
if(s.substr(s.size() - 4, 4).upper() == ".TTA")
return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle);
}
#include "speexfile.h"
using namespace TagLib;
+using namespace TagLib::Ogg;
class Speex::File::FilePrivate
{
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
(original Vorbis implementation)
- ***************************************************************************/
+***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
namespace TagLib {
- //! A namespace containing classes for Speex metadata
-
- namespace Speex {
+ namespace Ogg {
- //! An implementation of Ogg::File with Speex specific methods
+ //! A namespace containing classes for Speex metadata
- /*!
- * This is the central class in the Ogg Speex metadata processing collection
- * of classes. It's built upon Ogg::File which handles processing of the Ogg
- * logical bitstream and breaking it down into pages which are handled by
- * the codec implementations, in this case Speex specifically.
- */
-
- class TAGLIB_EXPORT File : public Ogg::File
- {
- public:
- /*!
- * Contructs a Speex file from \a file. If \a readProperties is true the
- * file's audio properties will also be read using \a propertiesStyle. If
- * false, \a propertiesStyle is ignored.
- */
- File(FileName file, bool readProperties = true,
- Properties::ReadStyle propertiesStyle = Properties::Average);
-
- /*!
- * Destroys this instance of the File.
- */
- virtual ~File();
+ namespace Speex {
- /*!
- * Returns the XiphComment for this file. XiphComment implements the tag
- * interface, so this serves as the reimplementation of
- * TagLib::File::tag().
- */
- virtual Ogg::XiphComment *tag() const;
+ //! An implementation of Ogg::File with Speex specific methods
/*!
- * Returns the Speex::Properties for this file. If no audio properties
- * were read then this will return a null pointer.
+ * This is the central class in the Ogg Speex metadata processing collection
+ * of classes. It's built upon Ogg::File which handles processing of the Ogg
+ * logical bitstream and breaking it down into pages which are handled by
+ * the codec implementations, in this case Speex specifically.
*/
- virtual Properties *audioProperties() const;
-
- virtual bool save();
- private:
- File(const File &);
- File &operator=(const File &);
-
- void read(bool readProperties, Properties::ReadStyle propertiesStyle);
-
- class FilePrivate;
- FilePrivate *d;
- };
+ class TAGLIB_EXPORT File : public Ogg::File
+ {
+ public:
+ /*!
+ * Contructs a Speex file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(FileName file, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
+ * Destroys this instance of the File.
+ */
+ virtual ~File();
+
+ /*!
+ * Returns the XiphComment for this file. XiphComment implements the tag
+ * interface, so this serves as the reimplementation of
+ * TagLib::File::tag().
+ */
+ virtual Ogg::XiphComment *tag() const;
+
+ /*!
+ * Returns the Speex::Properties for this file. If no audio properties
+ * were read then this will return a null pointer.
+ */
+ virtual Properties *audioProperties() const;
+
+ virtual bool save();
+
+ private:
+ File(const File &);
+ File &operator=(const File &);
+
+ void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+ class FilePrivate;
+ FilePrivate *d;
+ };
+ }
}
-
}
#endif
#include "speexfile.h"
using namespace TagLib;
+using namespace TagLib::Ogg;
class Speex::Properties::PropertiesPrivate
{
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
(original Vorbis implementation)
- ***************************************************************************/
+***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
namespace TagLib {
- namespace Speex {
-
- class File;
-
- //! An implementation of audio property reading for Ogg Speex
-
- /*!
- * This reads the data from an Ogg Speex stream found in the AudioProperties
- * API.
- */
-
- class TAGLIB_EXPORT Properties : public AudioProperties
- {
- public:
- /*!
- * Create an instance of Speex::Properties with the data read from the
- * Speex::File \a file.
- */
- Properties(File *file, ReadStyle style = Average);
+ namespace Ogg {
- /*!
- * Destroys this Speex::Properties instance.
- */
- virtual ~Properties();
+ namespace Speex {
- // Reimplementations.
+ class File;
- virtual int length() const;
- virtual int bitrate() const;
- virtual int sampleRate() const;
- virtual int channels() const;
+ //! An implementation of audio property reading for Ogg Speex
/*!
- * Returns the Speex version, currently "0" (as specified by the spec).
+ * This reads the data from an Ogg Speex stream found in the AudioProperties
+ * API.
*/
- int speexVersion() const;
- private:
- Properties(const Properties &);
- Properties &operator=(const Properties &);
-
- void read();
-
- class PropertiesPrivate;
- PropertiesPrivate *d;
- };
+ class TAGLIB_EXPORT Properties : public AudioProperties
+ {
+ public:
+ /*!
+ * Create an instance of Speex::Properties with the data read from the
+ * Speex::File \a file.
+ */
+ Properties(File *file, ReadStyle style = Average);
+
+ /*!
+ * Destroys this Speex::Properties instance.
+ */
+ virtual ~Properties();
+
+ // Reimplementations.
+
+ virtual int length() const;
+ virtual int bitrate() const;
+ virtual int sampleRate() const;
+ virtual int channels() const;
+
+ /*!
+ * Returns the Speex version, currently "0" (as specified by the spec).
+ */
+ int speexVersion() const;
+
+ private:
+ Properties(const Properties &);
+ Properties &operator=(const Properties &);
+
+ void read();
+
+ class PropertiesPrivate;
+ PropertiesPrivate *d;
+ };
+ }
}
-
}
#endif
*
* \endcode
*
+ * More examples can be found in the \e examples directory of the source distribution.
+ *
* \section Contact
*
* Questions about TagLib should be directed to the TagLib mailing list, not directly to the author.