libsaria: Find audio information, too
Length, bitrate and various other fields. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
97a0bb7260
commit
c38eaccf3a
|
@ -21,11 +21,11 @@ namespace libsaria
|
|||
/* string lenstr;*/
|
||||
unsigned int year;
|
||||
unsigned int track;
|
||||
/* int length;
|
||||
int length;
|
||||
int bitrate;
|
||||
int sample;
|
||||
int channels;
|
||||
sid_t songid;
|
||||
/* sid_t songid;
|
||||
|
||||
string *artist_lc;
|
||||
string *album_lc;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace libsaria
|
|||
void Track::read_tags()
|
||||
{
|
||||
TagLib::Tag *tag;
|
||||
//TagLib::AudioProperties *prop;
|
||||
TagLib::AudioProperties *prop;
|
||||
TagLib::FileRef ref(filepath.c_str());
|
||||
|
||||
if (ref.isNull())
|
||||
|
@ -29,6 +29,13 @@ namespace libsaria
|
|||
genre = tag->genre().to8Bit(true);
|
||||
year = tag->year();
|
||||
track = tag->track();
|
||||
|
||||
/* Extract audio properties */
|
||||
prop = ref.audioProperties();
|
||||
length = prop->length();
|
||||
bitrate = prop->bitrate();
|
||||
sample = prop->sampleRate();
|
||||
channels = prop->channels();
|
||||
}
|
||||
|
||||
Track::Track(string file, struct library::Path *lib_path)
|
||||
|
|
Loading…
Reference in New Issue