Пример #1
0
        /// <summary>
        /// Is called when the GlobalHotKey is pressed
        /// </summary>
        /// <param name="wParam"></param>
        /// <param name="lParam"></param>
        private void OnGlobalHotKeyPressed(IntPtr wParam, IntPtr lParam)
        {
            Keys        key      = (Keys)(((int)lParam >> 16) & 0xFFFF);      // The key of the hotkey that was pressed.
            KeyModifier modifier = (KeyModifier)((int)lParam & 0xFFFF);       // The modifier of the hotkey that was pressed.
            int         id       = wParam.ToInt32();

            if (Properties.Settings.Default.CycledList.Count > 0)
            {
                var nextAudioCycleId = hotKeyProcesses.GetNextCycledAudioId();

                var device = coreAudioProcesses.GetCoreAudioDevice(nextAudioCycleId);

                coreAudioProcesses.SetDefaultDevice(device);

                notifications = new Notifications(device.FullName);
                notifications.Activator();
            }
        }
Пример #2
0
        private void AudioOutput_ListView_DoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            var selectedItem = coreAudioProcesses.GetCoreAudioDevice(AudioOutput_ListView.SelectedItems[0].SubItems[1].Text);

            coreAudioProcesses.SetDefaultDevice(selectedItem);
        }