home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Shareware / Programare / skincraft / SkinCrafter_v1.4.12_Demo.msi / _49E29CB9A65AABBF653C1037E1AA74B6 / _51DA16AA9F2F48258B2D26AB94CE1EB6 < prev    next >
Encoding:
Text File  |  2004-03-06  |  2.9 KB  |  127 lines

  1. // PlayerView.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SCPlayer.h"
  6. #include "PlayerView.h"
  7. #include "atlconv.h"
  8.  
  9. #pragma comment(lib, "strmiids.lib")
  10.  
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CPlayerView
  19.  
  20. /////////////////////////////////////////////////////////////////////////
  21.  
  22. CPlayerView::CPlayerView()
  23. {
  24. }
  25.  
  26. CPlayerView::~CPlayerView()
  27. {
  28. //    MCIWndDestroy(m_hPlayerWnd);
  29. }
  30.  
  31.  
  32. BEGIN_MESSAGE_MAP(CPlayerView, CStatic)
  33.     //{{AFX_MSG_MAP(CPlayerView)
  34.     ON_WM_PAINT()
  35.     //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CPlayerView message handlers
  40.  
  41. LRESULT CPlayerView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
  42. {
  43. /*    switch(message) {
  44.     case WM_PAINT:
  45.         break;
  46.     case :
  47.         break;
  48.     default:
  49.     }*/
  50.     
  51.     return CStatic::WindowProc(message, wParam, lParam);
  52. }
  53.  
  54. void CPlayerView::InitMCI()
  55. {
  56. //    m_hPlayerWnd = MCIWndCreate(this->m_hWnd,AfxGetInstanceHandle(),
  57.         //WS_CHILD | WS_VISIBLE| MCIWNDF_NOMENU| MCIWNDF_NOTIFYALL| MCIWNDF_NOPLAYBAR,
  58.         ///*filename*/NULL);
  59.     //MCIWndSetTimeFormat(m_hPlayerWnd,"ms");
  60. //    MCIWndSetActiveTimer(m_hPlayerWnd,100);
  61.     //m_nVolume = MCIWndGetVolume(m_hPlayerWnd);
  62. }
  63.  
  64. void CPlayerView::OnPaint() 
  65. {
  66.     CPaintDC dc(this); // device context for painting
  67.     
  68. }
  69.  
  70. BOOL CPlayerView::PreCreateWindow(CREATESTRUCT& cs) 
  71. {
  72.     // TODO: Add your specialized code here and/or call the base class
  73.  
  74.     //    return FALSE;
  75.     return CStatic::PreCreateWindow(cs);
  76. }
  77.  
  78. int CPlayerView::OpenFile(CString filename)
  79. {
  80. //    int ret = MCIWndOpen(m_hPlayerWnd,filename.GetBuffer(filename.GetLength()),0);
  81. //    filename.ReleaseBuffer();
  82.     return 1;//ret;
  83. }
  84.  
  85. int CPlayerView::PlayFile()
  86. {
  87.     //return MCIWndPlay(m_hPlayerWnd);
  88. /*    IGraphBuilder *pGraph;
  89.     IMediaControl *pMediaControl;
  90.     IMediaEvent   *pEvent;
  91.     CoInitialize(NULL);
  92.     
  93.     // Create the filter graph manager and query for interfaces.
  94.     CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, 
  95.                         IID_IGraphBuilder, (void **)&pGraph);
  96.     pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
  97.     pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
  98.  
  99.     
  100.     CFileDialog dlg(TRUE);
  101.     if(dlg.DoModal() == IDOK)
  102.     {
  103.         CString str = dlg.GetPathName();
  104.     
  105.         LPWSTR wstr;// = ProduceWFromA(CP_ACP,str);
  106.         // Build the graph. IMPORTANT: Change string to a file on your system.
  107.         
  108.         pGraph->RenderFile(wstr, NULL);
  109.  
  110.         ::LocalFree(wstr);
  111.         // Run the graph.
  112.         pMediaControl->Run();
  113.  
  114.         // Wait for completion. 
  115.         long evCode;
  116.         pEvent->WaitForCompletion(INFINITE, &evCode);
  117.     }
  118.  
  119.     // Clean up.
  120.     pMediaControl->Release();
  121.     pEvent->Release();
  122.     pGraph->Release();
  123.     CoUninitialize();*/
  124.     return 1;
  125. }
  126.  
  127.