xref: /haiku/src/kits/media/legacy/OldAudioStream.h (revision 71452e98334eaac603bf542d159e24788a46bebb)
1 /******************************************************************************
2 
3 	File:	AudioStream.h
4 
5 	Copyright 1995-97, Be Incorporated
6 
7 ******************************************************************************/
8 #ifndef _AUDIO_STREAM_H
9 #define _AUDIO_STREAM_H
10 
11 
12 #include "OldBufferStream.h"
13 
14 
15 /* ================
16    Class definition for BADCStream and BDACStream
17    ================ */
18 
19 class BADCStream : public BAbstractBufferStream
20 {
21 public:
22 
23 					BADCStream();
24 	virtual			~BADCStream();
25 
26 	status_t		SetADCInput(int32 device);
27 	status_t		ADCInput(int32* device) const;
28 
29 	status_t		SetSamplingRate(float sRate);
30 	status_t		SamplingRate(float* sRate) const;
31 
32 	status_t		BoostMic(bool boost);
33 	bool			IsMicBoosted() const;
34 
35 	status_t		SetStreamBuffers(size_t bufferSize, int32 bufferCount);
36 
37 protected:
38 
39 	virtual BMessenger*	Server() const; 		/* message pipe to server */
40 	virtual stream_id	StreamID() const;		/* stream identifier */
41 
42 private:
43 
44 virtual	void		_ReservedADCStream1();
45 virtual	void		_ReservedADCStream2();
46 virtual	void		_ReservedADCStream3();
47 
48 	BMessenger*		fServer;
49 	stream_id		fStreamID;
50 	uint32			_reserved[4];
51 };
52 
53 
54 class BDACStream : public BAbstractBufferStream
55 {
56 public:
57 
58 					BDACStream();
59 	virtual			~BDACStream();
60 
61 	status_t		SetSamplingRate(float sRate);
62 	status_t		SamplingRate(float* sRate) const;
63 
64 	status_t		SetVolume(int32 device,
65 							  float l_volume,
66 							  float r_volume);
67 
68 	status_t		GetVolume(int32 device,
69 							  float *l_volume,
70 							  float *r_volume,
71 							  bool *enabled) const;
72 
73 	status_t		EnableDevice(int32 device, bool enable);
74 	bool			IsDeviceEnabled(int32 device) const;
75 
76 	status_t		SetStreamBuffers(size_t bufferSize, int32 bufferCount);
77 
78 protected:
79 
80 	virtual BMessenger*	Server() const; 		/* message pipe to server */
81 	virtual stream_id	StreamID() const;		/* stream identifier */
82 
83 private:
84 
85 virtual	void		_ReservedDACStream1();
86 virtual	void		_ReservedDACStream2();
87 virtual	void		_ReservedDACStream3();
88 
89 	BMessenger*		fServer;
90 	stream_id		fStreamID;
91 	uint32			_reserved[4];
92 };
93 
94 #endif			// #ifdef _AUDIO_STREAM_H
95