Skip to content

Commit

Permalink
programs/sndfile-play.c : Better error message on OSX_DARWIN_VERSION …
Browse files Browse the repository at this point in the history
…> 11.
  • Loading branch information
erikd committed Dec 1, 2012
1 parent 04bb407 commit 49017a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
13 changes: 12 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2012-12-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* configure.ac programs/sndfile-play.c
OS X 10.8 uses a different audio API to previous versions.
Fix compile failure on by disabling sndfile-play on this version.
Someone needs to supply code for the new API.

2012-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* Octave/Makefile.am Octave/octave_test.sh
Fix 'make distcheck'.

2012-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* M4/octave.m4
Expand Down Expand Up @@ -9607,4 +9619,3 @@ This is the boundary between version 1 of the library above and version 0 below.
* src/aiff.c:
Changed reading of 'COMM' chunk to avoid reading an int
which overlaps an int (4 byte) boundary.

14 changes: 12 additions & 2 deletions programs/sndfile-play.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
#include <AvailabilityMacros.h>
#include <Availability.h>

#if (OSX_DARWIN_VERSION == 11)
#if (OSX_DARWIN_VERSION > 11)
/* Includes go here. */
#elif (OSX_DARWIN_VERSION == 11)
#include <AudioToolbox/AudioToolbox.h>
#elif (OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10)
#include <Carbon.h>
Expand Down Expand Up @@ -477,8 +479,12 @@ opensoundsys_open_device (int channels, int srate)
** Mac OS X functions for playing a sound.
*/

#if (OSX_DARWIN_VERSION > 11)
/* MacOSX 10.8 use a new Audio API. Someone needs to write some code for it. */
#endif /* OSX_DARWIN_VERSION > 11 */

#if (OSX_DARWIN_VERSION == 11)
/* MacOSX 10.7 or later, use AudioQueue API */
/* MacOSX 10.7 use AudioQueue API */

#define kBytesPerAudioBuffer (1024 * 8)
#define kNumberOfAudioBuffers 4
Expand Down Expand Up @@ -1180,6 +1186,10 @@ main (int argc, char *argv [])
solaris_play (argc, argv) ;
#elif (OS_IS_WIN32 == 1)
win32_play (argc, argv) ;
#elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION > 11)
printf ("OS X 10.8 and later have a new Audio API.\n") ;
printf ("Someone needs to write code to use that API.\n") ;
return 1 ;
#elif defined (__BEOS__)
printf ("This program cannot be compiled on BeOS.\n") ;
printf ("Instead, compile the file sfplay_beos.cpp.\n") ;
Expand Down

0 comments on commit 49017a1

Please sign in to comment.