00001
00002
00003
00004 #include "stdafx.h"
00005 #include "axAnxOggPlayer.h"
00006 #include "ControlDialog.h"
00007 #include ".\controldialog.h"
00008
00009
00010
00011
00012 IMPLEMENT_DYNAMIC(CControlDialog, CDialog)
00013 CControlDialog::CControlDialog(CWnd* pParent )
00014 : CDialog(CControlDialog::IDD, pParent)
00015 , mBrowser(NULL)
00016 {
00017 debugLog.open("G:\\logs\\axanx.log", ios_base::out);
00018 }
00019
00020 CControlDialog::~CControlDialog()
00021 {
00022 debugLog.close();
00023 if (mBrowser != NULL) {
00024 mBrowser->Release();
00025 }
00026 }
00027
00028 void CControlDialog::DoDataExchange(CDataExchange* pDX)
00029 {
00030 CDialog::DoDataExchange(pDX);
00031 }
00032
00033
00034 BEGIN_MESSAGE_MAP(CControlDialog, CDialog)
00035 ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
00036 ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
00037 ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
00038 END_MESSAGE_MAP()
00039
00040
00041
00042
00043 void CControlDialog::OnBnClickedButton1()
00044 {
00045
00046 debugLog<<"Play button pushed"<<endl;
00047 mPlayer.loadFile(L"G:\\a.ogg", this->m_hWnd, 10, 100, 384, 240);
00048
00049 mPlayer.play();
00050 }
00051
00052 void CControlDialog::setBrowser(IWebBrowser2* inBrowser) {
00053 debugLog<<"Setting browser instance to "<<(int)inBrowser<<endl;
00054 mBrowser = inBrowser;
00055
00056 BSTR locURL = NULL;
00057 mBrowser->get_LocationURL(&locURL);
00058 wstring locS = locURL;
00059 SysFreeString(locURL);
00060 mPlayer.loadFile(locS);
00061 mPlayer.play();
00062
00063 }
00064
00065 void CControlDialog::OnBnClickedButton2()
00066 {
00067
00068 debugLog<<"Pause button pushed..."<<endl;
00069 mPlayer.pause();
00070 }
00071
00072 void CControlDialog::OnBnClickedButton3()
00073 {
00074
00075 debugLog<<"Stop button pushed.."<<endl;
00076 }