bool wxPlayer::OnInit() { bool result = (TryDevice("autodetect") || TryDevice("null")); if (!result) { wxMessageBox(wxT("Could not open output device"), wxT("wxPlayer")); } return result; }
bool CAESinkALSA::TryDeviceWithParams(const std::string &name, const std::string ¶ms, snd_pcm_t **pcmp, snd_config_t *lconf) { if (!params.empty()) { std::string nameWithParams = name; AppendParams(nameWithParams, params); if (TryDevice(nameWithParams, pcmp, lconf)) return true; } /* Try the variant without extra parameters. * Custom devices often do not take the AESx parameters, for example. */ return TryDevice(name, pcmp, lconf); }
void wxPlayer::OnNewDevice(wxWindow* parent) { NewDeviceDialog dialog(parent); if (dialog.ShowModal() == wxID_OK) { bool result = TryDevice( dialog.getDevice().c_str(), dialog.getParameters().c_str()); if (!result) { wxMessageBox(wxT("Error opening new device"), wxT("New Device"), wxOK | wxICON_ERROR, parent); } } }