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

GRAOUMF TRACKER 2

Copyright (c) 1996 - 2002 Laurent de Soras

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Contact the author : laurent@ohmforce.com
More information about this license : http://www.gnu.org/licenses/gpl.html

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



#if defined (GTK_CURRENT_HEADER)
	#error Inclusion recursive du header GTK.
#endif
#define	GTK_CURRENT_HEADER

#if ! defined (GTK_HEADER_INCLUDED)
#define	GTK_HEADER_INCLUDED



/*\\\ FICHIERS INCLUDE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#include	"archi.h"
#include	"fnames.h"
#include	"fx_p.h"
#include	"mixp.h"
#include	"Mutex.h"
#include	"patt.h"
#include	"Pattern.h"
#include	"PatternTools.h"
#include	"samp.h"
#include	"UndoList.h"

#include	<list>

class ConfigKey;



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

#define	GTK_VERSION_NUMBER	0.0019	/* Version du Graoumf Tracker */

/* Pour le mixer */
#define	GTK_TRACK_TYPE_AOU		Pattern_NBR_TYPES			/* Audio Out */
#define	GTK_NBR_MIX_TRACK_TYPE	(Pattern_NBR_TYPES + 1)	/* Nombre de types de piste pour le mixer */

/* Numeros de pattern */
#define	GTK_NBRPATTERNS_ZONE	PAT_NBRPATTERNS_MAXI		/* Nombre de patterns dans la zone des chunks */
#define	GTK_PATTERN_BIDON_A	GTK_NBRPATTERNS_ZONE		/* Ces deux patterns ne font pas    */
#define	GTK_PATTERN_BIDON_B	(GTK_NBRPATTERNS_ZONE + 1)	/* partie de l'espace des chunks */
#define	GTK_NBRPATTERNS_TOTAL	(GTK_NBRPATTERNS_ZONE + 2)

/* Numeros des samples */
#define	GTK_SAMPLE_TEMP	(SAMP_NBRSAMPLES_MAXI + 1)		/* Chunk temporaire des presets de mixage */
#define	GTK_NBRSAMPLES_TOTAL	(SAMP_NBRSAMPLES_MAXI + 1)

/* Numeros des presets de mixage */
#define	GTK_MIXP_TEMP		(MIXP_NBRMIXP_MAXI + 1)		/* Chunk temporaire des presets de mixage */
#define	GTK_NBRMIXP_TOTAL	(MIXP_NBRMIXP_MAXI + 1)

/* Numeros des preset d'effet */
#define	GTK_FXP_TEMP		(FXP_NBRFXP_MAXI + 1)		/* Chunk temporaire des presets d'effets */
#define	GTK_NBRFXP_TOTAL	(FXP_NBRFXP_MAXI + 1)

/* Configuration initiale */
#define	GTK_INIT_NBR_SPL_TRACKS	8
#define	GTK_INIT_NBR_FX_TRACKS	0
#define	GTK_INIT_NBR_MID_TRACKS	0



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



/*\\\ PROTOTYPES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

signed int GTK_main (int argc, char *argv []);

/*--------------------------------------------------------------------------*/
/*      Modification des variables                                          */
/*--------------------------------------------------------------------------*/

int	GTK_get_song_position (void);
void	GTK_set_song_position (int songpos);
int	GTK_get_current_pattern_number (void);
void	GTK_set_current_pattern_number (int pattern);
int	GTK_get_line_position (void);
void	GTK_set_line_position (int linepos);
void	GTK_set_cur_instr (int instr);
void	GTK_set_cur_sample (int sample);
int	GTK_get_edit_status (void);
void	GTK_set_edit_status (int status);

/*--------------------------------------------------------------------------*/
/*      Divers                                                              */
/*--------------------------------------------------------------------------*/

bool	GTK_mod_is_modified (void);
signed int	GTK_read_module_editing_conf (const std::list <ConfigKey> &key_list);

int	GTK_note_section_to_string (const UBYTE *data_ptr, int type, char *text_ptr);
int	GTK_note_to_string (const void *note_ptr, char *text_ptr, int track_type, int display_type);

int	GTK_get_ext_track_type (int track_type, const void *note_ptr);
int	GTK_get_fx_ext_track_type (const void *note_ptr);
int	GTK_get_mid_ext_track_type (const void *note_ptr);
void	GTK_next_line (void);
void	GTK_cherche_next_line_spl (BYTE mask1, LWORD mask2, bool full_flag);

void	GTK_stop_all (void);
void	GTK_play_pattern_bidon (void);
void	GTK_play_one_line (int pattern, int line_pos);
void	GTK_play_context (int pattern, int line_pos);
void	GTK_play_pattern (bool cont_flag);
void	GTK_play_song (bool cont_flag);
void	GTK_set_correct_cursor_color (void);

signed int	GTK_clear_song (void);
signed int	GTK_clear_instruments (void);
signed int	GTK_clear_all (void);



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

extern Mutex	GTK_mutex;

extern bool	GTK_modified_flag;

extern PatternTools	*GTK_pattern_block_ptr;
extern UndoList		*GTK_undo_list_ptr;

extern int	GTK_nbr_tracks [GTK_NBR_MIX_TRACK_TYPE];

extern int	GTK_instr_nbr;
extern int	GTK_sample_nbr;
extern int	GTK_mix_nbr;
extern int	GTK_fx_preset_nbr;
extern bool	GTK_fx_real_time_mode_flag;
extern bool	GTK_spl_instr_interdep_flag;

extern LWORD	GTK_default_d2d_buffer_len;

extern int	GTK_octave;
extern signed int	GTK_line_step;

extern QWORD	GTK_test_time [10];

extern bool	GTK_ask_for_exit_flag;
extern bool	GTK_exit_now_flag;
extern bool	GTK_ask_for_resolution_change_flag;
extern int	GTK_new_res_width;
extern int	GTK_new_res_height;

extern char	GTK_drag_and_drop_filename_0 [FNAM_PATHNAME_MAXLEN+1];
extern bool	GTK_ask_for_loading_module_flag;
extern char	GTK_skin_pathname_0 [FNAM_PATHNAME_MAXLEN+1];
extern bool	GTK_ask_for_loading_skin_flag;



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

#endif

#undef GTK_CURRENT_HEADER
