Beispiel #1
0
 public bool IsPlaying(int channel = -1)
 {
     if (channel == MusicChannel)
     {
         return(SDL_mixer.Mix_PlayingMusic() == 1);
     }
     else
     {
         return(SDL_mixer.Mix_Playing(channel) == 1);
     }
 }
Beispiel #2
0
        private void StopChannel()
        {
            if (Channel < 0)
            {
                return;
            }

            var isPlayimg = SDL_mixer.Mix_Playing(Channel) == 1;

            if (isPlayimg)
            {
                SDL_mixer.Mix_HaltChannel(Channel);
            }

            Channel = -1;
        }
Beispiel #3
0
        internal static void ArreterJouerSon(String son)
        {
            int id_canal = sons.Keys.ToList().IndexOf(son);

            // Son non trouvé
            if (id_canal == -1)
            {
                return;
            }

            // Son non joué
            if (SDL_mixer.Mix_Playing(id_canal) == 0)
            {
                return;
            }

            SDL_mixer.Mix_HaltChannel(id_canal);
        }
Beispiel #4
0
        internal static void JouerSon(String son)
        {
            int id_canal = sons.Keys.ToList().IndexOf(son);

            // trop de canaux utilisés
            if (id_canal == -1)
            {
                return;
            }

            // Son déjà joué
            if (SDL_mixer.Mix_Playing(id_canal) > 0)
            {
                return;
            }

            SDL_mixer.Mix_PlayChannel(id_canal, sons[son], 0);
        }
Beispiel #5
0
 public int NumChannelsPlaying()
 {
     return(SDL_mixer.Mix_Playing(-1));
 }
Beispiel #6
0
 private bool IsPlaying() =>
 Channel >= 0 &&
 SDL_mixer.Mix_Playing(Channel) == 1 &&
 SDL_mixer.Mix_Paused(Channel) == 0;