The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SaveVideo.cpp

Go to the documentation of this file.
00001 // SaveVideo.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "VideoDemo.h"
00006 #include "SaveVideo.h"
00007 
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013 
00015 // SaveVideo dialog
00016 
00017 
00018 SaveVideo::SaveVideo(CWnd* pParent /*=NULL*/)
00019         : CDialog(SaveVideo::IDD, pParent)
00020 {
00021         //{{AFX_DATA_INIT(SaveVideo)
00022                 // NOTE: the ClassWizard will add member initialization here
00023         //}}AFX_DATA_INIT
00024 }
00025 
00026 
00027 void SaveVideo::DoDataExchange(CDataExchange* pDX)
00028 {
00029         CDialog::DoDataExchange(pDX);
00030         //{{AFX_DATA_MAP(SaveVideo)
00031         DDX_Control(pDX, ID_PAUSE, m_pause);
00032         DDX_Control(pDX, ID_RESUME, m_resume);
00033         DDX_Control(pDX, ID_STOP, m_stop);
00034         DDX_Control(pDX, ID_SAVE, m_save);
00035         //}}AFX_DATA_MAP
00036 
00037         switch (m_directShow->m_recordMode) {
00038         case ds_stop:
00039                 break;
00040         case ds_pause:
00041                 m_save.EnableWindow(FALSE);
00042                 m_resume.EnableWindow(TRUE);
00043                 m_stop.EnableWindow(TRUE);
00044                 break;
00045         case ds_capture:
00046                 m_save.EnableWindow(FALSE);
00047                 m_pause.EnableWindow(TRUE);
00048                 m_stop.EnableWindow(TRUE);
00049                 break;
00050         default:
00051                 break;
00052         }
00053 }
00054 
00055 
00056 BEGIN_MESSAGE_MAP(SaveVideo, CDialog)
00057         //{{AFX_MSG_MAP(SaveVideo)
00058         ON_COMMAND(ID_FILE_SAVEVIDEO, OnFileSavevideo)
00059         ON_BN_CLICKED(ID_RESUME, OnResume)
00060         ON_BN_CLICKED(ID_PAUSE, OnPause)
00061         ON_BN_CLICKED(ID_SAVE, OnSave)
00062         ON_BN_CLICKED(ID_STOP, OnStop)
00063         //}}AFX_MSG_MAP
00064 END_MESSAGE_MAP()
00065 
00067 // SaveVideo message handlers
00068 
00069 void SaveVideo::setDirectShow(MPDirectShow* directShow)
00070 {
00071         m_directShow = directShow;
00072 }
00073 
00074 void SaveVideo::OnFileSavevideo() 
00075 {
00076         // TODO: Add your command handler code here
00077         
00078 }
00079 
00080 void SaveVideo::OnResume() 
00081 {
00082         m_directShow->RunFilter();
00083         m_pause.EnableWindow(TRUE);
00084         m_resume.EnableWindow(FALSE);
00085         
00086 }
00087 
00088 void SaveVideo::OnPause() 
00089 {
00090         m_directShow->PauseFilter();
00091         m_pause.EnableWindow(FALSE);
00092         m_resume.EnableWindow(TRUE);
00093         
00094 }
00095 
00096 void SaveVideo::OnSave() 
00097 {
00098         if(FAILED(m_directShow->SaveVideo()))
00099                 return;
00100         m_save.EnableWindow(FALSE);
00101         m_pause.EnableWindow(TRUE);
00102         m_stop.EnableWindow(TRUE);
00103         
00104 }
00105 
00106 void SaveVideo::OnStop() 
00107 {
00108         m_directShow->StopCapture();
00109         m_save.EnableWindow(TRUE);
00110         m_pause.EnableWindow(FALSE);
00111         m_stop.EnableWindow(FALSE);
00112         
00113 }

Generated on Mon Nov 8 17:07:52 2004 for MPT by  doxygen 1.3.9.1