diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/hw/xquartz/quartzAudio.c | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/hw/xquartz/quartzAudio.c')
-rw-r--r-- | xorg-server/hw/xquartz/quartzAudio.c | 48 |
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 |