]> git.vomp.tv Git - vompclient.git/blob - audio.h
Initial import of patches for ARM/Android/Raspeberry pi
[vompclient.git] / audio.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
19 */\r
20 \r
21 #ifndef AUDIO_H\r
22 #define AUDIO_H\r
23 \r
24 #include <stdio.h>\r
25 #include "defines.h"\r
26 #include "draintarget.h"\r
27 #include "abstractoption.h"\r
28 \r
29 typedef struct\r
30 {\r
31     unsigned char frontleft;\r
32     unsigned char frontright;\r
33     unsigned char rearleft;\r
34     unsigned char rearright;\r
35     unsigned char center;\r
36     unsigned char lfe;\r
37 } audio_volume;\r
38 \r
39 class Audio : public DrainTarget, public AbstractOption\r
40 {\r
41   public:\r
42     Audio();\r
43     virtual ~Audio();\r
44     static Audio* getInstance();\r
45    // static void setInstance(Audio* );\r
46 \r
47     virtual int init(UCHAR streamType)=0;\r
48     virtual int shutdown()=0;\r
49     virtual int setStreamType(UCHAR streamType)=0;\r
50     virtual int setChannel()=0;\r
51     virtual int setSource()=0;\r
52     virtual int sync()=0;\r
53     virtual int play()=0;\r
54     virtual int stop()=0;\r
55     virtual int pause()=0;\r
56     virtual int unPause()=0;\r
57     virtual int reset()=0;\r
58     virtual int setVolume(int volume)=0;\r
59     virtual int mute()=0;\r
60     virtual int unMute()=0;\r
61     virtual bool supportsAc3()=0;\r
62     virtual bool maysupportAc3(){return false;}\r
63 \r
64     int volumeUp();\r
65     int volumeDown();\r
66     int getVolume();\r
67     int toggleUserMute();\r
68     int systemMuteOn();\r
69     int systemMuteOff();\r
70     int doMuting();\r
71 \r
72     // Audio stream type  // FIXME these are MVP specific (probably!)\r
73     const static UCHAR MPEG2_PES = 2;\r
74     const static UCHAR MPEG1_PES = 3; // unused\r
75     const static UCHAR MP3 = 0;  //media player\r
76 \r
77 #ifdef DEV\r
78     virtual int test()=0;\r
79 #endif\r
80 \r
81   protected:\r
82     static Audio* instance;\r
83     int initted;\r
84     UCHAR userMute;\r
85     UCHAR systemMute;\r
86     UCHAR muted;\r
87     int volume;\r
88 \r
89     audio_volume Aoffset;\r
90 };\r
91 \r
92 #endif\r