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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
#define CURRENT_VERSION "1.98"
#define HOMEPAGE "http://sourceforge.net/project/?group_id=6126"
#define AUTHOR "Eric Bullen <ericb at thedeepsky.com>"
#define TRUE 1
#define FALSE 0
#define PASS 1
#define FAIL 0
#define YES 1
#define NO 0
#define BUFFER_LENGTH 128
//
// General MP3 file info
//
typedef struct {
int file_pos;
int good_frame_count;
int bad_frame_count;
// This variable stores the number of
// contiguous number of frames found, and is reset
// back to zero on the discovery of a
// bad frame. This is used for the '-q'
// option.
int frame_sequence_count;
int byte_count;
// This is set to 4 so it works corectly
// with a frame being the first thing in a file.
int next_expected_frame;
// This stores the length of the song in seconds.
double time_in_seconds;
} gen_info;
//
// VBR Structure
//
typedef struct {
int high_rate;
int low_rate;
int sum_rate;
int ave_rate;
} vbr_data;
//
// MP3 Time Structure
//
typedef struct {
int minutes;
int seconds;
int frac_second;
} mp3_time;
//
// Structure to hold the flag options.
//
typedef struct {
// Well, there are flags, and then
// there are the opions that the flags
// can have. This structure stores those
// options. This structure is small
// now, but it'll probably grow pretty fast.
int byte_limit;
int min_frame_seq;
} meta_options;
//
// Store all the flags in a cool structure for easy referencing
// in funtions.
//
typedef struct {
//
// These are the flags that come
// off the commandline.
//
int aflag;
int bflag;
int eflag;
int fflag;
int iflag;
int pflag;
int qflag;
int sflag;
int ssflag;
int vflag;
int vvflag;
} command_flags;
//
// Create a structure for easy frame info storage
//
typedef struct {
//
// Declare variables for the header storage
//
int FRAME_LENGTH;
int FRAME_DATA_LENGTH;
int BIT_RATE;
int SAMPLE_FREQ;
int SAMPLES_PER_FRAME;
short int MPV_1, MPV_2, MPV_25, MPV_RESERVED; // MPEG Version
short int L1, L2, L3, L_RESERVED; // Layer Version
short int PROT_BIT; // Protection Bit
short int PAD_BIT;
short int PRIV_BIT;
short int STEREO;
short int JOINT_STEREO;
short int DUAL_STEREO;
short int SINGLE_CHANNEL;
short int MODE_EXTENSION; // Do not use this one right now.
short int ID3V2;
short int COPYRIGHT;
short int ORIGINAL;
short int EMPH_NONE;
short int EMPH_5015;
short int EMPH_RESERV;
short int EMPH_CCIT;
char BIN_STRING[33];
int INT_HEADER;
short int CRC16_VALUE;
short int CORRECT_CRC16_VALUE;
short int check_state;
} frame_info;
//
// This gives info about the id3 tag found in the last part
// of the mp3 file.
//
typedef struct {
short int TAG_PRESENT;
short int ID3_311_VERSION;
char TITLE[31];
char ARTIST[31];
char ALBUM[31];
char YEAR[5];
char COMMENT[31];
short int GENRE;
short int TRACK_NUMBER;
short int COMPLIANT_PAD_FIELDS;
} id3_tag_info;
|