Exemplo n.º 1
0
void STDCALL DvProviderAvOpenhomeOrgRadio1GetPropertyIdArray(THandle aProvider, char** aValue, uint32_t* aValueLen)
{
    Brh buf;
    reinterpret_cast<DvProviderAvOpenhomeOrgRadio1C*>(aProvider)->GetPropertyIdArray(buf);
    *aValueLen = buf.Bytes();
    *aValue = (char*)buf.Extract();
}
Exemplo n.º 2
0
int32_t DvInvocationReadBinary(DvInvocationC aInvocation, const char* aName, uint8_t** aData, uint32_t* aLen)
{
    IDviInvocation* invocation = InvocationFromHandle(aInvocation);
    try {
        Brh value;
        invocation->InvocationReadBinary(aName, value);
        *aLen = value.Bytes();
        *aData = (uint8_t*)value.Extract();
    }
    catch (InvocationError&) {
        return -1;
    }
    return 0;
}
Exemplo n.º 3
0
void CpDevices::WaitForDeviceDiscovery()
{
    (void)iAddedSem.Clear();
    iAddedSem.Wait(30*1000); // allow up to 30 seconds to issue the msearch and receive a response
    // check that we not only have a device but that its at a different location from previously
    ASSERT(iDevices.size() == 1);
    CpDevice* device = iDevices[0];
    Brh locationBuf;
    ASSERT(device->GetAttribute("Upnp.Location", locationBuf));
    const TChar* location = locationBuf.Extract();
    if (iLocation != NULL) {
        ASSERT(strcmp(location, iLocation) != 0);
    }
    iLocation = location;
}
Exemplo n.º 4
0
void STDCALL DvDeviceStandardGetResourceManagerUri(DvDeviceC aDevice, THandle aAdapter, char** aUri, uint32_t* aLen)
{
    Brh uri;
    NetworkAdapter* nif = (NetworkAdapter*)aAdapter;
    ASSERT(nif != NULL);
    reinterpret_cast<DvDeviceStandard*>(DviDeviceC::DeviceFromHandle(aDevice))->GetResourceManagerUri(*nif, uri);
    if (uri.Bytes() == 0) {
        *aUri = NULL;
        *aLen = 0;
    }
    else {
        *aLen = uri.Bytes();
        *aUri = (char*)uri.Extract();
    }
}
Exemplo n.º 5
0
void ControlPointProxy::CPUpnpAv::upnpAvPause()
{
    Brh state;
    Brh dummy;

    if (iIsActive)
    {
        iUpnpAvProxy->SyncGetTransportInfo(0, state, dummy, dummy);

        string stateStr(state.Extract());

        if (canPause(stateStr))
        {
            iUpnpAvProxy->SyncPause(0);
        }
    }
}
Exemplo n.º 6
0
void ControlPointProxy::CPUpnpAv::pipelineChangedEvent()
{
    Brh  state;
    Brh  dummy;
    TUint mediaOptions = 0;

    // Ignore this notification if we are not the active source.
    if (! iIsActive)
    {
        return;
    }

    // Read the new transport state.
    try
    {
        iUpnpAvProxy->SyncGetTransportInfo(0, state, dummy, dummy);
    }
    catch (ProxyError& /*aPe*/)
    {
        return;
    }

    // Figure out the available playback options from the transport state.
    string stateStr(state.Extract());

    if (canPlay(stateStr))
    {
        mediaOptions |= MEDIAPLAYER_PLAY_OPTION;
    }

    if (canStop(stateStr))
    {
        mediaOptions |= MEDIAPLAYER_STOP_OPTION;
    }

    if (canPause(stateStr))
    {
        mediaOptions |= MEDIAPLAYER_PAUSE_OPTION;
    }

    // Adjust the UI accordingly.
    PostMessage(iHwnd, WM_APP_PLAYBACK_OPTIONS, NULL, (LPARAM)mediaOptions);
}