]>
Commit | Line | Data |
---|---|---|
354616b0 GL |
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" | |
56dc1ffd | 12 | #include "../lib/sndesd.h" |
354616b0 GL |
13 | #include "../lib/sndwav.h" |
14 | #include "../lib/sndaiff.h" | |
15 | ||
16 | class MyApp: public wxApp { | |
17 | bool OnInit() { | |
56dc1ffd GL |
18 | // wxSoundStreamOSS *oss_dev = new wxSoundStreamOSS(); |
19 | wxSoundStreamESD *oss_dev = new wxSoundStreamESD(); | |
354616b0 | 20 | wxFileInputStream *f_input = new wxFileInputStream(argv[1]); |
56dc1ffd | 21 | wxSoundFileStream *wav_file; |
354616b0 GL |
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 | ||
56dc1ffd GL |
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 | ||
354616b0 GL |
37 | wav_file->Play(); |
38 | frame->Show(TRUE); | |
39 | return TRUE; | |
40 | } | |
41 | }; | |
42 | ||
43 | IMPLEMENT_APP(MyApp) |