Beispiel #1
0
static mrb_value
mrb_sdl2_mixer_fade_out_group(mrb_state *mrb, mrb_value self)
{
  mrb_int tag, ms;
  mrb_get_args(mrb, "ii", &tag, &ms);
  return mrb_fixnum_value(Mix_FadeOutGroup(tag, ms));
}
Beispiel #2
0
	static int lua_Mix_FadeOutGroup(State & state){
		Stack * stack = state.stack;
		int tag = -1;
		int ms = 0;
		if (stack->is<LUA_TNUMBER>(1)){
			tag = stack->to<int>(1);
		}
		if (stack->is<LUA_TNUMBER>(2)){
			ms = stack->to<int>(2);
		}
		stack->push<int>(Mix_FadeOutGroup(tag, ms));
		return 1;
	}
bool SDLAudio::FadeGROUP(std::string name, int time)
{
    /** Check to see if we've created it */
    SListIterator<SGZChanGroup*> GroupListITR = GroupList.GetIterator();

    for( GroupListITR.Start(); GroupListITR.Valid(); GroupListITR.Forth() )
        if((GroupListITR.Item()->Name.compare(name))==0)
        {
            Mix_FadeOutGroup(GroupListITR.Item()->groupNum, time);
            return true;
        }

    SGZLogger.warn("AudioMAN: Group \"%s\" doesn't exist!\n", name.c_str());
    return false;
}
Beispiel #4
0
//
// sound_effect destructor
//
// Release the audio data.
//
sound_effect::~sound_effect()
{
    if(!sound_enabled)
        return;

    // Sound effect deletion only happens on level load, so there
    // is no problem in stopping everything. But the original playing
    // code handles the sound effects and the "playlist" differently.
    // Therefore with SDL_mixer, a sound that has not finished playing
    // on a level load will cut off in the middle. This is most noticable
    // for the button sound of the load savegame dialog.
    Mix_FadeOutGroup(-1, 100);
    while (Mix_Playing(-1))
        SDL_Delay(10);
    Mix_FreeChunk(m_chunk);
}
Beispiel #5
0
void sfx::fade_audio_group( int tag, int duration ) {
    Mix_FadeOutGroup( tag, duration );
}
Beispiel #6
0
/**
 * @brief Stops all the sounds in a group.
 *
 *    @param group Group to stop all it's sounds.
 */
void sound_mix_stopGroup( int group )
{
   Mix_FadeOutGroup(group, 100);
}
Beispiel #7
0
void SDLAudio::fade_out_group(int tag, int ms) {
  Mix_FadeOutGroup(tag, ms);
}