示例#1
0
        public EqualizerEngine(SoundSystem system)
        {
            _soundSystem = system;

            Bands = new ObservableCollection<EqualizerBand>();
            foreach (EqualizerParam value in SettingsModel.Instance.EqualizerValues)
            {
                Bands.Add(new EqualizerBand(value));
            }
        }
示例#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);
    }
示例#3
0
        public AudioPlayerEngine()
        {
            _soundSystem = new SoundSystem();
            _soundSystem.Init(32, InitFlags.Normal, (IntPtr) null);
            _callback = ChannelEndCallback;

            _soundSystem.SetStreamBufferSize(64 * 1024, TimeUnit.RawBytes);

            EqualizerEngine = new EqualizerEngine(_soundSystem);

            CurrentTimeChanged = Observable.Interval(TimeSpan.FromMilliseconds(1000))
                                           .Select(x => CurrentTime)
                                           .DistinctUntilChanged(x => x.TotalSeconds);

            PlaybackStateChanged = Observable.Interval(TimeSpan.FromMilliseconds(300))
                                             .Select(x => PlaybackState)
                                             .DistinctUntilChanged(x => x);

            TotalTimeChanged = Observable.Interval(TimeSpan.FromMilliseconds(1000))
                                         .Select(x => TotalTime)
                                         .DistinctUntilChanged(x => x.TotalSeconds);
        }
示例#4
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);
    }
示例#5
0
            public EqualizerBand(SoundSystem system, EqualizerParam param)
            {
                _dsp = system.CreateDspByType(Type.ParameQ);
                system.AddDSP(_dsp);

                Center = param.Center;
                BandWidth = param.Bandwidth;
                Gain = param.Gain;

                _dsp.Active = Active = true;

                Caption = param.Center < 1000
                    ? param.Center.ToString(CultureInfo.InvariantCulture)
                    : string.Format("{0}K", (param.Center/1000));
            }
示例#6
0
 public void Reset()
 {
     DeInitEqualizer();
     Bands.Clear();
     _soundSystem = null;
 }
示例#7
0
 public void Dispose()
 {
     Bands.Clear();
     if (_soundSystem != null)
     {
         DeInitEqualizer();                
         _soundSystem.Dispose();
         _soundSystem = null;
     }
 }
示例#8
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;
            }
        }