ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
media_mac.m
Go to the documentation of this file.
1 #import <AudioToolbox/AudioServices.h>
2 #import <Foundation/Foundation.h>
3 #include "media.h"
4 
6  // Get the system's default audio device
7  AudioObjectPropertyAddress propertyAddress = {
8  kAudioHardwarePropertyDefaultOutputDevice,
9  kAudioObjectPropertyScopeGlobal,
10  kAudioObjectPropertyElementMaster
11  };
12  AudioDeviceID deviceID = 0;
13  UInt32 dataSize = sizeof(deviceID);
14  if(AudioHardwareServiceGetPropertyData(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize, &deviceID)
15  != kAudioHardwareNoError){
16  return UNKNOWN;
17  }
18  // Grab the mute property
19  AudioObjectPropertyAddress propertyAddress2 = {
20  kAudioDevicePropertyMute,
21  kAudioDevicePropertyScopeOutput,
22  kAudioObjectPropertyElementMaster
23  };
24  if(!AudioHardwareServiceHasProperty(deviceID, &propertyAddress2))
25  return UNKNOWN;
26  bool state = 0;
27  dataSize = sizeof(state);
28  if(AudioHardwareServiceGetPropertyData(deviceID, &propertyAddress2, 0, NULL, &dataSize, &state)
29  != kAudioHardwareNoError)
30  return UNKNOWN;
31  return state ? MUTED : UNMUTED;
32 }
33 
35  [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep reason:@"Keyboard animation"];
36 }
muteState getMuteState()
Definition: media_mac.m:5
Definition: media.h:20
void disableAppNap()
Definition: media_mac.m:34
muteState
Definition: media.h:19
Definition: media.h:21
Definition: media.h:22