view src/aopp_system_info.cpp @ 10:d51a735106c2

All classes have basic functionality and support the full ao api. Test driver is now lists available sound drivers. TODO - AOSystem needs to be made into a singleton. - Need more fully fleshed out tests. - Need Doxygen - Need to consider more abstraction rather than the 1-1 mapping of api calls to methods.
author Eris Caffee <discordia@eldalin.com>
date Thu, 26 Mar 2015 16:17:33 -0500
parents src/main.cpp@65c716ba7cda
children
line source
1 #include <iostream>
3 #include "aopp.hpp"
5 using namespace AOPP;
7 int main( int argc, char **argv ) {
9 AOSystem aosys;
11 int driver_count;
12 AOInfo ** driver_list = aosys.driver_info_list( &driver_count );
14 std::cout << "Endianness: " << ( aosys.is_big_endian() ? "big" : "little" ) << std::endl;
16 int default_driver_id = aosys.default_driver_id();
17 if ( -1 == default_driver_id ) {
18 std::cout << "No default driver available." << std::endl;
19 }
21 for (int i=0; i < driver_count; ++i ) {
22 std::cout << driver_list[i]->short_name << std::endl;
24 int driver_id = AODriver::get_driver_id( driver_list[i]->short_name );
26 if ( default_driver_id == driver_id ) {
27 std::cout << "\tDEFAULT DRIVER" << std::endl;
28 }
30 std::cout << "\tID \t" << driver_id << std::endl;
31 std::cout << "\tName \t" << driver_list[i]->name << std::endl;
32 std::cout << "\tType \t" <<
33 ( driver_list[i]->type == AO_TYPE_LIVE ? "live" :
34 driver_list[i]->type == AO_TYPE_FILE ? "file" :
35 "unknown" )
36 << std::endl;
37 std::cout << "\tPriority \t" << driver_list[i]->priority << std::endl;
38 std::cout << "\tPreferred byte format\t" <<
39 ( driver_list[i]->preferred_byte_format == AO_FMT_LITTLE ? "little" :
40 driver_list[i]->preferred_byte_format == AO_FMT_BIG ? "big" :
41 "unknown" )
42 << std::endl;
43 std::cout << "\tcomment \t" << driver_list[i]->comment << std::endl;
44 std::cout << "\toptions" << std::endl;
45 for ( int j = 0; j < driver_list[i]->option_count; ++j ) {
46 std::cout << "\t\t" << driver_list[i]->options[j] << std::endl;
47 }
48 }
49 }