audiodata.h 2.17 KB
Newer Older
1
/***************************************************************************
2 3
 AudioData.h is a modified version of fileinfo.h which is a part of
 Mp3Kult (C) 2001 by Stefano Brustia (hio@lombardiacom.it) which is
4 5 6 7
 available at:

 http://mp3kult.sourceforge.net/

8
 fileinfo.h was modified to just include header information instead of
9
 header and id3 information.  These changes were made by Scott Wheeler
10
 (wheeler@kde.org) on 1/13/2002 based on Mp3Kult v0.5.
11

12
***************************************************************************/
13 14 15 16 17 18 19 20

/***************************************************************************
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

21

22 23
#ifndef AUDIODATA_H
#define AUDIODATA_H
24

25 26
#include <qstring.h>

27 28 29 30 31
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>

32 33 34 35 36
// I've started hacking a little on this file; both the API and the 
// implementation.  There's still a lot of ugly, non-Qt-happy stuff
// in here, but that will be fixed, well, as I feel motivated.
// (And fortunately I can blame someone else for this file. ;-) )

37
class AudioData
38 39 40
{

public:
41
    AudioData(const char* filein);
42
    virtual ~AudioData();
43

44 45 46 47 48 49 50 51 52
    int getBitrate() const;
    int getSamplerate() const;
    QString getMpegver() const;
    int getLayer() const;
    static QString getMode(int mode);
    int getMode() const;
    int getLength() const;
    QString getLengthChar() const;
    int getSize() const;
53

54
    bool getResult() const;
55 56 57

private:

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
    bool success;
    char* fileglob;
    int length;
    int version;
    int filelen;
    int layer;
    int error_protection;
    int bitrate_index;
    int sampling_frequency;
    int padding;
    int extension;
    int mode;
    int mode_ext;
    int copyright;
    int original;
    int emphasis;
74

75 76
    bool headCheck(unsigned long head);
    bool readLayerInfo(FILE* file);
77 78 79
};

#endif // MPEGHEADER_H