1 #ifndef BOOL
2 #define BOOL unsigned char
3 #endif
4 #ifndef TRUE
5 #define TRUE (1==1)
6 #endif
7 #ifndef FALSE
8 #define FALSE (1==0)
9 #endif
10 
11 typedef struct _field_select_typ {
12   char *field;
13   char *dest;
14   char *information;
15   struct _field_select_typ *next;
16   struct _field_select_typ *prev;
17 } field_select_typ;
18 
19 typedef struct _song_typ {
20   BOOL convert;           /* Convert to mp3 */
21   char *artist;           /* Artist of Song */
22   char *title;            /* Title of Song  */
23   char *album;            /* Albumname      */
24   char *comment;          /* Comment        */
25   int year;               /* year           */
26   int genre;              /* mp3 - genre    */
27   char *filename;         /* Filename       */
28   char *dirname;          /* Dirname        */
29   BOOL on_fly;            /* Convert on fly */
30   char toc;               /* Tracknumber    */
31   BOOL fn_auto;           /* generate fname */
32   long int cddb_id;       /* ID of CDDB     */
33   char *tmp_wav_file;     /* ripped wavefile*/
34   long int frame_len;     /* length of file */
35   BOOL sampler;           /* is sampler?    */
36   struct _song_typ *next; /* Pointer        */
37   struct _song_typ *prev;
38 } song_typ;
39 
40 
41 #define PRG_VERSION VERSION
42 
43 /* Default values */
44 #define MP3C_RCFILE     "mp3crc"
45 #define DEF_ETC_PATH    "/usr/local/etc"
46 #define TOT_GENRES      147
47 #define MP3C_BACKSPACE	''
48 #define MP3C_LOCKFILE   "~/.mp3c.lock"
49 
50 #include <stdio.h>
51 #include <stdlib.h>
52 #ifdef HAVE_FCNTL_H
53 #include <fcntl.h>
54 #endif
55 
56 #ifdef HAVE_UNISTD_H
57 #include <unistd.h>
58 #endif
59 
60 #ifdef HAVE_STRINGS_H
61 #include <strings.h>
62 #endif
63 
64 #ifdef HAVE_SYS_IOCTL_H
65 #include <sys/ioctl.h>
66 #endif
67 
68 #ifdef HAVE_SYS_TIME_H
69 #include <sys/time.h>
70 #endif
71 
72 #ifdef HAVE_STRING_H
73 #include <string.h>
74 #endif
75 
76 #ifdef HAVE_TIME_H
77 #include <time.h>
78 #endif
79 
80 /* Hmm, there seems to be two definitions ;-) */
81 #ifdef ENABLE_NLS
82 #ifndef HAVE_NLS
83 #define HAVE_NLS 1
84 #endif
85 #endif
86 
87 #ifdef HAVE_NLS
88 #ifdef HAVE_LIBINTL_H
89 #include <libintl.h>
90 #else
91 #include "../intl/libintl.h"
92 #endif
93 #ifdef HAVE_LOCALE_H
94 #include <locale.h>
95 #endif
96 #define _(str) gettext(str)
97 #else
98 #define _(str) str
99 #endif
100 
101 /* --- selectable presets ------------------------------------------- */
102 #define PRE1_PATTERN	"%7-%8.ogg"	/* pattern: %1:artist,%2:title,
103 					 * %3:album,%4:genre,%5:year,
104 					 * %6:track,%7:track (leading 0s),
105 					 * %8:cddb-id */
106 #define PRE1_PATTERN_M	"%3/%1-%2.ogg"
107 #define PRE1_ENC_INFO	"0"
108 #define PRE1_ENC_NF	"oggenc -b 192 -l \"%3\" -d \"%5\" -c \"comment=%6\" -N \"%a\" -a \"%c\" -t \"%d\" -o \"%2\" \"%1\""
109 #define PRE1_ENC_OF	"oggenc -b 192 -l \"%3\" -d \"%5\" -c \"comment=%6\" -N \"%a\" -a \"%c\" -t \"%d\" -o \"%1\" -"
110 
111 #define PRE2_PATTERN	"%7-%8.mp3"
112 #define PRE2_PATTERN_M	"%3/%1-%2.mp3"
113 #define PRE2_ENC_INFO	"0"
114 #define PRE2_ENC_NF	"lame --preset standard --tt \"%d\" --ta \"%c\" --tl \"%3\" --ty \"%5\" --tc \"%6\" --tn \"%a\" --tg \"%4\" \"%1\" \"%2\""
115 #define PRE2_ENC_OF	"lame --preset standard --tt \"%d\" --ta \"%c\" --tl \"%3\" --ty \"%5\" --tc \"%6\" --tn \"%a\" --tg \"%4\" - \"%1\""
116 /* ------------------------------------------------------------------ */
117 
118