void EngineShoutcast::process(const CSAMPLE* pBuffer, const int iBufferSize) { //Check to see if Shoutcast is enabled, and pass the samples off to be broadcast if necessary. bool prefEnabled = (m_pConfig->getValueString(ConfigKey(SHOUTCAST_PREF_KEY,"enabled")).toInt() == 1); if (!prefEnabled) { if (isConnected()) { // We are conneced but shoutcast is disabled. Disconnect. serverDisconnect(); infoDialog(tr("Mixxx has successfully disconnected from the shoutcast server"), ""); } return; } // If we are here then the user wants to be connected (shoutcast is enabled // in the preferences). bool connected = isConnected(); // If we aren't connected or the user has changed their preferences, // disconnect, update from prefs, and reconnect. if (!connected || m_pUpdateShoutcastFromPrefs->get() > 0.0f) { if (connected) { serverDisconnect(); } // Initialize/update the encoder and libshout setup. updateFromPreferences(); if (serverConnect()) { infoDialog(tr("Mixxx has successfully connected to the shoutcast server"), ""); } else { errorDialog(tr("Mixxx could not connect to streaming server"), tr("Please check your connection to the Internet and verify that your username and password are correct.")); } } // If we aren't connected, bail. if (m_iShoutStatus != SHOUTERR_CONNECTED) return; // If we are connected, encode the samples. if (iBufferSize > 0 && m_encoder){ m_encoder->encodeBuffer(pBuffer, iBufferSize); } // Check if track metadata has changed and if so, update. if (metaDataHasChanged()) { updateMetaData(); } }
bool QmitkNodeSelectionListItemWidget::eventFilter(QObject *obj, QEvent *ev) { if (obj == m_Controls.btnSelect) { if (ev->type() == QEvent::MouseButtonRelease) { auto mouseEv = dynamic_cast<QMouseEvent*>(ev); if (!mouseEv) { return false; } if (mouseEv->button() == Qt::RightButton) { auto selection = this->GetSelectedNode(); if (selection != nullptr) { QList<mitk::DataNode::ConstPointer> selectionList({ this->GetSelectedNode() }); QmitkNodeDetailsDialog infoDialog(selectionList, this); infoDialog.exec(); return true; } } } } return false; }
void vtkFrame::OpenCSVFile(wxCommandEvent& event) { wxFileDialog dialog(this, _T("Choose a CSV file to open"), _T(""),_T(""),_T("*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (dialog.ShowModal() == wxID_OK) { fileInfoDialog infoDialog(this); if ( infoDialog.ShowModal() == wxID_OK ) { showProgressDialog("Processing CSV File"); *ds = new Dataset( (const char*)dialog.GetPath().mb_str(wxConvUTF8), infoDialog.dims, infoDialog.steps, this ); clearProgressDialog(); UpdateSliderLimits(); vtkRenderWindow->SetDataset(*ds); UpdateMenuItems(); } } }
void BearerEx::on_showDetailsButton_clicked() { QListWidgetItem* item = listWidget->currentItem(); if (!item) { return; } QNetworkConfiguration networkConfiguration = qVariantValue<QNetworkConfiguration>(item->data(Qt::UserRole)); DetailedInfoDialog infoDialog(&networkConfiguration,this); infoDialog.exec(); }
bool MainWndController::actionInfo() { Regola *regola = _w->getRegola(); if(NULL != regola) { InfoDialog infoDialog(_w, regola, _w->isReadOnly()); if(infoDialog.exec() == QDialog::Accepted) { if(!_w->isReadOnly()) { return regola->setNewDTD(infoDialog.dtd()); } } } return false; }