Exemple #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);
    }
Exemple #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);
    }
        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;
            }
        }
 public void Load(string url)
 {
     lock (_playerLock)
     {
         _soundFile = _soundSystem.CreateSound(url, Mode.CreateStream | Mode.NonBlocking);
         _isLoaded = true;
     }
 }
 public void Load(RawTrack song)
 {
     lock (_playerLock)
     {
         _soundFile = _soundSystem.CreateSound(song.FullFilename);
         _isLoaded = true;
     }
 }
Exemple #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.");
        }
Exemple #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);
        }
Exemple #8
0
 public Channel.Channel PlaySound(Sound.Sound snd)
 {
     return PlaySound(snd, false);
 }