Modipulate 0.0
Modipulating games through sound.
src/modipulate/modipulate.h
Go to the documentation of this file.
00001 
00019 #ifndef MODIPULATE_H
00020 #define MODIPULATE_H
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif 
00025 
00026 #define MODIPULATE_ERROR_NONE                   0
00027 #define MODIPULATE_ERROR_GENERAL                1
00028 #define MODIPULATE_ERROR_INVALID_PARAMETERS     2
00029 #define MODIPULATE_ERROR_NOT_IMPLEMENTED        3
00030 
00034 #define MODIPULATE_OK(err) (err == MODIPULATE_ERROR_NONE)
00035 
00039 typedef unsigned ModipulateErr;
00040 
00044 typedef void* ModipulateSong;
00045 
00046 
00056 typedef void (*modipulate_song_pattern_change_cb) (ModipulateSong song, int pattern_number,
00057     void* user_data);
00058 
00075 typedef void (*modipulate_song_note_cb) (ModipulateSong song, unsigned channel, int note,
00076     int instrument, int sample, int volume_command, int volume_value,
00077     int effect_command, int effect_value, void* user_data);
00078 
00086 typedef void (*modipulate_song_row_change_cb) (ModipulateSong song, int row, void* user_data);
00087 
00091 typedef struct {
00092     char** instrument_names; 
00093     char** sample_names;  
00094     int* rows_per_pattern;  
00095     char* title;  
00096     char* message;  
00097     int default_tempo;  
00098     int num_channels;  
00099     int num_instruments;  
00100     int num_samples;  
00101     int num_patterns; 
00102 } ModipulateSongInfo;
00103 
00104 
00117 ModipulateErr modipulate_global_init(void);
00118 
00119 
00127 ModipulateErr modipulate_global_deinit(void);
00128 
00129 
00137 char* modipulate_global_get_last_error_string(void);
00138 
00139 
00147 ModipulateErr modipulate_global_update(void);
00148 
00149 
00155 float modipulate_global_get_volume(void);
00156 
00162 void modipulate_global_set_volume(float vol);
00163 
00180 ModipulateErr modipulate_song_load(const char* filename, ModipulateSong* song);
00181 
00190 ModipulateErr modipulate_song_unload(ModipulateSong song);
00191 
00192 
00201 ModipulateErr modipulate_song_play(ModipulateSong song, int play);
00202 
00203 
00213 ModipulateErr modipulate_song_get_info(ModipulateSong song, ModipulateSongInfo** song_info);
00214 
00221 ModipulateErr modipulate_song_info_free(ModipulateSongInfo* song_info);
00222 
00232 ModipulateErr modipulate_song_volume_command(ModipulateSong song, unsigned channel,
00233     int volume_command, int volume_value);
00234 
00244 ModipulateErr modipulate_song_enable_volume(ModipulateSong song, unsigned channel,
00245     int volume_command, int enable);
00246 
00256 ModipulateErr modipulate_song_effect_command(ModipulateSong song, unsigned channel,
00257     int effect_command, int effect_value);
00258 
00259 
00271 ModipulateErr modipulate_song_enable_effect(ModipulateSong song, unsigned channel,
00272     int effect_command, int enable);
00273 
00283 ModipulateErr modipulate_song_set_transposition(ModipulateSong song, unsigned channel,
00284     int offset);
00285 
00294 ModipulateErr modipulate_song_get_transposition(ModipulateSong song, unsigned channel,
00295     int* offset);
00296 
00297 void modipulate_song_set_channel_enabled(ModipulateSong song, unsigned channel, int enabled);
00298 
00299 int modipulate_song_get_channel_enabled(ModipulateSong song, unsigned channel);
00300 
00307 ModipulateErr modipulate_song_on_pattern_change(ModipulateSong song,
00308     modipulate_song_pattern_change_cb cb, void* user_data);
00309 
00316 ModipulateErr modipulate_song_on_row_change(ModipulateSong song,
00317     modipulate_song_row_change_cb cb, void* user_data);
00318 
00327 ModipulateErr modipulate_song_on_note(ModipulateSong song,
00328     modipulate_song_note_cb cb, void* user_data);
00329 
00333 #ifdef __cplusplus
00334 }
00335 #endif 
00336 
00337 #endif /* MODIPULATE_H */
 All Data Structures Files Functions Variables Typedefs Defines