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()) ); }
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 *))); }