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

📄 cfiltermpeg2vdprop.cpp

📁 DIRECTSHOW 开发指南电子书
💻 CPP
字号:
//
// CFilterMpeg2VDProp.cpp
//

#include <streams.h>

// Eliminate two expected level 4 warnings from the Microsoft compiler.
// The class does not have an assignment or copy operator, and so cannot
// be passed by value.  This is normal.  This file compiles clean at the
// highest (most picky) warning level (-W4).
#pragma warning(disable: 4511 4512)

#include <windowsx.h>
#include <commctrl.h>
#include <olectl.h>
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <tchar.h>

#include "Resource.h"            // ids used in the dialog
#include "CFilterMpeg2VDProp.h"    // our own class

//
// CreateInstance
//
// Override CClassFactory method.
// Set lpUnk to point to an IUnknown interface on a new NullIPProperties object
// Part of the COM object instantiation mechanism
//
CUnknown * WINAPI CFilterMpeg2VDProp::CreateInstance(LPUNKNOWN lpunk, HRESULT *phr)
{
    CUnknown *punk = new CFilterMpeg2VDProp(lpunk, phr);
    if (punk == NULL) 
	{
        *phr = E_OUTOFMEMORY;
    }
    return punk;
}

// Constructs and initialises a object
CFilterMpeg2VDProp::CFilterMpeg2VDProp(LPUNKNOWN pUnk, HRESULT *phr)
    : CBasePropertyPage(NAME("Mpeg2 Video Decoder Property Page"),pUnk,
        IDD_FILTER_Mpeg2, IDS_INFO)
{
	ASSERT(phr);
} // CGraphInfoProp


// Override CBasePropertyPage method.
// Handles the messages for our property window
BOOL CFilterMpeg2VDProp::OnReceiveMessage(HWND hwnd,
                                        UINT uMsg,
                                        WPARAM wParam,
                                        LPARAM lParam)
{
    switch (uMsg)
    {
        case WM_INITDIALOG:
        {
			// Get windows' handles
		//	m_hComboFilter    = GetDlgItem(hwnd, IDC_COMBO_FILTER);
            break;
        }

        case WM_COMMAND:
        {
	/*		switch (HIWORD(wParam))
			{
			case CBN_SELCHANGE:  // Combo box selected change
				{
					if ((HWND) lParam == m_hComboFilter)
					{
						ReflectFilterChange();
					}
					else if ((HWND) lParam == m_hComboPin)
					{
						ReflectPinChange();
					}
					else if ((HWND) lParam == m_hComboMediaType)
					{
						ReflectMediaTypeChange();
					}
					break;
				}
			};*/
			SetDirty();
            break;
        }

    }
    return CBasePropertyPage::OnReceiveMessage(hwnd,uMsg,wParam,lParam);

} // OnReceiveMessage


// Override CBasePropertyPage method.
// Notification of which object this property page should display.
// We query the object for the IFltTrace interface.
HRESULT CFilterMpeg2VDProp::OnConnect(IUnknown *pUnknown)
{
/*	HRESULT hr = pUnknown->QueryInterface(IID_IGraphInfo, (void **) &m_pIGraphInfo);
    if (FAILED(hr))
    {
        return E_NOINTERFACE;
    }

    ASSERT(m_pIGraphInfo);
	m_pIGraphInfo->get_FilterGraph(&m_pGraph);*/
    
	return NOERROR;
} // OnConnect


// Override CBasePropertyPage method.
// Release the private interface, release the upstream pin.
HRESULT CFilterMpeg2VDProp::OnDisconnect()
{
/*	// Release of Interface
	if (m_pIGraphInfo == NULL)
        return E_UNEXPECTED;
    m_pIGraphInfo->Release();
    m_pIGraphInfo = NULL;
*/
    return NOERROR;
} // OnDisconnect


// We are being activated
HRESULT CFilterMpeg2VDProp::OnActivate()
{
/*	FillFilterComboBox();
	// The first time to enter this property page
	if (m_nFilterIndex == -1) 
	{
		m_nFilterIndex = SendMessage(m_hComboFilter, CB_GETCURSEL, 0, 0);
	}
	else
	{
		if (m_nFilterIndex < SendMessage(m_hComboFilter, CB_GETCOUNT, 0, 0))
		{
			SendMessage(m_hComboFilter, CB_SETCURSEL, (WPARAM) m_nFilterIndex, 0);
		}
	}
	ReflectFilterChange();*/

    return NOERROR;
} // Activate


// Changes made should be kept
HRESULT CFilterMpeg2VDProp::OnApplyChanges()
{
    return NOERROR;
} // OnApplyChanges

//
// Sets m_hrDirtyFlag and notifies the property page site of the change
void CFilterMpeg2VDProp::SetDirty()
{
    m_bDirty = TRUE;
    if (m_pPageSite)
    {
        m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
    }
} // SetDirty

⌨️ 快捷键说明

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