4d6306eb4d
* WARNING! It is quite unstable on Windows and it doesn't work on Linux for the moment because I didn't finish fixing the CODEC stream. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
95 lines
1.8 KiB
C++
95 lines
1.8 KiB
C++
// /////////////////////////////////////////////////////////////////////////////
|
|
// 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
|