]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxMMedia2/sample/test_med2.cpp
Commited very sort samples
[wxWidgets.git] / utils / wxMMedia2 / sample / test_med2.cpp
diff --git a/utils/wxMMedia2/sample/test_med2.cpp b/utils/wxMMedia2/sample/test_med2.cpp
new file mode 100644 (file)
index 0000000..22d240a
--- /dev/null
@@ -0,0 +1,34 @@
+// --------------------------------------------------------------------------
+// Name: test_med.cpp
+// Purpose:
+// Date: 08/11/1999
+// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
+// CVSID: $Id$
+// --------------------------------------------------------------------------
+#include <wx/app.h>
+#include <wx/wfstream.h>
+#include <wx/frame.h>
+#include "../lib/sndoss.h"
+#include "../lib/sndwav.h"
+#include "../lib/sndaiff.h"
+
+class MyApp: public wxApp {
+ bool OnInit() {
+   wxSoundStreamOSS *oss_dev = new wxSoundStreamOSS();
+   wxFileInputStream *f_input = new wxFileInputStream(argv[1]);
+   wxSoundWave *wav_file = new wxSoundWave(*f_input, *oss_dev);
+   wxFrame *frame = new wxFrame(NULL, -1, "My Frame");
+   wxSoundFormatPcm pcm;
+
+   if (oss_dev->GetError() != wxSOUND_NOERR) {
+     wxPrintf("No device\n");
+     return FALSE;
+   }
+
+   wav_file->Play();
+   frame->Show(TRUE);
+   return TRUE;
+ }
+};
+
+IMPLEMENT_APP(MyApp)