示例#1
0
 public static void Dispose(object obj)
 {
     Bass.BASS_ChannelStop(stream);
     Bass.BASS_StreamFree(stream);
     Bass.BASS_Stop();    //停止
     Bass.BASS_Free();    //释放
     GC.SuppressFinalize(obj);
 }
示例#2
0
        //Audio_Start

        public void Audio_Stop()
        {
            Bass.BASS_StreamFree(Audio_Stream);
            Bass.BASS_Free();
            Audio_Stream   = 0;
            timer1.Enabled = false;
            timer2.Enabled = false;
        }
 /// <summary>
 /// Stops the player and removes it and its plugins from memory
 /// </summary>
 public void destroyPlayer()
 {
     foreach (int plg in plugin_dict.Values)
     {
         Bass.BASS_PluginFree(plg);
     }
     Bass.BASS_Free();
 }
示例#4
0
 //关闭bass
 public void CloseBass()
 {
     _updateTimer.Tick -= new EventHandler(timerUpdate_Tick);
     // close bass
     Bass.BASS_Stop();
     Bass.BASS_Free();
     th.Abort();
 }
示例#5
0
        public bool BassFree()
        {
            bool result = Bass.BASS_Free();

            this.Initiallized = !result;

            return(result);
        }
示例#6
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     Bass.BASS_StreamFree(stream);
     Bass.BASS_Free();
     UnregisterHotKey(this.Handle, 1);
     UnregisterHotKey(this.Handle, 2);
     UnregisterHotKey(this.Handle, 3);
 }
示例#7
0
文件: BassLib.cs 项目: tynidev/BPM
 public void Dispose()
 {
     if (instance != null)
     {
         Bass.BASS_Free();
         instance = null;
     }
 }
示例#8
0
 private void CloseBtn_Click(object sender, EventArgs e)
 {
     Bass.BASS_ChannelStop(hStream);
     Bass.BASS_Free();
     IsPreviewEnabled = false;
     Quitting         = true;
     Close();
 }
示例#9
0
 public AudioService()
 {
     speechSynthesiser = new SpeechSynthesizer();
     maryTtsPlayer     = new SoundPlayerEx();
     BassNet.Registration(BassRegistrationEmail, BassRegistrationKey);
     Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
     Application.Current.Exit += (sender, args) => Bass.BASS_Free();
 }
示例#10
0
        // Form1_Load

        //BinaryWriter bw = new BinaryWriter (File.Open ("test.pcm", FileMode.Create));

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            Bass.BASS_StreamFree(Audio_Stream);
            Bass.BASS_Free();
            Parm_To_Tab(ListParam [iFnames]);
            Save_Parms_Xml();
            //bw.Close ();
        }
示例#11
0
        /// <summary>
        /// Освобождает все ресурсы, используемые текущим экземпляром класса <see cref="SpectrumAnalyzer"/>.
        /// </summary>
        public void Dispose()
        {
            Stop();
            Free();

            BassWasapi.BASS_WASAPI_Free();
            Bass.BASS_Free();
        }
示例#12
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         Bass.BASS_Stop();
         Bass.BASS_Free();
     }
     _timer.Dispose();
 }
 //cleanup
 private static void Free()
 {
     BassWasapi.BASS_WASAPI_Free();
     Bass.FreeMe();
     if (!Bass.BASS_Free())
     {
         throw new InvalidOperationException("BASS was not freed");
     }
 }
示例#14
0
 private void CloseFile()
 {
     if (fileStream != 0)
     {
         Bass.BASS_StreamFree(fileStream);
         Bass.BASS_Free();
         fileStream = 0;
     }
 }
示例#15
0
文件: DataCheck.cs 项目: walney/KMC
        public static long GetMIDILength(string str)
        {
            Bass.BASS_Init(0, 22050, BASSInit.BASS_DEVICE_NOSPEAKER, IntPtr.Zero);
            Int32 time = BassMidi.BASS_MIDI_StreamCreateFile(str, 0L, 0L, BASSFlag.BASS_STREAM_DECODE, 0);

            Bass.BASS_StreamFree(time);
            Bass.BASS_Free();
            return(Bass.BASS_ChannelGetLength(time));
        }
示例#16
0
 private void butClose_Click(object sender, RoutedEventArgs e)
 {
     this.Close();
     if (backWorker.IsBusy)
     {
         backWorker.CancelAsync();
     }
     Bass.BASS_Free();
 }
示例#17
0
 private void Encoder_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     buttonStopRec.PerformClick();
     Bass.BASS_StreamFree(monStream);
     // close bass
     Bass.BASS_Stop();
     Bass.BASS_Free();
     Bass.BASS_PluginFree(_wmaPlugIn);
 }
示例#18
0
        public void stop()
        {
            Bass.BASS_PluginFree(_wmaPlugIn);
            // close bass
            Bass.BASS_Stop();
            Bass.BASS_Free();

            Bass.BASS_PluginFree(_wmaPlugIn);
        }
        public void IniciarEFinalizarBASS()
        {
            bool ok = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);

            Assert.IsTrue(ok);

            ok = Bass.BASS_Free();
            Assert.IsTrue(ok);
        }
示例#20
0
 public static void Free()
 {
     Bass.BASS_Stop();
     for (int i = 0; i < BassPluginsHandles.Count; i++)
     {
         Bass.BASS_PluginFree(BassPluginsHandles[i]);
     }
     Bass.BASS_Free();
 }
        protected void Dispose(bool bManagedDispose)
        {
            if (encoder != null)
            {
                encoder.Stop();                  // finish
                encoder.Dispose();
                encoder = null;
            }
            this.e出力デバイス = ESoundDeviceType.Unknown;                    // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ)

            if (this.hMixer_DeviceOut != 0)
            {
                BassMix.BASS_Mixer_ChannelPause(this.hMixer_DeviceOut);
                Bass.BASS_StreamFree(this.hMixer_DeviceOut);
                this.hMixer_DeviceOut = 0;
            }
            if (this.hMixer_Record != 0)
            {
                BassMix.BASS_Mixer_ChannelPause(this.hMixer_Record);
                Bass.BASS_StreamFree(this.hMixer_Record);
                this.hMixer_Record = 0;
            }

            if (hMixer != 0)
            {
                BassMix.BASS_Mixer_ChannelPause(this.hMixer_Record);
                Bass.BASS_StreamFree(this.hMixer);
            }
            if (this.hMixer_Chips != null)
            {
                for (int i = 0; i <= (int)CSound.EInstType.Unknown; i++)
                {
                    if (this.hMixer_Chips[i] != 0)
                    {
                        // Mixerにinputされるchannelsがfreeされると、Mixerへのinputも自動でremoveされる。
                        // 従い、ここでは、mixer本体をfreeするだけでよい
                        BassMix.BASS_Mixer_ChannelPause(this.hMixer_Chips[i]);
                        Bass.BASS_StreamFree(this.hMixer_Chips[i]);
                        this.hMixer_Chips[i] = 0;
                    }
                }
            }
#if TEST_MultiThreadedMixer
            //BASSThreadedMixerLibraryWrapper.FreeBASSThreadedMixerLibrary();
#endif

            if (!this.bIsBASSFree)
            {
                BassWasapi.BASS_WASAPI_Free();                  // システムタイマより先に呼び出すこと。(tWasapi処理() の中でシステムタイマを参照してるため)
                Bass.BASS_Free();
            }
            if (bManagedDispose)
            {
                CCommon.tDispose(this.tmシステムタイマ);
                this.tmシステムタイマ = null;
            }
        }
示例#22
0
        private void NetRadio_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Bass.BASS_PluginFree(_wmaPlugIn);
            // close bass
            Bass.BASS_Stop();
            Bass.BASS_Free();

            Bass.BASS_PluginFree(_wmaPlugIn);
        }
示例#23
0
 public void Dispose()
 {
     if (!IsSupported)
     {
         return;
     }
     Bass.BASS_Stop();
     Bass.BASS_PluginFree(0);
     Bass.BASS_Free();
 }
示例#24
0
 private void AudioAnalyzer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!picWorking.Visible && !backgroundWorker1.IsBusy && !backgroundWorker2.IsBusy)
     {
         Bass.BASS_Free();
         return;
     }
     MessageBox.Show("Please wait until the current process finishes", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     e.Cancel = true;
 }
        public override void Dispose()
        {
            Bass.BASS_Stop();

            /*      for (int i = 0; i < BassPluginsHandles.Count; i++)
             *        Bass.BASS_PluginFree(BassPluginsHandles[i]);*/
            Bass.BASS_Free();
            _stream           = 0;
            InitDefaultDevice = false;
        }
示例#26
0
 /// <summary>
 /// Free the associated resources
 /// </summary>
 public static void Free()
 {
     lock (Lockobject)
     {
         if (_initialized)
         {
             Bass.BASS_Free();
         }
     }
 }
示例#27
0
        private void PlugIn_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // unload all loaded add-ons...
            Bass.BASS_PluginFree(0);
            // close bass
            Bass.BASS_Stop();
            Bass.BASS_Free();

            BassNet.ShowAbout(this);
        }
示例#28
0
 private void ApplicationClose(object sender, FormClosedEventArgs e)
 {
     Bass.BASS_Stop();
     for (int i = 0; i < model.BassPluginsHandles.Count; i++)
     {
         Bass.BASS_PluginFree(model.BassPluginsHandles[i]);
     }
     Bass.BASS_Free();
     Application.Exit();
 }
示例#29
0
        private void qtPlayer_FormClosing(object sender, FormClosingEventArgs e)
        {
            string path = Path.GetDirectoryName(Application.ExecutablePath);

            playlist1.TrackList.SaveCache(path + "\\" + "cache.qtPlaylist");
            Bass.BASS_Free();
            playlist1.TrackList.StopReadingTags();
            string[] wlm = { "false" };
            WLMStatus.SetNPM(WLMStatus.NPMType.Music, wlm, "{0}", false);
        }
示例#30
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());

            // close bass
            Bass.BASS_Stop();
            Bass.BASS_Free();
        }