Author: matt
Date: 2010-03-10 14:56:56 -0800 (Wed, 10 Mar 2010)
New Revision: 7241
Log:
Removed remaining 'deprecated function' warnings for Xcode
Modified:
branches/branch-1.3/test/blocks.cxx
branches/branch-1.3/test/sudoku.cxx
Modified: branches/branch-1.3/test/blocks.cxx
===================================================================
--- branches/branch-1.3/test/blocks.cxx 2010-03-10 22:37:22 UTC (rev 7240)
+++ branches/branch-1.3/test/blocks.cxx 2010-03-10 22:56:56 UTC (rev 7241)
@@ -148,6 +148,9 @@
// Private, OS-specific data...
#ifdef __APPLE__
AudioDeviceID device;
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ AudioDeviceIOProcID audio_proc_id;
+# endif
AudioStreamBasicDescription format;
short *data;
int remaining;
@@ -216,11 +219,14 @@
// Check we got linear pcm - what to do if we did not ???
if (format.mFormatID != kAudioFormatLinearPCM) return;
- // Attach the callback
+ // Attach the callback and start the device
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ if (AudioDeviceCreateIOProcID(device, audio_cb, (void *)this,
&audio_proc_id) != noErr) return;
+ AudioDeviceStart(device, audio_proc_id);
+# else
if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return;
-
- // Start the device...
AudioDeviceStart(device, audio_cb);
+# endif
sample_size = (int)format.mSampleRate;
@@ -312,8 +318,13 @@
BlockSound::~BlockSound() {
#ifdef __APPLE__
if (sample_size) {
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ AudioDeviceStop(device, audio_proc_id);
+ AudioDeviceDestroyIOProcID(device, audio_proc_id);
+# else
AudioDeviceStop(device, audio_cb);
AudioDeviceRemoveIOProc(device, audio_cb);
+# endif
}
#elif defined(WIN32)
Modified: branches/branch-1.3/test/sudoku.cxx
===================================================================
--- branches/branch-1.3/test/sudoku.cxx 2010-03-10 22:37:22 UTC (rev 7240)
+++ branches/branch-1.3/test/sudoku.cxx 2010-03-10 22:56:56 UTC (rev 7241)
@@ -99,6 +99,9 @@
// Private, OS-specific data...
#ifdef __APPLE__
AudioDeviceID device;
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ AudioDeviceIOProcID audio_proc_id;
+# endif
AudioStreamBasicDescription format;
short *data;
int remaining;
@@ -245,12 +248,15 @@
// Check we got linear pcm - what to do if we did not ???
if (format.mFormatID != kAudioFormatLinearPCM) return;
- // Attach the callback
+ // Attach the callback and start the device
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ if (AudioDeviceCreateIOProcID(device, audio_cb, (void *)this,
&audio_proc_id) != noErr) return;
+ AudioDeviceStart(device, audio_proc_id);
+# else
if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return;
-
- // Start the device...
AudioDeviceStart(device, audio_cb);
-
+# endif
+
sample_size = (int)format.mSampleRate / 20;
#elif defined(WIN32)
@@ -349,8 +355,13 @@
SudokuSound::~SudokuSound() {
#ifdef __APPLE__
if (sample_size) {
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ AudioDeviceStop(device, audio_proc_id);
+ AudioDeviceDestroyIOProcID(device, audio_proc_id);
+# else
AudioDeviceStop(device, audio_cb);
AudioDeviceRemoveIOProc(device, audio_cb);
+# endif
}
#elif defined(WIN32)
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit