Ejemplo n.º 1
0
STFavoriteTimeline::STFavoriteTimeline(QString identifier, quint64 targetUserId, QObject *parent) :
    STTimeline(identifier, parent), m_targetUserId(targetUserId)
{
    QString urlStr="https://api.twitter.com/1.1/favorites/list.json?user_id=%1";
    setFetchEndpoint(QUrl(urlStr.arg(targetUserId)));

    STAccount *account=accountForIdentifier(identifier);
    if(account->userId()==targetUserId){
        m_streamer=account->userStreamer();
        connect(m_streamer, SIGNAL(streamingStarted()),
                this, SLOT(streamStarted()));
        connect(m_streamer, SIGNAL(streamingStopped(QString)),
                this, SLOT(streamStopped(QString)));
        connect(m_streamer, SIGNAL(streamingCouldNotStarted(QString)),
                this, SLOT(streamFailedToStart(QString)));
        connect(m_streamer, SIGNAL(statusRemoved(quint64)),
                this, SLOT(streamRemoved(quint64)));
        connect(m_streamer, SIGNAL(accountFavoritedStatus(STObjectManager::StatusRef,STObjectManager::UserRef)),
                this, SLOT(favoritedStatus(STObjectManager::StatusRef)));
        connect(m_streamer, SIGNAL(accountUnfavoritedStatus(STObjectManager::StatusRef,STObjectManager::UserRef)),
                this, SLOT(unfavoritedStatus(STObjectManager::StatusRef)));
    }else{
        m_streamer=NULL;
    }
}
Ejemplo n.º 2
0
void QRtmp::setStreamIsRunning(bool isRunning)
{
    if(isRunning ^ m_streamIsRunning)
    {
        m_streamIsRunning = isRunning;
        if(isRunning)
            emit streamStarted();
        else
            emit streamStopped();
    }
}
Ejemplo n.º 3
0
void eDVBServiceStream::recordEvent(int event)
{
	switch (event)
	{
	case iDVBTSRecorder::eventWriteError:
		eWarning("[eDVBServiceStream] stream write error");
		streamStopped();
		break;
	default:
		eDebug("unhandled record event %d", event);
		break;
	}
}
Ejemplo n.º 4
0
void LiveStream::setState(State newState)
{
    if (m_state == newState)
        return;

    State oldState = m_state;
    m_state = newState;

    if (m_state != Error)
        m_errorMessage.clear();

    emit stateChanged(newState);

    if (newState >= Streaming && oldState < Streaming)
        emit streamRunning();
    else if (oldState >= Streaming && newState < Streaming)
        emit streamStopped();

    if (oldState == Paused || newState == Paused)
        emit pausedChanged(isPaused());
}
Ejemplo n.º 5
0
STHomeTimeline::STHomeTimeline(QString identifier, QObject *parent) :
    STTimeline(identifier, parent)
{
    QStringList lst=identifier.split(".");
    quint64 uid=lst[0].toULongLong();

    this->setFetchEndpoint(QUrl("https://api.twitter.com/1.1/statuses/home_timeline.json?exclude_replies=false&include_my_retweet=1"));

    STAccount *ac=STAccountsManager::sharedManager()->account(uid);
    Q_ASSERT(ac);

    m_streamer=ac->userStreamer();
    connect(m_streamer, SIGNAL(streamingStarted()),
            this, SLOT(streamStarted()));
    connect(m_streamer, SIGNAL(streamingStopped(QString)),
            this, SLOT(streamStopped(QString)));
    connect(m_streamer, SIGNAL(streamingCouldNotStarted(QString)),
            this, SLOT(streamFailedToStart(QString)));
    connect(m_streamer, SIGNAL(homeNewStatusReceived(STObjectManager::StatusRef)),
            this, SLOT(streamReceived(STObjectManager::StatusRef)));
    connect(m_streamer, SIGNAL(statusRemoved(quint64)),
            this, SLOT(streamRemoved(quint64)));
}