Merge pull request #4685 from fritsch/pacork
[vuplus_xbmc] / lib / DllASAP.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program 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, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include "DynamicDll.h"
23
24 typedef int abool;
25
26 typedef struct {
27   char author[128];
28   char name[128];
29   int year;
30   int month;
31   int day;
32   int channels;
33   int duration;
34 } ASAP_SongInfo;
35
36 class DllASAPInterface
37 {
38 public:
39   virtual ~DllASAPInterface() {}
40   virtual int asapGetSongs(const char *filename)=0;
41   virtual abool asapGetInfo(const char *filename, int song, ASAP_SongInfo *songInfo)=0;
42   virtual abool asapLoad(const char *filename, int song, int *channels, int *duration)=0;
43   virtual void asapSeek(int position)=0;
44   virtual int asapGenerate(void *buffer, int buffer_len)=0;
45 };
46
47 class DllASAP : public DllDynamic, DllASAPInterface
48 {
49   DECLARE_DLL_WRAPPER(DllASAP, DLL_PATH_ASAP_CODEC)
50   DEFINE_METHOD1(int, asapGetSongs, (const char *p1))
51   DEFINE_METHOD3(abool, asapGetInfo, (const char *p1, int p2, ASAP_SongInfo *p3))
52   DEFINE_METHOD4(abool, asapLoad, (const char *p1, int p2, int *p3, int *p4))
53   DEFINE_METHOD1(void, asapSeek, (int p1))
54   DEFINE_METHOD2(int, asapGenerate, (void *p1, int p2))
55   BEGIN_METHOD_RESOLVE()
56     RESOLVE_METHOD(asapGetSongs)
57     RESOLVE_METHOD(asapGetInfo)
58     RESOLVE_METHOD(asapLoad)
59     RESOLVE_METHOD(asapSeek)
60     RESOLVE_METHOD(asapGenerate)
61   END_METHOD_RESOLVE()
62 };