Implementing ita_whad features for portaudii

parent 9c1745ca
...@@ -6,13 +6,13 @@ include( VistaCommon ) ...@@ -6,13 +6,13 @@ include( VistaCommon )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES ) vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
if( TA_DATA_SOURCES_WITH_INTEGRATED_ASIO ) if( ITA_DATA_SOURCES_WITH_INTEGRATED_ASIO )
add_definitions( "-DITA_WHAD_WITH_ASIO" ) add_definitions( "-DITA_WHAD_WITH_ASIO" )
endif( TA_DATA_SOURCES_WITH_INTEGRATED_ASIO ) endif( )
if( TA_DATA_SOURCES_WITH_INTEGRATED_PORTAUDIO ) if( ITA_DATA_SOURCES_WITH_INTEGRATED_PORTAUDIO )
add_definitions( "-DITA_WHAD_WITH_PORTAUDIO" ) add_definitions( "-DITA_WHAD_WITH_PORTAUDIO" )
endif( TA_DATA_SOURCES_WITH_INTEGRATED_PORTAUDIO ) endif( )
add_executable( ita_whad main.cpp ) add_executable( ita_whad main.cpp )
target_link_libraries( ita_whad ${VISTA_USE_PACKAGE_LIBRARIES} ) target_link_libraries( ita_whad ${VISTA_USE_PACKAGE_LIBRARIES} )
......
...@@ -31,26 +31,49 @@ int main( int, char** ) ...@@ -31,26 +31,49 @@ int main( int, char** )
#ifdef ITA_WHAD_WITH_ASIO #ifdef ITA_WHAD_WITH_ASIO
string sFileName = "ita_whad_asio.txt"; string sASIOFileName = "ita_whad_asio.txt";
FILE* file = fopen( sFileName.c_str(), "w" ); FILE* PASIOFile = fopen( sASIOFileName.c_str(), "w" );
ITAsioInitializeLibrary(); ITAsioInitializeLibrary();
long lDrivers = ITAsioGetNumDrivers(); long lASIODrivers = ITAsioGetNumDrivers();
if( lDrivers == 0 ) if( lASIODrivers == 0 )
cerr << "Warning: no ASIO drivers found." << endl; cerr << "Warning: no ASIO drivers found." << endl;
for( long i = 0; i < lDrivers; i++ ) cout << " ### ASIO ### " << endl;
for( long i = 0; i < lASIODrivers; i++ )
{ {
cout << "[" << i+1 << "] \"" << ITAsioGetDriverName(i) << "\"" << endl; cout << "[" << i + 1 << "] \"" << ITAsioGetDriverName( i ) << "\"" << endl;
} }
cout << endl;
ITAsioFinalizeLibrary(); ITAsioFinalizeLibrary();
fclose( file ); fclose( PASIOFile );
#endif // ITA_WHAD_WITH_ASIO #endif // ITA_WHAD_WITH_ASIO
#ifdef ITA_WHAD_WITH_PORTAUDIO
string sPAFileName = "ita_whad_portaudio.txt";
FILE* pPAFile = fopen( sPAFileName.c_str(), "w" );
ITAPortaudioInterface oITAPA( 44.1e3, 1024 );
oITAPA.Initialize();
int iPANumDevices = oITAPA.GetNumDevices();
cout << " ### Portaudio ### " << endl;
for( int i = 0; i < iPANumDevices; i++ )
{
cout << "[" << i + 1 << "] \"" << oITAPA.GetDeviceName( i ) << "\"" << endl;
}
cout << endl;
oITAPA.Finalize();
fclose( pPAFile );
#endif // ITA_WHAD_WITH:PORTAUDIO
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment