QUMediaPlayer::QUMediaPlayer(QWidget *parent): QWidget(parent) { setupUi(this); connect(stopBtn, SIGNAL(clicked()), this, SLOT(stop())); connect(prevBtn, SIGNAL(clicked()), this, SLOT(prev())); connect(nextBtn, SIGNAL(clicked()), this, SLOT(next())); connect(this, SIGNAL(stateChanged(QUMediaPlayer::States)), this, SLOT(updatePlayerControls(QUMediaPlayer::States))); connect(this, SIGNAL(stateChanged(QUMediaPlayer::States)), this, SLOT(updateInfoLabel(QUMediaPlayer::States))); connect(this, SIGNAL(stateChanged(QUMediaPlayer::States)), this, SLOT(updateTimeSlider(QUMediaPlayer::States))); connect(shuffleBtn, SIGNAL(toggled(bool)), this, SLOT(loopShuffleToggled())); connect(loopBtn, SIGNAL(toggled(bool)), this, SLOT(loopShuffleToggled())); connect(timeSlider, SIGNAL(sliderReleased()), this, SLOT(seek())); connect(autocue, SIGNAL(editSongRequested(int)), this, SLOT(requestSongEdit(int))); connect(autocue2, SIGNAL(editSongRequested(int)), this, SLOT(requestSongEdit(int))); timeSlider->setMinimum(0); timeSlider->setSingleStep(1); if(!BASS_Init(-1, 44100, 0, 0, NULL)) logSrv->add("BASS was NOT loaded.", QU::Warning); _mediaStream = 0; _currentSongIndex = -1; setState(QUMediaPlayer::stopped); }
void DownloadItem::finished() { progressBar->hide(); stopButton->setEnabled(false); stopButton->hide(); m_output.close(); updateInfoLabel(); emit statusChanged(); }
void DownloadItem::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { m_bytesReceived = bytesReceived; if (bytesTotal == -1) { progressBar->setValue(0); progressBar->setMaximum(0); } else { progressBar->setValue(bytesReceived); progressBar->setMaximum(bytesTotal); } updateInfoLabel(); }
void quitGame(GtkWidget *widget, gpointer data) { // simplify notation InfoInterface *gui = (InfoInterface *) data; if(waitingPlayer() || !playerPlaying) { if(!playerPlaying) { g_print ("Player tried to give up, impossible in first round\n", playerPlaying); updateInfoLabel("Impossible to give up in first part!", "red"); } else { g_print ("Player %d tried to give up, only possible in time between words\n", playerPlaying); updateInfoLabel("Only allowed to give up between words!", "red"); } return; } // show that player gave up updateInfoLabel("Player gave up!", "red"); playerGaveUp = 1; g_print ("Player %d gave up\n", playerPlaying); }
void DownloadItem::finished() { m_finishedDownloading = true; if (!m_startedSaving) { return; } progressBar->hide(); stopButton->setEnabled(false); stopButton->hide(); m_output.close(); updateInfoLabel(); emit statusChanged(); }
void DownloadItem::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { m_bytesReceived = bytesReceived; qint64 currentValue = 0; qint64 totalValue = 0; if (bytesTotal > 0) { currentValue = bytesReceived * 100 / bytesTotal; totalValue = 100; } progressBar->setValue(currentValue); progressBar->setMaximum(totalValue); emit progress(currentValue, totalValue); updateInfoLabel(); }
void WBDownloadItem::finished() { progressBar->hide(); stopButton->setEnabled(false); stopButton->hide(); m_output.close(); updateInfoLabel(); if(m_output.fileName().toLower().endsWith(".wgt") || m_output.fileName().toLower().endsWith(".wdgt")){ QString destPath = QFileInfo(m_output.fileName()).absolutePath() + "/Dir" + QFileInfo(m_output.fileName()).fileName(); if (!QFileInfo(m_output.fileName()).isDir()){ UBFileSystemUtils::expandZipToDir(m_output.fileName(), destPath); m_output.remove(); } } emit statusChanged(); }
void DownloadItem::finished() { if (m_reply->bytesAvailable() > 0) downloadReadyRead(); m_finished = true; progressBar->hide(); stopButton->setEnabled(false); stopButton->hide(); m_output.close(); deleteButton->show(); updateInfoLabel(); emit statusChanged(); // Process completed Torrents here checkAddTorrent(); }
void DownloadWidget::finished() { if (m_download) { QWebEngineDownloadItem::DownloadState state = m_download->state(); QString message; bool interrupted = false; switch (state) { case QWebEngineDownloadItem::DownloadRequested: // Fall-through. case QWebEngineDownloadItem::DownloadInProgress: Q_UNREACHABLE(); break; case QWebEngineDownloadItem::DownloadCompleted: break; case QWebEngineDownloadItem::DownloadCancelled: message = QStringLiteral("Download cancelled"); interrupted = true; break; case QWebEngineDownloadItem::DownloadInterrupted: message = QStringLiteral("Download interrupted"); interrupted = true; break; } if (interrupted) { downloadInfoLabel->setText(message); return; } } progressBar->hide(); stopButton->setEnabled(false); stopButton->hide(); updateInfoLabel(); emit statusChanged(); }