예제 #1
0
 public void SetCallbacks(VolumeChangedEventHandler volume, NewSoundEventHandler sound)
 {
     m_callbacks.VolumeCallback = volume;
     m_callbacks.SoundCallback  = sound;
     LibVlcMethods.libvlc_audio_set_callbacks(m_hMediaPlayer, m_hSound, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
     LibVlcMethods.libvlc_audio_set_volume_callback(m_hMediaPlayer, m_hVolume);
 }
예제 #2
0
        public void SetCallbacks(AudioCallbacks callbacks)
        {
            if (callbacks.SoundCallback == null)
            {
                throw new ArgumentNullException("Sound playback callback must be set");
            }

            m_callbacks = callbacks;
            LibVlcMethods.libvlc_audio_set_callbacks(m_hMediaPlayer, m_hSound, m_hPause, m_hResume, m_hFlush, m_hDrain, IntPtr.Zero);
            LibVlcMethods.libvlc_audio_set_volume_callback(m_hMediaPlayer, m_hVolume);
        }
예제 #3
0
        protected override void Dispose(bool disposing)
        {
            LibVlcMethods.libvlc_audio_set_format_callbacks(m_hMediaPlayer, IntPtr.Zero, IntPtr.Zero);
            LibVlcMethods.libvlc_audio_set_callbacks(m_hMediaPlayer, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            if (disposing)
            {
                m_formatSetupCB = null;
                m_callbacks     = null;
                m_callbacksDelegates.Clear();
            }
        }