summaryrefslogtreecommitdiffstats
path: root/noatun/modules/winskin/fileInfo.cpp
blob: 5cd2779ffdf5b813c6be1fd43250ed064df484db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <noatun/app.h>
#include <noatun/playlist.h>

#include <tqstring.h>
#include <tdefilemetainfo.h>

#include "fileInfo.h"

fileInfo::fileInfo(const PlaylistItem &item)
{
    TQString prop;

    prop = item.property("bitrate");
    if (prop.isNull())
        _bps = 0;
    else
        _bps = prop.toInt();

    prop = item.property("samplerate");
    if (prop.isNull())
        _KHz = 44100;
    else
        _KHz = prop.toInt();

    prop = item.property("channels");
    if (prop.isNull())
        _channelCount = 2;
    else
        _channelCount = prop.toInt();
}

fileInfo::~fileInfo()
{
}

unsigned int fileInfo::bps()
{
    return _bps;
}

unsigned int fileInfo::KHz()
{
    return _KHz;
}

unsigned int fileInfo::channelCount()
{
    return _channelCount;
}