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

        GRAOUMF TRACKER 2
        Author: Laurent de Soras, 1996-2016

--- Legal stuff ---

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

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



#if defined (PAT_CURRENT_HEADER)
	#error Inclusion recursive du header PAT.
#endif
#define	PAT_CURRENT_HEADER

#if ! defined (PAT_HEADER_INCLUDED)
#define	PAT_HEADER_INCLUDED



/*\\\ INCLUDES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#include	"archi.h"
#include	"mods_ct.h"



/*\\\ CONSTANTES PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#define	PAT_NBRPATTERNS_MAXI		256		/* 0-255 */



/*\\\ TYPES & STRUCTURES PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/



/*\\\ PROTOTYPES DES FONCTIONS PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

signed int	PAT_init (void);
void	PAT_restore (void);

/*--------------------------------------------------------------------------*/
/*      Routines de base                                                    */
/*--------------------------------------------------------------------------*/

char	*PAT_get_pattern_name (int pattern, char *name_0);
void	PAT_set_pattern_name (int pattern, const char *name_0);
int	PAT_get_pattern_nbr_tracks (int track_type, int pattern);
void	PAT_set_pattern_nbr_tracks (int track_type, int pattern, int nbr_tracks);

int	PAT_get_pattern_height (int pattern);
signed int	PAT_set_pattern_height (int pattern, int nbrlines);
int	PAT_get_current_pattern_height (void);
signed int	PAT_set_current_pattern_height (int height);
signed int	PAT_set_nbr_tracks (int track_type, int nbr_tracks);

void	*PAT_get_note_adr_pat (int track_type, int pattern, int line, int track);
MODS_GT2_SPL_NOTE	*PAT_get_spl_note_adr_pat (int pattern, int line, int track);
MODS_GT2_AIN_NOTE	*PAT_get_ain_note_adr_pat (int pattern, int line, int track);
MODS_GT2_FX_NOTE	*PAT_get_fx_note_adr_pat (int pattern, int line, int track);
MODS_GT2_MID_NOTE	*PAT_get_mid_note_adr_pat (int pattern, int line, int track);

UWORD	PAT_get_track_command (int pattern, int track_type, int line, int track);
void	PAT_set_track_command (int pattern, int track_type, int line, int track, UWORD command);

ULWORD	PAT_get_fx_command (int pattern, int line, int track);
void	PAT_set_fx_command (int pattern, int line, int track, ULWORD command);

void	PAT_clear_note (int track_type, int pattern, int line, int track);
signed int	PAT_clear_pattern (int pattern);
signed int	PAT_clear_patterns (void);
long	PAT_estimate_memory_usage (int pattern);

/*--------------------------------------------------------------------------*/
/*      Modifications avec l'interface                                      */
/*--------------------------------------------------------------------------*/

void	PAT_set_pattern_height_intr (int type, signed int value);
void	PAT_set_nbr_tracks_intr (int type, signed int value, int track_type);



/*\\\ VARIABLES EXTERNES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

extern int	PAT_new_pattern_nbr_lines;



/*\\\ FIN DU FICHIER \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#endif

#undef PAT_CURRENT_HEADER
