hathor-cpp-scanner/scanner.hh

81 lines
1.7 KiB
C++

//
// Created by eric on 8/15/15.
//
#ifndef HATHOR_SCANNER_HH
#define HATHOR_SCANNER_HH
#include <cstdio>
#include <iomanip>
#include <cstring>
// Include boost
#include "boost/filesystem.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/progress.hpp"
// Include taglib
#include <taglib/taglib.h>
#include <taglib/fileref.h>
#include <taglib/tpropertymap.h>
#include <taglib/mp4file.h>
#include <taglib/mpegfile.h>
#include "common.hh"
#ifndef HATHOR_MAX_SUPPORTED
#define HATHOR_MAX_SUPPORTED 9
#endif
unsigned long file_count = 0;
unsigned long dir_count = 0;
unsigned long other_count = 0;
unsigned long err_count = 0;
unsigned long skip_count = 0;
unsigned long no_info_count = 0;
static std::array<std::string,HATHOR_MAX_SUPPORTED> s_fileTypeStrings =
{"","mp2","mp3","mp4","m4p","m4a","ogg","flac","wma"};
struct s_fileFields {
std::string artist;
std::string albumartist;
std::string album;
std::string title;
unsigned int tracknum;
std::string genre;
unsigned int year;
std::string label;
std::string lyrics;
std::string comment;
unsigned int bitrate;
unsigned int sample;
unsigned int channels;
unsigned int length;
unsigned int minutes; // (properties->length() - seconds) / 60
unsigned int seconds; // properties->length() % 60
};
enum FileType
{
Unknown = 0,
mp2 = 1,
mp3 = 2,
mp4 = 3, // please use just for Ogg Vorbis
m4p = 4,
m4a = 5,
ogg = 6, // a file in MPEG-4 container that may or may not contain video
flac = 7, // a file in MPEG-4 container that contains only audio
wma = 8
};
//static FileType fileType( std::string extension );
//static bool is_hidden(const fs::path &p);
#endif //HATHOR_SCANNER_HH