/xbmc/cores/paplayer/TimidityCodec.h

http://github.com/xbmc/xbmc · C Header · 71 lines · 42 code · 10 blank · 19 comment · 0 complexity · 6816c1f8f9bad6f2a1c6c9056c7eef3c MD5 · raw file

  1. #ifndef Timidity_CODEC_H_
  2. #define Timidity_CODEC_H_
  3. /*
  4. * Copyright (C) 2005-2013 Team XBMC
  5. * http://xbmc.org
  6. *
  7. * This Program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2, or (at your option)
  10. * any later version.
  11. *
  12. * This Program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with XBMC; see the file COPYING. If not, see
  19. * <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "ICodec.h"
  23. #include "DllTimidity.h"
  24. class TimidityCodec : public ICodec
  25. {
  26. public:
  27. TimidityCodec();
  28. virtual ~TimidityCodec();
  29. virtual bool Init(const CStdString &strFile, unsigned int filecache);
  30. virtual void DeInit();
  31. virtual int64_t Seek(int64_t iSeekTime);
  32. virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize);
  33. virtual bool CanInit();
  34. static bool IsSupportedFormat(const CStdString& strExt);
  35. private:
  36. LibraryLoader* m_loader;
  37. CStdString m_loader_name;
  38. typedef int (__cdecl *InitMethod) ( const char * soundfont );
  39. typedef void* (__cdecl *LoadMethod) ( const char* p1);
  40. typedef int (__cdecl *FillMethod) ( void* p1, char* p2, int p3);
  41. typedef void (__cdecl *CleanupMethod)();
  42. typedef void (__cdecl *FreeMethod) ( void* p1);
  43. typedef const char* (__cdecl *ErrorMsgMethod) ();
  44. typedef unsigned long (__cdecl *LengthMethod) ( void* p1 );
  45. typedef unsigned long (__cdecl *SeekMethod) ( void* p1, unsigned long p2);
  46. struct
  47. {
  48. InitMethod Init;
  49. CleanupMethod Cleanup;
  50. ErrorMsgMethod ErrorMsg;
  51. LoadMethod LoadMID;
  52. FillMethod FillBuffer;
  53. FreeMethod FreeMID;
  54. LengthMethod GetLength;
  55. SeekMethod Seek;
  56. } m_dll;
  57. void * m_mid;
  58. int m_iTrack;
  59. int64_t m_iDataPos;
  60. };
  61. #endif