示例#1
0
bool wxPlayer::OnInit() {
  bool result = (TryDevice("autodetect") || TryDevice("null"));
  if (!result) {
    wxMessageBox(wxT("Could not open output device"), wxT("wxPlayer"));
  }
  return result;
}
示例#2
0
bool CAESinkALSA::TryDeviceWithParams(const std::string &name, const std::string &params, 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);
}
示例#3
0
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);
    }
  }
}