⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 renderingcontrolservice.cpp

📁 Windows CE 6.0 Server 源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft shared
// source or premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license agreement,
// you are not authorized to use this source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the SOURCE.RTF on your install media or the root of your tools installation.
// THE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//

#include "av_dcp.h"
#include "av_upnp.h"
#include "av_upnp_device_internal.h"

using namespace av_upnp;


//
// Macros which handle the common GetFoo/SetFoo calls
// Must use as "[GET|SET]_CALL(fn_name, val_name);"
//

#define GET_CALL(FN_NAME, VAR_NAME)             \
    if(!VAR_NAME)                               \
        return E_POINTER;                       \
                                                \
    MAKE_INSTANCE_CALL_1(FN_NAME, VAR_NAME);    \
                                                \
    return S_OK


#define SET_CALL(FN_NAME, VAR_NAME)             \
    MAKE_INSTANCE_CALL_1(FN_NAME, VAR_NAME);    \
                                                \
    return S_OK



/////////////////////////////////////////////////////////////////////////////
// RenderingControlServiceImpl

RenderingControlServiceImpl::RenderingControlServiceImpl()
    : VirtualServiceSupport<IRenderingControl>(DISPID_LASTCHANGE_RC, 1)
        // Have the first assigned-by-VSS ID to be 1, leaving 0 for post-mix control by convention
        // (Reference: RenderingControl:1 Service Template Version 1.01, section 1.2)
{
    InitErrDescrips();
    InitToolkitErrs();
}


RenderingControlServiceImpl::~RenderingControlServiceImpl()
{
}



//
// IUPnPService_RenderingControl1
//


STDMETHODIMP RenderingControlServiceImpl::get_LastChange(BSTR* pLastChange)
{
    return VirtualServiceSupport<IRenderingControl>::GetLastChange(pLastChange);
}



// non-"get_LastChange()" get_foo() methods are implemented only to satisfy upnp's devicehost, they are not used

STDMETHODIMP RenderingControlServiceImpl::get_PresetNameList(BSTR* pPresetNameList)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Brightness(unsigned short* pBrightness)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Contrast(unsigned short* pContrast)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Sharpness(unsigned short* pSharpness)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_RedVideoGain(unsigned short* pRedVideoGain)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_GreenVideoGain(unsigned short* pGreenVideoGain)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_BlueVideoGain(unsigned short* pBlueVideoGain)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_RedVideoBlackLevel(unsigned short* pRedVideoBlackLevel)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_GreenVideoBlackLevel(unsigned short* pGreenVideoBlackLevel)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_BlueVideoBlackLevel(unsigned short* pBlueVideoBlackLevel)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_ColorTemperature(unsigned short* pColorTemperature)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_HorizontalKeystone(short* pHorizontalKeystone)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_VerticalKeystone(short* pVerticalKeystone)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Mute(VARIANT_BOOL* pMute)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Volume(unsigned short* pVolume)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_VolumeDB(short* pVolumeDB)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_Loudness(VARIANT_BOOL* pLoudness)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_A_ARG_TYPE_Channel(BSTR* pA_ARG_TYPE_Channel)
{
    return S_OK;
}

STDMETHODIMP RenderingControlServiceImpl::get_A_ARG_TYPE_InstanceID(unsigned long* pA_ARG_TYPE_InstanceID)
{
    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::get_A_ARG_TYPE_PresetName(BSTR* pA_ARG_TYPE_PresetName)
{
    return S_OK;
}



STDMETHODIMP RenderingControlServiceImpl::ListPresets(unsigned long InstanceID,
                                                      BSTR* pCurrentPresetNameList)
{
    if(!pCurrentPresetNameList)
        return E_POINTER;


    wstring strCurrentPresetNameList;

    MAKE_INSTANCE_CALL_1(ListPresets, &strCurrentPresetNameList);


    // Set out arg
    if(!(*pCurrentPresetNameList = SysAllocString(strCurrentPresetNameList)))
        return m_ErrReport.ReportError(ERROR_AV_OOM);

    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::SelectPreset(unsigned long InstanceID,
                                                       BSTR PresetName)
{
    // Convert argument for call

    wstring strPresetName;

    if(!strPresetName.assign(PresetName, SysStringLen(PresetName)))
        return m_ErrReport.ReportError(ERROR_AV_OOM);


    MAKE_INSTANCE_CALL_1(SelectPreset, strPresetName);


    return S_OK;
}


STDMETHODIMP RenderingControlServiceImpl::GetBrightness(unsigned long InstanceID,
                                                        unsigned short* pCurrentBrightness)
{
    GET_CALL(GetBrightness, pCurrentBrightness);
}


STDMETHODIMP RenderingControlServiceImpl::SetBrightness(unsigned long InstanceID,
                                                        unsigned short DesiredBrightness)
{
    SET_CALL(SetBrightness, DesiredBrightness);
}


STDMETHODIMP RenderingControlServiceImpl::GetContrast(unsigned long InstanceID,
                                                      unsigned short* pCurrentContrast)
{
    GET_CALL(GetContrast, pCurrentContrast);
}


STDMETHODIMP RenderingControlServiceImpl::SetContrast(unsigned long InstanceID,
                                                      unsigned short DesiredContrast)
{
    SET_CALL(SetContrast, DesiredContrast);
}


STDMETHODIMP RenderingControlServiceImpl::GetSharpness(unsigned long InstanceID,
                                                       unsigned short* pCurrentSharpness)
{
    GET_CALL(GetSharpness, pCurrentSharpness);
}


STDMETHODIMP RenderingControlServiceImpl::SetSharpness(unsigned long InstanceID,
                                                       unsigned short DesiredSharpness)
{
    SET_CALL(SetSharpness, DesiredSharpness);
}


STDMETHODIMP RenderingControlServiceImpl::GetRedVideoGain(unsigned long InstanceID,
                                                          unsigned short* pCurrentRedVideoGain)
{
    GET_CALL(GetRedVideoGain, pCurrentRedVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::SetRedVideoGain(unsigned long InstanceID,
                                                          unsigned short DesiredRedVideoGain)
{
    SET_CALL(SetRedVideoGain, DesiredRedVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::GetGreenVideoGain(unsigned long InstanceID,
                                                            unsigned short* pCurrentGreenVideoGain)
{
    GET_CALL(GetGreenVideoGain, pCurrentGreenVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::SetGreenVideoGain(unsigned long InstanceID,
                                                            unsigned short DesiredGreenVideoGain)
{
    SET_CALL(SetGreenVideoGain, DesiredGreenVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::GetBlueVideoGain(unsigned long InstanceID,
                                                           unsigned short* pCurrentBlueVideoGain)
{
    GET_CALL(GetBlueVideoGain, pCurrentBlueVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::SetBlueVideoGain(unsigned long InstanceID,
                                                           unsigned short DesiredBlueVideoGain)
{
    SET_CALL(SetBlueVideoGain, DesiredBlueVideoGain);
}


STDMETHODIMP RenderingControlServiceImpl::GetRedVideoBlackLevel(unsigned long InstanceID,
                                                                unsigned short* pCurrentRedVideoBlackLevel)
{
    GET_CALL(GetRedVideoBlackLevel, pCurrentRedVideoBlackLevel);
}


STDMETHODIMP RenderingControlServiceImpl::SetRedVideoBlackLevel(unsigned long InstanceID,
                                                                unsigned short DesiredRedVideoBlackLevel)
{
    SET_CALL(SetRedVideoBlackLevel, DesiredRedVideoBlackLevel);
}


STDMETHODIMP RenderingControlServiceImpl::GetGreenVideoBlackLevel(unsigned long InstanceID,
                                                                  unsigned short* pCurrentGreenVideoBlackLevel)
{
    GET_CALL(GetGreenVideoBlackLevel, pCurrentGreenVideoBlackLevel);
}


STDMETHODIMP RenderingControlServiceImpl::SetGreenVideoBlackLevel(unsigned long InstanceID,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -