예제 #1
0
 public void PlaySoundSample(
     ushort number, SoundAction action, byte volume,
     byte repeats, SoundFinishedCallback callback
     )
 {
     // nada
 }
예제 #2
0
파일: GlkIO.cs 프로젝트: hackerlank/zlr
        void IZMachineIO.PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats,
                                         SoundFinishedCallback callback)
        {
            switch (action)
            {
            case SoundAction.Prepare:
                Glk.glk_sound_load_hint(number, true);
                break;

            case SoundAction.FinishWith:
                Glk.glk_sound_load_hint(number, false);
                break;

            case SoundAction.Start:
                if (soundChannel.IsNull)
                {
                    soundChannel = Glk.glk_schannel_create(0);
                }

                if (!soundChannel.IsNull)
                {
                    volume = Math.Min(volume, (byte)8);
                    Glk.glk_schannel_set_volume(soundChannel, (uint)(volume << 13));
                    soundCallback = callback;
                    Glk.glk_schannel_play_ext(soundChannel, number, repeats, 1);
                }
                break;

            case SoundAction.Stop:
                if (!soundChannel.IsNull)
                {
                    Glk.glk_schannel_stop(soundChannel);
                    soundChannel  = schanid_t.Null;
                    soundCallback = null;
                }
                break;
            }
        }
예제 #3
0
 public override void PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats, SoundFinishedCallback callback)
 {
     // nada
 }
예제 #4
0
파일: FilterBase.cs 프로젝트: dbremner/zlr
 public virtual void PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats, SoundFinishedCallback callback)
 {
     next.PlaySoundSample(number, action, volume, repeats, callback);
 }
예제 #5
0
파일: TeeFilter.cs 프로젝트: dbremner/zlr
        public override void PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats, SoundFinishedCallback callback)
        {
            if (PassSound)
                side.PlaySoundSample(number, action, volume, repeats, callback);

            base.PlaySoundSample(number, action, volume, repeats, callback);
        }
예제 #6
0
파일: ConsoleIO.cs 프로젝트: dbremner/zlr
 public void PlaySoundSample(ushort num, SoundAction action, byte volume, byte repeats,
     SoundFinishedCallback callback)
 {
     // not supported
 }
예제 #7
0
파일: TeeFilter.cs 프로젝트: hackerlank/zlr
        public override void PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats, SoundFinishedCallback callback)
        {
            if (PassSound)
            {
                side.PlaySoundSample(number, action, volume, repeats, callback);
            }

            base.PlaySoundSample(number, action, volume, repeats, callback);
        }
예제 #8
0
 public virtual void PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats, SoundFinishedCallback callback)
 {
     next.PlaySoundSample(number, action, volume, repeats, callback);
 }
예제 #9
0
파일: GlkIO.cs 프로젝트: KeanW/zlr--git
        void IZMachineIO.PlaySoundSample(ushort number, SoundAction action, byte volume, byte repeats,
            SoundFinishedCallback callback)
        {
            switch (action)
            {
                case SoundAction.Prepare:
                    Glk.glk_sound_load_hint(number, true);
                    break;

                case SoundAction.FinishWith:
                    Glk.glk_sound_load_hint(number, false);
                    break;

                case SoundAction.Start:
                    if (soundChannel.IsNull)
                        soundChannel = Glk.glk_schannel_create(0);

                    if (!soundChannel.IsNull)
                    {
                        volume = Math.Min(volume, (byte)8);
                        Glk.glk_schannel_set_volume(soundChannel, (uint)(volume << 13));
                        soundCallback = callback;
                        Glk.glk_schannel_play_ext(soundChannel, number, repeats, 1);
                    }
                    break;

                case SoundAction.Stop:
                    if (!soundChannel.IsNull)
                    {
                        Glk.glk_schannel_stop(soundChannel);
                        soundChannel = schanid_t.Null;
                        soundCallback = null;
                    }
                    break;
            }
        }