2 Steinberg Audio Stream I/O API
3 (c) 1996, Steinberg Soft- und Hardware GmbH
7 asio functions entries which translate the
8 asio interface to the asiodrvr class methods
12 #include "asiosys.h" // platform definition
20 AsioDriver
*theAsioDriver
= 0;
34 #include "asiodrivers.h"
36 IASIO
*theAsioDriver
= 0;
37 extern AsioDrivers
*asioDrivers
;
39 #elif SGI || SUN || BEOS || LINUX
41 static AsioDriver
*theAsioDriver
= 0;
44 //-----------------------------------------------------------------------------------------------------
45 ASIOError
ASIOInit(ASIODriverInfo
*info
)
47 #if MAC || SGI || SUN || BEOS || LINUX
53 info
->driverVersion
= 0;
54 strcpy(info
->name
, "No ASIO Driver");
55 theAsioDriver
= getDriver();
58 strcpy(info
->errorMessage
, "Not enough memory for the ASIO driver!");
59 return ASE_NotPresent
;
61 if(!theAsioDriver
->init(info
->sysRef
))
63 theAsioDriver
->getErrorMessage(info
->errorMessage
);
66 return ASE_NotPresent
;
68 strcpy(info
->errorMessage
, "No ASIO Driver Error");
69 theAsioDriver
->getDriverName(info
->name
);
70 info
->driverVersion
= theAsioDriver
->getDriverVersion();
75 info
->driverVersion
= 0;
76 strcpy(info
->name
, "No ASIO Driver");
77 if(theAsioDriver
) // must be loaded!
79 if(!theAsioDriver
->init(info
->sysRef
))
81 theAsioDriver
->getErrorMessage(info
->errorMessage
);
83 return ASE_NotPresent
;
86 strcpy(info
->errorMessage
, "No ASIO Driver Error");
87 theAsioDriver
->getDriverName(info
->name
);
88 info
->driverVersion
= theAsioDriver
->getDriverVersion();
91 return ASE_NotPresent
;
96 ASIOError
ASIOExit(void)
101 asioDrivers
->removeCurrentDriver();
103 delete theAsioDriver
;
110 ASIOError
ASIOStart(void)
113 return ASE_NotPresent
;
114 return theAsioDriver
->start();
117 ASIOError
ASIOStop(void)
120 return ASE_NotPresent
;
121 return theAsioDriver
->stop();
124 ASIOError
ASIOGetChannels(long *numInputChannels
, long *numOutputChannels
)
128 *numInputChannels
= *numOutputChannels
= 0;
129 return ASE_NotPresent
;
131 return theAsioDriver
->getChannels(numInputChannels
, numOutputChannels
);
134 ASIOError
ASIOGetLatencies(long *inputLatency
, long *outputLatency
)
138 *inputLatency
= *outputLatency
= 0;
139 return ASE_NotPresent
;
141 return theAsioDriver
->getLatencies(inputLatency
, outputLatency
);
144 ASIOError
ASIOGetBufferSize(long *minSize
, long *maxSize
, long *preferredSize
, long *granularity
)
148 *minSize
= *maxSize
= *preferredSize
= *granularity
= 0;
149 return ASE_NotPresent
;
151 return theAsioDriver
->getBufferSize(minSize
, maxSize
, preferredSize
, granularity
);
154 ASIOError
ASIOCanSampleRate(ASIOSampleRate sampleRate
)
157 return ASE_NotPresent
;
158 return theAsioDriver
->canSampleRate(sampleRate
);
161 ASIOError
ASIOGetSampleRate(ASIOSampleRate
*currentRate
)
164 return ASE_NotPresent
;
165 return theAsioDriver
->getSampleRate(currentRate
);
168 ASIOError
ASIOSetSampleRate(ASIOSampleRate sampleRate
)
171 return ASE_NotPresent
;
172 return theAsioDriver
->setSampleRate(sampleRate
);
175 ASIOError
ASIOGetClockSources(ASIOClockSource
*clocks
, long *numSources
)
180 return ASE_NotPresent
;
182 return theAsioDriver
->getClockSources(clocks
, numSources
);
185 ASIOError
ASIOSetClockSource(long reference
)
188 return ASE_NotPresent
;
189 return theAsioDriver
->setClockSource(reference
);
192 ASIOError
ASIOGetSamplePosition(ASIOSamples
*sPos
, ASIOTimeStamp
*tStamp
)
195 return ASE_NotPresent
;
196 return theAsioDriver
->getSamplePosition(sPos
, tStamp
);
199 ASIOError
ASIOGetChannelInfo(ASIOChannelInfo
*info
)
203 info
->channelGroup
= -1;
204 info
->type
= ASIOSTInt16MSB
;
205 strcpy(info
->name
, "None");
206 return ASE_NotPresent
;
208 return theAsioDriver
->getChannelInfo(info
);
211 ASIOError
ASIOCreateBuffers(ASIOBufferInfo
*bufferInfos
, long numChannels
,
212 long bufferSize
, ASIOCallbacks
*callbacks
)
216 ASIOBufferInfo
*info
= bufferInfos
;
217 for(long i
= 0; i
< numChannels
; i
++, info
++)
218 info
->buffers
[0] = info
->buffers
[1] = 0;
219 return ASE_NotPresent
;
221 return theAsioDriver
->createBuffers(bufferInfos
, numChannels
, bufferSize
, callbacks
);
224 ASIOError
ASIODisposeBuffers(void)
227 return ASE_NotPresent
;
228 return theAsioDriver
->disposeBuffers();
231 ASIOError
ASIOControlPanel(void)
234 return ASE_NotPresent
;
235 return theAsioDriver
->controlPanel();
238 ASIOError
ASIOFuture(long selector
, void *opt
)
241 return ASE_NotPresent
;
242 return theAsioDriver
->future(selector
, opt
);
245 ASIOError
ASIOOutputReady(void)
248 return ASE_NotPresent
;
249 return theAsioDriver
->outputReady();