ASIO backend, part 8
add control panel button last commit unless it doesn't work somewhere
This commit is contained in:
parent
8ed69b7a5d
commit
99c6cbffa6
7 changed files with 38 additions and 0 deletions
|
|
@ -45,6 +45,10 @@ void TAAudio::acceptDeviceStatus() {
|
|||
deviceStatus=TA_AUDIO_DEVICE_OK;
|
||||
}
|
||||
|
||||
int TAAudio::specialCommand(TAAudioCommand which) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool TAAudio::quit() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -319,6 +319,16 @@ void* TAAudioASIO::getContext() {
|
|||
return (void*)&driverInfo;
|
||||
}
|
||||
|
||||
int TAAudioASIO::specialCommand(TAAudioCommand which) {
|
||||
switch (which) {
|
||||
case TA_AUDIO_CMD_SETUP:
|
||||
if (ASIOControlPanel()==ASE_NotPresent) return 0;
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool TAAudioASIO::quit() {
|
||||
if (!initialized) return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class TAAudioASIO: public TAAudio {
|
|||
String getFormatName(ASIOSampleType which);
|
||||
|
||||
void* getContext();
|
||||
int specialCommand(TAAudioCommand which);
|
||||
bool quit();
|
||||
bool setRun(bool run);
|
||||
bool init(TAAudioDesc& request, TAAudioDesc& response);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ enum TAAudioDeviceStatus {
|
|||
TA_AUDIO_DEVICE_REMOVED
|
||||
};
|
||||
|
||||
enum TAAudioCommand {
|
||||
// open control panel for audio device
|
||||
TA_AUDIO_CMD_SETUP=0
|
||||
};
|
||||
|
||||
enum TAAudioFormat {
|
||||
TA_AUDIO_FORMAT_F32=0,
|
||||
TA_AUDIO_FORMAT_F64,
|
||||
|
|
@ -184,6 +189,7 @@ class TAAudio {
|
|||
void setCallback(void (*callback)(void*,float**,float**,int,int,unsigned int), void* user);
|
||||
|
||||
virtual void* getContext();
|
||||
virtual int specialCommand(TAAudioCommand which);
|
||||
virtual bool quit();
|
||||
virtual bool setRun(bool run);
|
||||
virtual std::vector<String> listAudioDevices();
|
||||
|
|
|
|||
|
|
@ -3808,6 +3808,11 @@ void DivEngine::acceptAudioDeviceStatus() {
|
|||
output->acceptDeviceStatus();
|
||||
}
|
||||
|
||||
int DivEngine::audioBackendCommand(TAAudioCommand which) {
|
||||
if (output==NULL) return -1;
|
||||
return output->specialCommand(which);
|
||||
}
|
||||
|
||||
std::vector<String>& DivEngine::getAudioDevices() {
|
||||
return audioDevs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1409,6 +1409,9 @@ class DivEngine {
|
|||
// acknowledge an audio device status change
|
||||
void acceptAudioDeviceStatus();
|
||||
|
||||
// send command to audio backend
|
||||
int audioBackendCommand(TAAudioCommand which);
|
||||
|
||||
// init dispatch
|
||||
void initDispatch(bool isRender=false);
|
||||
|
||||
|
|
|
|||
|
|
@ -1347,6 +1347,15 @@ void FurnaceGUI::drawSettings() {
|
|||
}
|
||||
}
|
||||
|
||||
if (settings.audioEngine==DIV_AUDIO_ASIO) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(_("Control panel"))) {
|
||||
if (e->audioBackendCommand(TA_AUDIO_CMD_SETUP)!=2) {
|
||||
showError(_("this driver doesn't have a control panel."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::AlignTextToFramePadding();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue