aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/quartzAudio.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/xquartz/quartzAudio.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xquartz/quartzAudio.c')
-rw-r--r--xorg-server/hw/xquartz/quartzAudio.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/xorg-server/hw/xquartz/quartzAudio.c b/xorg-server/hw/xquartz/quartzAudio.c
index 21232665a..8cf241738 100644
--- a/xorg-server/hw/xquartz/quartzAudio.c
+++ b/xorg-server/hw/xquartz/quartzAudio.c
@@ -211,14 +211,20 @@ QuartzAudioIOProc(
/*
- * QuartzCoreAudioBell
- * Play a tone using the CoreAudio API
+ * DDXRingBell
+ * Play a tone using the CoreAudio API
*/
-static void QuartzCoreAudioBell(
+void DDXRingBell(
int volume, // volume is % of max
int pitch, // pitch is Hz
int duration ) // duration is milliseconds
{
+ if (quartzUseSysBeep) {
+ if (volume)
+ NSBeep();
+ return;
+ }
+
if (quartzAudioDevice == kAudioDeviceUnknown) return;
pthread_mutex_lock(&data.lock);
@@ -239,7 +245,7 @@ static void QuartzCoreAudioBell(
OSStatus status;
status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc);
if (status) {
- ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", (long)status);
+ ErrorF("DDXRingBell: AudioDeviceStart returned %ld\n", (long)status);
} else {
data.playing = TRUE;
}
@@ -247,40 +253,6 @@ static void QuartzCoreAudioBell(
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 {
- QuartzCoreAudioBell(volume, pitch, duration);
- }
-}
-
-
/*
* QuartzAudioInit
* Prepare to play the bell with the CoreAudio API