XQuartz: Purge redundant QuartzBell
(cherry picked from commit de14a63d20095e1537fd74352850c734d900031d)
This commit is contained in:
parent
8c0085c715
commit
e360104880
|
@ -219,6 +219,12 @@ void DDXRingBell(
|
||||||
int pitch, // pitch is Hz
|
int pitch, // pitch is Hz
|
||||||
int duration ) // duration is milliseconds
|
int duration ) // duration is milliseconds
|
||||||
{
|
{
|
||||||
|
if (quartzUseSysBeep) {
|
||||||
|
if (volume)
|
||||||
|
NSBeep();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (quartzAudioDevice == kAudioDeviceUnknown) return;
|
if (quartzAudioDevice == kAudioDeviceUnknown) return;
|
||||||
|
|
||||||
pthread_mutex_lock(&data.lock);
|
pthread_mutex_lock(&data.lock);
|
||||||
|
@ -247,40 +253,6 @@ void DDXRingBell(
|
||||||
pthread_mutex_unlock(&data.lock);
|
pthread_mutex_unlock(&data.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* QuartzBell
|
|
||||||
* Ring the bell
|
|
||||||
*/
|
|
||||||
void QuartzBell(
|
|
||||||
int volume, // volume in percent of max
|
|
||||||
DeviceIntPtr pDevice,
|
|
||||||
pointer ctrl,
|
|
||||||
int class )
|
|
||||||
{
|
|
||||||
int pitch; // pitch in Hz
|
|
||||||
int duration; // duration in milliseconds
|
|
||||||
|
|
||||||
if (class == BellFeedbackClass) {
|
|
||||||
pitch = ((BellCtrl*)ctrl)->pitch;
|
|
||||||
duration = ((BellCtrl*)ctrl)->duration;
|
|
||||||
} else if (class == KbdFeedbackClass) {
|
|
||||||
pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
|
|
||||||
duration = ((KeybdCtrl*)ctrl)->bell_duration;
|
|
||||||
} else {
|
|
||||||
ErrorF("QuartzBell: bad bell class %d\n", class);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (quartzUseSysBeep) {
|
|
||||||
if (volume)
|
|
||||||
NSBeep();
|
|
||||||
} else {
|
|
||||||
DDXRingBell(volume, pitch, duration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* QuartzAudioInit
|
* QuartzAudioInit
|
||||||
* Prepare to play the bell with the CoreAudio API
|
* Prepare to play the bell with the CoreAudio API
|
||||||
|
|
|
@ -32,9 +32,6 @@
|
||||||
#ifndef _QUARTZAUDIO_H
|
#ifndef _QUARTZAUDIO_H
|
||||||
#define _QUARTZAUDIO_H
|
#define _QUARTZAUDIO_H
|
||||||
|
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
void QuartzAudioInit(void);
|
void QuartzAudioInit(void);
|
||||||
void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -327,7 +327,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
|
||||||
/* We need to really have rules... or something... */
|
/* We need to really have rules... or something... */
|
||||||
//XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
|
//XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
|
||||||
|
|
||||||
InitKeyboardDeviceStruct(pDev, NULL, QuartzBell, DarwinChangeKeyboardControl);
|
InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
|
||||||
|
|
||||||
pthread_mutex_lock(&keyInfo_mutex);
|
pthread_mutex_lock(&keyInfo_mutex);
|
||||||
DarwinLoadKeyboardMapping(&keySyms);
|
DarwinLoadKeyboardMapping(&keySyms);
|
||||||
|
|
Loading…
Reference in New Issue