Пример #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);
     }
 }
Пример #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;
        }
Пример #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);
        }
Пример #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);
        }
Пример #5
0
 public int NumChannelsPlaying()
 {
     return(SDL_mixer.Mix_Playing(-1));
 }
Пример #6
0
 private bool IsPlaying() =>
 Channel >= 0 &&
 SDL_mixer.Mix_Playing(Channel) == 1 &&
 SDL_mixer.Mix_Paused(Channel) == 0;