misc/libopenalbridge/commands.h
changeset 9431 0f5961910e27
parent 9357 a501f5ec7b34
parent 9429 7a97a554ac80
child 9433 f0a8ac191839
equal deleted inserted replaced
9357:a501f5ec7b34 9431:0f5961910e27
     1 /*
       
     2  *  commands.h
       
     3  *  Hedgewars
       
     4  *
       
     5  *  Created by Vittorio on 13/06/10.
       
     6  *  Copyright 2010 __MyCompanyName__. All rights reserved.
       
     7  *
       
     8  */
       
     9 
       
    10 #ifndef _OALB_COMMANDS_H
       
    11 #define _OALB_COMMANDS_H
       
    12 
       
    13 #include "openalbridge_t.h"
       
    14 #include "openalbridge.h"
       
    15 
       
    16 
       
    17 #define openal_fadein(x,y)          openal_fade(x,y,AL_FADE_IN)
       
    18 #define openal_fadeout(x,y)         openal_fade(x,y,AL_FADE_OUT)
       
    19 #define openal_playsound_loop(x,y)  openal_playsound(x)  \
       
    20                                         if (y != 0)  \
       
    21                                         openal_toggleloop(x);
       
    22 #ifdef __CPLUSPLUS
       
    23 extern "C" {
       
    24 #endif
       
    25 
       
    26     // play, pause, stop a single sound source
       
    27     void openal_pausesound        (unsigned int index);
       
    28     void openal_stopsound         (unsigned int index);
       
    29 
       
    30     // play a sound and set whether it should loop or not (0/1)
       
    31     void openal_playsound         (unsigned int index);
       
    32 
       
    33     void openal_freesound         (unsigned int index);
       
    34 
       
    35     // set or unset the looping property for a sound source
       
    36     void openal_toggleloop        (unsigned int index);
       
    37 
       
    38     // set position and volume of a sound source
       
    39     void openal_setposition       (unsigned int index, float x, float y, float z);
       
    40     void openal_setvolume         (unsigned int index, float gain);
       
    41 
       
    42     // set volume for all sounds (gain interval is [0-1])
       
    43     void openal_setglobalvolume   (float gain);
       
    44 
       
    45     // mute or unmute all sounds
       
    46     void openal_togglemute        (void);
       
    47 
       
    48     // fade effect,
       
    49     void openal_fade              (unsigned int index, unsigned short int quantity, al_fade_t direction);
       
    50 
       
    51 #ifdef __CPLUSPLUS
       
    52 }
       
    53 #endif
       
    54 
       
    55 #endif /*_OALB_COMMANDS_H*/