示例#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;