Return the correct codec/format type for all the supported file types.

This commit is contained in:
codestation
2013-09-14 17:30:10 -04:30
parent 339b08704a
commit 6bff6b9831
6 changed files with 90 additions and 35 deletions

View File

@@ -25,7 +25,27 @@
#include <vitamtp.h>
#define OHFI_OFFSET 1000
#define OHFI_OFFSET 256
#define FILE_FORMAT_MP4 1
#define FILE_FORMAT_WAV 2
#define FILE_FORMAT_MP3 3
#define FILE_FORMAT_JPG 4
#define FILE_FORMAT_PNG 5
#define FILE_FORMAT_GIF 6
#define FILE_FORMAT_BMP 7
#define FILE_FORMAT_TIF 8
#define CODEC_TYPE_MPEG4 2
#define CODEC_TYPE_AVC 3
#define CODEC_TYPE_MP3 12
#define CODEC_TYPE_AAC 13
#define CODEC_TYPE_PCM 15
#define CODEC_TYPE_JPG 17
#define CODEC_TYPE_PNG 18
#define CODEC_TYPE_TIF 19
#define CODEC_TYPE_BMP 20
#define CODEC_TYPE_GIF 21
class CMAObject
{
@@ -38,7 +58,7 @@ public:
void rename(const QString &name);
void updateObjectSize(qint64 size);
bool hasParent(const CMAObject *obj);
void initObject(const QFileInfo &file);
void initObject(const QFileInfo &file, int file_type = -1);
bool operator==(const CMAObject &obj);
bool operator!=(const CMAObject &obj);
@@ -52,6 +72,16 @@ public:
ohfi_count = OHFI_OFFSET;
}
typedef struct {
const char *file_ext;
int file_format;
int file_codec;
} file_type;
static const file_type audio_list[3];
static const file_type photo_list[7];
static const char *video_list[1];
QString path;
CMAObject *parent;
metadata_t metadata;