PropsOggMux.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "PropsOggMux.h"
00003 
00004 PropsOggMux::PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR)
00005         :       CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_OGG_MUX_SETTINGS, IDS_OGG_MUX_PROPS_STRING)
00006         ,       mOggMuxSettings(NULL)
00007 
00008 {
00009         //debugLog.open("G:\\logs\\TheoProps.log", ios_base::out);
00010         *outHR = S_OK;
00011 }
00012 
00013 PropsOggMux::~PropsOggMux(void)
00014 {
00015         //debugLog.close();
00016 }
00017 
00018 CUnknown* PropsOggMux::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
00019 {
00020     return new PropsOggMux(inUnk, outHR);
00021 }
00022 
00023 
00024 HRESULT PropsOggMux::OnApplyChanges(void)
00025 {
00026         if (mOggMuxSettings == NULL) {
00027                 return E_POINTER;
00028         }
00029 
00030         mOggMuxSettings->setMaxPacketsPerPage(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED));
00031         SetClean();
00032     return S_OK;
00033 }
00034 
00035 HRESULT PropsOggMux::OnActivate(void)
00036 {
00037     char* locStrBuff = new char[16];
00038 
00039         //SetupBitrateCombo();
00040         //SetupKeyframeFreqCombo();
00041         
00042         //Set up the sliders
00043     SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETRANGE, TRUE, MAKELONG(0, 64));
00044     SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETTICFREQ, 1, 0);
00045         SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETPOS, 1, mOggMuxSettings->maxPacketsPerPage());
00046 
00047         itoa(mOggMuxSettings->maxPacketsPerPage(), locStrBuff, 10);
00048         SendDlgItemMessage(m_Dlg, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)locStrBuff);
00049 
00050         delete[] locStrBuff;
00051     return S_OK;
00052 }
00053 
00054 HRESULT PropsOggMux::OnConnect(IUnknown *pUnk)
00055 {
00056     
00057         if (mOggMuxSettings != NULL) {
00058                 //mOggMuxSettings->Release();
00059                 mOggMuxSettings = NULL;
00060         }
00061 
00062     HRESULT locHR;
00063     // Query pUnk for the filter's custom interface.
00064     locHR = pUnk->QueryInterface(IID_IOggMuxSettings, (void**)(&mOggMuxSettings));
00065     return locHR;
00066 }
00067 
00068 HRESULT PropsOggMux::OnDisconnect(void)
00069 {
00070         if (mOggMuxSettings != NULL) {
00071                 //mTheoraEncodeSettings->Release();
00072                 mOggMuxSettings = NULL;
00073         }
00074     return S_OK;
00075 }
00076 void PropsOggMux::SetDirty()
00077 {
00078     m_bDirty = TRUE;
00079     if (m_pPageSite)
00080     {
00081         m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
00082     }
00083 }
00084 
00085 void PropsOggMux::SetClean()
00086 {
00087     m_bDirty = FALSE;
00088     if (m_pPageSite)
00089     {
00090         m_pPageSite->OnStatusChange(PROPPAGESTATUS_CLEAN);
00091     }
00092 }
00093 INT_PTR PropsOggMux::OnReceiveMessage(HWND hwnd,  UINT uMsg, WPARAM wParam, LPARAM lParam)
00094 {
00095         char locBuff[16];
00096     switch (uMsg)    {
00097                 case WM_COMMAND:
00098                 
00099                 case WM_HSCROLL:
00100                         if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_MAX_PACKETS_PER_PAGE)) {
00101                                 SetDirty();
00102                                 itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED), (char*)&locBuff, 10);
00103                                 SendDlgItemMessage(m_hwnd, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
00104                  return (INT_PTR)TRUE;
00105                         }
00106 
00107                         break;
00108         } // switch
00109 
00110     // Did not handle the message.
00111     return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
00112 }

Generated on Thu Feb 16 23:48:15 2006 for oggdsf by  doxygen 1.3.9