diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2013-10-09 23:44:33 +0200 |
|---|---|---|
| committer | Stephen Sinclair <sinclair@music.mcgill.ca> | 2013-10-10 01:08:39 +0200 |
| commit | a3d2ee35944db4dd0a3a342bb7f2df69f229f45d (patch) | |
| tree | 1a1199a30b0db8a0306dceef0c15c9f9e3e72629 /tests/info.cpp | |
| parent | 8eb71e693530726068addf6b8088aea0fd340f2a (diff) | |
Version 2.1
Diffstat (limited to 'tests/info.cpp')
| -rw-r--r-- | tests/info.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/tests/info.cpp b/tests/info.cpp index 9cd9738..fdde049 100644 --- a/tests/info.cpp +++ b/tests/info.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) int devices = audio->getDeviceCount(); cout << "\nFound " << devices << " devices ...\n"; - for (int i=0; i<devices; i++) { + for (int i=1; i<=devices; i++) { try { audio->getDeviceInfo(i, &my_info); } @@ -35,29 +35,32 @@ int main(int argc, char *argv[]) } cout << "\nname = " << my_info.name << '\n'; - if (my_info.probed == true) + if (my_info.probed == true) { cout << "probe successful\n"; + cout << "maxOutputChans = " << my_info.maxOutputChannels << '\n'; + cout << "minOutputChans = " << my_info.minOutputChannels << '\n'; + cout << "maxInputChans = " << my_info.maxInputChannels << '\n'; + cout << "minInputChans = " << my_info.minInputChannels << '\n'; + cout << "maxDuplexChans = " << my_info.maxDuplexChannels << '\n'; + cout << "minDuplexChans = " << my_info.minDuplexChannels << '\n'; + if (my_info.hasDuplexSupport) cout << "duplex support = true\n"; + else cout << "duplex support = false\n"; + if (my_info.isDefault) cout << "is default device = true\n"; + else cout << "is default device = false\n"; + cout << "format = " << my_info.nativeFormats << '\n'; + if (my_info.nSampleRates == -1) { + cout << "min_srate = " << my_info.sampleRates[0]; + cout << ", max_srate = " << my_info.sampleRates[1] << '\n'; + } + else { + cout << "sample rates = "; + for (int j=0; j<my_info.nSampleRates; j++) + cout << my_info.sampleRates[j] << " "; + cout << endl; + } + } else cout << "probe unsuccessful\n"; - cout << "maxOutputChans = " << my_info.maxOutputChannels << '\n'; - cout << "minOutputChans = " << my_info.minOutputChannels << '\n'; - cout << "maxInputChans = " << my_info.maxInputChannels << '\n'; - cout << "minInputChans = " << my_info.minInputChannels << '\n'; - cout << "maxDuplexChans = " << my_info.maxDuplexChannels << '\n'; - cout << "minDuplexChans = " << my_info.minDuplexChannels << '\n'; - if (my_info.hasDuplexSupport) - cout << "duplex support = true\n"; - else - cout << "duplex support = false\n"; - cout << "format = " << my_info.nativeFormats << '\n'; - if (my_info.nSampleRates == -1) - cout << "min_srate = " << my_info.sampleRates[0] << ", max_srate = " << my_info.sampleRates[1] << '\n'; - else { - cout << "sample rates = "; - for (int j=0; j<my_info.nSampleRates; j++) - cout << my_info.sampleRates[j] << " "; - cout << endl; - } } cout << endl; |
