// vidsvr.odl : type library source for vidsvr.exe
// Copyright (c) Microsoft Corporation 1995-1997.

// This file will be processed by the Make Type Library (mktyplib) tool to
// produce the type library (vidsvr.tlb).

#include <olectl.h>

#define ENABLE_OVERSCAN

[ uuid(99D257C1-97A9-11CF-A88F-444553540000), version(1.0),
  helpstring("Microsoft BPC Video Server and Control module"), control ]
library MSBPCVideo
{

    importlib(STDOLE_TLB);
    importlib(STDTYPE_TLB);

#ifdef __midl
        import "ocidl.idl";
#define boolean VARIANT_BOOL
#endif

#define DISPID_NEWENUM (-4)
#include "devtype.h"

    //  Primary dispatch interface for CBPCPurchase

    [ uuid(40ca1ac0-d66d-11cf-a88f-444553540000),
      oleautomation, dual, hidden
    ]
    interface IBPCPurchase : IDispatch
    {
        [id(OABPCDETID_Channel), propget] HRESULT Channel([out, retval] short *Channel);
        [id(OABPCDETID_Channel), propput] HRESULT Channel([in] short Channel);
        [id(OABPCDETID_StartTime), propget] HRESULT StartTime([out, retval] DATE *StartTime);
        [id(OABPCDETID_StartTime), propput] HRESULT StartTime([in] DATE StartTime);
        [id(OABPCDETID_Expiry), propget] HRESULT Expiry([out, retval] DATE *Expiry);
        [id(OABPCDETID_Expiry), propput] HRESULT Expiry([in] DATE Expiry);
        [id(OABPCDETID_Duration), propget] HRESULT Duration([out, retval] long *Duration);
        [id(OABPCDETID_Duration), propput] HRESULT Duration([in] long Duration);
        [id(OABPCDETID_ItemID), propget] HRESULT ItemID([out, retval] long *ItemID);
        [id(OABPCDETID_ItemID), propput] HRESULT ItemID([in] long ItemID);
        [id(OABPCDETID_Location), propget] HRESULT Location([out, retval] long *Location);
        [id(OABPCDETID_Location), propput] HRESULT Location([in] long Location);
        [id(OABPCDETID_UserId), propget] HRESULT UserId([out, retval] long *UserId);
        [id(OABPCDETID_UserId), propput] HRESULT UserId([in] long UserId);
        [id(OABPCDETID_StorageId), propget] HRESULT StorageId([out, retval] long *StorageId);
        [id(OABPCDETID_StorageId), propput] HRESULT StorageId([in] long StorageId);
        [id(OABPCDETID_Title), propget] HRESULT Title([out, retval] BSTR *Title);
        [id(OABPCDETID_Title), propput] HRESULT Title([in] BSTR Title);
        [id(OABPCDETID_Rating), propget] HRESULT Rating([out, retval] long *Rating);
        [id(OABPCDETID_Rating), propput] HRESULT Rating([in] long Rating);
        [id(OABPCDETID_Year), propget] HRESULT Year([out, retval] BSTR *Year);
        [id(OABPCDETID_Year), propput] HRESULT Year([in] BSTR Year);
        [id(OABPCDETID_Description), propget] HRESULT Description([out, retval] BSTR *Description);
        [id(OABPCDETID_Description), propput] HRESULT Description([in] BSTR Description);
        [id(OABPCDETID_ViewCost), propget] HRESULT ViewCost([out, retval] CURRENCY *ViewCost);
        [id(OABPCDETID_ViewCost), propput] HRESULT ViewCost([in] CURRENCY ViewCost);
        [id(OABPCDETID_TapeCost), propget] HRESULT TapeCost([out, retval] CURRENCY *TapeCost);
        [id(OABPCDETID_TapeCost), propput] HRESULT TapeCost([in] CURRENCY TapeCost);
        [id(OABPCDETID_Action), propget] HRESULT Action([out, retval] long *Action);
        [id(OABPCDETID_Action), propput] HRESULT Action([in] long Action);
        [id(OABPCDETID_Status), propget] HRESULT Status([out, retval] long *Status);
        [id(OABPCDETID_Status), propput] HRESULT Status([in] long Status);
        [id(OABPCDETID_Reason), propget] HRESULT Reason([out, retval] long *Reason);
        [id(OABPCDETID_Reason), propput] HRESULT Reason([in] long Reason);
        [id(OABPCDETID_ReasonDesc), propget] HRESULT ReasonDesc([out, retval] BSTR *ReasonDesc);
        [id(OABPCDETID_ReasonDesc), propput] HRESULT ReasonDesc([in] BSTR ReasonDesc);
        [id(OABPCDETID_ProviderBuffer), propget] HRESULT ProviderBuffer([out, retval] BSTR *Buffer);
    };

    //  Class information for CBPCPurchase

    [ uuid(329301E1-D0CA-11CF-A19E-00AA00A286A1) ]
    coclass BPCPurchase
    {
            [default] interface IBPCPurchase;
    };

    [ uuid(C043CF80-6D5D-11d0-ABCA-00AA00B5092C),
      oleautomation, dual, hidden
    ]
    interface IBPCMessage : IDispatch
    {
        [id(MSGID_Attributes), propget] HRESULT Attributes([out, retval] long *Attrs);
        [id(MSGID_Message), propget] HRESULT Msg([out, retval] BSTR *Text);
    };

    //  Class information for CExplicitOsd

    [ uuid(C043CF81-6D5D-11d0-ABCA-00AA00B5092C)]
    coclass BPCMessage
    {
            [default] interface IBPCMessage;
    };

    [ uuid(ff93ca20-d67f-11cf-a88f-444553540000),
      oleautomation, dual, hidden
    ]
    interface IBPCHistoryItemsCollection : IDispatch
    {
        [id(DISPID_NEWENUM), propget, restricted] HRESULT _NewEnum([out, retval] IUnknown **pCollection);
        [id(COLLECTID_Count), propget] HRESULT Count([out, retval] long *Count);
        [id(COLLECTID_Remove)] HRESULT Remove([in] VARIANT Index);
        [id(COLLECTID_Item)] HRESULT Item([in] VARIANT Index, [out, retval] IBPCPurchase **pItem);
    };

    //  Class information for CHistoryItemsCollection

    [ uuid(54F98D96-CA2E-11CF-B08E-00AA00B8C32E)]
    coclass BPCHistoryItemsCollection
    {
            [default] interface IBPCHistoryItemsCollection;
    };

    // provider "email" style stored notification message
    [ uuid(D9BEE320-C198-11d0-8D13-00AA00BD8339),
      oleautomation, dual, hidden
    ]
    interface IBPCEmailMessage : IDispatch
    {
        [id(EMSGID_MsgId), propget] HRESULT MsgId([out, retval] long *MsgId);
        [id(EMSGID_UserId), propget] HRESULT UserId([out, retval] long *UserId);
        [id(EMSGID_Read), propget] HRESULT IsRead([out, retval] boolean *HasBeenRead);
        [id(EMSGID_Received), propget] HRESULT Received([out, retval] DATE *Received);
        [id(EMSGID_Expires), propget] HRESULT Expires([out, retval] DATE *Expires);
        [id(EMSGID_Title), propget] HRESULT Title([out, retval] BSTR *Text);
        [id(EMSGID_Message), propget] HRESULT Msg([out, retval] BSTR *Text);
    };


    //  Primary dispatch interface for CEmailMessagesCollection

    [ uuid(f92f8500-d681-11cf-a88f-444553540000),
      oleautomation, dual, hidden
    ]
    interface IBPCEmailMessagesCollection : IDispatch
    {
        [id(DISPID_NEWENUM), propget, restricted] HRESULT _NewEnum([out, retval] IUnknown **pCollection);
        [id(COLLECTID_Count), propget] HRESULT Count([out, retval] long *Count);
        [id(COLLECTID_Item)] HRESULT Item([in] VARIANT Index, [out, retval] IBPCEmailMessage **pItem);
        [id(COLLECTID_Remove)] HRESULT Remove([in] VARIANT pMsg);
		[id(COLLECTID_MarkRead)] HRESULT MarkAsRead([in] IBPCEmailMessage *pMsg);
    };

    //  Class information for CEmailMessagesCollection

    [ uuid(C26AAD80-DDB3-11d0-8D13-00AA00BD8339) ]
    coclass BPCEmailMessageItem
    {
            [default] interface IBPCEmailMessage;
    };
    //  Class information for CEmailMessagesCollection

    [ uuid(54F98D98-CA2E-11CF-B08E-00AA00B8C32E) ]
    coclass BPCEmailMessagesCollection
    {
            [default] interface IBPCEmailMessagesCollection;
    };

    //  Primary dispatch interface for CDeviceBase

    interface IBPCDevices;
    [
        uuid(49224DE0-B30F-11cf-A88F-444553540000),
        dual, oleautomation, hidden,
        helpstring("MS BPC Video Server DeviceBase Dual Interface"),
    ]
    interface IBPCDeviceBase : IDispatch
    {
//NOTE:  all of the HWND parameters are defined as long since
// vb doesn't understand HWND and won't instatiate an object
// with any HWNDs in the interface
        // properties
        [propget, id(dispidName)] HRESULT Name([out, retval] BSTR *Name);
        [propget, id(dispidHasFilename)] HRESULT HasFilename([out, retval] boolean *HasFilename);
        [propget, id(dispidHasCA)] HRESULT HasCA([out, retval] boolean *HasCA);
        [propget, id(dispidIsInput)] HRESULT IsInput([out, retval] boolean *IsInput);
        [propget, id(dispidIsOutput)] HRESULT IsOutput([out, retval] boolean *IsOutput);
        [propget, id(dispidHasChannel)] HRESULT HasChannel([out, retval] boolean *HasChannel);
        [propget, id(dispidStatus)] HRESULT Status([out, retval] long *Status);
        [propget, id(dispidProdName)] HRESULT ProdName([out, retval] BSTR *ProdName);
        [propget, id(dispidDevFileName)] HRESULT FileName([out, retval] BSTR *FileName);
        [propput, id(dispidDevFileName)] HRESULT FileName([in] BSTR FileName);
        [propget, id(dispidChannel)] HRESULT Channel([out, retval] long *Channel);
        [propput, id(dispidChannel)] HRESULT Channel([in] long Channel);
        [propget, id(dispidDevImageSourceWidth)] HRESULT ImageSourceWidth([retval, out] long *x);
        [propget, id(dispidDevImageSourceHeight)] HRESULT ImageSourceHeight([retval, out] long *y);
        [propget, id(dispidDevCurrentState)] HRESULT CurrentState([out, retval] long *CurrentState);
        [propget, id(dispidDevCurrentPosition)] HRESULT CurrentPosition([retval, out] double *dPos);
        [propput, id(dispidDevCurrentPosition)] HRESULT CurrentPosition([in] double dPos);
        [propget, id(dispidDevDuration)] HRESULT Duration([retval, out] double *dPos);
        [propget, id(dispidDevPrerollTime)] HRESULT PrerollTime([retval, out] double *dPos);
        [propput, id(dispidDevPrerollTime)] HRESULT PrerollTime([in] double dPos);
        [propget, id(dispidDevRate)] HRESULT Rate([retval, out] double *dPos);
        [propput, id(dispidDevRate)] HRESULT Rate([in] double dPos);
        [propget, id(dispidDevCountryCode)] HRESULT CountryCode([retval, out] long *lcc);
        [propput, id(dispidDevCountryCode)] HRESULT CountryCode([in] long lcc);
        [propget, id(dispidDevVideoFrequency)] HRESULT VideoFrequency([retval, out] long *lcc);
        [propget, id(dispidDevAudioFrequency)] HRESULT AudioFrequency([retval, out] long *lcc);
        [propget, id(dispidDevDefaultVideoType)] HRESULT DefaultVideoType([retval, out] long *lcc);
        [propput, id(dispidDevDefaultVideoType)] HRESULT DefaultVideoType([in] long lcc);
        [propget, id(dispidDevDefaultAudioType)] HRESULT DefaultAudioType([retval, out] long *lcc);
        [propput, id(dispidDevDefaultAudioType)] HRESULT DefaultAudioType([in] long lcc);
        [propget, id(dispidDevVideoSubchannel)] HRESULT VideoSubchannel([retval, out] long *lcc);
        [propput, id(dispidDevVideoSubchannel)] HRESULT VideoSubchannel([in] long lcc);
        [propget, id(dispidDevAudioSubchannel)] HRESULT AudioSubchannel([retval, out] long *lcc);
        [propput, id(dispidDevAudioSubchannel)] HRESULT AudioSubchannel([in] long lcc);
        [propput, id(dispidDevVolume)] HRESULT Volume([in] long lVol);
        [propget, id(dispidDevVolume)] HRESULT Volume([retval, out] long *lVol);
        [propput, id(dispidDevBalance)] HRESULT Balance([in] long lBal);
        [propget, id(dispidDevBalance)] HRESULT Balance([retval, out] long *lBal);
        [propput, id(dispidDevPower)] HRESULT Power([in] boolean bPower);
        [propget, id(dispidDevPower)] HRESULT Power([retval, out] boolean *bPower);
#ifdef ENABLE_OVERSCAN
        [propput, id(dispidDevOverScan)] HRESULT OverScan([in] long lPercent);
        [propget, id(dispidDevOverScan)] HRESULT OverScan([retval, out] long *plPercent);
#endif
        [id(CASERVERID_ProviderRating), propget] HRESULT ProviderRating([out, retval] long* pRating);
        [id(CASERVERID_ProviderStatus), propget] HRESULT ProviderStatus([out, retval] boolean* pStatus);
        [id(CASERVERID_ProviderEPGMask), propget] HRESULT ProviderEPGMask([out, retval] long* pMask);
        [id(CASERVERID_HistoryItems), propget] HRESULT HistoryItems([out, retval] IBPCHistoryItemsCollection** ppHistoryItem);
        [id(CASERVERID_EmailMessages), propget] HRESULT EmailMessages([out, retval] IBPCEmailMessagesCollection** ppEmailMsg);
        [id(CASERVERID_UserName), propget] HRESULT UserName([out, retval] BSTR* pUserName);
        [id(CASERVERID_UserName), propput] HRESULT UserName([in] BSTR UserName);
        [id(CASERVERID_UserArea), propget] HRESULT UserArea([out, retval] BSTR* pUserArea);
        [id(CASERVERID_UserArea), propput] HRESULT UserArea([in] BSTR UserArea);
        [id(CASERVERID_ItemDetails), propget] HRESULT ItemDetails([in] long Priority, [in] IBPCPurchase *pInDetails, [out, retval] IBPCPurchase** ppOutDetails);


        //methods
        [id(dispidDevRun)] HRESULT Run();
        [id(dispidDevPause)] HRESULT Pause();
        [id(dispidDevStop)] HRESULT Stop();
        [id(dispidDevRefresh)] HRESULT Refresh();
        [id(dispidChannelAvailable)] HRESULT ChannelAvailable([in] long nChannel, [out] long *SignalStrength, [retval, out] boolean *fSignalPresent);


        [id(CASERVERID_ResetProviderSystem)] HRESULT ResetProviderSystem();
        [id(CASERVERID_BuyItem)] HRESULT BuyItem([in] long Priority, [in] IBPCPurchase *pInDetails, [out, retval] IBPCPurchase **ppOutDetails);
        [id(CASERVERID_CancelItem)] HRESULT CancelItem([in] IBPCPurchase *pInDetails, [out, retval] IBPCPurchase **ppOutDetails);
        [id(CASERVERID_DisplayConfigDialog)] HRESULT DisplayConfigDialog();
        [id(CASERVERID_HandleCardChaining)] HRESULT HandleCardChaining([in] boolean fOK);

    };

//NOTE: IBPCDeviceEvent methods should match the non-stock events
// in DBPCVidEvents
// NOTE: this interface must match the midl version above the
// library statement or the marshalling won't work right.
    [uuid(F4B33700-BD9B-11cf-A88F-444553540000),
         hidden, oleautomation, dual,
         helpstring("Private Interface for Device Events between vidsvr and ocx")
    ]
    interface IBPCDeviceEvent : IDispatch
    {
        [id(eventidGotControl)]     HRESULT GotControl();
        [id(eventidLostControl)]    HRESULT LostControl();
        [id(eventidStateChange)]    HRESULT StateChange([in] IBPCDeviceBase *lpd, [in] long oldState, [in] long newState);
        [id(eventidErrorMessage)]   HRESULT ErrorMessage([in] long iMessage, [in] BSTR Text);
        // MESSAGE EVENTS
        [id(CAEVENTID_CardMissing)]         HRESULT CardMissing([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_CardInvalid)]         HRESULT CardInvalid([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_WrongCard)]           HRESULT WrongCard([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_BlackedOut)]          HRESULT BlackedOut([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_RatingExceeded)]      HRESULT RatingExceeded([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_CostExceeded)]        HRESULT CostExceeded([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_OSDRequest)]          HRESULT OSDRequest([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_NoSubscriber)]        HRESULT NoSubscriber([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_CAFail)]              HRESULT CAFail([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_CannotPurchase)]      HRESULT CannotPurchase([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_CASuccess)]           HRESULT CASuccess([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        [id(CAEVENTID_Retry)]               HRESULT Retry([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message);
        // NOTIFICATION EVENTS
        [id(CAEVENTID_SignalLost)]          HRESULT SignalLost([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_NewEmail)]            HRESULT NewEmail([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_ColdStart)]           HRESULT ColdStart([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_Ready)]               HRESULT Ready([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_NotReady)]            HRESULT NotReady([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_CAFault)]             HRESULT CAFault([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_PasswordCleared)]     HRESULT PasswordCleared([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_TuningChanged)]       HRESULT TuningChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        // SPECIAL EVENT
        [id(CAEVENTID_HandlePurchaseOffer)] HRESULT HandlePurchaseOffer([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCPurchase *pDetails);
        [id(CAEVENTID_RevokeEvent)]         HRESULT RevokeEvent([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_CopyCard)]            HRESULT CopyCard([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_EPGFilterChanged)]    HRESULT EPGFilterChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
        [id(CAEVENTID_TapingControlChanged)]    HRESULT TapingControlChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);

    };

    [uuid(E323F120-B484-11cf-A88F-444553540000),
            dual, oleautomation, hidden,
            helpstring("Dispatch Dual Interface for Devices Collection"),
    ]
    interface IBPCDevices : IDispatch
    {
            // properties
            [propget, id(dispidCount)] HRESULT Count([out, retval] long *lCount);
            [propget, id(DISPID_NEWENUM), restricted] HRESULT _NewEnum([out, retval] IUnknown **pD);
            [propput, id(dispidHWnd)] HRESULT HWnd([in] long hwnd);
            [propput, id(dispidLCID)] HRESULT LCID([in] long lcid);
            [propput, id(dispidNotify)] HRESULT Notify([in] IBPCDeviceEvent *pDeviceEvents);
            [propget, id(dispidDevColorKey)] HRESULT ColorKey([retval, out] long *lcc);
            [propput, id(dispidDevColorKey)] HRESULT ColorKey([in] long lcc);
            [propget, id(dispidDevPriority)] HRESULT Priority([retval, out] long *lcc);
            [propput, id(dispidDevPriority)] HRESULT Priority([in] long lcc);
            [propget, id(dispidDevInput)] HRESULT Input([retval, out] IBPCDeviceBase **ppInput);
            [propput, id(dispidDevInput)] HRESULT Input([in] IBPCDeviceBase *pInput);
            [propget, id(dispidDevOutput)] HRESULT Output([retval, out] IBPCDeviceBase **ppOutput);
            [propput, id(dispidDevOutput)] HRESULT Output([in] IBPCDeviceBase *pOutput);
            [propget, id(dispidDevVideoOn)] HRESULT VideoOn([out, retval] boolean *VideoOn);
            [propput, id(dispidDevVideoOn)] HRESULT VideoOn([in] boolean VideoOn);

            // methods
            [id(dispidItem)] HRESULT Item([in] VARIANT v, [out, retval] IBPCDeviceBase **pDB);
            [id(dispidDevTune)] HRESULT Tune([in] long lTuningSpace, [in] long Channel, [in] long VideoSubchannel, [in] long AudioSubchannel);
            [id(dispidDevLogin)] HRESULT Login([in] BSTR UserName, [in] BSTR Password);
            [id(dispidDevLogout)] HRESULT Logout();
            [id(dispidDevOpen)] HRESULT Open([in] BSTR FileName);
            [id(dispidDevTSDevCount)] HRESULT TSDeviceCount([in] long lTuningSpace, [out, retval] long *count);
            [id(dispidDevAutoScan)] HRESULT AutoScan([retval, out] long *SignalStrength);
    };

    [ uuid(8AFAFD81-31C3-11CF-A1E9-00AA0062C797),
      helpstring("Dispatch interface for Vid Control"), hidden,
      oleautomation, dual
    ]
    interface IBPCVid : IDispatch
    {
        // properties
        [id(dispidPower), propget] HRESULT Power([retval, out] boolean *Power);
        [id(dispidPower), propput] HRESULT Power([in] boolean Power);
        [id(dispidStartTime), propget] HRESULT StartTime([retval, out] double *StartTime);
        [id(dispidStartTime), propput] HRESULT StartTime([in] double StartTime);
        [id(dispidStopTime), propget] HRESULT StopTime([retval, out] double *StopTime);
        [id(dispidStopTime), propput] HRESULT StopTime([in] double StopTime);
        [id(dispidVideoOn), propget] HRESULT VideoOn([out, retval] boolean *VideoOn);
        [id(dispidVideoOn), propput] HRESULT VideoOn([in] boolean VideoOn);
        [id(dispidClosedCaption), propget] HRESULT ClosedCaption([out, retval] boolean *ClosedCaption);
        [id(dispidClosedCaption), propput] HRESULT ClosedCaption([in] boolean ClosedCaption);
        [id(dispidDebug), helpstring("Information/Diagnostic display in the OCX window"), propget] HRESULT Debug([out, retval] boolean *Debug);
        [id(dispidDebug), helpstring("Information/Diagnostic display in the OCX window"), propput] HRESULT Debug([in] boolean Debug);
        [id(dispidDeviceCount), propget] HRESULT DeviceCount([out, retval] long *DeviceCount);
        [id(dispidInput), propget] HRESULT Input([out, retval] IBPCDeviceBase** Input);
        [id(dispidInput), propput] HRESULT Input([in] IBPCDeviceBase* Input);
        [id(dispidOutput), propget] HRESULT Output([out, retval] IBPCDeviceBase** Output);
        [id(dispidOutput), propput] HRESULT Output([in] IBPCDeviceBase* Output);

        [id(dispidColorKey), propget] HRESULT ColorKey([out, retval] long *ColorKey);
        [id(dispidColorKey), propput] HRESULT ColorKey([in] long ColorKey);
        [id(dispidFileName), propget] HRESULT FileName([out, retval] BSTR *FileName);
        [id(dispidFileName), propput] HRESULT FileName([in] BSTR FileName);
        [id(dispidPriority), propget] HRESULT Priority([out, retval] long *Priority);
        [id(dispidPriority), propput] HRESULT Priority([in] long Priority);
        [id(dispidVolume), propget] HRESULT Volume([out, retval] long *Volume);
        [id(dispidVolume), propput] HRESULT Volume([in] long Volume);
        [id(dispidBalance), propget] HRESULT Balance([out, retval] long *Balance);
        [id(dispidBalance), propput] HRESULT Balance([in] long Balance);
        [id(dispidImageSourceHeight), propget] HRESULT ImageSourceHeight([out, retval] long *ImageSourceHeight);
        [id(dispidImageSourceWidth), propget] HRESULT ImageSourceWidth([out, retval] long *ImageSourceWidth);
        [id(dispidMovieWindowSetting), propget] HRESULT MovieWindowSetting([out, retval] short *MovieWindowSetting);
        [id(dispidMovieWindowSetting), propput] HRESULT MovieWindowSetting([in] short MovieWindowSetting);
        [id(dispidCurrentState), propget] HRESULT CurrentState([out, retval] long *CurrentState);
        [id(dispidCurrentPosition), propget] HRESULT CurrentPosition([out, retval] double *CurrentPosition);
        [id(dispidCurrentPosition), propput] HRESULT CurrentPosition([in] double CurrentPosition);
        [id(dispidDuration), propget] HRESULT Duration([out, retval] double *Duration);
        [id(dispidPrerollTime), propget] HRESULT PrerollTime([out, retval] double *PrerollTime);
        [id(dispidPrerollTime), propput] HRESULT PrerollTime([in] double PrerollTime);
        [id(dispidRate), propget] HRESULT Rate([out, retval] double *Rate);
        [id(dispidRate), propput] HRESULT Rate([in] double Rate);
        [id(dispidLocaleID), propget] HRESULT LocaleID([out, retval] long *LocaleID);
        [id(dispidLocaleID), propput] HRESULT LocaleID([in] long LocaleID);
        [id(DISPID_FONT), bindable, propget] HRESULT Font([out, retval] IFontDisp** Font);
        [id(DISPID_FONT), bindable, propput] HRESULT Font([in] IFontDisp* Font);
        [id(dispidDisplayMode), propget] HRESULT DisplayMode([out, retval] short *DisplayMode);
        [id(dispidDisplayMode), propput] HRESULT DisplayMode([in] short DisplayMode);
        [id(DISPID_HWND), propget] HRESULT HWnd([out, retval] OLE_HANDLE *HWnd);
        [id(dispidDevices), propget, helpstring("All the devices available for use")] HRESULT Devices([out, retval] IBPCDevices **DeviceEnumerator);

        // methods
        [id(dispidRun)] HRESULT Run();
        [id(dispidPause)] HRESULT Pause();
        [id(dispidStop)] HRESULT Stop();
        [id(dispidClose)] HRESULT Close();
        [id(dispidOpen)] HRESULT Open([in] BSTR FileName);
        [id(dispidLogin)] HRESULT Login([in] BSTR UserName, [in] BSTR Password);
        [id(dispidLogout)] HRESULT Logout();
        [id(dispidTune)] HRESULT Tune([in] long lTuningSpace, [in] long Channel, [in] long VideoSubchannel, [in] long AudioSubchannel);
        [id(dispidTSDevCount)] HRESULT TSDeviceCount([in] long lTuningSpace, [out, retval] long *count);
        [id(DISPID_REFRESH)] HRESULT Refresh();
        [id(dispidAutoScan)] HRESULT AutoScan([retval, out] long *SignalStrength);

        [id(DISPID_ABOUTBOX)] HRESULT AboutBox();
    };

    //  Event dispatch interface for CVidCtrl

// NOTE: the non stock methods should match IBPCDeviceEvent
    [ uuid(8AFAFD82-31C3-11CF-A1E9-00AA0062C797),
      helpstring("Event interface for Vid Control") ]
    dispinterface DBPCVidEvents
    {
        properties:
                //  Event interface has no properties

        methods:
            // NOTE - ClassWizard will maintain event information here.
            //    Use extreme caution when editing this section.
            [id(eventidGotControl)]     void GotControl();
            [id(eventidLostControl)]    void LostControl();
            [id(eventidStateChange)]    void StateChange(IBPCDeviceBase *lpdDevice, long oldState, long newState);
            [id(eventidErrorMessage)]   void ErrorMessage(long iMessage, BSTR Text);
            [id(DISPID_CLICK)] void Click();
            [id(DISPID_DBLCLICK)] void DblClick();
            [id(DISPID_KEYDOWN)] void KeyDown(short* KeyCode, short Shift);
            [id(DISPID_KEYPRESS)] void KeyPress(short* KeyAscii);
            [id(DISPID_KEYUP)] void KeyUp(short* KeyCode, short Shift);
            [id(DISPID_MOUSEDOWN)] void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
            [id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
            [id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
            [id(DISPID_ERROREVENT)] void Error(short Number, BSTR* Description, long Scode, BSTR Source, BSTR HelpFile, long HelpContext, boolean* CancelDisplay);

            // MESSAGE EVENTS
            [id(CAEVENTID_CardMissing)]         void CardMissing([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_CardInvalid)]         void CardInvalid([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_WrongCard)]           void WrongCard([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_BlackedOut)]          void BlackedOut([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_RatingExceeded)]      void RatingExceeded([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_CostExceeded)]        void CostExceeded([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_OSDRequest)]          void OSDRequest([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_NoSubscriber)]        void NoSubscriber([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_CAFail)]              void CAFail([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_CannotPurchase)]      void CannotPurchase([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_CASuccess)]           void CASuccess([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            [id(CAEVENTID_Retry)]               void Retry([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCMessage *Message, [out] long *HresultRC);
            // NOTIFICATION EVENTS
            [id(CAEVENTID_SignalLost)]          void SignalLost([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_NewEmail)]            void NewEmail([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_ColdStart)]           void ColdStart([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_Ready)]               void Ready([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_NotReady)]            void NotReady([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_CAFault)]             void CAFault([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_PasswordCleared)]     void PasswordCleared([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_TuningChanged)]       void TuningChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            // SPECIAL EVENT
            [id(CAEVENTID_HandlePurchaseOffer)] void HandlePurchaseOffer([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [in] IBPCPurchase *pDetails, [out] long *HresultRC);
            [id(CAEVENTID_RevokeEvent)]         void RevokeEvent([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_CopyCard)]            void CopyCard([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority, [out] long *HresultRC);
            [id(CAEVENTID_EPGFilterChanged)]    void EPGFilterChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
            [id(CAEVENTID_TapingControlChanged)]    void TapingControlChanged([in] IBPCDeviceBase *lpdDevice, [in] long SubEvent, [in] long EventNumber, [in] long ItemNumber, [in] long Priority);
    };

    //  Class information for CVidCtrl

    [ uuid(31263EC0-2957-11CF-A1E5-00AA9EC79700),
      helpstring("MS BPC Video Control"), control ]
    coclass BPCVid
    {
            [default] interface IBPCVid;
            [default, source] dispinterface DBPCVidEvents;
    };

    //  Class information for CDeviceBase


    [ uuid(833DE722-31D5-11CF-A1E9-00AA0062C797),
      helpstring("MS BPC Video Server Device Class") ]
    coclass BPCDeviceBase
    {
        [default] interface IBPCDeviceBase;
    };

    [ uuid(E323F121-B484-11cf-A88F-444553540000),
      helpstring("MS BPC Video Server Device Collection Class") ]
    coclass BPCDevices
    {
        [default] interface IBPCDevices;
        [source] interface IBPCDeviceEvent;
    };

#if 0
    [ uuid(EE50972F-1E8C-11d1-B6AD-00C04FBBDE6E),
      oleautomation, dual
    ]
    interface IBPCVidsvrControl : IDispatch
    {
		// NOTE: all operations on this interface must be atomic since we have no event
		// mechanism in this interface for returning gotcontrol/lostcontrol
		// methods
        [id(VCTL_VBITune)] HRESULT VBITune([in] long lTuningSpace, [in] long channel, [in] long priority);
        [id(VCTL_VBIStatus)] HRESULT VBIStatus([in] long lTuningSpace, [in] long channel, [in] long priority, [out] long *SignalStrength, [retval, out] boolean *fSignalPresent);
    };

    [ uuid(EE50972E-1E8C-11d1-B6AD-00C04FBBDE6E),
      helpstring("MS BPC Video Server Control Class") ]
    coclass BPCVidsvrControl
    {
        [default] interface IBPCVidsvrControl;
    };
		
#endif

    [ uuid(887072E6-45D6-11d1-B6B0-00C04FBBDE6E),
      oleautomation, dual
    ]
	interface IBPCSuspend : IDispatch {
		// priority reserved, set to 0
        [id(SUSPEND_DeviceRelease)] HRESULT DeviceRelease([in] long priority, [out] IDispatch **ppS);
	};

    [ uuid(887072E7-45D6-11d1-B6B0-00C04FBBDE6E),
      helpstring("MS BPC Video Server Suspendor Class") ]
    coclass BPCSuspend
    {
        [default] interface IBPCSuspend;
    };

    [ uuid(887072E8-45D6-11d1-B6B0-00C04FBBDE6E),
      helpstring("MS BPC Video Server Suspended Class") ]
    coclass BPCSuspended
    {
        [default] interface IDispatch;
    };

};


