]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxMMedia/mmfile.h
* Added wxMMedia in the repository so people interrested in it can work on it
[wxWidgets.git] / utils / wxMMedia / mmfile.h
diff --git a/utils/wxMMedia/mmfile.h b/utils/wxMMedia/mmfile.h
new file mode 100644 (file)
index 0000000..29b3968
--- /dev/null
@@ -0,0 +1,94 @@
+// /////////////////////////////////////////////////////////////////////////////
+// Name:       mmfile.h
+// Purpose:    wxMMedia
+// Author:     Guilhem Lavaux
+// Created:    1997
+// Updated:    1998
+// Copyright:  (C) 1997, 1998, Guilhem Lavaux
+// License:    wxWindows license
+// /////////////////////////////////////////////////////////////////////////////
+#ifndef __MMD_file_H__
+#define __MMD_file_H__
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#ifdef WX_PRECOMP
+#include "wx_prec.h"
+#else
+#include "wx/wx.h"
+#endif
+#include "wx/string.h"
+#include "wx/stream.h"
+#include "mmtype.h"
+
+///
+typedef enum {
+  wxMMFILE_NOERROR,
+  wxMMFILE_INVALID,
+  wxMMFILE_EOF
+} ///
+ wxMMFileError;
+
+typedef struct {
+  wxInt8 hours;
+  wxUint8 minutes, seconds;
+} wxMMtime;
+
+/// Common base class for multimedia file.
+class wxMMediaFile {
+public:
+  wxMMediaFile();
+  ///
+  wxMMediaFile(wxInputStream& is, bool preload, bool seekable);
+  ///
+  wxMMediaFile(wxOutputStream& is, bool seekable);
+  ///
+  wxMMediaFile(const wxString& fname);
+  ///
+  virtual ~wxMMediaFile();
+
+  ///
+  wxInputStream *GetIRawData();
+  wxOutputStream *GetORawData();
+  ///
+  wxString GetCurrentFile();
+
+  ///
+  virtual void SetFile(wxInputStream& is,
+                       bool preload = FALSE, bool seekable = FALSE);
+  ///
+  virtual void SetFile(wxOutputStream& is, bool seekable = FALSE);
+  ///
+  void SetFile(const wxString& fname);
+
+  ///
+  wxMMFileError GetFileError() const { return m_mmerror; }
+  ///
+  virtual wxMMtime GetLength();
+  ///
+  virtual wxMMtime GetPosition();
+  ///
+  virtual bool StartPlay() = 0;
+  ///
+  virtual void StopPlay() = 0;
+protected:
+  ///
+  wxMMFileError m_mmerror;
+  ///
+  wxInputStream *m_istream, *m_i_temp;
+  ///
+  wxOutputStream *m_ostream, *m_o_temp;
+  ///
+  wxString m_tmpfname, m_mfname;
+  ///
+  bool m_seekable;
+
+  ///
+  void CacheIO(); 
+  ///
+  void CleanUpPrevious();
+};
+
+#endif