decoder-ogg.h
branchtrunk
changeset 33 65ed49cbc08b
parent 0 474a1293c3c0
child 35 efc694fccc45
     1.1 --- a/decoder-ogg.h	Sat Oct 24 11:31:53 2009 +0800
     1.2 +++ b/decoder-ogg.h	Fri Nov 13 19:27:36 2009 +0800
     1.3 @@ -1,7 +1,7 @@
     1.4  /*
     1.5   * MP3/MPlayer plugin to VDR (C++)
     1.6   *
     1.7 - * (C) 2001-2005 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.8 + * (C) 2001-2009 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.9   *
    1.10   * This code is free software; you can redistribute it and/or
    1.11   * modify it under the terms of the GNU General Public License
    1.12 @@ -40,14 +40,16 @@
    1.13  class cOggFile : public cFileInfo {
    1.14  friend class cOggInfo;
    1.15  private:
    1.16 -  bool opened, canSeek;
    1.17 +  bool canSeek;
    1.18 +protected:
    1.19 +  bool opened;
    1.20    OggVorbis_File vf;
    1.21    //
    1.22    void Error(const char *action, const int err);
    1.23  public:
    1.24    cOggFile(const char *Filename);
    1.25    ~cOggFile();
    1.26 -  bool Open(bool log=true);
    1.27 +  virtual bool Open(bool log=true);
    1.28    void Close(void);
    1.29    long long Seek(long long posMs=0, bool relativ=false);
    1.30    int Stream(short *buffer, int samples);
    1.31 @@ -65,15 +67,14 @@
    1.32    bool Abort(bool result);
    1.33  public:
    1.34    cOggInfo(cOggFile *File);
    1.35 -  bool DoScan(bool KeepOpen=false);
    1.36 +  virtual bool DoScan(bool KeepOpen=false);
    1.37 +  virtual void InfoHook(void) {};
    1.38    };
    1.39  
    1.40  // ----------------------------------------------------------------
    1.41  
    1.42  class cOggDecoder : public cDecoder {
    1.43  private:
    1.44 -  cOggFile file;
    1.45 -  cOggInfo info;
    1.46    struct Decode ds;
    1.47    struct mad_pcm *pcm;
    1.48    unsigned long long index;
    1.49 @@ -82,8 +83,11 @@
    1.50    bool Clean(void);
    1.51    bool GetInfo(bool keepOpen);
    1.52    struct Decode *Done(eDecodeStatus status);
    1.53 +protected:
    1.54 +  cOggFile *file;
    1.55 +  cOggInfo *info;
    1.56  public:
    1.57 -  cOggDecoder(const char *Filename);
    1.58 +  cOggDecoder(const char *Filename, bool preinit=true);
    1.59    ~cOggDecoder();
    1.60    virtual bool Valid(void);
    1.61    virtual cFileInfo *FileInfo(void);