public void resume() { if (SDL_mixer.Mix_PausedMusic() == 1) { SDL_mixer.Mix_ResumeMusic(); } }
public void Resume(int channel = -1) { if (channel == MusicChannel) { SDL_mixer.Mix_ResumeMusic(); } else { SDL_mixer.Mix_Resume(channel); } }
internal void Resume() { SDL_mixer.Mix_ResumeMusic(); }
public override void ResumeAll() { SDL_mixer.Mix_Resume(-1); SDL_mixer.Mix_ResumeMusic(); }
static int Main(string[] args) { SDL.SDL_SetHint(SDL.SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1"); Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; //Start up SDL and create window var success = Init(); if (success == false) { Console.WriteLine("Failed to initialize!"); } else { //Load media success = LoadMedia(); if (success == false) { Console.WriteLine("Failed to load media!"); } else { //Main loop flag bool quit = false; //While application is running while (!quit) { //Event handler SDL.SDL_Event e; //Handle events on queue while (SDL.SDL_PollEvent(out e) != 0) { //User requests quit if (e.type == SDL.SDL_EventType.SDL_QUIT) { quit = true; } //Handle key press else if (e.type == SDL.SDL_EventType.SDL_KEYDOWN) { switch (e.key.keysym.sym) { //Play high sound effect case SDL.SDL_Keycode.SDLK_1: SDL_mixer.Mix_PlayChannel(-1, _High, 0); break; //Play medium sound effect case SDL.SDL_Keycode.SDLK_2: SDL_mixer.Mix_PlayChannel(-1, _Medium, 0); break; //Play low sound effect case SDL.SDL_Keycode.SDLK_3: SDL_mixer.Mix_PlayChannel(-1, _Low, 0); break; //Play scratch sound effect case SDL.SDL_Keycode.SDLK_4: SDL_mixer.Mix_PlayChannel(-1, _Scratch, 0); break; case SDL.SDL_Keycode.SDLK_9: //If there is no music playing if (SDL_mixer.Mix_PlayingMusic() == 0) { //Play the music SDL_mixer.Mix_PlayMusic(_Music, -1); } //If music is being played else { //If the music is paused if (SDL_mixer.Mix_PausedMusic() == 1) { //Resume the music SDL_mixer.Mix_ResumeMusic(); } //If the music is playing else { //Pause the music SDL_mixer.Mix_PauseMusic(); } } break; case SDL.SDL_Keycode.SDLK_0: //Stop the music SDL_mixer.Mix_HaltMusic(); break; } } } //Clear screen SDL.SDL_SetRenderDrawColor(Renderer, 0xFF, 0xFF, 0xFF, 0xFF); SDL.SDL_RenderClear(Renderer); //Render prompt _PromptTexture.Render(0, 0); //Update screen SDL.SDL_RenderPresent(Renderer); } } } //Free resources and close SDL Close(); if (success == false) { Console.ReadLine(); } return(0); }
public void Resume() { SDL_mixer.Mix_ResumeMusic(); }