
/* COMMON REQUEST MESSAGES */

#define PLEASE_TERMINATE_IMMEDIATELY 0	/* stop playing and exit */


/* PLAYER_SPECIFIC REQUEST MESSAGES */

/* exit when current song finishes */
#define PLEASE_TERMINATE_WHEN_FINISHED 2

/* stop song immediately but don't exit */
#define PLEASE_ABORT_IMMEDIATELY 3

/* start fade-out */
#define PLEASE_START_FADEOUT 4

/* play song */
#define PLEASE_PLAY_SONG 5

/* play song with immediate reply */
#define PLEASE_PLAY_SONG_IMMEDIATE_REPLY 6

/* reply when current song is finished */
#define PLEASE_REPLY_WHEN_SONG_FINISHES 7


/* LOADER-SPECIFIC REQUEST MESSAGES */

/* load a song -- does not insure all samples are loaded */
#define PLEASE_LOAD_SONG 20	

/* loads any samples necessary to insure all samples are loaded for songid */
#define PLEASE_ATTACH_SAMPLES 21

/* unloads song but does not remove song's samples */
#define PLEASE_UNLOAD_SONG 22

/* unloads all samples that aren't "tagged" */
#define PLEASE_PURGE_UNTAGGED_SAMPLES 23

/* loads any samples found in CAT of samples that are referred to by a song 
 * and haven't been loaded yet */
#define PLEASE_LOAD_CAT_SAMPLES 24

/* loads any samples necessary to insure all samples are loaded for all 
 * songs */
#define PLEASE_ATTACH_ALL_SAMPLES 25

/* clears "tag" bits for all samples */
#define PLEASE_CLEAR_SAMPLE_TAGS 26

/* set tags for samples referenced by song */
#define PLEASE_TAG_SONGS_SAMPLES 27

/* set tag for sample referenced by sample name */
#define PLEASE_TAG_NAMED_SAMPLE 28


#define PLAYER_PORTNAME "SMUSserver-player"

#define LOADER_PORTNAME "SMUSserver-loader"

/* same request type for player and loader */
struct PlayerRequest
{
	struct Message message;
	short command;
	short status;
	union
	{
		char *filename;
#ifdef SERVER
		Song *song_pointer;
#else
		void *song_pointer;
#endif
	} data;
};


#define ES_INVALID_COMMAND -99	/* command is invalid */
#define ES_SERVER_ABORTED -98	/* server aborted, can be player or loader */
#define ES_NOT_IMPLEMENTED -97	/* command is not implemented */
#define ES_ALREADY_PLAYING -96	/* new play request while song playing */
#define ES_LOAD_FAILED -95		/* couldn't load a song */

/* tried to play without all samples or attachsamples couldn't find all
 * the song's samples */
#define ES_NOT_ALL_SAMPLES_PRESENT -94

#define ES_SONG_IS_PLAYING -93	/* can't unload a playing song */
#define ES_BAD_SONG_ADDRESS -92 /* passed bad song address to one of the servers */

#define ES_NOT_FOUND -91		/* couldn't find something you were looking for */

#define ES_OK 0					/* request completed OK */
#define ES_PENDING 1			/* server task hasn't seen message */
#define ES_PROCESSING 2			/* server task is processing message */


