av.h

Go to the documentation of this file.
00001 #ifndef _AV_H
00002 
00003 #define _AV_H
00004 
00005 #include <SDL.h>
00006 
00007 #define AV_NUM_CHANNELS     2
00008 #define AV_ALL_CHANNELS     -1
00009 #define AV_SOUND_CHANNEL    0
00010 #define AV_MUSIC_CHANNEL    1
00011 #define AV_MIN_VOLUME       0
00012 #define AV_MAX_VOLUME       SDL_MIX_MAXVOLUME
00013 
00014 #define AV_FADE_IN          0
00015 #define AV_FADE_OUT         1
00016 
00017 /*
00018  * 5 => 10x6 px rectangles
00019  * 4 => 20x12 ... etc
00020  * minimal = 1
00021  */
00022 #define AV_DTREE_DEPTH       5
00023 /* 
00024  * Whole rectangle will be marked as dirty if fill area is higher than this
00025  */
00026 #define AV_DTREE_FILL_RATIO .8
00027 
00028 extern void av_step (void);
00029 extern void av_block (void);
00030 extern void av_setup (void);
00031 extern void av_silence (int channel);
00032 extern void av_sync (void);
00033 
00034 struct audio_chunk {
00035     struct audio_chunk *next;
00036     void *data;
00037     unsigned size;
00038     int loop;
00039 };
00040 extern void play (struct audio_chunk *cp, int channel);
00041 
00042 struct audio_channel {
00043     unsigned                volume;
00044     unsigned                mute;
00045 #if 0
00046     unsigned                fade;            /* actual fade value */
00047     int                     fade_inc;        /* fade inc or dec */
00048 #endif
00049     struct audio_chunk*     chunk;           /**< played chunk */
00050     struct audio_chunk**    chunk_tailp;     /**< tail of chunk list? */
00051     unsigned                offset;          /**< data offset in chunk */
00052 };
00053 
00054 extern char AnimSoundCheck(void);
00055 extern void UpdateAudio (void);
00056 extern void MuteChannel(int channel, int mute);
00057 
00058 extern double get_time (void);
00059 extern int bioskey (int peek);
00060 
00061 extern int av_mouse_cur_x, av_mouse_cur_y;
00062 extern int av_mouse_pressed_x, av_mouse_pressed_y;
00063 extern int av_mouse_pressed_cur;
00064 extern int av_mouse_pressed_latched;
00065 
00066 extern SDL_Overlay *video_overlay;
00067 extern SDL_Rect video_rect;
00068 extern SDL_Overlay *news_overlay;
00069 extern SDL_Rect news_rect;
00070 extern void av_need_update(SDL_Rect *r);
00071 extern void av_need_update_xy(int x1, int y1, int x2, int y2);
00072 
00073 extern void av_set_fading(int type, int from, int to, int steps, int preserve);
00074 
00075 #endif /* ifndef _AV_H */

Generated on Fri Sep 28 00:35:26 2007 for raceintospace by  doxygen 1.5.3