void Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input) { tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full(); if( m_sipPlugin->m_account->configuration().value("publishtracks").toBool() == false ) { tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full() << "Not publishing now playing info (disabled in account config)"; return; } switch ( type ) { case InfoNowPlaying: case InfoNowResumed: m_pauseTimer.stop(); if ( input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) audioStarted( input.value< Tomahawk::InfoSystem::InfoStringHash >() ); break; case InfoNowPaused: m_pauseTimer.start( PAUSE_TIMEOUT * 1000 ); audioPaused(); break; case InfoNowStopped: m_pauseTimer.stop(); audioStopped(); break; default: return; } }
// InfoPlugin Methods void MprisPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) { bool isPlayingInfo = false; switch ( pushData.type ) { case InfoNowPlaying: isPlayingInfo = true; audioStarted( pushData.infoPair.second ); break; case InfoNowPaused: isPlayingInfo = true; audioPaused(); break; case InfoNowResumed: isPlayingInfo = true; audioResumed( pushData.infoPair.second ); break; case InfoNowStopped: isPlayingInfo = true; audioStopped(); break; default: break; } if ( isPlayingInfo ) notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "PlaybackStatus" ); }
void MprisPlugin::audioResumed( const QVariant& input ) { audioStarted( input ); }
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) , config_() , model_() , synthesis_(new Synthesis) , ui_(new Ui::MainWindow) , dataEntryWindow_(new DataEntryWindow) , intonationWindow_(new IntonationWindow) , intonationParametersWindow_(new IntonationParametersWindow) , postureEditorWindow_(new PostureEditorWindow) , prototypeManagerWindow_(new PrototypeManagerWindow) , specialTransitionEditorWindow_(new TransitionEditorWindow) , ruleManagerWindow_(new RuleManagerWindow) , ruleTesterWindow_(new RuleTesterWindow) , synthesisWindow_(new SynthesisWindow) , transitionEditorWindow_(new TransitionEditorWindow) { ui_->setupUi(this); ui_->logTextEdit->setMaximumBlockCount(MAX_LOG_BLOCK_COUNT); specialTransitionEditorWindow_->setSpecial(); connect(ui_->quitAction, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); connect(ui_->aboutAction, SIGNAL(triggered()), this, SLOT(about())); coutStreamBuffer_.reset(new LogStreamBuffer(std::cout, false, ui_->logTextEdit)); cerrStreamBuffer_.reset(new LogStreamBuffer(std::cerr, true, ui_->logTextEdit)); LogStreamBuffer::registerQDebugMessageHandler(); connect(prototypeManagerWindow_.get(), SIGNAL(editTransitionButtonClicked(unsigned int, unsigned int)), transitionEditorWindow_.get(), SLOT(handleEditTransitionButtonClicked(unsigned int, unsigned int))); connect(prototypeManagerWindow_.get(), SIGNAL(editSpecialTransitionButtonClicked(unsigned int, unsigned int)), specialTransitionEditorWindow_.get(), SLOT(handleEditTransitionButtonClicked(unsigned int, unsigned int))); connect(dataEntryWindow_.get(), SIGNAL(categoryChanged()) , postureEditorWindow_.get(), SLOT(unselectPosture())); connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), postureEditorWindow_.get(), SLOT(unselectPosture())); connect(dataEntryWindow_.get(), SIGNAL(symbolChanged()) , postureEditorWindow_.get(), SLOT(unselectPosture())); connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), ruleManagerWindow_.get(), SLOT(loadRuleData())); connect(dataEntryWindow_.get(), SIGNAL(parameterChanged()), synthesisWindow_.get(), SLOT(setupParameterTable())); connect(postureEditorWindow_.get(), SIGNAL(postureChanged()), ruleManagerWindow_.get(), SLOT(unselectRule())); connect(postureEditorWindow_.get(), SIGNAL(postureCategoryChanged()), dataEntryWindow_.get(), SLOT(updateCategoriesTable())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), transitionEditorWindow_.get(), SLOT(updateEquationsTree())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), transitionEditorWindow_.get(), SLOT(updateTransition())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), specialTransitionEditorWindow_.get(), SLOT(updateEquationsTree())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), specialTransitionEditorWindow_.get(), SLOT(updateTransition())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), ruleManagerWindow_.get(), SLOT(setupRuleSymbolEquationsTable())); connect(prototypeManagerWindow_.get(), SIGNAL(equationChanged()), ruleManagerWindow_.get(), SLOT(setupEquationsTree())); connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), transitionEditorWindow_.get(), SLOT(clear())); connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), ruleManagerWindow_.get(), SLOT(setupRuleTransitionsTable())); connect(prototypeManagerWindow_.get(), SIGNAL(transitionChanged()), ruleManagerWindow_.get(), SLOT(setupTransitionsTree())); connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), specialTransitionEditorWindow_.get(), SLOT(clear())); connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), ruleManagerWindow_.get(), SLOT(setupRuleSpecialTransitionsTable())); connect(prototypeManagerWindow_.get(), SIGNAL(specialTransitionChanged()), ruleManagerWindow_.get(), SLOT(setupSpecialTransitionsTree())); connect(transitionEditorWindow_.get(), SIGNAL(equationReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupEquationsTree())); connect(transitionEditorWindow_.get(), SIGNAL(transitionChanged()), prototypeManagerWindow_.get(), SLOT(unselectTransition())); connect(specialTransitionEditorWindow_.get(), SIGNAL(equationReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupEquationsTree())); connect(specialTransitionEditorWindow_.get(), SIGNAL(transitionChanged()), prototypeManagerWindow_.get(), SLOT(unselectSpecialTransition())); connect(ruleManagerWindow_.get(), SIGNAL(categoryReferenceChanged()), dataEntryWindow_.get(), SLOT(updateCategoriesTable())); connect(ruleManagerWindow_.get(), SIGNAL(transitionReferenceChanged()) , prototypeManagerWindow_.get(), SLOT(setupTransitionsTree())); connect(ruleManagerWindow_.get(), SIGNAL(specialTransitionReferenceChanged()), prototypeManagerWindow_.get(), SLOT(setupSpecialTransitionsTree())); connect(ruleManagerWindow_.get(), SIGNAL(equationReferenceChanged()) , prototypeManagerWindow_.get(), SLOT(setupEquationsTree())); connect(synthesisWindow_.get(), SIGNAL(textSynthesized()), intonationWindow_.get(), SLOT(loadIntonationFromEventList())); connect(synthesisWindow_.get(), SIGNAL(audioStarted()), intonationWindow_.get(), SLOT(handleAudioStarted())); connect(synthesisWindow_.get(), SIGNAL(audioFinished()), intonationWindow_.get(), SLOT(handleAudioFinished())); connect(synthesisWindow_.get(), SIGNAL(synthesisFinished()), intonationWindow_.get(), SLOT(handleSynthesisFinished())); connect(intonationWindow_.get(), SIGNAL(synthesisRequested()), synthesisWindow_.get(), SLOT(synthesizeWithManualIntonation())); connect(intonationWindow_.get(), SIGNAL(synthesisToFileRequested(QString)), synthesisWindow_.get(), SLOT(synthesizeToFileWithManualIntonation(QString))); }