Beispiel #1
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        this.SoundSystem = new Linsft.FmodSharp.SoundSystem.SoundSystem();
        this.SoundSystem.Init();

        this.SoundFile = SoundSystem.CreateSound (@"/home/madrang/Music/Tetris.mp3", Linsft.FmodSharp.Mode.Default);

        if(this.Channel != null)
            this.Channel.Dispose();

        this.Channel = this.SoundSystem.PlaySound(SoundFile);

        this.fft_Draw = new Linsft.FmodSharp.Gtk.FFTDraw();
        this.fft_Draw.Source = this.Channel;
        this.fft_Draw.Show();
        this.Add(this.fft_Draw);
    }
Beispiel #2
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        this.SoundSystem = new Linsft.FmodSharp.SoundSystem.SoundSystem();
        this.SoundSystem.Init();

        this.SoundFile = SoundSystem.CreateSound(@"/home/madrang/Music/Tetris.mp3", Linsft.FmodSharp.Mode.Default);

        if (this.Channel != null)
        {
            this.Channel.Dispose();
        }

        this.Channel = this.SoundSystem.PlaySound(SoundFile);


        this.fft_Draw        = new Linsft.FmodSharp.Gtk.FFTDraw();
        this.fft_Draw.Source = this.Channel;
        this.fft_Draw.Show();
        this.Add(this.fft_Draw);
    }
Beispiel #3
0
        public void Dispose()
        {
            Stop();

            if (EqualizerEngine != null)
            {
                EqualizerEngine.Dispose();
                EqualizerEngine = null;
            }
            if (_channel != null)
            {
                _soundFile.Dispose();
                _soundFile = null;
                _channel.Dispose();
                _channel = null;
            }

            if (_soundSystem != null)
            {
                _soundSystem.Dispose();
                _soundSystem = null;
            }
        }
Beispiel #4
0
 public void Load(string url)
 {
     lock (_playerLock)
     {
         _soundFile = _soundSystem.CreateSound(url, Mode.CreateStream | Mode.NonBlocking);
         _isLoaded = true;
     }
 }
Beispiel #5
0
 public void Load(RawTrack song)
 {
     lock (_playerLock)
     {
         _soundFile = _soundSystem.CreateSound(song.FullFilename);
         _isLoaded = true;
     }
 }
Beispiel #6
0
        private void PlaySound(Sound.Sound snd, bool paused, Channel.Channel chn)
        {
            //FIXME The handle is changed most of the time on some system.
            //Only use the other metods to be safe.

            IntPtr channel = chn.DangerousGetHandle();

            Code returnCode = PlaySound(DangerousGetHandle(), Index.Reuse, snd.DangerousGetHandle(), paused, ref channel);
            Errors.ThrowError(returnCode);

            //This can't really happend.
            //Check just in case...
            if (chn.DangerousGetHandle() == channel)
                throw new Exception("Channel handle got changed by Fmod.");
        }
Beispiel #7
0
        public Channel.Channel PlaySound(Sound.Sound snd, bool paused)
        {
            IntPtr channelHandle = IntPtr.Zero;

            Code returnCode = PlaySound(DangerousGetHandle(), Index.Free, snd.DangerousGetHandle(), paused, ref channelHandle);
            Errors.ThrowError(returnCode);

            return new Channel.Channel(channelHandle);
        }
Beispiel #8
0
 public Channel.Channel PlaySound(Sound.Sound snd)
 {
     return PlaySound(snd, false);
 }