1 /************************************************************* 2 * mpgtx an mpeg toolbox * 3 * by Laurent Alacoque <laureck@users.sourceforge.net> * 4 * (c) 2001 * 5 * You may copy, modify and redistribute this * 6 * source file under the terms of the GNU Public License * 7 ************************************************************/ 8 9 #ifndef __id3command_hh_ 10 #define __id3command_hh_ 11 12 #include <stdio.h> 13 #include <string.h> 14 #include "common.hh" 15 16 // needed by move 17 #include <sys/types.h> 18 #include <sys/stat.h> 19 #include <unistd.h> 20 #include <errno.h> 21 //for the home dir 22 #include <pwd.h> 23 // end needed 24 25 bool id3_Show_Only =false; 26 27 /** 28 * ID3v1 TAG with additional character for each string termination 29 */ 30 typedef struct { 31 char title [31]; 32 char artist [31]; 33 char album [31]; 34 char year [5]; 35 char comment [31]; 36 int track; 37 unsigned char genre; 38 } myID3tag; 39 40 #define NOT_MP3 0 41 #define REAL_MP3 1 42 #define FAKE_MP3 2 43 44 typedef struct { 45 FILE* thefile; 46 myID3tag* thetag; 47 int filetype; 48 } OpenedFile; 49 50 int ParseID3Command(int argc, char** argv, int argc_offset); 51 int ParseShow(int argc, char** argv, int argc_offset); 52 int ParseSet(int argc, char** argv, int argc_offset); 53 int ParseMov(int argc, char** argv, int argc_offset); 54 int ParseDel(int argc, char** argv, int argc_offset); 55 // include for ParseDel() 56 #ifdef _WIN32 57 // windows version 58 // del mode is not implemented under windows 59 #else 60 #include <unistd.h> 61 #endif 62 63 OpenedFile* OpenFile(char* FileName); 64 65 bool SetID3(char* format,OpenedFile* tag); 66 void WriteID3(OpenedFile* filename); 67 bool AskDirCreation(char* path); 68 void Move2(const char* name,const char* basedir,const char* dest); 69 70 #endif // __id3command_hh_ 71