Пример #1
0
 private void OnCaptureEffectsChanged(AudioCaptureEffectsManager sender, object evt)
 {
     var ignored = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         IReadOnlyList <AudioEffect> effectslist = m_CaptureEffectsManager.GetAudioCaptureEffects();
         DisplayEffectsList(effectslist);
     });
 }
Пример #2
0
 private void ScenarioClose()
 {
     if (m_CaptureEffectsManager != null)
     {
         m_CaptureEffectsManager.AudioCaptureEffectsChanged -= OnCaptureEffectsChanged;
         m_CaptureEffectsManager = null;
     }
 }
 private void ScenarioInit()
 {
     m_MonitorStarted = false;
     m_DeviceInfo = null;
     m_CaptureEffectsManager = null;
     DisplayEmptyDevicesList();
     DisplayEmptyEffectsList();
     DisplayCategoriesList();
     lblEffects.DataContext = new EffectLabelView { EffectLabelName = "Effects" };
 }
Пример #4
0
 private void ScenarioInit()
 {
     m_MonitorStarted        = false;
     m_DeviceInfo            = null;
     m_CaptureEffectsManager = null;
     DisplayEmptyDevicesList();
     DisplayEmptyEffectsList();
     DisplayCategoriesList();
     lblEffects.DataContext = new EffectLabelView {
         EffectLabelName = "Effects"
     };
 }
Пример #5
0
        private void StartStopMonitor(Object sender, Windows.UI.Xaml.RoutedEventArgs evt)
        {
            if (m_MonitorStarted == true)
            {
                if (m_CaptureEffectsManager != null)
                {
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged -= OnCaptureEffectsChanged;
                    m_CaptureEffectsManager = null;
                }
                // No longer monitoring effects changes; re-enable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = true;
                // Reset effects list to empty
                lblEffects.DataContext = new EffectLabelView {
                    EffectLabelName = "Effects"
                };
                DisplayEmptyEffectsList();
                m_MonitorStarted            = false;
                btnStartStopMonitor.Content = "Start Monitoring";
            }
            else
            {
                int           deviceIndex = DevicesList.SelectedIndex;
                MediaCategory Category;

                if (CategoriesList.SelectedIndex < 0)
                {
                    Category = MediaCategory.Communications;
                }
                else
                {
                    Category = (MediaCategory)CategoriesList.SelectedIndex;
                }

                if (deviceIndex < 0)
                {
                    m_CaptureEffectsManager = AudioEffectsManager.CreateAudioCaptureEffectsManager(
                        MediaDevice.GetDefaultAudioCaptureId(AudioDeviceRole.Communications),
                        Category,
                        Windows.Media.AudioProcessing.Default);
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged += OnCaptureEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView {
                        EffectLabelName = "Effects Active on {Default Device}"
                    };
                }
                else
                {
                    m_CaptureEffectsManager = AudioEffectsManager.CreateAudioCaptureEffectsManager(
                        m_DeviceInfo[deviceIndex].Id,
                        Category,
                        Windows.Media.AudioProcessing.Default);
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged += OnCaptureEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView {
                        EffectLabelName = "Effects Active on  {" + m_DeviceInfo[deviceIndex].Name + "}"
                    };
                }

                // Display current effects once
                IReadOnlyList <AudioEffect> Effectslist = m_CaptureEffectsManager.GetAudioCaptureEffects();
                DisplayEffectsList(Effectslist);

                // Start monitoring effects changes; for now disable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = false;
                m_MonitorStarted            = true;
                btnStartStopMonitor.Content = "Stop Monitoring";
            }
        }
 private void ScenarioClose()
 {
     if (m_CaptureEffectsManager != null)
     {
         m_CaptureEffectsManager.AudioCaptureEffectsChanged -= OnCaptureEffectsChanged;
         m_CaptureEffectsManager = null;
     }
 }
        private void StartStopMonitor(Object sender, Windows.UI.Xaml.RoutedEventArgs evt)
        {
            if ( m_MonitorStarted == true )
            {
                if (m_CaptureEffectsManager != null)
                {
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged -= OnCaptureEffectsChanged;
                    m_CaptureEffectsManager = null;
                }
                // No longer monitoring effects changes; re-enable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = true;
                // Reset effects list to empty
                lblEffects.DataContext = new EffectLabelView { EffectLabelName = "Effects" };
                DisplayEmptyEffectsList();
                m_MonitorStarted = false;
                btnStartStopMonitor.Content = "Start Monitoring";
            }
            else
            {
                int deviceIndex = DevicesList.SelectedIndex;
                MediaCategory Category;

                if ( CategoriesList.SelectedIndex < 0 )
                {
                    Category = MediaCategory.Communications;
                }
                else
                {
                    Category = (MediaCategory)CategoriesList.SelectedIndex;
                }

                if (deviceIndex < 0)
                {
                    m_CaptureEffectsManager = AudioEffectsManager.CreateAudioCaptureEffectsManager(
                       MediaDevice.GetDefaultAudioCaptureId(AudioDeviceRole.Communications),
                       Category,
                       Windows.Media.AudioProcessing.Default);
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged += OnCaptureEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView { EffectLabelName = "Effects Active on {Default Device}" };
                }
                else
                {
                    m_CaptureEffectsManager = AudioEffectsManager.CreateAudioCaptureEffectsManager(
                        m_DeviceInfo[deviceIndex].Id,
                        Category,
                        Windows.Media.AudioProcessing.Default);
                    m_CaptureEffectsManager.AudioCaptureEffectsChanged += OnCaptureEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView { EffectLabelName = "Effects Active on  {" + m_DeviceInfo[deviceIndex].Name + "}" };
                }

                // Display current effects once
                IReadOnlyList<AudioEffect> Effectslist = m_CaptureEffectsManager.GetAudioCaptureEffects();
                DisplayEffectsList(Effectslist);

                // Start monitoring effects changes; for now disable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = false;
                m_MonitorStarted = true;
                btnStartStopMonitor.Content = "Stop Monitoring";
            }
        }
 private void OnCaptureEffectsChanged(AudioCaptureEffectsManager sender, object evt)
 {
     var ignored = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
             IReadOnlyList<AudioEffect> effectslist = m_CaptureEffectsManager.GetAudioCaptureEffects();
             DisplayEffectsList ( effectslist );
     });
 }
 public AudioCaptureEffectsManagerEvents(AudioCaptureEffectsManager This)
 {
     this.This = This;
 }