void PlaybackWidget::setPaused(bool val) { if (val == isPaused()) return; slotPlay(); }
PlayList::PlayList(QWidget *parent) : QWidget(parent), m_listView(new PlayListView(this)), m_buttonBar(new QFrame(this)), m_barLayout(new QHBoxLayout(m_buttonBar)), m_playButton(0), m_moveUpButton(0), m_moveDownButton(0), m_deleteButton(0), m_clearButton(0) { QVBoxLayout *vLayout = new QVBoxLayout; vLayout->addWidget(m_listView); vLayout->addWidget(m_buttonBar); setLayout(vLayout); m_openButton = new QPushButton(m_buttonBar); m_playButton = new QPushButton(m_buttonBar); m_moveUpButton = new QPushButton(m_buttonBar); m_moveDownButton = new QPushButton(m_buttonBar); m_deleteButton = new QPushButton(m_buttonBar); m_clearButton = new QPushButton(m_buttonBar); m_barLayout->addWidget(m_openButton); m_barLayout->addWidget(m_playButton); m_barLayout->addWidget(m_moveUpButton); m_barLayout->addWidget(m_moveDownButton); m_barLayout->addWidget(m_deleteButton); m_barLayout->addWidget(m_clearButton); m_barLayout->addStretch(); m_openButton ->setText(tr("Add...")); m_playButton ->setText(tr("Play")); m_moveUpButton ->setText(tr("Move Up")); m_moveDownButton->setText(tr("Move Down")); m_deleteButton ->setText(tr("Remove")); m_clearButton ->setText(tr("Clear whole List")); connect(m_openButton, SIGNAL(clicked()), SLOT(slotOpenFiles())); connect(m_playButton, SIGNAL(clicked()),SLOT(slotPlay())); connect(m_deleteButton, SIGNAL(clicked()), SLOT(slotDeleteCurrent())); connect(m_clearButton, SIGNAL(clicked()), SLOT(slotClear())); connect(m_moveUpButton, SIGNAL(clicked()), SLOT(slotMoveUp())); connect(m_moveDownButton, SIGNAL(clicked()), SLOT(slotMoveDown())); connect(m_listView, SIGNAL(droppedURIs(QDropEvent*, QTreeWidget*, QStringList)), SLOT(slotDroppedURIs(QDropEvent*, QTreeWidget*, QStringList))); connect(m_listView, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(slotCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); // connect(m_listView, SIGNAL(currentChanged(QTreeWidgetItem*)), // SLOT(slotCurrentItemChanged(QTreeWidgetItem*))); // connect(m_listView, SIGNAL(dropped(QDropEvent*, QTreeWidgetItem*)), // SLOT(slotDropped(QDropEvent*, QTreeWidgetItem*))); restore(); enableButtons(0); }
MpdWidget::MpdWidget(QWidget *parent) : QWidget(parent) , aktPlay(false), aktStop(false) { timerMpd = new QTimer(); timerMpd->setInterval(100); connect(timerMpd, SIGNAL(timeout()), this, SLOT(psMpdHB())); timerMpd->start(); labelSender = new ScrollText(); labelVol = new ScrollText(); labelTitle = new ScrollText(); buttonPlay = new QPushButton("Play"); connect(buttonPlay, SIGNAL(clicked()), this, SLOT(slotPlay())); buttonStop = new QPushButton("Stop"); connect(buttonStop, SIGNAL(clicked()), this, SLOT(slotStop())); QBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addWidget(buttonPlay); buttonLayout->addWidget(buttonStop); QBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addWidget(labelTitle); mainLayout->addWidget(labelSender); mainLayout->addWidget(labelVol); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); }
//--------------------------------------------------------------------------- // //! \brief release connection to buttons and remove stored button pointer // //! \author Jo2003 //! \date 26.11.2012 // //! \param -- // //! \return -- //--------------------------------------------------------------------------- void QFusionControl::disconnectBtn() { disconnect(this, SLOT(slotPlay())); _playBtnVector.clear(); disconnect(this, SLOT(slotRec())); _recBtnVector.clear(); disconnect(this, SLOT(slotStop())); _stopBtnVector.clear(); disconnect(this, SLOT(slotFwd())); _fwdBtnVector.clear(); disconnect(this, SLOT(slotBwd())); _bwdBtnVector.clear(); disconnect(this, SLOT(slotFs())); _fsBtnVector.clear(); disconnect(this, SLOT(slotScrShot())); _scrShtBtnVector.clear(); disconnect(this, SLOT(slotEnterWndwd())); _wndModBtnVector.clear(); disconnect(this, SLOT(slotSaveVideoFormat())); _frmtBtnVector.clear(); }
GuiCoordinator::GuiCoordinator(void){ qDebug() << "GuiCoordinator constructor"; _mainWindow=new MainWindow(); // MainWindow -> GuiCoordinator : load the Table /*connect( _mainWindow, SIGNAL(robotFileXml(const QString&,const QString&)), this, SLOT(forwardRobotNameXml(const QString&,const QString&)) ); */ connect(_mainWindow, SIGNAL(uiPlay()), this, SLOT(slotPlay())); connect(_mainWindow, SIGNAL(uiPause()), this, SLOT(slotPause())); connect(_mainWindow, SIGNAL(uiStop()), this, SLOT(slotStop())); connect(_mainWindow, SIGNAL(close()), this, SLOT(slotClose())); }
void PresentationAudioWidget::setPaused(bool val) { if (val == isPaused()) return; slotPlay(); }
void PresentationAudioWidget::slotPlayerStateChanged(QMediaPlayer::State state) { switch (state) { case QMediaPlayer::StoppedState: m_playButton->setEnabled(true); setGUIPlay(true); if (d->mediaObject->mediaStatus() == QMediaPlayer::LoadingMedia) { if (d->stopCalled) { d->stopCalled = false; } else { slotPlay(); checkSkip(); } } break; case QMediaPlayer::PlayingState: setGUIPlay(false); checkSkip(); break; default: break; } }
void GLWidget::slotTogglePlayPause() { if (_playMode == PlayMode_Pause) slotPlay(); else slotPause(); }
LircCommander::LircCommander(LircClient *lirc, RosegardenMainWindow *rgGUIApp) : QObject() { m_lirc = lirc; m_rgGUIApp = rgGUIApp; connect(m_lirc, SIGNAL(buttonPressed(const char *)), this, SLOT(slotExecute(const char *)) ); connect(this, SIGNAL(play()), m_rgGUIApp, SLOT(slotPlay()) ); connect(this, SIGNAL(stop()), m_rgGUIApp, SLOT(slotStop()) ); connect(this, SIGNAL(record()), m_rgGUIApp, SLOT(slotRecord()) ); connect(this, SIGNAL(rewind()), m_rgGUIApp, SLOT(slotRewind()) ); connect(this, SIGNAL(rewindToBeginning()), m_rgGUIApp, SLOT(slotRewindToBeginning()) ); connect(this, SIGNAL(fastForward()), m_rgGUIApp, SLOT(slotFastforward()) ); connect(this, SIGNAL(fastForwardToEnd()), m_rgGUIApp, SLOT(slotFastForwardToEnd()) ); connect(this, SIGNAL(toggleRecord()), m_rgGUIApp, SLOT(slotToggleRecord()) ); connect(this, SIGNAL(trackDown()), m_rgGUIApp, SLOT(slotTrackDown()) ); connect(this, SIGNAL(trackUp()), m_rgGUIApp, SLOT(slotTrackUp()) ); connect(this, SIGNAL(trackMute()), m_rgGUIApp, SLOT(slotToggleMute()) ); connect(this, SIGNAL(trackRecord()), m_rgGUIApp, SLOT(slotToggleRecordCurrentTrack()) ); connect(this, SIGNAL(undo()), CommandHistory::getInstance(), SLOT(undo()) ); connect(this, SIGNAL(redo()), CommandHistory::getInstance(), SLOT(redo()) ); connect(this, SIGNAL(aboutrg()), m_rgGUIApp, SLOT(slotHelpAbout()) ); connect(this, SIGNAL(editInMatrix()), m_rgGUIApp, SLOT(slotEditInMatrix()) ); connect(this, SIGNAL(editInPercussionMatrix()), m_rgGUIApp, SLOT(slotEditInPercussionMatrix()) ); connect(this, SIGNAL(editInEventList()), m_rgGUIApp, SLOT(slotEditInEventList()) ); connect(this, SIGNAL(editAsNotation()), m_rgGUIApp, SLOT(slotEditAsNotation()) ); connect(this, SIGNAL(quit()), m_rgGUIApp, SLOT(slotQuit()) ); connect(this, SIGNAL(closeTransport()), m_rgGUIApp, SLOT(slotCloseTransport()) ); connect(this, SIGNAL(toggleTransportVisibility()), m_rgGUIApp, SLOT(slotToggleTransportVisibility()) ); }
void FVAnimation::setupMenu( ) { contextMenuObj->clear(); acPlay = contextMenuObj->addAction(tr("&Play"), this, SLOT( slotPlay() ) ); acPause = contextMenuObj->addAction(tr("&Pause"), this, SLOT( slotPause() ) ); acStop = contextMenuObj->addAction(tr("&Stop"), this, SLOT( slotStop() ) ); acPause->setEnabled( false ); acStop->setEnabled( false ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Update"), this, SLOT( slotUpdate() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) ); }
void k2send::setupActions() { KAction *action; KShortcut cut; setXMLFile( "k2sendui.rc" ); KStdAction::openNew(this, SLOT(fileNew()), actionCollection(),"file_new"); KStdAction::open(this, SLOT(fileOpen()), actionCollection(),"file_open"); action = new KAction(i18n("Import Playlist"), cut, this, SLOT(importPlaylist()), actionCollection(), "file_import"); KStdAction::print(this, SLOT(filePrint()), actionCollection(),"file_print"); KStdAction::quit(kapp, SLOT(quit()), actionCollection(),"file_quit"); m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection(),"preferences"); action = new KAction(i18n("Remove"), "editdelete", cut, m_view, SLOT(slotRemoveBranch()), actionCollection(), "file_remove"); action = new KAction(i18n("Play"), "player_play", cut, m_view, SLOT(slotPlay()), actionCollection(), "player_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotStop()), actionCollection(), "player_stop"); action = new KAction(i18n("Next"), "player_fwd", cut,m_view, SLOT(slotSkip()), actionCollection(), "player_next"); action = new KAction(i18n("Loudness"), 0, cut,m_view, SLOT(slotLoudness()), actionCollection(), "player_loudness"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotPlaylistClear()), actionCollection(), "playlist_clear"); action = new KAction(i18n("Play"), "player_play", cut,m_view, SLOT(slotConsolePlay()), actionCollection(), "console_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotConsoleStop()), actionCollection(), "console_stop"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotConsoleClear()), actionCollection(), "console_clear"); createGUI(); }
void PlaybackWidget::slotMediaStateChanged(Phonon::State newstate, Phonon::State oldstate) { switch (newstate) { case Phonon::StoppedState : m_playButton->setEnabled(true); setGUIPlay(true); if ( oldstate == Phonon::LoadingState ) { if ( m_stopCalled ) m_stopCalled = false; else { slotPlay(); checkSkip(); } } break; case Phonon::ErrorState : slotError(); break; case Phonon::PlayingState : setGUIPlay(false); checkSkip(); break; case Phonon::PausedState : break; case Phonon::LoadingState : break; case Phonon::BufferingState : break; } }
k2send::k2send() : KMainWindow( 0, "k2send" ), m_printer(0) { m_config = new KConfig("k2send"); m_view = new k2sendWidget(this,"k2sendwidget",0,m_config); setAcceptDrops(FALSE); setCentralWidget(m_view); setupActions(); statusBar()->show(); setAutoSaveSettings(); statusBar()->insertFixedItem("9999 Files", 0, true); statusBar()->insertFixedItem("00:00:00", 1, true); statusBar()->insertFixedItem("000 kbit/s", 2, true); statusBar()->insertFixedItem("Loud: 0", 3, true); statusBar()->insertFixedItem("00:00:00:00:00:00 ", 4, true); statusBar()->changeItem ("0 Files", 0); statusBar()->changeItem ("0 kbit/s", 2); trayicon = new KSystemTray(this, "k2sendtray"); trayicon->show(); trayicon->setPixmap (DesktopIcon( "k2send", 24)); KPopupMenu * pop = trayicon->contextMenu() ; pop->insertItem(DesktopIcon( "player_play", 16 ), "Play", m_view, SLOT(slotPlay()), CTRL+Key_P ,1,1); pop->insertItem(DesktopIcon( "player_stop", 16 ), "Stop", m_view, SLOT(slotStop()), CTRL+Key_S ,2,2); pop->insertItem(DesktopIcon( "player_fwd", 16 ), "Next", m_view, SLOT(slotSkip()), CTRL+Key_N ,3,3); pop->insertItem( "Loundess", m_view, SLOT(slotLoudness()), CTRL+Key_L ,4,4); connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), this, SLOT(changeStatusbar(const QString&))); connect(m_view, SIGNAL(signalChangeCaption(const QString&)), this, SLOT(changeCaption(const QString&))); }
TranzportClient::TranzportClient(RosegardenMainWindow* rgGUIApp) : QObject(), device_online(true), previous_buttons(*reinterpret_cast<uint32_t*>(previousbuf+2)), current_buttons(*reinterpret_cast<uint32_t*>(currentbuf+2)), datawheel(currentbuf[6]), status(currentbuf[1]), m_rgGUIApp(rgGUIApp), m_rgDocument(rgGUIApp->getDocument()), m_composition(&m_rgDocument->getComposition()) { m_descriptor = open("/dev/tranzport0",O_RDWR); if (m_descriptor < 0) { throw Exception(qstrtostr(QObject::tr("Failed to open tranzport device /dev/tranzport0"))); } bzero(currentbuf,8); bzero(previousbuf,8); fcntl(m_descriptor,F_SETOWN, getpid()); int socketFlags = fcntl(m_descriptor, F_GETFL, 0); if (socketFlags != -1) { fcntl(m_descriptor, F_SETFL, socketFlags | O_NONBLOCK); } m_socketReadNotifier = new QSocketNotifier(m_descriptor, QSocketNotifier::Read, 0); m_socketWriteNotifier = new QSocketNotifier(m_descriptor, QSocketNotifier::Write,0); connect(m_socketReadNotifier, SIGNAL(activated(int)), this, SLOT(readData())); connect(m_socketWriteNotifier, SIGNAL(activated(int)), this, SLOT(writeCommandQueue())); connect(this, SIGNAL(play()), m_rgGUIApp, SLOT(slotPlay()) ); connect(this, SIGNAL(stop()), m_rgGUIApp, SLOT(slotStop()) ); connect(this, SIGNAL(record()), m_rgGUIApp, SLOT(slotRecord()) ); connect(this, SIGNAL(rewind()), m_rgGUIApp, SLOT(slotRewind()) ); connect(this, SIGNAL(rewindToBeginning()), m_rgGUIApp, SLOT(slotRewindToBeginning()) ); connect(this, SIGNAL(fastForward()), m_rgGUIApp, SLOT(slotFastforward()) ); connect(this, SIGNAL(fastForwardToEnd()), m_rgGUIApp, SLOT(slotFastForwardToEnd()) ); connect(this, SIGNAL(toggleRecord()), m_rgGUIApp, SLOT(slotToggleRecord()) ); connect(this, SIGNAL(trackDown()), m_rgGUIApp, SLOT(slotTrackDown()) ); connect(this, SIGNAL(trackUp()), m_rgGUIApp, SLOT(slotTrackUp()) ); connect(this, SIGNAL(trackMute()), m_rgGUIApp, SLOT(slotToggleMute()) ); connect(this, SIGNAL(trackRecord()), m_rgGUIApp, SLOT(slotToggleRecordCurrentTrack()) ); connect(this, SIGNAL(solo(bool)), m_rgGUIApp, SLOT(slotToggleSolo(bool))); connect(m_rgGUIApp, SIGNAL(documentChanged(RosegardenDocument*)), this, SLOT(documentChanged(RosegardenDocument*))); connect(m_rgDocument, SIGNAL(pointerPositionChanged(timeT)), this, SLOT(pointerPositionChanged(timeT))); connect(m_rgDocument, SIGNAL(loopChanged(timeT,timeT)), this, SLOT(loopChanged(timeT,timeT))); connect(this, SIGNAL(undo()), CommandHistory::getInstance(),SLOT(undo())); connect(this, SIGNAL(redo()), CommandHistory::getInstance(), SLOT(redo())); connect(this, SIGNAL(setPosition(timeT)), m_rgDocument, SLOT(slotSetPointerPosition(timeT))); m_composition->addObserver(this); m_socketWriteNotifier->setEnabled(false); stateUpdate(); RG_DEBUG << "TranzportClient::TranzportClient: connected to tranzport device: " << m_descriptor << endl; }
Monitor::Monitor(Kdenlive::MONITORID id, MonitorManager *manager, QString profile, QWidget *parent) : AbstractMonitor(id, manager, parent) , render(NULL) , m_currentClip(NULL) , m_overlay(NULL) , m_scale(1) , m_length(2) , m_dragStarted(false) , m_loopClipAction(NULL) , m_contextMenu(NULL) , m_effectWidget(NULL) , m_selectedClip(NULL) , m_loopClipTransition(true) #ifdef USE_OPENGL , m_glWidget(NULL) #endif , m_editMarker(NULL) { QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); // Video widget holder layout->addWidget(videoBox, 10); layout->addStretch(); // Get base size for icons int s = style()->pixelMetric(QStyle::PM_SmallIconSize); // Tool bar buttons m_toolbar = new QToolBar(this); m_toolbar->setIconSize(QSize(s, s)); m_playIcon = KIcon("media-playback-start"); m_pauseIcon = KIcon("media-playback-pause"); if (id != Kdenlive::dvdMonitor) { m_toolbar->addAction(KIcon("kdenlive-zone-start"), i18n("Set zone start"), this, SLOT(slotSetZoneStart())); m_toolbar->addAction(KIcon("kdenlive-zone-end"), i18n("Set zone end"), this, SLOT(slotSetZoneEnd())); } m_toolbar->addAction(KIcon("media-seek-backward"), i18n("Rewind"), this, SLOT(slotRewind())); //m_toolbar->addAction(KIcon("media-skip-backward"), i18n("Rewind 1 frame"), this, SLOT(slotRewindOneFrame())); QToolButton *playButton = new QToolButton(m_toolbar); m_playMenu = new QMenu(i18n("Play..."), this); m_playAction = m_playMenu->addAction(m_playIcon, i18n("Play")); //m_playAction->setCheckable(true); connect(m_playAction, SIGNAL(triggered()), this, SLOT(slotPlay())); playButton->setMenu(m_playMenu); playButton->setPopupMode(QToolButton::MenuButtonPopup); m_toolbar->addWidget(playButton); //m_toolbar->addAction(KIcon("media-skip-forward"), i18n("Forward 1 frame"), this, SLOT(slotForwardOneFrame())); m_toolbar->addAction(KIcon("media-seek-forward"), i18n("Forward"), this, SLOT(slotForward())); playButton->setDefaultAction(m_playAction); if (id != Kdenlive::dvdMonitor) { QToolButton *configButton = new QToolButton(m_toolbar); m_configMenu = new QMenu(i18n("Misc..."), this); configButton->setIcon(KIcon("system-run")); configButton->setMenu(m_configMenu); configButton->setPopupMode(QToolButton::QToolButton::InstantPopup); m_toolbar->addWidget(configButton); if (id == Kdenlive::clipMonitor) { m_markerMenu = new QMenu(i18n("Go to marker..."), this); m_markerMenu->setEnabled(false); m_configMenu->addMenu(m_markerMenu); connect(m_markerMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotGoToMarker(QAction *))); }
Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *parent) : AbstractMonitor(id, manager, parent) , render(NULL) , m_controller(NULL) , m_glMonitor(NULL) , m_splitEffect(NULL) , m_splitProducer(NULL) , m_length(2) , m_dragStarted(false) , m_recManager(NULL) , m_loopClipAction(NULL) , m_effectCompare(NULL) , m_sceneVisibilityAction(NULL) , m_contextMenu(NULL) , m_selectedClip(NULL) , m_loopClipTransition(true) , m_editMarker(NULL) , m_forceSizeFactor(0) , m_rootItem(NULL) , m_lastMonitorSceneType(MonitorSceneNone) { QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); // Create container widget m_glWidget = new QWidget; QGridLayout* glayout = new QGridLayout(m_glWidget); glayout->setSpacing(0); glayout->setContentsMargins(0, 0, 0, 0); // Create QML OpenGL widget m_glMonitor = new GLWidget(); m_videoWidget = QWidget::createWindowContainer(qobject_cast<QWindow*>(m_glMonitor)); glayout->addWidget(m_videoWidget, 0, 0); m_verticalScroll = new QScrollBar(Qt::Vertical); glayout->addWidget(m_verticalScroll, 0, 1); m_verticalScroll->hide(); m_horizontalScroll = new QScrollBar(Qt::Horizontal); glayout->addWidget(m_horizontalScroll, 1, 0); m_horizontalScroll->hide(); connect(m_horizontalScroll, SIGNAL(valueChanged(int)), m_glMonitor, SLOT(setOffsetX(int))); connect(m_verticalScroll, SIGNAL(valueChanged(int)), m_glMonitor, SLOT(setOffsetY(int))); connect(m_glMonitor, SIGNAL(frameDisplayed(const SharedFrame&)), this, SLOT(onFrameDisplayed(const SharedFrame&))); connect(m_glMonitor, SIGNAL(mouseSeek(int,bool)), this, SLOT(slotMouseSeek(int,bool))); connect(m_glMonitor, SIGNAL(monitorPlay()), this, SLOT(slotPlay())); connect(m_glMonitor, SIGNAL(startDrag()), this, SLOT(slotStartDrag())); connect(m_glMonitor, SIGNAL(switchFullScreen(bool)), this, SLOT(slotSwitchFullScreen(bool))); connect(m_glMonitor, SIGNAL(zoomChanged()), this, SLOT(setZoom())); connect(m_glMonitor, SIGNAL(effectChanged(QRect)), this, SIGNAL(effectChanged(QRect))); connect(m_glMonitor, SIGNAL(effectChanged(QVariantList)), this, SIGNAL(effectChanged(QVariantList))); if (KdenliveSettings::displayMonitorInfo()) { // Load monitor overlay qml m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitor.qml")))); m_rootItem = m_glMonitor->rootObject(); } connect(m_glMonitor, SIGNAL(showContextMenu(QPoint)), this, SLOT(slotShowMenu(QPoint))); m_glWidget->setMinimumSize(QSize(320, 180)); layout->addWidget(m_glWidget, 10); layout->addStretch(); // Get base size for icons int s = style()->pixelMetric(QStyle::PM_SmallIconSize); // Tool bar buttons m_toolbar = new QToolBar(this); m_toolbar->setIconSize(QSize(s, s)); QWidget *sp1 = new QWidget(this); sp1->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); m_toolbar->addWidget(sp1); if (id == Kdenlive::ClipMonitor) { // Add options for recording m_recManager = new RecManager(s, this); connect(m_recManager, &RecManager::warningMessage, this, &Monitor::warningMessage); connect(m_recManager, &RecManager::addClipToProject, this, &Monitor::addClipToProject); } if (id != Kdenlive::DvdMonitor) { m_toolbar->addAction(manager->getAction("mark_in")); m_toolbar->addAction(manager->getAction("mark_out")); } m_toolbar->addAction(manager->getAction("monitor_seek_backward")); QToolButton *playButton = new QToolButton(m_toolbar); m_playMenu = new QMenu(i18n("Play..."), this); m_playAction = static_cast<KDualAction*> (manager->getAction("monitor_play")); m_playMenu->addAction(m_playAction); playButton->setMenu(m_playMenu); playButton->setPopupMode(QToolButton::MenuButtonPopup); m_toolbar->addWidget(playButton); m_toolbar->addAction(manager->getAction("monitor_seek_forward")); playButton->setDefaultAction(m_playAction); m_configMenu = new QMenu(i18n("Misc..."), this); if (id != Kdenlive::DvdMonitor) { if (id == Kdenlive::ClipMonitor) { m_markerMenu = new QMenu(i18n("Go to marker..."), this); m_markerMenu->setEnabled(false); m_configMenu->addMenu(m_markerMenu); connect(m_markerMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotGoToMarker(QAction*))); } m_forceSize = new KSelectAction(QIcon::fromTheme("transform-scale"), i18n("Force Monitor Size"), this); QAction *fullAction = m_forceSize->addAction(QIcon(), i18n("Force 100%")); fullAction->setData(100); QAction *halfAction = m_forceSize->addAction(QIcon(), i18n("Force 50%")); halfAction->setData(50); QAction *freeAction = m_forceSize->addAction(QIcon(), i18n("Free Resize")); freeAction->setData(0); m_configMenu->addAction(m_forceSize); m_forceSize->setCurrentAction(freeAction); connect(m_forceSize, SIGNAL(triggered(QAction*)), this, SLOT(slotForceSize(QAction*))); }
PlaybackWidget::PlaybackWidget(QWidget* parent, KUrl::List &urls, SharedContainer* sharedData) : QWidget(parent) { setupUi(this); m_sharedData = sharedData; m_currIndex = 0; m_urlList = urls; m_stopCalled = false; m_canHide = true; m_soundLabel->setPixmap(KIcon("speaker").pixmap(64, 64)); m_prevButton->setText(""); m_nextButton->setText(""); m_playButton->setText(""); m_stopButton->setText(""); m_prevButton->setIcon(KIcon("media-skip-backward")); m_nextButton->setIcon(KIcon("media-skip-forward")); m_playButton->setIcon(KIcon("media-playback-start")); m_stopButton->setIcon(KIcon("media-playback-stop")); connect(m_prevButton, SIGNAL(clicked()), this, SLOT(slotPrev())); connect(m_nextButton, SIGNAL(clicked()), this, SLOT(slotNext())); connect(m_playButton, SIGNAL(clicked()), this, SLOT(slotPlay())); connect(m_stopButton, SIGNAL(clicked()), this, SLOT(slotStop())); if (m_urlList.empty()) { setEnabled(false); return; } // Waiting for files to be enqueued. m_playButton->setEnabled(false); m_prevButton->setEnabled(false); // Phonon m_mediaObject = new Phonon::MediaObject(this); m_mediaObject->setTransitionTime(1000); m_mediaObject->setTickInterval(500); connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(slotMediaStateChanged(Phonon::State,Phonon::State))); connect(m_mediaObject, SIGNAL(finished()), this, SLOT(slotSongFinished())); connect(m_mediaObject, SIGNAL(tick(qint64)), this, SLOT(slotTimeUpdaterTimeout())); m_audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(m_mediaObject, m_audioOutput); m_volumeSlider->setAudioOutput(m_audioOutput); m_volumeSlider->setOrientation(Qt::Horizontal); setZeroTime(); // Loading first song m_mediaObject->setCurrentSource(static_cast<QUrl>(m_urlList[m_currIndex])); }
//--------------------------------------------------------------------------- // //! \brief add button to control // //! \author Jo2003 //! \date 26.11.2012 // //! \param pBtn pointer to pushbutton //! \param role role for button (start, stop, rec, ...) // //! \return -- //--------------------------------------------------------------------------- void QFusionControl::addButton (QPushButton *pBtn, eBtnRole role) { switch (role) { case BTN_PLAY: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotPlay())); // add to vector ... _playBtnVector.append(pBtn); break; case BTN_REC: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotRec())); // add to vector ... _recBtnVector.append(pBtn); break; case BTN_STOP: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotStop())); // add to vector ... _stopBtnVector.append(pBtn); break; case BTN_FWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotFwd())); // add to vector ... _fwdBtnVector.append(pBtn); break; case BTN_BWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotBwd())); // add to vector ... _bwdBtnVector.append(pBtn); break; case BTN_FS: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotFs())); // add to vector ... _fsBtnVector.append(pBtn); break; case BTN_FRMT: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotSaveVideoFormat())); // add to vector ... _frmtBtnVector.append(pBtn); break; case BTN_SCRSHOT: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotScrShot())); // add to vector ... _scrShtBtnVector.append(pBtn); break; case BTN_WNDWD: // connect signal --> slots ... connect (pBtn, SIGNAL(clicked()), this, SLOT(slotEnterWndwd())); // add to vector ... _wndModBtnVector.append(pBtn); break; default: break; } }