Changeset 2874


Ignore:
Timestamp:
Sep 8, 2013, 12:00:46 AM (6 years ago)
Author:
Jnat
Message:

add methods to Audio class to mute/unmute and change volume per channel

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/audio.cpp

    r2816 r2874  
    4444}
    4545
     46void Audio::SetVolume(int channel, int volume)
     47{
     48#if defined USE_SDL_MIXER
     49    Mix_Volume(channel,volume);
     50#else
     51    UNUSED(channel);
     52#endif
     53}
     54
     55void Audio::MuteAll()
     56{
     57#if defined USE_SDL_MIXER
     58    Mix_Volume(-1,0);
     59#else
     60    UNUSED(false);
     61#endif
     62}
     63
     64void Audio::UnmuteAll()
     65{
     66#if defined USE_SDL_MIXER
     67    Mix_Volume(-1,MIX_MAX_VOLUME);
     68#else
     69    UNUSED(false);
     70#endif
     71}
     72
    4673} /* namespace lol */
    4774
  • trunk/src/audio.h

    r2816 r2874  
    2727public:
    2828    static void Setup(int channels);
     29    static void SetVolume(int channel,int volume);
     30    static void MuteAll();
     31    static void UnmuteAll();
    2932
    3033private:
Note: See TracChangeset for help on using the changeset viewer.