home *** CD-ROM | disk | FTP | other *** search
- // picmevw.cpp : implementation of the CPicmenuView class
- //
-
- #include "stdafx.h"
- #include "picmenu.h"
-
- #include "picmedoc.h"
- #include "picmevw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CPicmenuView
-
- IMPLEMENT_DYNCREATE(CPicmenuView, CView)
-
- BEGIN_MESSAGE_MAP(CPicmenuView, CView)
- //{{AFX_MSG_MAP(CPicmenuView)
- ON_COMMAND(ID_PICTUREMENU_ITEM1, OnPicturemenuItem1)
- ON_COMMAND(ID_PICTUREMENU_ITEM2, OnPicturemenuItem2)
- ON_COMMAND(ID_PICTUREMENU_ITEM3, OnPicturemenuItem3)
- ON_COMMAND(ID_PICTUREMENU_ITEM4, OnPicturemenuItem4)
- ON_COMMAND(ID_PICTUREMENU_ITEM5, OnPicturemenuItem5)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CPicmenuView construction/destruction
-
- CPicmenuView::CPicmenuView()
- {
- // TODO: add construction code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- char FileToOpen[255];
-
-
- // Open the Kennedy WAV session
- strcpy ( FileToOpen, "\\vcProg\\WAV\\8Kenned3.WAV" );
- m_KennedySession = sp_OpenSession ( FileToOpen );
-
-
- // If WAV session can not be opened, display message box.
- if ( m_KennedySession < 0 )
- {
- CString Message, Caption;
- Message = "Can't open the file: ";
- Message = Message + FileToOpen;
- Caption = "Error";
- MessageBox ( Message, Caption );
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
- }
-
- CPicmenuView::~CPicmenuView()
- {
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- sp_CloseSession ( m_KennedySession );
-
-
- ////////////////////,
- // MY CODE ENDS HERE
-
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CPicmenuView drawing
-
- void CPicmenuView::OnDraw(CDC* pDC)
- {
- CPicmenuDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- // TODO: add draw code for native data here
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CPicmenuView diagnostics
-
- #ifdef _DEBUG
- void CPicmenuView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CPicmenuView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CPicmenuDoc* CPicmenuView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPicmenuDoc)));
- return (CPicmenuDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CPicmenuView message handlers
-
- void CPicmenuView::OnPicturemenuItem1()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Cause a WM_PAINT message
- Invalidate();
-
- CString Message;
-
- CClientDC dc(this);
-
-
- // So my fellow Americans
- Message = "So my fellow Americans";
- dc.TextOut ( 10, // X coordinate
- 20, // Y coordinate
- Message, // The text
- Message.GetLength() ); // Length of text
-
- sp_PlaySnd ( m_KennedySession,
- 0,
- 25980 );
-
- // Ask not
- Message = "Ask not";
- dc.TextOut ( 10, // X coordinate
- 40, // Y coordinate
- Message, // The text
- Message.GetLength() ); // Length of text
-
- sp_PlaySnd ( m_KennedySession,
- 25980,
- 54680 );
-
- // What your country can do for you
- Message = "What your country can do for you";
- dc.TextOut ( 10, // X coordinate
- 60, // Y coordinate
- Message, // The text
- Message.GetLength() ); // Length of text
-
- sp_PlaySnd ( m_KennedySession,
- 54680,
- 84090 );
-
- // ask what you can do for your country
- Message = "ask what you can do for your country";
- dc.TextOut ( 10, // X coordinate
- 80, // Y coordinate
- Message, // The text
- Message.GetLength() ); // Length of text
-
- sp_PlaySnd ( m_KennedySession,
- 84090,
- 107619 );
-
- // People cheering
- sp_PlaySnd ( m_KennedySession,
- 107619,
- SP_END_OF_FILE );
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CPicmenuView::OnPicturemenuItem2()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- MessageBox ("You selected the second item");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CPicmenuView::OnPicturemenuItem3()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- MessageBox ("You selected the third item");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CPicmenuView::OnPicturemenuItem4()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- MessageBox ("You selected the 4th item");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CPicmenuView::OnPicturemenuItem5()
- {
- // TODO: Add your command handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- MessageBox ("You selected the 5th item");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-