Exemple #1
0
        public static void Play(Playlists PlayItem)
        {
            if (Bass.BASS_GetInfo() == null)
            {
                Bass.BASS_Init(-1, hz, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
            }
            Bass.BASS_StreamFree(_stream);
            Bass.BASS_ChannelStop(_stream);

            _stream = Bass.BASS_StreamCreateFile(PlayItem.Path, 0, 0, BASSFlag.BASS_DEFAULT);
            now     = PlayList.IndexOf(PlayItem);
            Bass.BASS_ChannelSetAttribute(_stream, BASSAttribute.BASS_ATTRIB_VOL, slrVolume / 100f);

            EqualizerSettings.SetFX(_stream);

            ggg.Dispatcher.Invoke(() =>
            {
                ggg.lblAudioName.Content = PlayItem.Name;
                ggg.SyncSlider();
                ggg.lblMusicDuration.Content = new TimeSpan(0, 0, (int)Bass.BASS_ChannelBytes2Seconds(BassMet._stream, Bass.BASS_ChannelGetLength(BassMet._stream)));
                ggg.btnResumePause.Content   = "Pause";
            });


            Bass.BASS_ChannelPlay(_stream, true);
            timer.Start();
        }