]> git.saurik.com Git - wxWidgets.git/blame_incremental - utils/wxMMedia2/sample/test_med2.cpp
added support for several new events in wxCalendarCtrl: clicking on week
[wxWidgets.git] / utils / wxMMedia2 / sample / test_med2.cpp
... / ...
CommitLineData
1// --------------------------------------------------------------------------
2// Name: test_med.cpp
3// Purpose:
4// Date: 08/11/1999
5// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
6// CVSID: $Id$
7// --------------------------------------------------------------------------
8#include <wx/app.h>
9#include <wx/wfstream.h>
10#include <wx/frame.h>
11#include "../lib/sndoss.h"
12#include "../lib/sndesd.h"
13#include "../lib/sndwav.h"
14#include "../lib/sndaiff.h"
15
16class MyApp: public wxApp {
17 bool OnInit() {
18// wxSoundStreamOSS *oss_dev = new wxSoundStreamOSS();
19 wxSoundStreamESD *oss_dev = new wxSoundStreamESD();
20 wxFileInputStream *f_input = new wxFileInputStream(argv[1]);
21 wxSoundFileStream *wav_file;
22 wxFrame *frame = new wxFrame(NULL, -1, "My Frame");
23 wxSoundFormatPcm pcm;
24
25 if (oss_dev->GetError() != wxSOUND_NOERR) {
26 wxPrintf("No device\n");
27 return FALSE;
28 }
29
30 wav_file = new wxSoundWave(*f_input, *oss_dev);
31 if (!wav_file->CanRead()) {
32 wav_file = new wxSoundAiff(*f_input, *oss_dev);
33 if (!wav_file->CanRead())
34 return FALSE;
35 }
36
37 wav_file->Play();
38 frame->Show(TRUE);
39 return TRUE;
40 }
41};
42
43IMPLEMENT_APP(MyApp)