/*
** chord.h for Chord 1.0
**
** Made by caput_r
** Login caput_r <caput_r@epita.fr>
**
** Started on  Tue Sep 27 01:34:52 2005 remi caput
** Last update Tue Sep 27 02:51:08 2005 remi caput
*/

#ifndef CHORD_H_
#define CHORD_H_

#ifdef __cplusplus
extern "C" {
#endif

#define REALLOC_SOUND	64
#define REALLOC_STREAM	16

#include <stdlib.h>
#include <string.h>
#include "fmod.h"
#include "fmod_errors.h"

struct				s_chord_item
{
	FMOD_CHANNEL*	channel;
	FMOD_SOUND*		handle;
	float			frequency;
};

struct						s_chord_list
{
	struct s_chord_item*	array;
	int						count;
	int						size;
};

struct					s_chord
{
	struct s_chord_list	list;
	FMOD_SYSTEM*		system;
};

extern struct s_chord	gl_chord;

int		CHD_InternalAlloc (unsigned int*);

int		CHD_Init (int, int);
int		CHD_LoadSound (const char*, int, unsigned int*);
int		CHD_LoadStream (const char*, int, unsigned int*);
void	CHD_Loop (void);
void	CHD_PlayStart (unsigned int, char);
void	CHD_PlayStop (unsigned int);
void	CHD_SetFrequency (unsigned int, float, char);
void	CHD_SetLoop (unsigned int, int);
void	CHD_SetPan (unsigned int, float);
void	CHD_SetPaused (unsigned int, char);
void	CHD_SetVolume (unsigned int, float);
void	CHD_Stop (void);

#ifdef __cplusplus
}
#endif

#endif
