|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef XARADIOITF_H |
|
19 #define XARADIOITF_H |
|
20 |
|
21 #include "openmaxalwrapper.h" |
|
22 #include "xaglobals.h" |
|
23 #ifdef _GSTREAMER_BACKEND_ |
|
24 #include "XAAdaptationContextBase.h" |
|
25 #include "XARadioItfAdaptation.h" |
|
26 #endif |
|
27 /** MACROS **/ |
|
28 #define RADIO_PRESET_NAME_MAX_LENGTH 20 |
|
29 |
|
30 /** TYPES **/ |
|
31 |
|
32 /** ENUMERATIONS **/ |
|
33 |
|
34 /** STRUCTURES **/ |
|
35 |
|
36 /* Definition of radio preset */ |
|
37 typedef struct RadioPreset_ |
|
38 { |
|
39 XAuint32 freq; |
|
40 XAuint8 range; |
|
41 XAuint32 stereoMode; |
|
42 char* name; |
|
43 } RadioPreset; |
|
44 |
|
45 /* Definition of XAEqualizerItf implementation */ |
|
46 typedef struct XARadioItfImpl_ |
|
47 { |
|
48 /* parent interface */ |
|
49 struct XARadioItf_ itf; |
|
50 /* pointer to self */ |
|
51 struct XARadioItfImpl_* self; |
|
52 |
|
53 /* variables */ |
|
54 XAboolean squelch; |
|
55 XAuint32 stereoMode; |
|
56 |
|
57 XAuint32 preset; |
|
58 XAuint32 numOfPresets; |
|
59 |
|
60 #ifdef _GSTREAMER_BACKEND_ |
|
61 RadioPreset presets[RADIO_NUM_OF_PRESETS]; |
|
62 #endif |
|
63 XARadioItf cbPtrToSelf; |
|
64 xaRadioCallback callback; |
|
65 void *context; |
|
66 |
|
67 #ifdef _GSTREAMER_BACKEND_ |
|
68 /*Adaptation variables*/ |
|
69 XAAdaptationBaseCtx *adapCtx; |
|
70 #endif |
|
71 } XARadioItfImpl; |
|
72 |
|
73 /** METHODS **/ |
|
74 |
|
75 /* Base interface XARadioItf implementation */ |
|
76 XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range); |
|
77 |
|
78 XAresult XARadioItfImpl_GetFreqRange(XARadioItf self, XAuint8 * pRange); |
|
79 |
|
80 XAresult XARadioItfImpl_IsFreqRangeSupported(XARadioItf self, |
|
81 XAuint8 range, |
|
82 XAboolean * pSupported); |
|
83 |
|
84 XAresult XARadioItfImpl_GetFreqRangeProperties(XARadioItf self, |
|
85 XAuint8 range, |
|
86 XAuint32 * pMinFreq, |
|
87 XAuint32 * pMaxFreq, |
|
88 XAuint32 * pFreqInterval); |
|
89 |
|
90 XAresult XARadioItfImpl_SetFrequency(XARadioItf self, XAuint32 freq); |
|
91 |
|
92 XAresult XARadioItfImpl_CancelSetFrequency(XARadioItf self); |
|
93 |
|
94 XAresult XARadioItfImpl_GetFrequency(XARadioItf self, XAuint32 * pFreq); |
|
95 |
|
96 XAresult XARadioItfImpl_SetSquelch(XARadioItf self, XAboolean squelch); |
|
97 |
|
98 XAresult XARadioItfImpl_GetSquelch(XARadioItf self, XAboolean * pSquelch); |
|
99 |
|
100 XAresult XARadioItfImpl_SetStereoMode(XARadioItf self, XAuint32 mode); |
|
101 |
|
102 XAresult XARadioItfImpl_GetStereoMode(XARadioItf self, XAuint32 * pMode); |
|
103 |
|
104 XAresult XARadioItfImpl_GetSignalStrength(XARadioItf self, XAuint32 * pStrength); |
|
105 |
|
106 XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards); |
|
107 |
|
108 XAresult XARadioItfImpl_StopSeeking(XARadioItf self); |
|
109 |
|
110 XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets); |
|
111 |
|
112 XAresult XARadioItfImpl_SetPreset(XARadioItf self, |
|
113 XAuint32 preset, |
|
114 XAuint32 freq, |
|
115 XAuint8 range, |
|
116 XAuint32 mode, |
|
117 const XAchar * name); |
|
118 |
|
119 XAresult XARadioItfImpl_GetPreset(XARadioItf self, |
|
120 XAuint32 preset, |
|
121 XAuint32 * pFreq, |
|
122 XAuint8 * pRange, |
|
123 XAuint32 * pMode, |
|
124 XAchar * pName, |
|
125 XAuint16 * pNameLength); |
|
126 |
|
127 XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self, |
|
128 xaRadioCallback callback, |
|
129 void * pContext); |
|
130 #ifdef _GSTREAMER_BACKEND_ |
|
131 |
|
132 /* XARadioItfImpl -specific methods */ |
|
133 XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx); |
|
134 void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event ); |
|
135 #endif |
|
136 void XARadioItfImpl_Free(XARadioItfImpl* self); |
|
137 |
|
138 #endif /* XARADIOITF_H */ |