view src/aopp.hpp @ 9:cf38ffea8def

Added AODevice and AODriver. Renamed AOOptions.cpp file.
author Eris Caffee <discordia@eldalin.com>
date Wed, 25 Mar 2015 16:25:10 -0500
parents 65c716ba7cda
children d51a735106c2
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 }
61 #endif