PageRenderTime 186ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/libtunepimp-0.5.3/plugins/vorbis/vorbisdecode.h

#
C Header | 64 lines | 30 code | 8 blank | 26 comment | 0 complexity | 4f422ca21f5a0515e034f4a1bce6020e MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, GPL-2.0, LGPL-2.0
  1. /*----------------------------------------------------------------------------
  2. libtunepimp -- The MusicBrainz tagging library.
  3. Let a thousand taggers bloom!
  4. Copyright (C) Robert Kaye 2003
  5. This file is part of libtunepimp.
  6. libtunepimp is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. libtunepimp is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with libtunepimp; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. $Id: vorbisdecode.h 1390 2005-06-14 17:46:40Z robert $
  18. ----------------------------------------------------------------------------*/
  19. #ifndef __VORBIS_DECODE_H
  20. #define __VORBIS_DECODE_H
  21. #include <vorbis/vorbisfile.h>
  22. #include <string>
  23. using namespace std;
  24. #include "metadata.h"
  25. #include "decode_plugin.h"
  26. #include "fileio.h"
  27. class VorbisDecode : public DecodePlugin
  28. {
  29. public:
  30. VorbisDecode(const string &file, const string &encoding);
  31. virtual ~VorbisDecode(void);
  32. int getInfo(unsigned long &duration,
  33. unsigned int &samplesPerSecond,
  34. unsigned int &bitsPerSample,
  35. unsigned int &channels);
  36. int read (char *data, int maxBytes);
  37. private:
  38. unsigned int duration;
  39. unsigned int samplesPerSecond;
  40. unsigned int bitsPerSample;
  41. unsigned int channels;
  42. OggVorbis_File vf;
  43. vorbis_info *vi;
  44. ov_callbacks callbacks;
  45. TFILE *in;
  46. string encoding;
  47. };
  48. #endif