home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Players / JukeboxASF / JukeboxASFDlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-09  |  5.0 KB  |  165 lines

  1. //------------------------------------------------------------------------------
  2. // File: JukeboxASFDlg.h
  3. //
  4. // Desc: DirectShow sample code - main dialog header file for the Jukebox
  5. //       application.
  6. //
  7. // Copyright (c) 1998-2001 Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10. #if !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  11. #define AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_
  12.  
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16.  
  17. #include <dshow.h>
  18. #include "keyprovider.h"
  19.  
  20. //
  21. // Constants
  22. //
  23. const int TICKLEN=100, TIMERID=55;
  24.  
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CJukeboxDlg dialog
  28.  
  29. class CJukeboxDlg : public CDialog
  30. {
  31. // Construction
  32. public:
  33.     CJukeboxDlg(CWnd* pParent = NULL);    // standard constructor
  34.     void FillFileList(LPTSTR pszCmdLine);
  35.  
  36.     HRESULT PrepareMedia(LPTSTR lpszMovie);
  37.     BOOL DisplayFileInfo(LPTSTR szFile);
  38.     HRESULT DisplayFileDuration(void);
  39.     BOOL DisplayImageInfo(void);
  40.     void Say(LPTSTR szText);
  41.     BOOL IsWindowsMediaFile(LPTSTR lpszFile);
  42.  
  43.     LONG GetDXMediaPath(TCHAR *strPath);
  44.     LONG GetGraphEditPath(TCHAR *szPath);
  45.     void InitMediaDirectory(void);
  46.  
  47.     HRESULT RenderWMFile(LPCWSTR wFile);
  48.     HRESULT CreateFilter(REFCLSID clsid, IBaseFilter **ppFilter);
  49.     HRESULT AddKeyProvider(IGraphBuilder *pGraph);
  50.     HRESULT RenderOutputPins(IGraphBuilder *pGB, IBaseFilter *pReader);
  51.  
  52.     HRESULT InitDirectShow(void);
  53.     HRESULT FreeDirectShow(void);
  54.     HRESULT HandleGraphEvent(void);
  55.  
  56.     void ResetDirectShow(void);
  57.     void DisplayECEvent(long lEventCode, long lParam1, long lParam2);
  58.     void CenterVideo(void);
  59.     void PlayNextFile(void);
  60.     void PlayPreviousFile(void);
  61.     void PlaySelectedFile(void);
  62.     void ShowState(void);
  63.     void ConfigureSeekbar(void);
  64.     void StartSeekTimer(void);
  65.     void StopSeekTimer(void);
  66.     void HandleTrackbar(WPARAM wReq);
  67.     void UpdatePosition(REFERENCE_TIME rtNow);
  68.     void ReadMediaPosition(void);
  69.  
  70.     BOOL CanStep(void);
  71.     HRESULT StepFrame(void);
  72.     HRESULT EnumFilters(void);
  73.     HRESULT EnumPins(IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
  74.     IBaseFilter * FindFilterFromName(LPTSTR szName);
  75.     BOOL SupportsPropertyPage(IBaseFilter *pFilter);
  76.  
  77.     void CALLBACK MediaTimer(UINT wTimerID, UINT msg, ULONG dwUser, ULONG dw1, ULONG dw2);
  78.  
  79.     // Dialog Data
  80.     //{{AFX_DATA(CJukeboxDlg)
  81.     enum { IDD = IDD_JUKEBOX_DIALOG };
  82.     CStatic    m_StrPosition;
  83.     CSliderCtrl    m_Seekbar;
  84.     CStatic    m_StrImageSize;
  85.     CStatic    m_StrDuration;
  86.     CEdit    m_EditMediaDir;
  87.     CSpinButtonCtrl    m_SpinFiles;
  88.     CButton    m_ButtonFrameStep;
  89.     CListBox    m_ListEvents;
  90.     CButton    m_CheckEvents;
  91.     CButton    m_ButtonProperties;
  92.     CStatic    m_StrMediaPath;
  93.     CButton    m_CheckMute;
  94.     CButton    m_ButtonStop;
  95.     CButton    m_ButtonPlay;
  96.     CButton    m_ButtonPause;
  97.     CButton    m_CheckPlaythrough;
  98.     CButton    m_CheckLoop;
  99.     CStatic    m_StrFileDate;
  100.     CStatic    m_StrFileSize;
  101.     CListBox    m_ListPinsOutput;
  102.     CListBox    m_ListPinsInput;
  103.     CStatic    m_StrFileList;
  104.     CStatic    m_Status;
  105.     CStatic    m_Screen;
  106.     CListBox    m_ListInfo;
  107.     CListBox    m_ListFilters;
  108.     CListBox    m_ListFiles;
  109.     //}}AFX_DATA
  110.  
  111.     // ClassWizard generated virtual function overrides
  112.     //{{AFX_VIRTUAL(CJukeboxDlg)
  113.     protected:
  114.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  115.     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  116.     //}}AFX_VIRTUAL
  117.  
  118. // Implementation
  119. protected:
  120.     HICON m_hIcon;
  121.     int   m_nCurrentFileSelection;
  122.     REFERENCE_TIME g_rtTotalTime;
  123.     UINT_PTR g_wTimerID;
  124.     TCHAR m_szCurrentDir[MAX_PATH];
  125.  
  126.     // Global key provider object created/released during the
  127.     // Windows Media graph-building stage.
  128.     CKeyProvider prov;
  129.  
  130.     // Generated message map functions
  131.     //{{AFX_MSG(CJukeboxDlg)
  132.     virtual BOOL OnInitDialog();
  133.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  134.     afx_msg void OnPaint();
  135.     afx_msg HCURSOR OnQueryDragIcon();
  136.     afx_msg void OnClose();
  137.     afx_msg void OnSelectFile();
  138.     afx_msg void OnPause();
  139.     afx_msg void OnPlay();
  140.     afx_msg void OnStop();
  141.     afx_msg void OnCheckMute();
  142.     afx_msg void OnCheckLoop();
  143.     afx_msg void OnCheckPlaythrough();
  144.     afx_msg void OnSelchangeListFilters();
  145.     afx_msg void OnDblclkListFilters();
  146.     afx_msg void OnButtonProppage();
  147.     afx_msg void OnCheckEvents();
  148.     afx_msg void OnButtonFramestep();
  149.     afx_msg void OnButtonClearEvents();
  150.     afx_msg void OnDblclkListFiles();
  151.     afx_msg void OnDeltaposSpinFiles(NMHDR* pNMHDR, LRESULT* pResult);
  152.     afx_msg void OnButtonSetMediadir();
  153.     afx_msg void OnTimer(UINT nIDEvent);
  154.     afx_msg void OnButtonGraphedit();
  155.     afx_msg void OnDestroy();
  156.     afx_msg BOOL OnEraseBkgnd(CDC *);
  157.     //}}AFX_MSG
  158.     DECLARE_MESSAGE_MAP()
  159. };
  160.  
  161. //{{AFX_INSERT_LOCATION}}
  162. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  163.  
  164. #endif // !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  165.