/* channels.h - karl's smus structure that defines stuff about channels */

/* define the IOB array entries in sound structures */

#define MAX_CHANNELS 4

#define MAX_CHANNEL_IOBS 7

#define ALLOC_IOB 0		/* Use this IOB when allocating a channel */
#define ONESHOT_IOB 1	/* Used for oneshot portion of musical notes */
#define LOOP_IOB 2		/* Use to play the looped part of the sound */
#define STOP_IOB 3		/* Use this IOB to stop playing the sound */
#define PERVOL_IOB 4	/* Use to change a playing sound's period & volume */
#define PRECEDENCE_IOB 5	/* Use to change a playing sound's precedence */
#define FREE_IOB 6		/* Use to release the allocated channel */

typedef struct ChannelStruct
{
	int flags;
	struct SMUS_IOAudio
	{
		struct IOAudio smusIOB;
		struct ChannelStruct *channelp;
	} *IOBs[MAX_CHANNEL_IOBS];
	Sample *samptr;
} Channel;

/* definitions of Amiga's sound port bits */

#define LEFT0 1
#define RIGHT0 2
#define RIGHT1 4
#define LEFT1 8
#define LEFTSIDE (LEFT0 | LEFT1)
#define RIGHTSIDE (RIGHT0 | RIGHT1)

/* flag bits for Track.flags */

#define SHOT_PLAYING 1
#define LOOP_PLAYING 2
#define PRECEDENCE_QUEUED 4
#define LEFT 8			/* user parameter, which channel? */
#define RIGHT 0			/* placeholder user parameter, opposite of LEFT */
#define EITHER 16		/* user parameter, don't care which channel */

/* end of channels.h */

