From 616adfc77dc1d08f3bfcd79991a78c6350e4e2f6 Mon Sep 17 00:00:00 2001 From: lvw Date: Fri, 28 May 2004 15:29:19 +0000 Subject: Merged player branch back on HEAD branch. git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@98 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder_mp3.h | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 vdr_decoder_mp3.h (limited to 'vdr_decoder_mp3.h') diff --git a/vdr_decoder_mp3.h b/vdr_decoder_mp3.h new file mode 100644 index 0000000..abc8eed --- /dev/null +++ b/vdr_decoder_mp3.h @@ -0,0 +1,114 @@ +/*! + * \file vdr_decoder_mp3.h + * \brief An mp3 decoder for a VDR media plugin (muggle) + * + * \version $Revision: 1.2 $ + * \date $Date: 2004/05/28 15:29:19 $ + * \author Ralf Klueber, Lars von Wedel, Andreas Kellner + * \author Responsible author: $Author: lvw $ + * + * $Id: vdr_decoder_mp3.h,v 1.2 2004/05/28 15:29:19 lvw Exp $ + * + * Adapted from + * MP3/MPlayer plugin to VDR (C++) + * (C) 2001,2002 Stefan Huelswitt + */ + +#ifndef ___DECODER_MP3_H +#define ___DECODER_MP3_H + +#define DEC_MP3 DEC_ID('M','P','3',' ') +#define DEC_MP3_STR "MP3" + +#include +#include + +#include "vdr_decoder.h" + +#if MAD_F_FRACBITS != 28 +#warning libmad with MAD_F_FRACBITS != 28 not tested +#endif + +class mgStream; + +// ---------------------------------------------------------------- + +/*! + * \brief A class to decode mp3 songs into PCM using libmad + */ +class mgMP3Decoder : public mgDecoder +{ +private: + struct mgDecode m_ds; + + // + struct mad_stream m_madstream; + struct mad_frame *m_madframe; + struct mad_synth *m_madsynth; + mad_timer_t m_playtime, m_skiptime; + + // + struct FrameInfo + { + unsigned long long Pos; + mad_timer_t Time; + } *m_frameinfo; + + int m_framenum, m_framemax, m_errcount, m_mute; + // + void init(); + + void clean(); + + struct mgDecode *done( eDecodeStatus status ); + + virtual mgPlayInfo *playInfo(); + + eDecodeStatus decodeError(bool hdr); + + void makeSkipTime(mad_timer_t *skiptime, mad_timer_t playtime, + int secs, int avail, int dvbrate); + +protected: + mgStream *m_stream; + bool m_isStream; + +public: + + /*! + * \brief construct a decoder from a filename + */ + mgMP3Decoder( std::string filename, bool preinit = true ); + + /*! + * \brief the destructor + */ + virtual ~mgMP3Decoder(); + + /*! + * \brief check, whether the file contains useable MP3 content + */ + virtual bool valid(); + + /*! + * \brief start the decoding process + */ + virtual bool start(); + + /*! + * \brief stop the decoding process + */ + virtual bool stop(); + + /*! + * \brief skip an amount of seconds + */ + virtual bool skip( int seconds, int avail, int rate ); + + /*! + * \brief the actual decoding function (uses libmad) + */ + virtual struct mgDecode *decode(); +}; + +#endif //___DECODER_MP3_H -- cgit v1.2.3 From 653ca204d10b3481670a80769baa3d768bb5f64a Mon Sep 17 00:00:00 2001 From: lvw Date: Tue, 7 Sep 2004 17:40:47 +0000 Subject: Merged ogg vorbis player to trunk git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@148 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder_mp3.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vdr_decoder_mp3.h') diff --git a/vdr_decoder_mp3.h b/vdr_decoder_mp3.h index abc8eed..f9f3bde 100644 --- a/vdr_decoder_mp3.h +++ b/vdr_decoder_mp3.h @@ -3,11 +3,11 @@ * \brief An mp3 decoder for a VDR media plugin (muggle) * * \version $Revision: 1.2 $ - * \date $Date: 2004/05/28 15:29:19 $ + * \date $Date$ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: lvw $ + * \author Responsible author: $Author$ * - * $Id: vdr_decoder_mp3.h,v 1.2 2004/05/28 15:29:19 lvw Exp $ + * $Id$ * * Adapted from * MP3/MPlayer plugin to VDR (C++) @@ -30,6 +30,7 @@ #endif class mgStream; +class mgContentItem; // ---------------------------------------------------------------- @@ -55,7 +56,7 @@ private: } *m_frameinfo; int m_framenum, m_framemax, m_errcount, m_mute; - // + void init(); void clean(); @@ -65,7 +66,7 @@ private: virtual mgPlayInfo *playInfo(); eDecodeStatus decodeError(bool hdr); - + void makeSkipTime(mad_timer_t *skiptime, mad_timer_t playtime, int secs, int avail, int dvbrate); @@ -78,7 +79,7 @@ public: /*! * \brief construct a decoder from a filename */ - mgMP3Decoder( std::string filename, bool preinit = true ); + mgMP3Decoder( mgContentItem *item, bool preinit = true ); /*! * \brief the destructor -- cgit v1.2.3 From 0756ae40d68d403082c86adef042a4c0daba219f Mon Sep 17 00:00:00 2001 From: LarsAC Date: Fri, 7 Jan 2005 18:43:03 +0000 Subject: Merged branch osd_extensions back to main trunk git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@324 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder_mp3.h | 115 +++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 58 deletions(-) (limited to 'vdr_decoder_mp3.h') diff --git a/vdr_decoder_mp3.h b/vdr_decoder_mp3.h index f9f3bde..47d6eb2 100644 --- a/vdr_decoder_mp3.h +++ b/vdr_decoder_mp3.h @@ -9,7 +9,7 @@ * * $Id$ * - * Adapted from + * Adapted from * MP3/MPlayer plugin to VDR (C++) * (C) 2001,2002 Stefan Huelswitt */ @@ -37,79 +37,78 @@ class mgContentItem; /*! * \brief A class to decode mp3 songs into PCM using libmad */ -class mgMP3Decoder : public mgDecoder +class mgMP3Decoder:public mgDecoder { -private: - struct mgDecode m_ds; + private: + struct mgDecode m_ds; - // - struct mad_stream m_madstream; - struct mad_frame *m_madframe; - struct mad_synth *m_madsynth; - mad_timer_t m_playtime, m_skiptime; +// + struct mad_stream m_madstream; + struct mad_frame *m_madframe; + struct mad_synth *m_madsynth; + mad_timer_t m_playtime, m_skiptime; - // - struct FrameInfo - { - unsigned long long Pos; - mad_timer_t Time; - } *m_frameinfo; +// + struct FrameInfo + { + unsigned long long Pos; + mad_timer_t Time; + } *m_frameinfo; - int m_framenum, m_framemax, m_errcount, m_mute; + int m_framenum, m_framemax, m_errcount, m_mute; - void init(); + void init (); - void clean(); + void clean (); - struct mgDecode *done( eDecodeStatus status ); + struct mgDecode *done (eDecodeStatus status); - virtual mgPlayInfo *playInfo(); + virtual mgPlayInfo *playInfo (); - eDecodeStatus decodeError(bool hdr); - - void makeSkipTime(mad_timer_t *skiptime, mad_timer_t playtime, - int secs, int avail, int dvbrate); + eDecodeStatus decodeError (bool hdr); -protected: - mgStream *m_stream; - bool m_isStream; + void makeSkipTime (mad_timer_t * skiptime, mad_timer_t playtime, + int secs, int avail, int dvbrate); -public: + protected: + mgStream * m_stream; + bool m_isStream; - /*! - * \brief construct a decoder from a filename - */ - mgMP3Decoder( mgContentItem *item, bool preinit = true ); + public: - /*! - * \brief the destructor - */ - virtual ~mgMP3Decoder(); +/*! + * \brief construct a decoder from a filename + */ + mgMP3Decoder (mgContentItem * item, bool preinit = true); + +/*! + * \brief the destructor + */ + virtual ~ mgMP3Decoder (); - /*! - * \brief check, whether the file contains useable MP3 content - */ - virtual bool valid(); +/*! + * \brief check, whether the file contains useable MP3 content + */ + virtual bool valid (); - /*! - * \brief start the decoding process - */ - virtual bool start(); +/*! + * \brief start the decoding process + */ + virtual bool start (); - /*! - * \brief stop the decoding process - */ - virtual bool stop(); +/*! + * \brief stop the decoding process + */ + virtual bool stop (); - /*! - * \brief skip an amount of seconds - */ - virtual bool skip( int seconds, int avail, int rate ); +/*! + * \brief skip an amount of seconds + */ + virtual bool skip (int seconds, int avail, int rate); - /*! - * \brief the actual decoding function (uses libmad) - */ - virtual struct mgDecode *decode(); +/*! + * \brief the actual decoding function (uses libmad) + */ + virtual struct mgDecode *decode (); }; - -#endif //___DECODER_MP3_H +#endif //___DECODER_MP3_H -- cgit v1.2.3