1 /*
2 	Steinberg Audio Stream I/O API
3 	(c) 1996, Steinberg Soft- und Hardware GmbH
4 	charlie (May 1996)
5 
6 	asiodrvr.h
7 	c++ superclass to implement asio functionality. from this,
8 	you can derive whatever required
9 */
10 
11 #ifndef _asiodrvr_
12 #define _asiodrvr_
13 
14 // cpu and os system we are running on
15 #include "asiosys.h"
16 // basic "C" interface
17 #include "asio.h"
18 
19 class AsioDriver;
20 extern AsioDriver *getDriver();		// for generic constructor
21 
22 #if WINDOWS
23 #include <windows.h>
24 #include "combase.h"
25 #include "iasiodrv.h"
26 class AsioDriver : public IASIO ,public CUnknown
27 {
28 public:
29 	AsioDriver(LPUNKNOWN pUnk, HRESULT *phr);
30 
31 	DECLARE_IUNKNOWN
32 	// Factory method
33 	static CUnknown *CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
34 	// IUnknown
35 	virtual HRESULT STDMETHODCALLTYPE NonDelegatingQueryInterface(REFIID riid,void **ppvObject);
36 
37 #else
38 
39 class AsioDriver
40 {
41 public:
42 	AsioDriver();
43 #endif
44 	virtual ~AsioDriver();
45 
46 	virtual ASIOBool init(void* sysRef);
47 	virtual void getDriverName(char *name);	// max 32 bytes incl. terminating zero
48 	virtual long getDriverVersion();
49 	virtual void getErrorMessage(char *string);	// max 124 bytes incl.
50 
51 	virtual ASIOError start();
52 	virtual ASIOError stop();
53 
54 	virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels);
55 	virtual ASIOError getLatencies(long *inputLatency, long *outputLatency);
56 	virtual ASIOError getBufferSize(long *minSize, long *maxSize,
57 		long *preferredSize, long *granularity);
58 
59 	virtual ASIOError canSampleRate(ASIOSampleRate sampleRate);
60 	virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate);
61 	virtual ASIOError setSampleRate(ASIOSampleRate sampleRate);
62 	virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources);
63 	virtual ASIOError setClockSource(long reference);
64 
65 	virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp);
66 	virtual ASIOError getChannelInfo(ASIOChannelInfo *info);
67 
68 	virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
69 		long bufferSize, ASIOCallbacks *callbacks);
70 	virtual ASIOError disposeBuffers();
71 
72 	virtual ASIOError controlPanel();
73 	virtual ASIOError future(long selector, void *opt);
74 	virtual ASIOError outputReady();
75 };
76 #endif
77