Пример #1
0
bool HAvTransportAdapterPrivate::getPositionInfo(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

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

        quint32 track = outArgs.value("Track").toUInt();
        HDuration trackDuration = outArgs.value("TrackDuration").toString();
        QString trackMd = outArgs.value("TrackMetaData").toString();
        QUrl trackUri = outArgs.value("TrackURI").toString();
        HDuration relTime = outArgs.value("RelTime").toString();
        HDuration absTime = outArgs.value("AbsTime").toString();
        qint32 relCountPos = outArgs.value("RelCount").toInt();
        quint32 absCountPos = outArgs.value("AbsCount").toUInt();

        info = HPositionInfo(
                   track, trackDuration, trackMd, trackUri, relTime, absTime,
                   relCountPos, absCountPos);
    }
    emit q->getPositionInfoCompleted(q, takeOp(op, info));

    return false;
}
Пример #2
0
bool HAvTransportAdapterPrivate::getMediaInfo_ext(
    HClientAction*, const HClientActionOp& op)
{
    H_Q(HAvTransportAdapter);

    HMediaInfo mediaInfo;
    if (op.returnValue() == UpnpSuccess)
    {
        const HActionArguments& outArgs = op.outputArguments();

        QString currentType = outArgs.value("CurrentType").toString();
        quint32 nrTracks = outArgs.value("NrTracks").toUInt();
        HDuration duration = outArgs.value("MediaDuration").toString();
        QUrl curUri = outArgs.value("CurrentURI").toUrl();
        QString curUriMetadata = outArgs.value("CurrentURIMetaData").toString();
        QUrl nextUri = outArgs.value("NextURI").toUrl();
        QString nextUriMetadata = outArgs.value("NextURIMetaData").toString();
        HStorageMedium playMedium = outArgs.value("PlayMedium").toString();
        HStorageMedium recMedium  = outArgs.value("RecordMedium").toString();
        HRecordMediumWriteStatus ws = outArgs.value("WriteStatus").toString();

        mediaInfo = HMediaInfo(
                        nrTracks, duration, curUri, curUriMetadata, nextUri, nextUriMetadata,
                        playMedium, recMedium, ws,
                        HMediaInfo::mediaCategoryFromString(currentType));
    }
    emit q->getMediaInfo_extCompleted(q, takeOp(op, mediaInfo));

    return false;
}
Пример #3
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);
            }
        }
Пример #4
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;
}
Пример #5
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;
}
Пример #6
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;
}