Index: Source/NSSound.m
===================================================================
--- Source/NSSound.m	(revision 28296)
+++ Source/NSSound.m	(working copy)
@@ -32,20 +32,22 @@
 #include "AppKit/NSPasteboard.h"
 #include "AppKit/NSSound.h"
 
-#ifdef HAVE_AUDIOFILE_H
-#include <audiofile.h>
+#if defined(HAVE_SNDFILE_H)
+#include <sndfile.h>
 #endif
 
-#define BUFFER_SIZE_IN_FRAMES 4096
+#if defined(HAVE_AL_AL_H)
+#include <AL/al.h>
+#include <AL/alc.h>
 
-#define DEFAULT_CHANNELS 2
+static ALCdevice *device = NULL;
+static ALCcontext *context = NULL;
+#endif
 
 /* Class variables and functions for class methods */
 static NSMutableDictionary *nameDict = nil;
 static NSDictionary *nsmapping = nil;
 
-#define	GSNDNAME @"GNUstepGSSoundServer"
-
 @implementation NSBundle (NSSoundAdditions)
 
 - (NSString *) pathForSoundResource: (NSString *)name
@@ -75,268 +77,131 @@
 
 @end 
 
-@protocol GSSoundSvr
-
-- (BOOL) playSound: (id)aSound;
-- (BOOL) stopSoundWithIdentifier: (NSString *)identifier;
-- (BOOL) pauseSoundWithIdentifier: (NSString *)identifier;
-- (BOOL) resumeSoundWithIdentifier: (NSString *)identifier;
-- (BOOL) isPlayingSoundWithIdentifier: (NSString *)identifier;
-
-@end 
-
 @interface NSSound (PrivateMethods)
 
-+ (id<GSSoundSvr>) gsnd;
-+ (void) localServer: (id<GSSoundSvr>)s;
-+ (id) lostServer: (NSNotification*)notification;
-
 - (BOOL) getDataFromFileAtPath: (NSString *)path;
-- (void) setIdentifier: (NSString *)identifier;
-- (NSString *) identifier;
-- (float) samplingRate;
-- (float) frameSize;
-- (long) frameCount;
-- (NSData *) data;
+- (BOOL) getContext;
+- (BOOL) bufferData;
 
 @end
 
 @implementation NSSound (PrivateMethods)
 
-#ifdef HAVE_AUDIOFILE_H
-static id<GSSoundSvr> the_server = nil;
-
-+ (id<GSSoundSvr>) gsnd
-{
-  if (the_server == nil) 
-    {
-      NSString *host;
-      NSString *description;
-      
-      host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"];
-      if (host == nil) 
-	{
-	  host = @"";
-	} 
-      else 
-	{
-	  NSHost *h = [NSHost hostWithName: host];
-	  if (h == nil) 
-	    {
-	      NSLog(@"Unknown NSHost (%@) ignored", host);
-	      host = @"";
-	    } 
-	  else if ([h isEqual: [NSHost currentHost]] == YES) 
-	    {
-	      host = @"";
-	    } 
-	  else 
-	    {
-	      host = [h name];
-	    }
-	}
-
-      if ([host length] == 0) 
-	{
-	  description = @"local host";
-	} 
-      else 
-	{
-	  description = host;
-	}
-
-      the_server = (id<GSSoundSvr>)[NSConnection
-	rootProxyForConnectionWithRegisteredName: GSNDNAME host: host];
-
-      if (the_server == nil && [host length] > 0) 
-	{
-	  NSString *service = [GSNDNAME stringByAppendingFormat: @"-%@", host];
-
-	  the_server = (id<GSSoundSvr>)[NSConnection
-	    rootProxyForConnectionWithRegisteredName: service host: @"*"];
-	}
-
-      if (RETAIN ((id)the_server) != nil) 
-	{
-	  NSConnection*	conn = [(id)the_server connectionForProxy];
-
-	  [[NSNotificationCenter defaultCenter]
-	    addObserver: self
-	    selector: @selector(lostServer:)
-	    name: NSConnectionDidDieNotification
-	    object: conn];
-	} 
-      else 
-	{
-	  static BOOL recursion = NO;
-	  static NSString	*cmd = nil;
-	  static NSArray *args = nil;
-	  
-	  if (cmd == nil && recursion == NO) 
-	    {
-	      cmd = [NSTask launchPathForTool: @"gnustep_sndd"];
-	    }
-
-	  if (recursion == YES || cmd == nil) 
-	    {
-	      NSLog(@"Unable to contact sound server - "
-		@"please ensure that gnustep_sndd is running for %@.",
-		description);
-	      return nil;
-	    } 
-	  else 
-	    {
-	      NSLog(@"\nI couldn't contact the sound server for %@ -\n"
-		    @"so I'm attempting to to start one - which will take a few seconds.\n"
-		    @"Trying to launch gnustep_sndd from %@ or a machine/operating-system subdirectory.\n"
-		    @"It is recommended that you start the sound server (gnustep_sndd) when\n"
-		    @"your windowing system is started up.\n", description,
-		    [cmd stringByDeletingLastPathComponent]);
-
-	      if ([host length] > 0) 
-		{
-		  args = [[NSArray alloc] initWithObjects: @"-NSHost", host, nil];
-		}
-
-	      [NSTask launchedTaskWithLaunchPath: cmd arguments: args];
-
-	      [NSTimer scheduledTimerWithTimeInterval: 5.0
-		       invocation: nil repeats: NO];
-
-	      [[NSRunLoop currentRunLoop] runUntilDate: 
-					      [NSDate dateWithTimeIntervalSinceNow: 5.0]];
-
-	      recursion = YES;
-	      [self gsnd];
-	      recursion = NO;
-	    }
-	}
-    }
-		
-  return the_server;
-}
-
-+ (void) localServer: (id<GSSoundSvr>)s
-{
-  the_server = s;
-}
-
-+ (id) lostServer: (NSNotification*)notification
-{
-  id obj = the_server;
-
-  the_server = nil;
-  [[NSNotificationCenter defaultCenter]
-    removeObserver: self
-    name: NSConnectionDidDieNotification
-    object: [notification object]];
-  RELEASE (obj);
-  return self;
-}
-
+#if defined(HAVE_SNDFILE_H)
 - (BOOL) getDataFromFileAtPath: (NSString *)path
 {
-  NSMutableData *d;
-  AFfilehandle file;
-  AFframecount framesRead;
-  void *buffer;
+  SNDFILE *file;
+  SF_INFO fileInfo;
+  int framesRead;
 
-#define CHECK_AF_ERR(x) \
-if ((x) == -1) { \
-afCloseFile(file); \
-return NO; \
-}
-
-  if ((file = afOpenFile([path fileSystemRepresentation], "r", NULL)) 
-	== AF_NULL_FILEHANDLE) 
+  fileInfo.format = 0;
+  if ((file = sf_open([path fileSystemRepresentation], SFM_READ, &fileInfo)) == NULL)
     {
       return NO;
     }
-
-  _dataFormat = AF_SAMPFMT_TWOSCOMP;
-  CHECK_AF_ERR (afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK, _dataFormat, 16));
-  _channelCount = DEFAULT_CHANNELS;
-  CHECK_AF_ERR (afSetVirtualChannels(file, AF_DEFAULT_TRACK, _channelCount));
-  CHECK_AF_ERR (_samplingRate = afGetRate(file, AF_DEFAULT_TRACK));	
-  CHECK_AF_ERR (_frameCount = afGetFrameCount(file, AF_DEFAULT_TRACK));	
-  CHECK_AF_ERR (_frameSize = afGetVirtualFrameSize(file, AF_DEFAULT_TRACK, 1));	
-  CHECK_AF_ERR (_dataLocation = afGetDataOffset(file, AF_DEFAULT_TRACK));
+  
+  _channelCount = (int) fileInfo.channels;
+  _sampleRate = (int) fileInfo.samplerate;
+  _frameCount = (long) fileInfo.frames;
+  _dataSize = _frameCount + (long)_sampleRate + (long)_channelCount;
 		
-  buffer = NSZoneMalloc(NSDefaultMallocZone(), BUFFER_SIZE_IN_FRAMES * _frameSize);
-  d = [[NSMutableData alloc] initWithCapacity: 1];
-
-  CHECK_AF_ERR (framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer, 
-					  BUFFER_SIZE_IN_FRAMES));
-  while (framesRead > 0) 
-    {	
-      [d appendBytes: (const void *)buffer 
-	 length: framesRead * _frameSize];
-      CHECK_AF_ERR (framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer, 
-					      BUFFER_SIZE_IN_FRAMES));		
-    }
-
-  _data = d;	
-  _dataSize = [_data length];
-  NSZoneFree(NSDefaultMallocZone(), buffer);
-  afCloseFile(file);
+  _data = NSZoneMalloc(NSDefaultMallocZone(), _dataSize);
+  framesRead = sf_read_short (file, _data, _dataSize);
+  
+  sf_close (file);
 	
   return YES;
 }
-
 #else
 /* No sound software */
 
-+ (id<GSSoundSvr>) gsnd
-{
-  return nil;
-}
-
-+ (void) localServer: (id<GSSoundSvr>)s
-{
-}
-
-+ (id) lostServer: (NSNotification*)notification
-{
-  return self;
-}
-
 - (BOOL) getDataFromFileAtPath: (NSString *)path
 {
+  /* FIXME: insert code to read AIFF, AIFC, AU and WAV formats here */
   NSLog(@"NSSound: No sound software installed, cannot get sound");
   return NO;
 }
 #endif
 
-- (void) setIdentifier: (NSString *)identifier
+#if defined(HAVE_AL_AL_H)
+- (BOOL) getContext
 {
-  ASSIGN (_uniqueIdentifier, identifier);
+  if ((context = alcGetCurrentContext()) == NULL)
+    {
+      device = alcOpenDevice (NULL);
+      if (device == NULL)
+        {
+          return NO;
+        }
+      context = alcCreateContext (device, NULL);
+      alcMakeContextCurrent (context);
+      if (alGetError() != AL_NO_ERROR)
+        {
+          return NO;
+        }
+    }
+  device = alcGetContextsDevice (context);
+  
+  return YES;
 }
-
-- (NSString *) identifier
+- (BOOL) bufferData
 {
-  return _uniqueIdentifier;
+  ALenum format;
+  
+  alGenSources (1, &_sndSource);
+  if (alGetError() != AL_NO_ERROR)
+    {
+      return NO;
+    }
+  alSourcef (_sndSource, AL_MIN_GAIN, 0.0);
+  alSourcef (_sndSource, AL_MAX_GAIN, 1.0);
+  if (alGetError() != AL_NO_ERROR)
+    {
+      return NO;
+    }
+  
+  alGenBuffers (1, &_sndBuffer);
+  if (alGetError() != AL_NO_ERROR)
+    {
+      return NO;
+    }
+  
+  if (_channelCount == 1)
+    {
+      format = AL_FORMAT_MONO16;
+    }
+  else if (_channelCount == 2)
+    {
+      format = AL_FORMAT_STEREO16;
+    }
+  else
+    {
+      format = 0;
+    }
+  alBufferData (_sndBuffer, format, _data, (ALsizei)_dataSize, (ALsizei)_sampleRate);
+  if (alGetError() != AL_NO_ERROR)
+    {
+      NSLog (@"Could not buffer");
+      return NO;
+    }
+  
+  alSourcei (_sndSource, AL_BUFFER, _sndBuffer);
+  return YES;
 }
-
-- (float) samplingRate
+#else
+- (BOOL) createContext
 {
-  return _samplingRate;
+  NSLog(@"NSSound: No sound software installed, cannot create context");
+  return NO;
 }
 
-- (float) frameSize
+- (BOOL) bufferData
 {
-  return _frameSize;
+  NSLog(@"NSSound: No sound software installed, cannot buffer sound");
+  return NO;
 }
+#endif
 
-- (long) frameCount
-{
-  return _frameCount;
-}
-
-- (NSData *) data
-{
-  return _data;
-}
-
 @end
 
 @implementation	NSSound
@@ -353,10 +218,10 @@
       nameDict = [[NSMutableDictionary alloc] initWithCapacity: 10];
       
       if (path) 
-	{
-	  nsmapping = RETAIN([[NSString stringWithContentsOfFile: path]
-			       propertyListFromStringsFileFormat]);
-	}
+        {
+          nsmapping = RETAIN([[NSString stringWithContentsOfFile: path]
+                  propertyListFromStringsFileFormat]);
+        }
     }
 }
 
@@ -367,8 +232,14 @@
     { 
       [nameDict removeObjectForKey: _name];
     }
+#if defined(HAVE_AL_AL_H)
+  alDeleteSources (1, &_sndSource);
+  alDeleteBuffers (1, &_sndBuffer);
+#endif
   TEST_RELEASE (_name);
-  TEST_RELEASE (_uniqueIdentifier);
+  TEST_RELEASE (_playbackDeviceIdentifier);
+  TEST_RELEASE (_channelMap);
+  NSZoneFree(NSDefaultMallocZone(), _data);
   [super dealloc];
 }
 
@@ -383,12 +254,29 @@
     {			
       _onlyReference = byRef;			
       ASSIGN (_name, [path lastPathComponent]);
-      _uniqueIdentifier = nil;
+      _playbackDeviceIdentifier = nil;
+      _channelMap = nil;
       if ([self getDataFromFileAtPath: path] == NO) 
-	{
-	  NSLog(@"Could not get sound data from %@", path);
-	  DESTROY (self);
-	}
+        {
+          NSLog(@"Could not get sound data from %@", path);
+          DESTROY (self);
+        }
+      else
+        {
+          if ([self getContext] == NO)
+            {
+              NSLog (@"Could not get context");
+              DESTROY (self);
+            }
+          else
+            {
+              if ([self bufferData] == NO)
+                {
+                  NSLog (@"Could not buffer data!");
+                  DESTROY (self);
+                }
+            }
+        }
     }
 	
   return self;
@@ -402,6 +290,7 @@
 
 - (id) initWithData: (NSData *)data
 {
+  /* FIXME: insert code to read from NSData */
   [self notImplemented: _cmd];
   return nil;
 }
@@ -417,49 +306,144 @@
 }
 
 //
-// Playing
+// Playing and Information
 //
+#if defined(HAVE_AL_AL_H)
+
 - (BOOL) pause 
 {
-  if (_uniqueIdentifier) 
+  alSourcePause (_sndSource);
+  return (alGetError() == AL_NO_ERROR ? YES : NO);
+}
+
+- (BOOL) play
+{
+  alSourcePlay (_sndSource);
+  return (alGetError() == AL_NO_ERROR ? YES : NO);
+}
+
+- (BOOL) resume
+{
+  ALint value;
+  alGetSourcei (_sndSource, AL_SOURCE_STATE, &value);
+  if (value == AL_PLAYING)
     {
-      return [[NSSound gsnd] pauseSoundWithIdentifier: _uniqueIdentifier];
-    }	
+      return YES;
+    }
+  alSourcePlay (_sndSource);
+  return (alGetError() == AL_NO_ERROR ? YES : NO);
+}
+
+- (BOOL) stop
+{
+  alSourceStop (_sndSource);
+  return (alGetError() == AL_NO_ERROR ? YES : NO);
+}
+
+- (BOOL) isPlaying
+{
+  ALint value;
+  alGetSourcei (_sndSource, AL_SOURCE_STATE, &value);
+  return (value == AL_PLAYING ? YES : NO);
+}
+
+- (float) volume
+{
+  ALfloat value;
+  alGetSourcef (_sndSource, AL_GAIN, &value);
+  return (float)value;
+}
+
+- (void) setVolume: (float) volume
+{
+  alSourcef (_sndSource, AL_GAIN, (ALfloat)volume);
+}
+  
+- (NSTimeInterval) currentTime
+{
+  ALfloat value;
+  alGetSourcef (_sndSource, AL_SEC_OFFSET, &value);
+  return (NSTimeInterval)value;
+}
+
+- (void) setCurrentTime: (NSTimeInterval) currentTime
+{
+  alSourcef (_sndSource, AL_SEC_OFFSET, (ALfloat)currentTime);
+}
+
+- (BOOL) loops
+{
+  ALint value;
+  alGetSourcei (_sndSource, AL_LOOPING, &value);
+  return (value == AL_TRUE ? YES : NO);
+}
+
+- (void) setLoops: (BOOL) loops
+{
+  ALint value;
+  (loops == YES) ? (value = AL_TRUE) : (value = AL_FALSE);
+  alSourcei (_sndSource, AL_LOOPING, value);
+}
+
+#else
+
+- (BOOL) pause 
+{
   return NO;
 }
 
 - (BOOL) play
 {
-  return [[NSSound gsnd] playSound: self];
+  return NO;
 }
 
 - (BOOL) resume
 {
-  if (_uniqueIdentifier) 
-    {
-      return [[NSSound gsnd] resumeSoundWithIdentifier: _uniqueIdentifier];
-    }	
   return NO;
 }
 
 - (BOOL) stop
 {
-  if (_uniqueIdentifier) 
-    {
-      return [[NSSound gsnd] stopSoundWithIdentifier: _uniqueIdentifier];
-    }	
   return NO;
 }
 
 - (BOOL) isPlaying
 {
-  if (_uniqueIdentifier) 
-    {
-      return [[NSSound gsnd] isPlayingSoundWithIdentifier: _uniqueIdentifier];
-    }	
   return NO;
 }
 
+- (float) volume
+{
+  return 0.0;
+}
+
+- (void) setVolume: (float) volume
+{
+  return;
+}
+
+- (NSTimeInterval) currentTime;
+{
+  return 0.0;
+}
+
+- (void) setCurrentTime: (NSTimeInterval) currentTime
+{
+  return;
+}
+
+- (BOOL) loops;
+{
+  return NO;
+}
+
+- (void) setLoops: (BOOL) loops
+{
+  return;
+}
+
+#endif
+
 //
 // Working with pasteboards 
 //
@@ -619,7 +603,11 @@
 
 + (NSArray *) soundUnfilteredFileTypes
 {
-  return [NSArray arrayWithObjects: @"aiff", @"waw", @"snd", @"au", nil];
+#if defined(HAVE_SNDFILE_H) 
+  return [NSArray arrayWithObjects: @"wav", @"aiff", @"aifc", @"aif", @"au", @"snd", @"mat", @"mat4", @"mat5", @"paf", @"sf", @"voc", @"w64", @"xi", @"caf", @"sd2", @"flac", @"ogg", @"oga", nil];
+#else
+  return [NSArray arrayWithObjects: @"wav", @"aiff", @"aifc", @"aif", @"au", @"snd", nil];
+#endif
 }
 
 - (NSString *) name
@@ -656,6 +644,28 @@
   return YES;
 }
 
+- (NSString *) playbackDeviceIdentifier
+{
+  [self notImplemented: _cmd];
+  return nil;
+}
+
+- (void) setPlaybackDeviceIdentifier: (NSString *) playbackDeviceIdentifier
+{
+  [self notImplemented: _cmd];
+}
+
+- (NSArray *) channelMapping
+{
+  [self notImplemented: _cmd];
+  return nil;
+}
+
+- (void) setChannelMapping: (NSArray *) channelMapping
+{
+  [self notImplemented: _cmd];
+}
+
 //
 // NSCoding 
 //
@@ -671,25 +681,19 @@
       [coder encodeObject: _name];
       
       if (_onlyReference == YES) 
-	{
-	  return;
-	}
-      
-      if (_uniqueIdentifier != nil) 
-	{
-	  [coder encodeObject: _uniqueIdentifier];
-	}
-      
+      	{
+	        return;
+      	}
       [coder encodeConditionalObject: _delegate];
-      [coder encodeValueOfObjCType: @encode(long) at: &_dataLocation];
       [coder encodeValueOfObjCType: @encode(long) at: &_dataSize];
-      [coder encodeValueOfObjCType: @encode(int) at: &_dataFormat];
-      [coder encodeValueOfObjCType: @encode(float) at: &_samplingRate];
-      [coder encodeValueOfObjCType: @encode(float) at: &_frameSize];
       [coder encodeValueOfObjCType: @encode(long) at: &_frameCount];
+      [coder encodeValueOfObjCType: @encode(int) at: &_sampleRate];
       [coder encodeValueOfObjCType: @encode(int) at: &_channelCount];
+      [coder encodeValueOfObjCType: @encode(unsigned int) at: &_sndSource];
+      [coder encodeValueOfObjCType: @encode(unsigned int) at: &_sndBuffer];
+      /* FIXME: need to encode _data */
       
-      [coder encodeObject: _data];
+      [coder encodeObject: _playbackDeviceIdentifier];
     }
 }
 
@@ -704,29 +708,28 @@
       [decoder decodeValueOfObjCType: @encode(BOOL) at: &_onlyReference];
       
       if (_onlyReference == YES) 
-	{
-	  NSString *theName = [decoder decodeObject];
-	  
-	  RELEASE (self);
-	  self = RETAIN ([NSSound soundNamed: theName]);
-	  [self setName: theName];	
-	} 
+	      {
+	        NSString *theName = [decoder decodeObject];
+	        
+	        RELEASE (self);
+	        self = RETAIN ([NSSound soundNamed: theName]);
+	        [self setName: theName];	
+	      } 
       else 
-	{
-	  _name = TEST_RETAIN ([decoder decodeObject]);
-	  _uniqueIdentifier = TEST_RETAIN ([decoder decodeObject]);
-	  [self setDelegate: [decoder decodeObject]];
-	  
-	  [decoder decodeValueOfObjCType: @encode(long) at: &_dataLocation];
-	  [decoder decodeValueOfObjCType: @encode(long) at: &_dataSize];
-	  [decoder decodeValueOfObjCType: @encode(int) at: &_dataFormat];
-	  [decoder decodeValueOfObjCType: @encode(float) at: &_samplingRate];
-	  [decoder decodeValueOfObjCType: @encode(float) at: &_frameSize];
-	  [decoder decodeValueOfObjCType: @encode(long) at: &_frameCount];
-	  [decoder decodeValueOfObjCType: @encode(int) at: &_channelCount];
-	  
-	  _data = RETAIN([decoder decodeObject]);
-	}
+	      {
+	        _name = TEST_RETAIN ([decoder decodeObject]);
+	        [self setDelegate: [decoder decodeObject]];
+	        
+          [decoder decodeValueOfObjCType: @encode(long) at: &_dataSize];
+          [decoder decodeValueOfObjCType: @encode(long) at: &_frameCount];
+          [decoder decodeValueOfObjCType: @encode(int) at: &_sampleRate];
+          [decoder decodeValueOfObjCType: @encode(int) at: &_channelCount];
+          [decoder decodeValueOfObjCType: @encode(unsigned int) at: &_sndSource];
+          [decoder decodeValueOfObjCType: @encode(unsigned int) at: &_sndBuffer];
+	        /* FIXME: need to decode _data */
+	        
+	        _playbackDeviceIdentifier = RETAIN([decoder decodeObject]);
+	      }
     }
   return self;
 }
@@ -741,11 +744,10 @@
 //
 - (id) copyWithZone: (NSZone *)zone
 {
+  /* FIXME: need to copy _data and all the other stuff */
   NSSound *newSound = (NSSound *)NSCopyObject(self, 0, zone);
 	
-  newSound->_data = [_data copyWithZone: zone];	
-  newSound->_name = [_name copyWithZone: zone];		
-  newSound->_uniqueIdentifier = [_uniqueIdentifier copyWithZone: zone];
+  newSound->_name = [_name copyWithZone: zone];
 	
   return newSound;
 }
Index: configure.ac
===================================================================
--- configure.ac	(revision 28296)
+++ configure.ac	(working copy)
@@ -354,32 +354,11 @@
 #--------------------------------------------------------------------
 # NSSound
 #--------------------------------------------------------------------
-AC_ARG_ENABLE(gsnd, 
-  [  --disable-gsnd          Disable gsnd server],,
-  enable_gsnd=yes)
-BUILD_GSND=
 
-# This is only for gsnd, so don't add it to LIBS
-save_LIBS="$LIBS"
-AC_CHECK_LIB(portaudio, Pa_OpenDefaultStream, have_portaudio=yes, have_portaudio=no)
-LIBS="$save_LIBS"
+AC_CHECK_LIB(sndfile, sf_error)
+AC_CHECK_LIB(openal, alGetError)
+AC_CHECK_HEADERS(sndfile.h AL/al.h)
 
-AC_CHECK_LIB(audiofile, afGetVirtualFrameSize)
-AC_CHECK_HEADERS(portaudio.h audiofile.h)
-
-AC_MSG_CHECKING(for portaudio version >= 19)
-have_portaudio19=no
-if test $ac_cv_header_portaudio_h = yes; then
-  AC_EGREP_HEADER(PaStreamCallback, portaudio.h,
-        have_portaudio19=yes, have_portaudio19=no)
-fi
-AC_MSG_RESULT($have_portaudio19)
-
-if test $have_portaudio19 = yes -a $have_portaudio = yes -a $enable_gsnd = yes; then
-  BUILD_GSND=gsnd
-fi
-AC_SUBST(BUILD_GSND)
-
 #--------------------------------------------------------------------
 # Find CUPS
 #--------------------------------------------------------------------
Index: Headers/AppKit/NSSound.h
===================================================================
--- Headers/AppKit/NSSound.h	(revision 28296)
+++ Headers/AppKit/NSSound.h	(working copy)
@@ -43,31 +43,58 @@
 @interface NSSound : NSObject <NSCoding, NSCopying>
 {		
   NSString *_name;
-  NSString *_uniqueIdentifier;	
+  NSString *_playbackDeviceIdentifier;
+  NSArray  *_channelMap; /* Currently unused */
   BOOL _onlyReference;
-  id _delegate;	
-	
-  NSData *_data;
-  float _samplingRate;
-  float _frameSize;
-  long _dataLocation;
-  long _dataSize;
-  long _frameCount;
-  int _channelCount;	
-  int _dataFormat;
+  id _delegate;
+
+  short *_data;
+  long  _dataSize;
+  long  _frameCount;
+  int   _sampleRate;
+  int   _channelCount;
+  
+  /* Used for OpenAL */
+  unsigned int _sndSource;
+  unsigned int _sndBuffer;
 }
 
 //
 // Creating an NSSound 
 //
+/** Initalizes the receiver object with the contents of file located at path.<p/>
+ *  If byRef is set to YES only the name of the NSSound is encoded with -encodeWithCoder:;
+ *  if set to NO the data is encoded.
+ *  See Also:
+ *   -initWithContentsOfURL:byReference:
+ *   -initWithData:
+ */
 - (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef;
+/** Initializes the receiver object with the contents of the data located in url.<p/>
+ *  If byRef is set to YES only the name of the NSSound is encoded with -encodeWithCoder:;
+ *  if set to NO the data is encoded.
+ *  See Also:
+ *    -initWithContentsOfFile:byReference:
+ *    -initWithData:
+ */
 - (id)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef;
+/** THIS METHOD CURRENTLY UNIMPLEMENTED.<p/>
+ *  Initializes the receiver object with the contents of data.<p/>
+ *  If byRef is set to YES only the name of the NSSound is encoded with -encodeWithCoder:;
+ *  if set to NO the data is encoded.
+ *  See Also:
+ *    -initWithContentsOfFile:byReference:
+ *    -initWithContentsOfURL:byReference:
+ */
 - (id)initWithData:(NSData *)data;
 - (id)initWithPasteboard:(NSPasteboard *)pasteboard;
 
 //
 // Playing
 //
+/** Pauses audio playback.<p/>
+ *  Returns YES on success and NO if sound could not be paused.
+ */
 - (BOOL)pause;
 - (BOOL)play; 
 - (BOOL)resume;
@@ -78,23 +105,64 @@
 // Working with pasteboards 
 //
 + (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
+/** Provides an array of file types that NSSound can understand.  The returning
+ *  array may be directly passed to [NSOpenPanel -runModalForTypes:].
+ *  Built with libsndfile:<p/>
+ *    wav, aiff, aifc, aif, au, snd, mat, mat4, mat5, paf, sf, voc, w64,
+ *    xi, caf, sd2, flac, ogg, oga
+ *  Built without libsndfile:
+ *    wav, aiff, aifc, aif, au, snd
+ */
 + (NSArray *)soundUnfilteredPasteboardTypes;
 - (void)writeToPasteboard:(NSPasteboard *)pasteboard;
 
 //
 // Working with delegates 
 //
+/** Returns the receiver's delegate
+ */
 - (id)delegate;
+/** Sets the receiver's delegate
+ */
 - (void)setDelegate:(id)aDelegate;
 
 //
-// Naming Sounds 
+// Sound Information
 //
 + (id)soundNamed:(NSString *)name;
 + (NSArray *)soundUnfilteredFileTypes;
 - (NSString *)name;
 - (BOOL)setName:(NSString *)aName;
 
+#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
+/** Returns the volume of the receiver.<p/>
+ *  Volume will be between 0.0 and 1.0.
+ */
+- (float) volume;
+/** Sets the volume of the receiver.<p/>
+ *  Volume must be between 0.0 and 1.0.
+ */
+- (void) setVolume: (float) volume;
+/** Returns the current position of the audio playback.
+ */
+- (NSTimeInterval) currentTime;
+/** Sets the current time of the audio playback.
+ */
+- (void) setCurrentTime: (NSTimeInterval) currentTime;
+/** Returns the current loop property of the receiver.<p/>
+ *  YES indicates this NSSound will restart once it reaches the end, otherwise NO.
+ */
+- (BOOL) loops;
+/** Sets the loop property of the receiver.
+ *  YES indicates this NSSound will restart once it reaches the end, otherwise NO.
+ */
+- (void) setLoops: (BOOL) loops;
+- (NSString *) playbackDeviceIdentifier;
+- (void) setPlaybackDeviceIdentifier: (NSString *) playbackDeviceIdentifier;
+- (NSArray *) channelMapping;
+- (void) setChannelMapping: (NSArray *) channelMapping;
+#endif
+
 @end
 
 //
Index: Headers/Additions/GNUstepGUI/config.h.in
===================================================================
--- Headers/Additions/GNUstepGUI/config.h.in	(revision 28296)
+++ Headers/Additions/GNUstepGUI/config.h.in	(working copy)
@@ -6,8 +6,8 @@
 /* Define to 1 if you have the <aspell.h> header file. */
 #undef HAVE_ASPELL_H
 
-/* Define to 1 if you have the <audiofile.h> header file. */
-#undef HAVE_AUDIOFILE_H
+/* Define to 1 if you have the <sndfile.h> header file. */
+#undef HAVE_SNDFILE_H
 
 /* Define to 1 if you have the <cups/cups.h> header file. */
 #undef HAVE_CUPS_CUPS_H
@@ -24,8 +24,8 @@
 /* Define to 1 if you have the `aspell' library (-laspell). */
 #undef HAVE_LIBASPELL
 
-/* Define to 1 if you have the `audiofile' library (-laudiofile). */
-#undef HAVE_LIBAUDIOFILE
+/* Define to 1 if you have the `sndfile' library (-lsndfile). */
+#undef HAVE_LIBSNDFILE
 
 /* Define to 1 if you have the `gif' library (-lgif). */
 #undef HAVE_LIBGIF
@@ -60,8 +60,8 @@
 /* Define to 1 if you have the <mntent.h> header file. */
 #undef HAVE_MNTENT_H
 
-/* Define to 1 if you have the <portaudio.h> header file. */
-#undef HAVE_PORTAUDIO_H
+/* Define to 1 if you have the <AL/al.h> header file. */
+#undef HAVE_AL_AL_H
 
 /* Define to 1 if you have the `rint' function. */
 #undef HAVE_RINT
Index: config.make.in
===================================================================
--- config.make.in	(revision 28296)
+++ config.make.in	(working copy)
@@ -6,8 +6,6 @@
 ADDITIONAL_LIB_DIRS += @ADDITIONAL_LIB_DIRS@
 ADDITIONAL_DEPENDS = @LIBS@
 
-BUILD_GSND=@BUILD_GSND@
-
 GSCUPS_CFLAGS = @GSCUPS_CFLAGS@
 GSCUPS_LDFLAGS = @GSCUPS_LDFLAGS@
 GSCUPS_LIBS = @GSCUPS_LIBS@
