bool HRenderingControlAdapterPrivate::getMute(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    bool currentlyMuted = op.outputArguments().value("CurrentMute").toBool();
    emit q->getMuteCompleted(q, takeOp(op, currentlyMuted));

    return false;
}
bool HRenderingControlAdapterPrivate::getVolumeDB(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    qint16 currentVolumeDb = op.outputArguments().value("CurrentVolume").toInt();
    emit q->getVolumeDBCompleted(q, takeOp(op, currentVolumeDb));

    return false;
}
bool HRenderingControlAdapterPrivate::setStateVariables(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    QStringList stateVariableList =
        op.outputArguments().value("StateVariableList").toString().split(",");

    emit q->setStateVariablesCompleted(q, takeOp(op, stateVariableList));

    return false;
}
bool HRenderingControlAdapterPrivate::getStateVariables(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    QString stateVariableValuePairs =
        op.outputArguments().value("StateVariableValuePairs").toString();

    emit q->getStateVariablesCompleted(q, takeOp(op, stateVariableValuePairs));

    return false;
}
bool HRenderingControlAdapterPrivate::getColorTemperature(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    quint16 currentColorTemperature =
        op.outputArguments().value("CurrentColorTemperature").toUInt();

    emit q->getColorTemperatureCompleted(q, takeOp(op, currentColorTemperature));

    return false;
}
bool HRenderingControlAdapterPrivate::getBlueVideoGain(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    quint16 currentBlueVideoGain =
        op.outputArguments().value("CurrentBlueVideoGain").toUInt();

    emit q->getBlueVideoGainCompleted(q, takeOp(op, currentBlueVideoGain));

    return false;
}
bool HRenderingControlAdapterPrivate::getSharpness(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    quint16 currentSharpness =
        op.outputArguments().value("CurrentSharpness").toUInt();

    emit q->getSharpnessCompleted(q, takeOp(op, currentSharpness));

    return false;
}
bool HRenderingControlAdapterPrivate::getVerticalKeystone(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    quint16 currentVerticalKeyStone =
        op.outputArguments().value("CurrentVerticalKeystone").toUInt();

    emit q->getVerticalKeystoneCompleted(
        q, takeOp(op, currentVerticalKeyStone));

    return false;
}
bool HRenderingControlAdapterPrivate::getGreenVideoBlackLevel(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    quint16 currentGreenVideoBlackLevel =
        op.outputArguments().value("CurrentGreenVideoBlackLevel").toUInt();

    emit q->getGreenVideoBlackLevelCompleted(
        q, takeOp(op, currentGreenVideoBlackLevel));

    return false;
}
bool HRenderingControlAdapterPrivate::getVolumeDBRange(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HRenderingControlAdapter);

    qint32 minValue = op.outputArguments().value("MinValue").toInt();
    qint32 maxValue = op.outputArguments().value("MaxValue").toInt();

    HVolumeDbRangeResult result(minValue, maxValue);

    emit q->getVolumeDBRangeCompleted(q, takeOp(op, result));

    return false;
}
예제 #11
0
bool HAvTransportAdapterPrivate::getCurrentTransportActions(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

    QSet<HTransportAction> actions;
    if (op.returnValue() == UpnpSuccess)
    {
        QStringList slist = op.outputArguments().value("Actions").toString().split(",");

        foreach(const QString& action, slist)
        {
            HTransportAction ta(action);
            if (ta.isValid())
            {
                actions.insert(ta);
            }
        }
예제 #12
0
bool HAvTransportAdapterPrivate::getTransportSettings(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

    HTransportSettings settings;
    if (op.returnValue() == UpnpSuccess)
    {
        const HActionArguments& outArgs = op.outputArguments();

        HPlayMode pm = outArgs.value("PlayMode").toString();
        QString rqMode = outArgs.value("RecQualityMode").toString();

        settings = HTransportSettings(pm, rqMode);
    }
    emit q->getTransportSettingsCompleted(q, takeOp(op, settings));

    return false;
}
예제 #13
0
void ObjectCache::attemptIdToPathResolution( const HClientActionOp &op )
{
    HActionArguments output = op.outputArguments();
    // NOTE disconnection is important
    bool ok = disconnect( m_cpt, SIGNAL( browseResult( const Herqq::Upnp::HClientActionOp & ) ),
                          this, SLOT( attemptIdToPathResolution( const Herqq::Upnp::HClientActionOp & ) ) );
    Q_ASSERT( ok );
    Q_UNUSED( ok );
    if( !output["Result"].isValid() ) {
        emit m_cpt->error( KIO::ERR_SLAVE_DEFINED, "ID to Path Resolution error" );
        return;
    }
    kDebug() << "In attempt for" << m_idResolve.currentId << "got"<< output["Result"].value().toString();

    DIDL::Parser parser;
    connect( &parser, SIGNAL(itemParsed(DIDL::Item *)),
                       this, SLOT(slotBuildPathForId(DIDL::Item *)) );
    connect( &parser, SIGNAL(containerParsed(DIDL::Container *)),
             this, SLOT(slotBuildPathForId(DIDL::Container *)) );

    parser.parse( output[QLatin1String("Result")].value().toString() );

    // we block because devices ( atleast MediaTomb )
    // seem to block continous TCP connections after some time
    // this interval might need modification
    block(500);

// TODO fill stuff here

    // if we are done, emit the relevant Object
    // otherwise recurse with a new (m_)resolve :)
    if( m_idResolve.currentId == QLatin1String("0") ) {
        emit idToPathResolved( m_idResolve.id, QLatin1Char('/') + m_idResolve.fullPath );
        m_idToPathRequestsInProgress = false;
        kDebug() << "Done with one resolve, continuing";
        if( !m_idToPathRequests.empty() )
            resolveNextIdToPath();
    }
    else {
        kDebug() << "Now calling recursive";
        resolveIdToPathInternal();
    }
}
예제 #14
0
bool HAvTransportAdapterPrivate::getTransportInfo(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

    HTransportInfo info;
    if (op.returnValue() == UpnpSuccess)
    {
        const HActionArguments& outArgs = op.outputArguments();

        QString state = outArgs.value("CurrentTransportState").toString();
        QString status = outArgs.value("CurrentTransportStatus").toString();
        QString speed = outArgs.value("CurrentSpeed").toString();

        info = HTransportInfo(state, status, speed);
    }
    emit q->getTransportInfoCompleted(q, takeOp(op, info));

    return false;
}
예제 #15
0
bool HAvTransportAdapterPrivate::getDeviceCapabilities(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

    HDeviceCapabilities capabilities;
    if (op.returnValue() == UpnpSuccess)
    {
        const HActionArguments& outArgs = op.outputArguments();

        QStringList pmedia = outArgs.value("PlayMedia").toString().split(",");
        QStringList rmedia = outArgs.value("RecMedia").toString().split(",");
        QStringList rqMode = outArgs.value("RecQualityModes").toString().split(",");

        capabilities =
            HDeviceCapabilities(pmedia.toSet(), rmedia.toSet(), rqMode.toSet());
    }
    emit q->getDeviceCapabilitiesCompleted(q, takeOp(op, capabilities));

    return false;
}