rtaglib 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Manifest.txt +84 -9
- data/README.txt +0 -0
- data/Rakefile +30 -27
- data/{test/data → data}/440Hz-5sec.flac +0 -0
- data/{test/data → data}/440Hz-5sec.mp3 +0 -0
- data/{test/data → data}/440Hz-5sec.mpc +0 -0
- data/{test/data → data}/440Hz-5sec.ogg +0 -0
- data/{test/data → data}/440Hz-5sec.wv +0 -0
- data/data/test_jason.mp3 +0 -0
- data/data/test_jason.ogg +0 -0
- data/ext/Rakefile +10 -0
- data/ext/tagfile/Rakefile.rb +42 -0
- data/ext/tagfile/rake_ext_conf.rb +29 -0
- data/ext/tagfile/tagfile.c +11 -7
- data/ext/taglib/Rakefile.rb +48 -0
- data/ext/taglib/rake_ext_conf.rb +33 -0
- data/ext/taglib/taglib-mswin32/bin/tag.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tag_c.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tag_cd.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tagd.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/taglib-config +55 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apefooter.h +173 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apeitem.h +204 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apetag.h +162 -0
- data/ext/taglib/taglib-mswin32/include/taglib/attachedpictureframe.h +220 -0
- data/ext/taglib/taglib-mswin32/include/taglib/audioproperties.h +110 -0
- data/ext/taglib/taglib-mswin32/include/taglib/commentsframe.h +168 -0
- data/ext/taglib/taglib-mswin32/include/taglib/fileref.h +262 -0
- data/ext/taglib/taglib-mswin32/include/taglib/flacfile.h +201 -0
- data/ext/taglib/taglib-mswin32/include/taglib/flacproperties.h +92 -0
- data/ext/taglib/taglib-mswin32/include/taglib/generalencapsulatedobjectframe.h +174 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v1genres.h +66 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v1tag.h +180 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2extendedheader.h +93 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2footer.h +82 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2frame.h +414 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2framefactory.h +167 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2header.h +175 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2synchdata.h +70 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2tag.h +300 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpcfile.h +175 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpcproperties.h +85 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegfile.h +277 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegheader.h +166 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegproperties.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggfile.h +112 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggflacfile.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggpage.h +203 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggpageheader.h +232 -0
- data/ext/taglib/taglib-mswin32/include/taglib/relativevolumeframe.h +274 -0
- data/ext/taglib/taglib-mswin32/include/taglib/speexfile.h +99 -0
- data/ext/taglib/taglib-mswin32/include/taglib/speexproperties.h +89 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tag.h +173 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tag_c.h +288 -0
- data/ext/taglib/taglib-mswin32/include/taglib/taglib.h +177 -0
- data/ext/taglib/taglib-mswin32/include/taglib/taglib_export.h +39 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tbytevector.h +409 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tbytevectorlist.h +91 -0
- data/ext/taglib/taglib-mswin32/include/taglib/textidentificationframe.h +258 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tfile.h +271 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tlist.h +252 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tlist.tcc +316 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tmap.h +200 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tmap.tcc +196 -0
- data/ext/taglib/taglib-mswin32/include/taglib/trueaudiofile.h +180 -0
- data/ext/taglib/taglib-mswin32/include/taglib/trueaudioproperties.h +93 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tstring.h +456 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tstringlist.h +115 -0
- data/ext/taglib/taglib-mswin32/include/taglib/uniquefileidentifierframe.h +113 -0
- data/ext/taglib/taglib-mswin32/include/taglib/unknownframe.h +79 -0
- data/ext/taglib/taglib-mswin32/include/taglib/unsynchronizedlyricsframe.h +157 -0
- data/ext/taglib/taglib-mswin32/include/taglib/urllinkframe.h +172 -0
- data/ext/taglib/taglib-mswin32/include/taglib/vorbisfile.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/vorbisproperties.h +125 -0
- data/ext/taglib/taglib-mswin32/include/taglib/wavpackfile.h +164 -0
- data/ext/taglib/taglib-mswin32/include/taglib/wavpackproperties.h +94 -0
- data/ext/taglib/taglib-mswin32/include/taglib/xingheader.h +100 -0
- data/ext/taglib/taglib-mswin32/include/taglib/xiphcomment.h +202 -0
- data/ext/taglib/taglib-mswin32/lib/pkgconfig/taglib_c.pc +12 -0
- data/ext/taglib/taglib-mswin32/lib/tag.lib +0 -0
- data/ext/taglib/taglib-mswin32/lib/tag_c.lib +0 -0
- data/ext/taglib/taglib_i386-mingw32.source +22645 -0
- data/ext/taglib/taglib_i386-mswin32.source +22645 -0
- data/ext/taglib/{taglib.cxx → taglib_x86_64-linux.source} +508 -75
- data/lib/TagLib.rb +3 -2
- data/lib/TagLib_doc.rb +1532 -1526
- data/lib/rtaglib_mswin32.rb +4 -0
- data/lib/tagfile.rb +6 -0
- data/swig/Doxyfile +0 -0
- data/swig/Rakefile +44 -19
- data/swig/TagLib_doc.rb +2755 -0
- data/swig/make_doc.rb +5 -4
- data/swig/process_cxx.rb +2 -2
- data/swig/rake_ext_conf.rb +33 -0
- data/swig/taglib.i +8 -5
- data/swig/test.rb +47 -39
- data/test/test_read.rb +4 -3
- data/test/test_taglib.rb +47 -39
- data/test/test_write.rb +4 -3
- metadata +96 -20
- data/ext/tagfile/extconf.rb +0 -14
- data/ext/taglib/extconf.rb +0 -22
- data/swig/extconf.rb +0 -22
@@ -0,0 +1,172 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2002 - 2008 by Scott Wheeler
|
3
|
+
email : wheeler@kde.org
|
4
|
+
copyright : (C) 2006 by Urs Fleisch
|
5
|
+
email : ufleisch@users.sourceforge.net
|
6
|
+
***************************************************************************/
|
7
|
+
|
8
|
+
/***************************************************************************
|
9
|
+
* This library is free software; you can redistribute it and/or modify *
|
10
|
+
* it under the terms of the GNU Lesser General Public License version *
|
11
|
+
* 2.1 as published by the Free Software Foundation. *
|
12
|
+
* *
|
13
|
+
* This library is distributed in the hope that it will be useful, but *
|
14
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
16
|
+
* Lesser General Public License for more details. *
|
17
|
+
* *
|
18
|
+
* You should have received a copy of the GNU Lesser General Public *
|
19
|
+
* License along with this library; if not, write to the Free Software *
|
20
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
21
|
+
* USA *
|
22
|
+
* *
|
23
|
+
* Alternatively, this file is available under the Mozilla Public *
|
24
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
25
|
+
* http://www.mozilla.org/MPL/ *
|
26
|
+
***************************************************************************/
|
27
|
+
|
28
|
+
#ifndef TAGLIB_URLLINKFRAME_H
|
29
|
+
#define TAGLIB_URLLINKFRAME_H
|
30
|
+
|
31
|
+
#include <id3v2frame.h>
|
32
|
+
|
33
|
+
namespace TagLib {
|
34
|
+
|
35
|
+
namespace ID3v2 {
|
36
|
+
|
37
|
+
//! ID3v2 URL frame
|
38
|
+
/*!
|
39
|
+
* An implementation of ID3v2 URL link frames.
|
40
|
+
*/
|
41
|
+
class TAGLIB_EXPORT UrlLinkFrame : public Frame
|
42
|
+
{
|
43
|
+
friend class FrameFactory;
|
44
|
+
|
45
|
+
public:
|
46
|
+
/*!
|
47
|
+
* This is a dual purpose constructor. \a data can either be binary data
|
48
|
+
* that should be parsed or (at a minimum) the frame ID.
|
49
|
+
*/
|
50
|
+
explicit UrlLinkFrame(const ByteVector &data);
|
51
|
+
|
52
|
+
/*!
|
53
|
+
* Destroys this UrlLinkFrame instance.
|
54
|
+
*/
|
55
|
+
virtual ~UrlLinkFrame();
|
56
|
+
|
57
|
+
/*!
|
58
|
+
* Returns the URL.
|
59
|
+
*/
|
60
|
+
virtual String url() const;
|
61
|
+
|
62
|
+
/*!
|
63
|
+
* Sets the URL to \a s.
|
64
|
+
*/
|
65
|
+
virtual void setUrl(const String &s);
|
66
|
+
|
67
|
+
// Reimplementations.
|
68
|
+
|
69
|
+
virtual void setText(const String &s);
|
70
|
+
virtual String toString() const;
|
71
|
+
|
72
|
+
protected:
|
73
|
+
virtual void parseFields(const ByteVector &data);
|
74
|
+
virtual ByteVector renderFields() const;
|
75
|
+
|
76
|
+
/*!
|
77
|
+
* The constructor used by the FrameFactory.
|
78
|
+
*/
|
79
|
+
UrlLinkFrame(const ByteVector &data, Header *h);
|
80
|
+
|
81
|
+
private:
|
82
|
+
UrlLinkFrame(const UrlLinkFrame &);
|
83
|
+
UrlLinkFrame &operator=(const UrlLinkFrame &);
|
84
|
+
|
85
|
+
class UrlLinkFramePrivate;
|
86
|
+
UrlLinkFramePrivate *d;
|
87
|
+
};
|
88
|
+
|
89
|
+
//! ID3v2 User defined URL frame
|
90
|
+
|
91
|
+
/*!
|
92
|
+
* This is a specialization of URL link frames that allows for
|
93
|
+
* user defined entries. Each entry has a description in addition to the
|
94
|
+
* normal list of fields that a URL link frame has.
|
95
|
+
*
|
96
|
+
* This description identifies the frame and must be unique.
|
97
|
+
*/
|
98
|
+
class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
|
99
|
+
{
|
100
|
+
friend class FrameFactory;
|
101
|
+
|
102
|
+
public:
|
103
|
+
/*!
|
104
|
+
* Constructs an empty user defined URL link frame. For this to be
|
105
|
+
* a useful frame both a description and text must be set.
|
106
|
+
*/
|
107
|
+
explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
|
108
|
+
|
109
|
+
/*!
|
110
|
+
* This is a dual purpose constructor. \a data can either be binary data
|
111
|
+
* that should be parsed or (at a minimum) the frame ID.
|
112
|
+
*/
|
113
|
+
explicit UserUrlLinkFrame(const ByteVector &data);
|
114
|
+
|
115
|
+
/*!
|
116
|
+
* Destroys this UserUrlLinkFrame instance.
|
117
|
+
*/
|
118
|
+
virtual ~UserUrlLinkFrame();
|
119
|
+
|
120
|
+
// Reimplementations.
|
121
|
+
|
122
|
+
virtual String toString() const;
|
123
|
+
|
124
|
+
/*!
|
125
|
+
* Returns the text encoding that will be used in rendering this frame.
|
126
|
+
* This defaults to the type that was either specified in the constructor
|
127
|
+
* or read from the frame when parsed.
|
128
|
+
*
|
129
|
+
* \see setTextEncoding()
|
130
|
+
* \see render()
|
131
|
+
*/
|
132
|
+
String::Type textEncoding() const;
|
133
|
+
|
134
|
+
/*!
|
135
|
+
* Sets the text encoding to be used when rendering this frame to
|
136
|
+
* \a encoding.
|
137
|
+
*
|
138
|
+
* \see textEncoding()
|
139
|
+
* \see render()
|
140
|
+
*/
|
141
|
+
void setTextEncoding(String::Type encoding);
|
142
|
+
|
143
|
+
/*!
|
144
|
+
* Returns the description for this frame.
|
145
|
+
*/
|
146
|
+
String description() const;
|
147
|
+
|
148
|
+
/*!
|
149
|
+
* Sets the description of the frame to \a s. \a s must be unique.
|
150
|
+
*/
|
151
|
+
void setDescription(const String &s);
|
152
|
+
|
153
|
+
protected:
|
154
|
+
virtual void parseFields(const ByteVector &data);
|
155
|
+
virtual ByteVector renderFields() const;
|
156
|
+
|
157
|
+
/*!
|
158
|
+
* The constructor used by the FrameFactory.
|
159
|
+
*/
|
160
|
+
UserUrlLinkFrame(const ByteVector &data, Header *h);
|
161
|
+
|
162
|
+
private:
|
163
|
+
UserUrlLinkFrame(const UserUrlLinkFrame &);
|
164
|
+
UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
|
165
|
+
|
166
|
+
class UserUrlLinkFramePrivate;
|
167
|
+
UserUrlLinkFramePrivate *d;
|
168
|
+
};
|
169
|
+
|
170
|
+
}
|
171
|
+
}
|
172
|
+
#endif
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2002 - 2008 by Scott Wheeler
|
3
|
+
email : wheeler@kde.org
|
4
|
+
***************************************************************************/
|
5
|
+
|
6
|
+
/***************************************************************************
|
7
|
+
* This library is free software; you can redistribute it and/or modify *
|
8
|
+
* it under the terms of the GNU Lesser General Public License version *
|
9
|
+
* 2.1 as published by the Free Software Foundation. *
|
10
|
+
* *
|
11
|
+
* This library is distributed in the hope that it will be useful, but *
|
12
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
14
|
+
* Lesser General Public License for more details. *
|
15
|
+
* *
|
16
|
+
* You should have received a copy of the GNU Lesser General Public *
|
17
|
+
* License along with this library; if not, write to the Free Software *
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
19
|
+
* USA *
|
20
|
+
* *
|
21
|
+
* Alternatively, this file is available under the Mozilla Public *
|
22
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
23
|
+
* http://www.mozilla.org/MPL/ *
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
#ifndef TAGLIB_VORBISFILE_H
|
27
|
+
#define TAGLIB_VORBISFILE_H
|
28
|
+
|
29
|
+
#include "taglib_export.h"
|
30
|
+
#include "oggfile.h"
|
31
|
+
#include "xiphcomment.h"
|
32
|
+
|
33
|
+
#include "vorbisproperties.h"
|
34
|
+
|
35
|
+
namespace TagLib {
|
36
|
+
|
37
|
+
/*
|
38
|
+
* This is just to make this appear to be in the Ogg namespace in the
|
39
|
+
* documentation. The typedef below will make this work with the current code.
|
40
|
+
* In the next BIC version of TagLib this will be really moved into the Ogg
|
41
|
+
* namespace.
|
42
|
+
*/
|
43
|
+
|
44
|
+
#ifdef DOXYGEN
|
45
|
+
namespace Ogg {
|
46
|
+
#endif
|
47
|
+
|
48
|
+
//! A namespace containing classes for Vorbis metadata
|
49
|
+
|
50
|
+
namespace Vorbis {
|
51
|
+
|
52
|
+
|
53
|
+
//! An implementation of Ogg::File with Vorbis specific methods
|
54
|
+
|
55
|
+
/*!
|
56
|
+
* This is the central class in the Ogg Vorbis metadata processing collection
|
57
|
+
* of classes. It's built upon Ogg::File which handles processing of the Ogg
|
58
|
+
* logical bitstream and breaking it down into pages which are handled by
|
59
|
+
* the codec implementations, in this case Vorbis specifically.
|
60
|
+
*/
|
61
|
+
|
62
|
+
class TAGLIB_EXPORT File : public Ogg::File
|
63
|
+
{
|
64
|
+
public:
|
65
|
+
/*!
|
66
|
+
* Contructs a Vorbis file from \a file. If \a readProperties is true the
|
67
|
+
* file's audio properties will also be read using \a propertiesStyle. If
|
68
|
+
* false, \a propertiesStyle is ignored.
|
69
|
+
*/
|
70
|
+
File(FileName file, bool readProperties = true,
|
71
|
+
Properties::ReadStyle propertiesStyle = Properties::Average);
|
72
|
+
|
73
|
+
/*!
|
74
|
+
* Destroys this instance of the File.
|
75
|
+
*/
|
76
|
+
virtual ~File();
|
77
|
+
|
78
|
+
/*!
|
79
|
+
* Returns the XiphComment for this file. XiphComment implements the tag
|
80
|
+
* interface, so this serves as the reimplementation of
|
81
|
+
* TagLib::File::tag().
|
82
|
+
*/
|
83
|
+
virtual Ogg::XiphComment *tag() const;
|
84
|
+
|
85
|
+
/*!
|
86
|
+
* Returns the Vorbis::Properties for this file. If no audio properties
|
87
|
+
* were read then this will return a null pointer.
|
88
|
+
*/
|
89
|
+
virtual Properties *audioProperties() const;
|
90
|
+
|
91
|
+
virtual bool save();
|
92
|
+
|
93
|
+
private:
|
94
|
+
File(const File &);
|
95
|
+
File &operator=(const File &);
|
96
|
+
|
97
|
+
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
98
|
+
|
99
|
+
class FilePrivate;
|
100
|
+
FilePrivate *d;
|
101
|
+
};
|
102
|
+
}
|
103
|
+
|
104
|
+
/*
|
105
|
+
* To keep compatibility with the current version put Vorbis in the Ogg namespace
|
106
|
+
* only in the docs and provide a typedef to make it work. In the next BIC
|
107
|
+
* version this will be removed and it will only exist in the Ogg namespace.
|
108
|
+
*/
|
109
|
+
|
110
|
+
#ifdef DOXYGEN
|
111
|
+
}
|
112
|
+
#else
|
113
|
+
namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } }
|
114
|
+
#endif
|
115
|
+
|
116
|
+
}
|
117
|
+
|
118
|
+
#endif
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2002 - 2008 by Scott Wheeler
|
3
|
+
email : wheeler@kde.org
|
4
|
+
***************************************************************************/
|
5
|
+
|
6
|
+
/***************************************************************************
|
7
|
+
* This library is free software; you can redistribute it and/or modify *
|
8
|
+
* it under the terms of the GNU Lesser General Public License version *
|
9
|
+
* 2.1 as published by the Free Software Foundation. *
|
10
|
+
* *
|
11
|
+
* This library is distributed in the hope that it will be useful, but *
|
12
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
14
|
+
* Lesser General Public License for more details. *
|
15
|
+
* *
|
16
|
+
* You should have received a copy of the GNU Lesser General Public *
|
17
|
+
* License along with this library; if not, write to the Free Software *
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
19
|
+
* USA *
|
20
|
+
* *
|
21
|
+
* Alternatively, this file is available under the Mozilla Public *
|
22
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
23
|
+
* http://www.mozilla.org/MPL/ *
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
#ifndef TAGLIB_VORBISPROPERTIES_H
|
27
|
+
#define TAGLIB_VORBISPROPERTIES_H
|
28
|
+
|
29
|
+
#include "taglib_export.h"
|
30
|
+
#include "audioproperties.h"
|
31
|
+
|
32
|
+
namespace TagLib {
|
33
|
+
|
34
|
+
/*
|
35
|
+
* This is just to make this appear to be in the Ogg namespace in the
|
36
|
+
* documentation. The typedef below will make this work with the current code.
|
37
|
+
* In the next BIC version of TagLib this will be really moved into the Ogg
|
38
|
+
* namespace.
|
39
|
+
*/
|
40
|
+
|
41
|
+
#ifdef DOXYGEN
|
42
|
+
namespace Ogg {
|
43
|
+
#endif
|
44
|
+
|
45
|
+
namespace Vorbis {
|
46
|
+
|
47
|
+
class File;
|
48
|
+
|
49
|
+
//! An implementation of audio property reading for Ogg Vorbis
|
50
|
+
|
51
|
+
/*!
|
52
|
+
* This reads the data from an Ogg Vorbis stream found in the AudioProperties
|
53
|
+
* API.
|
54
|
+
*/
|
55
|
+
|
56
|
+
class TAGLIB_EXPORT Properties : public AudioProperties
|
57
|
+
{
|
58
|
+
public:
|
59
|
+
/*!
|
60
|
+
* Create an instance of Vorbis::Properties with the data read from the
|
61
|
+
* Vorbis::File \a file.
|
62
|
+
*/
|
63
|
+
Properties(File *file, ReadStyle style = Average);
|
64
|
+
|
65
|
+
/*!
|
66
|
+
* Destroys this VorbisProperties instance.
|
67
|
+
*/
|
68
|
+
virtual ~Properties();
|
69
|
+
|
70
|
+
// Reimplementations.
|
71
|
+
|
72
|
+
virtual int length() const;
|
73
|
+
virtual int bitrate() const;
|
74
|
+
virtual int sampleRate() const;
|
75
|
+
virtual int channels() const;
|
76
|
+
|
77
|
+
/*!
|
78
|
+
* Returns the Vorbis version, currently "0" (as specified by the spec).
|
79
|
+
*/
|
80
|
+
int vorbisVersion() const;
|
81
|
+
|
82
|
+
/*!
|
83
|
+
* Returns the maximum bitrate as read from the Vorbis identification
|
84
|
+
* header.
|
85
|
+
*/
|
86
|
+
int bitrateMaximum() const;
|
87
|
+
|
88
|
+
/*!
|
89
|
+
* Returns the nominal bitrate as read from the Vorbis identification
|
90
|
+
* header.
|
91
|
+
*/
|
92
|
+
int bitrateNominal() const;
|
93
|
+
|
94
|
+
/*!
|
95
|
+
* Returns the minimum bitrate as read from the Vorbis identification
|
96
|
+
* header.
|
97
|
+
*/
|
98
|
+
int bitrateMinimum() const;
|
99
|
+
|
100
|
+
private:
|
101
|
+
Properties(const Properties &);
|
102
|
+
Properties &operator=(const Properties &);
|
103
|
+
|
104
|
+
void read();
|
105
|
+
|
106
|
+
class PropertiesPrivate;
|
107
|
+
PropertiesPrivate *d;
|
108
|
+
};
|
109
|
+
}
|
110
|
+
|
111
|
+
/*
|
112
|
+
* To keep compatibility with the current version put Vorbis in the Ogg namespace
|
113
|
+
* only in the docs and provide a typedef to make it work. In the next BIC
|
114
|
+
* version this will be removed and it will only exist in the Ogg namespace.
|
115
|
+
*/
|
116
|
+
|
117
|
+
#ifdef DOXYGEN
|
118
|
+
}
|
119
|
+
#else
|
120
|
+
namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } }
|
121
|
+
#endif
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
#endif
|
@@ -0,0 +1,164 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2006 by Lukáš Lalinský
|
3
|
+
email : lalinsky@gmail.com
|
4
|
+
|
5
|
+
copyright : (C) 2004 by Allan Sandfeld Jensen
|
6
|
+
email : kde@carewolf.org
|
7
|
+
(original MPC implementation)
|
8
|
+
***************************************************************************/
|
9
|
+
|
10
|
+
/***************************************************************************
|
11
|
+
* This library is free software; you can redistribute it and/or modify *
|
12
|
+
* it under the terms of the GNU Lesser General Public License version *
|
13
|
+
* 2.1 as published by the Free Software Foundation. *
|
14
|
+
* *
|
15
|
+
* This library is distributed in the hope that it will be useful, but *
|
16
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
17
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
18
|
+
* Lesser General Public License for more details. *
|
19
|
+
* *
|
20
|
+
* You should have received a copy of the GNU Lesser General Public *
|
21
|
+
* License along with this library; if not, write to the Free Software *
|
22
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
23
|
+
* USA *
|
24
|
+
* *
|
25
|
+
* Alternatively, this file is available under the Mozilla Public *
|
26
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
27
|
+
* http://www.mozilla.org/MPL/ *
|
28
|
+
***************************************************************************/
|
29
|
+
|
30
|
+
#ifndef TAGLIB_WVFILE_H
|
31
|
+
#define TAGLIB_WVFILE_H
|
32
|
+
|
33
|
+
#include <tfile.h>
|
34
|
+
#include "taglib_export.h"
|
35
|
+
#include "wavpackproperties.h"
|
36
|
+
|
37
|
+
namespace TagLib {
|
38
|
+
|
39
|
+
class Tag;
|
40
|
+
|
41
|
+
namespace ID3v1 { class Tag; }
|
42
|
+
namespace APE { class Tag; }
|
43
|
+
|
44
|
+
//! An implementation of WavPack metadata
|
45
|
+
|
46
|
+
/*!
|
47
|
+
* This is implementation of WavPack metadata.
|
48
|
+
*
|
49
|
+
* This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream
|
50
|
+
* properties from the file.
|
51
|
+
*/
|
52
|
+
|
53
|
+
namespace WavPack {
|
54
|
+
|
55
|
+
//! An implementation of TagLib::File with WavPack specific methods
|
56
|
+
|
57
|
+
/*!
|
58
|
+
* This implements and provides an interface for WavPack files to the
|
59
|
+
* TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
|
60
|
+
* the abstract TagLib::File API as well as providing some additional
|
61
|
+
* information specific to WavPack files.
|
62
|
+
*/
|
63
|
+
|
64
|
+
class TAGLIB_EXPORT File : public TagLib::File
|
65
|
+
{
|
66
|
+
public:
|
67
|
+
/*!
|
68
|
+
* This set of flags is used for various operations and is suitable for
|
69
|
+
* being OR-ed together.
|
70
|
+
*/
|
71
|
+
enum TagTypes {
|
72
|
+
//! Empty set. Matches no tag types.
|
73
|
+
NoTags = 0x0000,
|
74
|
+
//! Matches ID3v1 tags.
|
75
|
+
ID3v1 = 0x0001,
|
76
|
+
//! Matches APE tags.
|
77
|
+
APE = 0x0002,
|
78
|
+
//! Matches all tag types.
|
79
|
+
AllTags = 0xffff
|
80
|
+
};
|
81
|
+
|
82
|
+
/*!
|
83
|
+
* Contructs an WavPack file from \a file. If \a readProperties is true the
|
84
|
+
* file's audio properties will also be read using \a propertiesStyle. If
|
85
|
+
* false, \a propertiesStyle is ignored.
|
86
|
+
*/
|
87
|
+
File(FileName file, bool readProperties = true,
|
88
|
+
Properties::ReadStyle propertiesStyle = Properties::Average);
|
89
|
+
|
90
|
+
/*!
|
91
|
+
* Destroys this instance of the File.
|
92
|
+
*/
|
93
|
+
virtual ~File();
|
94
|
+
|
95
|
+
/*!
|
96
|
+
* Returns the Tag for this file. This will be an APE tag, an ID3v1 tag
|
97
|
+
* or a combination of the two.
|
98
|
+
*/
|
99
|
+
virtual TagLib::Tag *tag() const;
|
100
|
+
|
101
|
+
/*!
|
102
|
+
* Returns the MPC::Properties for this file. If no audio properties
|
103
|
+
* were read then this will return a null pointer.
|
104
|
+
*/
|
105
|
+
virtual Properties *audioProperties() const;
|
106
|
+
|
107
|
+
/*!
|
108
|
+
* Saves the file.
|
109
|
+
*/
|
110
|
+
virtual bool save();
|
111
|
+
|
112
|
+
/*!
|
113
|
+
* Returns a pointer to the ID3v1 tag of the file.
|
114
|
+
*
|
115
|
+
* If \a create is false (the default) this will return a null pointer
|
116
|
+
* if there is no valid ID3v1 tag. If \a create is true it will create
|
117
|
+
* an ID3v1 tag if one does not exist. If there is already an APE tag, the
|
118
|
+
* new ID3v1 tag will be placed after it.
|
119
|
+
*
|
120
|
+
* \note The Tag <b>is still</b> owned by the APE::File and should not be
|
121
|
+
* deleted by the user. It will be deleted when the file (object) is
|
122
|
+
* destroyed.
|
123
|
+
*/
|
124
|
+
ID3v1::Tag *ID3v1Tag(bool create = false);
|
125
|
+
|
126
|
+
/*!
|
127
|
+
* Returns a pointer to the APE tag of the file.
|
128
|
+
*
|
129
|
+
* If \a create is false (the default) this will return a null pointer
|
130
|
+
* if there is no valid APE tag. If \a create is true it will create
|
131
|
+
* a APE tag if one does not exist.
|
132
|
+
*
|
133
|
+
* \note The Tag <b>is still</b> owned by the APE::File and should not be
|
134
|
+
* deleted by the user. It will be deleted when the file (object) is
|
135
|
+
* destroyed.
|
136
|
+
*/
|
137
|
+
APE::Tag *APETag(bool create = false);
|
138
|
+
|
139
|
+
/*!
|
140
|
+
* This will remove the tags that match the OR-ed together TagTypes from the
|
141
|
+
* file. By default it removes all tags.
|
142
|
+
*
|
143
|
+
* \note This will also invalidate pointers to the tags
|
144
|
+
* as their memory will be freed.
|
145
|
+
* \note In order to make the removal permanent save() still needs to be called
|
146
|
+
*/
|
147
|
+
void strip(int tags = AllTags);
|
148
|
+
|
149
|
+
private:
|
150
|
+
File(const File &);
|
151
|
+
File &operator=(const File &);
|
152
|
+
|
153
|
+
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
154
|
+
void scan();
|
155
|
+
long findID3v1();
|
156
|
+
long findAPE();
|
157
|
+
|
158
|
+
class FilePrivate;
|
159
|
+
FilePrivate *d;
|
160
|
+
};
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
#endif
|