view src/aopp.hpp @ 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 cf38ffea8def
children
line source
1 #ifndef __AOPP_H__
2 #define __AOPP_H__
4 #include "ao/ao.h"
5 #include <cstdint>
7 namespace AOPP {
9 typedef ao_sample_format AOSampleFormat;
10 typedef ao_info AOInfo;
12 ////////////////////////////////////////////////////////////////////////////
13 class AOOptions {
14 friend class AODriver;
16 public:
17 AOOptions();
18 ~AOOptions();
19 int append( const char *key, const char *value );
20 void print_options(void);
22 private:
23 ao_option *options;
25 };
28 ////////////////////////////////////////////////////////////////////////////
29 class AODevice {
30 public:
31 AODevice( ao_device * dev );
32 int play( char *output_samples, uint32_t num_bytes );
33 int close( void );
35 private:
36 AODevice();
37 ao_device *device;
38 };
40 ////////////////////////////////////////////////////////////////////////////
41 class AODriver {
42 public:
43 AODriver( int id );
44 AODevice * open_live( AOSampleFormat *format, AOOptions *options );
45 AODevice * open_file( const char *filename, int overwrite, AOSampleFormat *format, AOOptions *options );
46 AOInfo * driver_info( void );
47 #if 0
48 // ao_file_extension not in my libao ?
49 const char * file_extension( void );
50 #endif
52 static int get_driver_id( const char *short_name );
54 private:
55 AODriver();
56 int driver_id;
57 };
59 ////////////////////////////////////////////////////////////////////////////
60 class AOSystem {
61 public:
62 AOSystem();
63 ~AOSystem();
64 AOInfo ** driver_info_list( int *driver_count );
65 int default_driver_id( void );
66 int is_big_endian( void );
67 int append_global_option( const char *key, const char *value );
69 private:
70 };
73 }
75 #endif