Subversion Repositories mdb

Rev

Rev 29 | Rev 50 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 andreas 1
/*
2
 * Copyright (C) 2015 by Andreas Theofilu <andreas@theosys.at>
3
 *
4
 * All rights reserved. No warranty, explicit or implicit, provided.
5
 *
6
 * NOTICE:  All information contained herein is, and remains
7
 * the property of Andreas Theofilu and his suppliers, if any.
8
 * The intellectual and technical concepts contained
9
 * herein are proprietary to Andreas Theofilu and its suppliers and
10
 * may be covered by European and Foreign Patents, patents in process,
11
 * and are protected by trade secret or copyright law.
12
 * Dissemination of this information or reproduction of this material
13
 * is strictly forbidden unless prior written permission is obtained
14
 * from Andreas Theofilu.
15
 */
16
#ifndef __PLAY_H__
17
#define __PLAY_H__
18
 
7 andreas 19
#define PLAY_NONE		0		/* Empty or no command */
20
#define PLAY_PLAY		1		/* Play a file */
21
#define PLAY_PAUSE		2		/* Pause currently playing file */
22
#define PLAY_STOP		3		/* Stop playing */
23
#define PLAY_PLAYPAUSE	4		/* Play or pause current playing file */
24
#define PLAY_FWD		5		/* Fast forward file */
25
#define PLAY_REW		6		/* Restart file from start */
26
#define PLAY_SKIP_FWD	7		/* Stop current file and play next in queue */
27
#define PLAY_SKIP_REW	8		/* Stop current file and play previous in queue */
8 andreas 28
#define PLAY_STOP_NOW	9		/* Stops playing in every case immediately */
6 andreas 29
 
7 andreas 30
#define PLAY_STATUS_PLAY	1
31
#define PLAY_STATUS_PAUSE	2
32
#define PLAY_STATUS_STOP	3
33
#define PLAY_STATUS_FWD		4
34
#define PLAY_STATUS_REW		5
35
#define PLAY_STATUS_SKIPF	6
36
#define PLAY_STATUS_SKIPR	7
6 andreas 37
 
8 andreas 38
#define NOWPLAY			"/nowplaying.list"
39
 
6 andreas 40
struct ST_PlayPars
41
{
42
	int s1;
9 andreas 43
	char type[32];
44
	char what[256];
6 andreas 45
};
46
 
11 andreas 47
typedef struct
48
{
49
	int id;
50
	char title[256];
51
	char artist[256];
52
	char album[256];
53
	char genre[256];
54
	char cover[512];
55
}ST_PLAYING;
56
 
57
typedef struct
58
{
59
	int id;					/* The uniqie id of the music file */
60
	int played;				/* TRUE = File was already played. This is used only when playing randomly. */
61
	char path[512];			/* The full path to the music file */
32 andreas 62
	int fType;				/* The file type of "path" */
11 andreas 63
	char title[256];		/* The title of the song */
64
	char artist[256];		/* The artist of the song */
65
	char album[256];		/* The name of the album */
66
	char genre[256];		/* The genre the song belongs to */
67
	char cover[512];		/* A path to an optional cover picture */
68
	void *next;				/* Pointer to the next element in the chain */
69
}QUEUE;
70
 
6 andreas 71
extern int nextCommand;
7 andreas 72
extern int playStatus;
73
extern int playerActive;
11 andreas 74
extern int playerRepeat;
75
extern int playerRandom;
76
extern int queueTotal;
77
extern ST_PLAYING playCurrent;
78
extern QUEUE *pqueue;
6 andreas 79
 
80
void *pthr_playfile(void *pV_data);
7 andreas 81
void appendToQueue(int s1, char *type, char *what);
8 andreas 82
int playlistToQueue(int uid, int del);
83
int QueueToPlaylist(int s1, char *user, char *playlist);
25 andreas 84
int readQueue();
11 andreas 85
int scanQueue(int fd);
29 andreas 86
void freeQueue();
32 andreas 87
int check_command(int s1);
6 andreas 88
 
89
#endif