//const char *mname = CFStringGetCStringPtr( cfname, CFStringGetSystemEncoding() );\r
int length = CFStringGetLength(cfname);\r
char *mname = (char *)malloc(length * 3 + 1);\r
+#if defined( UNICODE ) || defined( _UNICODE )\r
+ CFStringGetCString(cfname, mname, length * 3 + 1, kCFStringEncodingUTF8);\r
+#else\r
CFStringGetCString(cfname, mname, length * 3 + 1, CFStringGetSystemEncoding());\r
+#endif\r
info.name.append( (const char *)mname, strlen(mname) );\r
info.name.append( ": " );\r
CFRelease( cfname );\r
//const char *name = CFStringGetCStringPtr( cfname, CFStringGetSystemEncoding() );\r
length = CFStringGetLength(cfname);\r
char *name = (char *)malloc(length * 3 + 1);\r
+#if defined( UNICODE ) || defined( _UNICODE )\r
+ CFStringGetCString(cfname, name, length * 3 + 1, kCFStringEncodingUTF8);\r
+#else\r
CFStringGetCString(cfname, name, length * 3 + 1, CFStringGetSystemEncoding());\r
+#endif\r
info.name.append( (const char *)name, strlen(name) );\r
CFRelease( cfname );\r
free(name);\r
return info;\r
}\r
\r
-static void bufferSwitch( long index, ASIOBool processNow )\r
+static void bufferSwitch( long index, ASIOBool /*processNow*/ )\r
{\r
RtApiAsio *object = (RtApiAsio *) asioCallbackInfo->object;\r
object->callbackEvent( index );\r
std::cerr << "\nRtApiAsio: driver reports sample rate changed to " << sRate << " ... stream stopped!!!\n" << std::endl;\r
}\r
\r
-static long asioMessages( long selector, long value, void* message, double* opt )\r
+static long asioMessages( long selector, long value, void* /*message*/, double* /*opt*/ )\r
{\r
long ret = 0;\r
\r
for ( unsigned int i=0; i<indices.size(); i++ )\r
dsDevices.erase( dsDevices.begin()-nErased++ );\r
\r
- return dsDevices.size();\r
+ return static_cast<unsigned int>(dsDevices.size());\r
}\r
\r
RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )\r
return FAILURE;\r
}\r
\r
- unsigned int nDevices = dsDevices.size();\r
+ size_t nDevices = dsDevices.size();\r
if ( nDevices == 0 ) {\r
// This should not happen because a check is made before this function is called.\r
errorText_ = "RtApiDs::probeDeviceOpen: no devices found!";\r
\r
static BOOL CALLBACK deviceQueryCallback( LPGUID lpguid,\r
LPCTSTR description,\r
- LPCTSTR module,\r
+ LPCTSTR /*module*/,\r
LPVOID lpContext )\r
{\r
struct DsProbeData& probeInfo = *(struct DsProbeData*) lpContext;\r
exit( 0 );
}
+void errorCallback( RtAudioError::Type type, const std::string &errorText )
+{
+ // This example error handling function does exactly the same thing
+ // as the embedded RtAudio::error() function.
+ std::cout << "in errorCallback" << std::endl;
+ if ( type == RtAudioError::WARNING )
+ std::cerr << '\n' << errorText << "\n\n";
+ else if ( type != RtAudioError::WARNING )
+ throw( RtAudioError( errorText, type ) );
+}
+
unsigned int channels;
RtAudio::StreamOptions options;
unsigned int frameCounter = 0;
options.flags |= RTAUDIO_NONINTERLEAVED;
#endif
try {
- dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options );
+ dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options, &errorCallback );
dac.startStream();
}
catch ( RtAudioError& e ) {