From a915739887477b28d924ecc8417ee107d125bd6c Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 6 Sep 2009 18:48:27 +0000 Subject: Switched to xorg-server-1.6.99.900.tar.gz --- xorg-server/hw/xquartz/quartzAudio.c | 48 ++++++++---------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) (limited to 'xorg-server/hw/xquartz/quartzAudio.c') 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 -- cgit v1.2.3