File: ddj.h

package info (click to toggle)
digitaldj 0.6-7.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 268 kB
  • ctags: 264
  • sloc: ansic: 3,112; makefile: 90
file content (106 lines) | stat: -rwxr-xr-x 2,351 bytes parent folder | download
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
/*****************************************************************

  ddj.h

  Copyright (c) 1999 by Mike Oliphant - oliphant@ling.ed.ac.uk

    http://www.ling.ed.ac.uk/~oliphant/ddj

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

*****************************************************************/

#include <glib.h>

#define VERSION "0.6"

#define PROGRAM "DigitalDJ"

/* Random value in a range */

#define RRand(range) (random()%(range))

/* Song orders */

#define SONG_ORDER_RANDOM 0
#define SONG_ORDER_DISC 1
#define SONG_ORDER_OLDEST 2
#define SONG_ORDER_SLOWEST 3

/* BPM range */

#define LOW_BPM 0
#define HIGH_BPM 300

/* Speed catagories */

#define SLOW_BPM 60
#define MEDIUM_BPM 130
#define FAST_BPM 170


/* size of scrolling display window */

typedef struct _artist
{
  int id;
  char name[80];
} Artist;

typedef struct _disc
{
  int id;
  char title[80];
  int artistid;
  int year;
} Disc;

typedef struct _song
{
  int id;
  char filename[256];
  char title[80];
  int artistid;
  int discid;
  char genre[20];
  int track_num;
  int start_frame;
  int num_frames;
  int mins;
  int secs;
  int bpm;
  int year;
} Song;

/* Routines in mp3db.c */

void EscapeQuote(char *in,char *out,int maxlen);
gboolean ConnectSQL(void);
void DisconnectSQL(void);
gboolean SQLQuery(char *query);
gboolean InitSQL(char *rootpswd);
gboolean ReloadSQL(char *rootpswd);
gboolean MakeSQLUser(char *user,char *host,char *pswd,char *rootpswd);
gboolean DeleteSQLUser(char *user,char *host,char *rootpswd);
int AddSQLArtist(char *artist);
int AddSQLDisc(char *disc,int artistid,char *genre,int year);
int AddSQLEntry(char *filename,char *artist,char *sartist,char *title,
		char *disc_name,char *genre,int year,
		int track_num,int start_frame,int num_frames,int mins,
		int secs,int bpm);
gboolean DeleteSongByID(int id);

/* Routines in mp3.c */

#ifdef BUILTIN_MP3
gboolean MP3Init(void);
void MP3CleanUp(void);
gboolean PlayMP3(char *fname);
#endif