diff --git a/hw/xquartz/GL/Makefile.am b/hw/xquartz/GL/Makefile.am index af890776e..736c94b4a 100644 --- a/hw/xquartz/GL/Makefile.am +++ b/hw/xquartz/GL/Makefile.am @@ -1,5 +1,5 @@ noinst_LTLIBRARIES = libCGLCore.la -AM_CFLAGS = $(DIX_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(GL_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/glx \ diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am index 721d2725e..96b1fb0c5 100644 --- a/hw/xquartz/Makefile.am +++ b/hw/xquartz/Makefile.am @@ -30,7 +30,6 @@ libXquartz_la_SOURCES = \ keysym2ucs.c \ pseudoramiX.c \ quartz.c \ - quartzAudio.c \ quartzCocoa.m \ quartzKeyboard.c \ quartzStartup.c \ @@ -47,7 +46,6 @@ EXTRA_DIST = \ keysym2ucs.h \ pseudoramiX.h \ quartz.h \ - quartzAudio.h \ quartzCommon.h \ quartzKeyboard.h \ quartzRandR.h \ diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index 462128464..b3ad19b53 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -77,7 +77,6 @@ void X11ApplicationMain(int argc, char **argv, char **envp); #define PREFS_APPSMENU "apps_menu" #define PREFS_FAKEBUTTONS "enable_fake_buttons" -#define PREFS_SYSBEEP "enable_system_beep" #define PREFS_KEYEQUIVS "enable_key_equivalents" #define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" #define PREFS_FULLSCREEN_MENU "fullscreen_menu" diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index c3563b6b5..b855c8358 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -718,8 +718,6 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { NSString *nsstr; const char *tem; - XQuartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP - default:XQuartzUseSysBeep]; XQuartzRootlessDefault = [self prefs_get_boolean:@PREFS_ROOTLESS default:XQuartzRootlessDefault]; XQuartzFullscreenMenu = [self prefs_get_boolean:@PREFS_FULLSCREEN_MENU diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index 65a09b8d5..9edaacdd5 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -65,7 +65,6 @@ typedef unsigned int NSUInteger; IBOutlet NSButton *fake_buttons; IBOutlet NSButton *enable_fullscreen; IBOutlet NSButton *enable_fullscreen_menu; - IBOutlet NSButton *use_sysbeep; IBOutlet NSButton *enable_keyequivs; IBOutlet NSButton *sync_keymap; IBOutlet NSButton *option_sends_alt; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 13b63664f..2edfb185e 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -637,9 +637,6 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row if(sender == fake_buttons) { darwinFakeButtons = [fake_buttons intValue]; [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; - } else if(sender == use_sysbeep) { - XQuartzUseSysBeep = [use_sysbeep intValue]; - [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:XQuartzUseSysBeep]; } else if(sender == enable_keyequivs) { XQuartzEnableKeyEquivalents = [enable_keyequivs intValue]; [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:XQuartzEnableKeyEquivalents]; @@ -701,7 +698,6 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row BOOL pbproxy_active = [NSApp prefs_get_boolean:@PREFS_SYNC_PB default:YES]; [fake_buttons setIntValue:darwinFakeButtons]; - [use_sysbeep setIntValue:XQuartzUseSysBeep]; [enable_keyequivs setIntValue:XQuartzEnableKeyEquivalents]; [sync_keymap setIntValue:darwinSyncKeymap]; [option_sends_alt setIntValue:XQuartzOptionSendsAlt]; diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib index 7609393ba..bbf7eda62 100644 --- a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 10D573 - 761 - 1038.29 - 460.00 + 10J541 + 850 + 1038.35 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 761 + 850 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -388,7 +391,7 @@ 1 - + 256 @@ -396,7 +399,6 @@ 256 {{18, 210}, {402, 18}} - YES 67239424 @@ -424,7 +426,6 @@ 256 {{36, 60}, {385, 31}} - YES 67239424 @@ -461,7 +462,6 @@ 256 {{36, 162}, {385, 42}} - YES 67239424 @@ -479,7 +479,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 97}, {402, 18}} - YES 67239424 @@ -501,7 +500,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 126}, {385, 14}} - YES 67239424 @@ -518,7 +516,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 146}, {402, 18}} - YES 67239424 @@ -540,7 +537,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, -1}, {385, 31}} - YES 67239424 @@ -557,7 +553,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 36}, {402, 18}} - YES 67239424 @@ -576,8 +571,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg {{10, 33}, {438, 246}} - - Input @@ -588,51 +581,15 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Use system alert effect - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 29}, {385, 28}} - - YES - - 67239424 - 4194304 - X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel. - - - - - - 256 {{74, 202}, {128, 26}} + YES -2076049856 @@ -723,6 +680,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{17, 205}, {55, 20}} + YES 67239424 @@ -739,6 +697,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 183}, {392, 14}} + YES 67239424 @@ -755,6 +714,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 149}, {409, 23}} + YES 67239424 @@ -776,6 +736,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{37, 83}, {409, 23}} + YES 67239424 @@ -797,6 +758,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 112}, {385, 31}} + YES 67239424 @@ -810,6 +772,8 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg {{10, 33}, {438, 246}} + + Output @@ -1212,13 +1176,13 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - + 0 YES YES - + @@ -1732,14 +1696,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1788,14 +1744,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2547,27 +2495,9 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2760,16 +2690,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - - 100371 - - - - - 100372 - - - 100382 @@ -3249,8 +3169,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3443,10 +3361,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3582,6 +3496,76 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg id id + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + NSMenuItem NSTableView @@ -3614,6 +3598,128 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg NSMenuItem NSMenuItem + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + IBDocumentRelativeSource ../../../X11Controller.h diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib index 888424dfc..836d59532 100644 Binary files a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 26b2c1f38..6c185a8eb 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -80,7 +80,6 @@ Bool XQuartzRootlessDefault = TRUE; Bool XQuartzIsRootless = TRUE; Bool XQuartzServerVisible = FALSE; Bool XQuartzFullscreenMenu = FALSE; -Bool XQuartzUseSysBeep = FALSE; /* =========================================================================== @@ -446,3 +445,13 @@ void QuartzCopyDisplayIDs(ScreenPtr pScreen, memcpy(pQuartzScreen->displayIDs, displayIDs, size); pQuartzScreen->displayCount = displayCount; } + +void NSBeep(void); +void DDXRingBell( + int volume, // volume is % of max + int pitch, // pitch is Hz + int duration) // duration is milliseconds +{ + if (volume) + NSBeep(); +} diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h index 7efb7e09b..b83391db9 100644 --- a/hw/xquartz/quartz.h +++ b/hw/xquartz/quartz.h @@ -123,7 +123,6 @@ extern Bool XQuartzIsRootless; /* Is our current mode rootless (or FS)? */ extern Bool XQuartzFullscreenMenu; /* Show the menu bar (autohide) while in FS */ extern Bool XQuartzFullscreenDisableHotkeys; extern Bool XQuartzOptionSendsAlt; /* Alt or Mode_switch? */ -extern Bool XQuartzUseSysBeep; /* Sys beep or our own? */ Bool QuartzAddScreen(int index, ScreenPtr pScreen); Bool QuartzSetupScreen(int index, ScreenPtr pScreen); diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c deleted file mode 100644 index d0f7c53e5..000000000 --- a/hw/xquartz/quartzAudio.c +++ /dev/null @@ -1,329 +0,0 @@ -// -// QuartzAudio.m -// -// X Window bell support using CoreAudio or AppKit. -// Greg Parker gparker@cs.stanford.edu 19 Feb 2001 -// -// Info about sine wave sound playback: -// CoreAudio code derived from macosx-dev posting by Tim Wood -// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html -// Smoothing transitions between sounds -// http://www.wam.umd.edu/~mphoenix/dss/dss.html -// -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#include "sanitizedCarbon.h" - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartz.h" -#include "quartzAudio.h" - -#include -#include -#include - -#include "inputstr.h" -#include -#include - -void NSBeep(void); - -typedef struct QuartzAudioRec { - double frequency; - double amplitude; - - UInt32 curFrame; - UInt32 remainingFrames; - UInt32 totalFrames; - double sampleRate; - UInt32 fadeLength; - - UInt32 bufferByteCount; - Boolean playing; - pthread_mutex_t lock; - - // used to fade out interrupted sound and avoid 'pop' - double prevFrequency; - double prevAmplitude; - UInt32 prevFrame; -} QuartzAudioRec; - -static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown; -static QuartzAudioRec data; - - -/* - * QuartzAudioEnvelope - * Fade sound in and out to avoid pop. - * Sounds with shorter duration will never reach full amplitude. Deal. - */ -static double QuartzAudioEnvelope( - UInt32 curFrame, - UInt32 totalFrames, - UInt32 fadeLength ) -{ - double fadeFrames = min(fadeLength, totalFrames / 2); - if (fadeFrames < 1) return 0; - - if (curFrame < fadeFrames) { - return curFrame / fadeFrames; - } else if (curFrame > totalFrames - fadeFrames) { - return (totalFrames-curFrame) / fadeFrames; - } else { - return 1.0; - } -} - - -/* - * QuartzFillBuffer - * Fill this buffer with data and update the data position. - * FIXME: this is ugly - */ -static void QuartzFillBuffer( - AudioBuffer *audiobuffer, - QuartzAudioRec *data ) -{ - float *buffer, *b; - unsigned int frame, frameCount; - unsigned int bufferFrameCount; - float multiplier, v; - int i; - - buffer = (float *)audiobuffer->mData; - bufferFrameCount = audiobuffer->mDataByteSize / (sizeof(float) * audiobuffer->mNumberChannels); - - frameCount = min(bufferFrameCount, data->remainingFrames); - - // Fade out previous sine wave, if any. - b = buffer; - if (data->prevFrame) { - multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate); - for (frame = 0; frame < data->fadeLength; frame++) { - v = data->prevAmplitude * - QuartzAudioEnvelope(frame+data->fadeLength, - 2*data->fadeLength, - data->fadeLength) * - sin(multiplier * (data->prevFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - // no more prev fade - data->prevFrame = 0; - - // adjust for space eaten by prev fade - b += audiobuffer->mNumberChannels*frame; - bufferFrameCount -= frame; - frameCount = min(bufferFrameCount, data->remainingFrames); - } - - // Write a sine wave with the specified frequency and amplitude - multiplier = 2*M_PI*(data->frequency/data->sampleRate); - for (frame = 0; frame < frameCount; frame++) { - v = data->amplitude * - QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames, - data->fadeLength) * - sin(multiplier * (data->curFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - - // Zero out the rest of the buffer, if any - memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels * - (bufferFrameCount-frame)); - - data->curFrame += frameCount; - data->remainingFrames -= frameCount; - if (data->remainingFrames == 0) { - data->playing = FALSE; - data->curFrame = 0; - } -} - - -/* - * QuartzAudioIOProc - * Callback function for audio playback. - * FIXME: use inOutputTime to correct for skipping - */ -static OSStatus -QuartzAudioIOProc( - AudioDeviceID inDevice, - const AudioTimeStamp *inNow, - const AudioBufferList *inInputData, - const AudioTimeStamp *inInputTime, - AudioBufferList *outOutputData, - const AudioTimeStamp *inOutputTime, - void *inClientData ) -{ - QuartzAudioRec *data = (QuartzAudioRec *)inClientData; - int i; - Boolean wasPlaying; - - pthread_mutex_lock(&data->lock); - wasPlaying = data->playing; - for (i = 0; i < outOutputData->mNumberBuffers; i++) { - if (data->playing) { - QuartzFillBuffer(outOutputData->mBuffers+i, data); - } - else { - memset(outOutputData->mBuffers[i].mData, 0, - outOutputData->mBuffers[i].mDataByteSize); - } - } - if (wasPlaying && !data->playing) { - OSStatus err; - err = AudioDeviceStop(inDevice, QuartzAudioIOProc); - if(err != noErr) - fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err); - } - pthread_mutex_unlock(&data->lock); - return 0; -} - - -/* - * DDXRingBell - * Play a tone using the CoreAudio API - */ -void DDXRingBell( - int volume, // volume is % of max - int pitch, // pitch is Hz - int duration ) // duration is milliseconds -{ - if (XQuartzUseSysBeep) { - if (volume) - NSBeep(); - return; - } - - if (quartzAudioDevice == kAudioDeviceUnknown) return; - - pthread_mutex_lock(&data.lock); - - // fade previous sound, if any - data.prevFrequency = data.frequency; - data.prevAmplitude = data.amplitude; - data.prevFrame = data.curFrame; - - // set new sound - data.frequency = pitch; - data.amplitude = volume / 100.0; - data.curFrame = 0; - data.totalFrames = (int)(data.sampleRate * duration / 1000.0); - data.remainingFrames = data.totalFrames; - - if (! data.playing) { - OSStatus status; - status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc); - if (status) { - ErrorF("DDXRingBell: AudioDeviceStart returned %ld\n", (long)status); - } else { - data.playing = TRUE; - } - } - pthread_mutex_unlock(&data.lock); -} - -/* - * QuartzAudioInit - * Prepare to play the bell with the CoreAudio API - */ -void QuartzAudioInit(void) -{ - UInt32 propertySize; - OSStatus status; - AudioDeviceID outputDevice; - double sampleRate; - AudioObjectPropertyAddress devicePropertyAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; - AudioObjectPropertyAddress sampleRatePropertyAddress = { kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; - - // Get the default output device - propertySize = sizeof(outputDevice); - status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &devicePropertyAddress, - 0, NULL, - &propertySize, &outputDevice); - if (status) { - ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(output device) returned %ld\n", - (long)status); - return; - } - if (outputDevice == kAudioDeviceUnknown) { - ErrorF("QuartzAudioInit: No audio output devices available.\n"); - return; - } - - // Get the basic device description - sampleRate = 0.; - propertySize = sizeof(sampleRate); - status = AudioObjectGetPropertyData(outputDevice, &sampleRatePropertyAddress, - 0, NULL, - &propertySize, &sampleRate); - if (status) { - ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(sample rate) returned %ld\n", - (long)status); - return; - } - - // Fill in the playback data - data.frequency = 0; - data.amplitude = 0; - data.curFrame = 0; - data.remainingFrames = 0; - data.sampleRate = sampleRate; - // data.bufferByteCount = bufferByteCount; - data.playing = FALSE; - data.prevAmplitude = 0; - data.prevFrame = 0; - data.prevFrequency = 0; - data.fadeLength = data.sampleRate / 200; - pthread_mutex_init(&data.lock, NULL); // fixme error check - - // fixme assert fadeLength= 1050 - { - AudioDeviceIOProcID sInputIOProcID = NULL; - status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID ); - } -#else - status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data); -#endif - if (status) { - ErrorF("QuartzAudioInit: AddIOProc returned %ld\n", (long)status); - return; - } - - // success! - quartzAudioDevice = outputDevice; -} diff --git a/hw/xquartz/quartzAudio.h b/hw/xquartz/quartzAudio.h deleted file mode 100644 index 2a78b3957..000000000 --- a/hw/xquartz/quartzAudio.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// QuartzAudio.h -// -// X Window bell support using CoreAudio or AppKit. -// Greg Parker gparker@cs.stanford.edu 19 Feb 2001 -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef _QUARTZAUDIO_H -#define _QUARTZAUDIO_H - -void QuartzAudioInit(void); - -#endif diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index f54c686d1..54f709a8b 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -53,7 +53,6 @@ #include "darwinEvents.h" #include "quartzKeyboard.h" -#include "quartzAudio.h" #include "X11Application.h" diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c index ba92ecef6..36c8182ae 100644 --- a/hw/xquartz/quartzStartup.c +++ b/hw/xquartz/quartzStartup.c @@ -40,7 +40,6 @@ #include "X11Controller.h" #include "darwin.h" #include "darwinEvents.h" -#include "quartzAudio.h" #include "quartz.h" #include "opaque.h" #include "micmap.h" @@ -117,9 +116,6 @@ int server_main(int argc, char **argv, char **envp) { } } - /* Create the audio mutex */ - QuartzAudioInit(); - X11ControllerMain(argc, argv, envp); exit(0); }