khronosfws/openmax_al/src/radio/xaradioitf.h
changeset 21 2ed61feeead6
parent 19 4a629bc82c5e
child 25 6f7ceef7b1d1
equal deleted inserted replaced
20:b67dd1fc57c5 21:2ed61feeead6
    20 
    20 
    21 #include "xaadptbasectx.h"
    21 #include "xaadptbasectx.h"
    22 #include "xaradioitfadaptation.h"
    22 #include "xaradioitfadaptation.h"
    23 
    23 
    24 /** MACROS **/
    24 /** MACROS **/
    25 #define RADIO_PRESET_NAME_MAX_LENGTH 20
    25 #define RADIO_DEFAULT_STEREO_MODE 2
    26 
       
    27 /** TYPES **/
    26 /** TYPES **/
    28 
    27 
    29 /** ENUMERATIONS **/
    28 /** ENUMERATIONS **/
    30 
    29 
    31 /** STRUCTURES **/
    30 /** STRUCTURES **/
    32 
       
    33 /* Definition of radio preset */
       
    34 typedef struct RadioPreset_
       
    35 {
       
    36     XAuint32    freq;
       
    37     XAuint8     range;
       
    38     XAuint32    stereoMode;
       
    39     char*       name;
       
    40 } RadioPreset;
       
    41 
    31 
    42 /* Definition of XAEqualizerItf implementation */
    32 /* Definition of XAEqualizerItf implementation */
    43 typedef struct XARadioItfImpl_
    33 typedef struct XARadioItfImpl_
    44 {
    34 {
    45     /* parent interface */
    35     /* parent interface */
    48     struct XARadioItfImpl_* self;
    38     struct XARadioItfImpl_* self;
    49 
    39 
    50     /* variables */
    40     /* variables */
    51     XAboolean   squelch;
    41     XAboolean   squelch;
    52     XAuint32    stereoMode;
    42     XAuint32    stereoMode;
    53 
       
    54     XAuint32    preset;
       
    55     XAuint32    numOfPresets;
       
    56 
       
    57     RadioPreset presets[RADIO_NUM_OF_PRESETS];
       
    58 
    43 
    59     XARadioItf         cbPtrToSelf;
    44     XARadioItf         cbPtrToSelf;
    60     xaRadioCallback    callback;
    45     xaRadioCallback    callback;
    61     void               *context;
    46     void               *context;
    62 
    47 
    99 
    84 
   100 XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards);
    85 XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards);
   101 
    86 
   102 XAresult XARadioItfImpl_StopSeeking(XARadioItf self);
    87 XAresult XARadioItfImpl_StopSeeking(XARadioItf self);
   103 
    88 
   104 XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets);
       
   105 
       
   106 XAresult XARadioItfImpl_SetPreset(XARadioItf self,
       
   107                                   XAuint32 preset,
       
   108                                   XAuint32 freq,
       
   109                                   XAuint8 range,
       
   110                                   XAuint32 mode,
       
   111                                   const XAchar * name);
       
   112 
       
   113 XAresult XARadioItfImpl_GetPreset(XARadioItf self,
       
   114                                   XAuint32 preset,
       
   115                                   XAuint32 * pFreq,
       
   116                                   XAuint8 * pRange,
       
   117                                   XAuint32 * pMode,
       
   118                                   XAchar * pName,
       
   119                                   XAuint16 * pNameLength);
       
   120 
       
   121 XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
    89 XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
   122                                               xaRadioCallback callback,
    90                                               xaRadioCallback callback,
   123                                               void * pContext);
    91                                               void * pContext);
   124 
    92 
   125 /* XARadioItfImpl -specific methods */
    93 /* XARadioItfImpl -specific methods */
   126 XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
    94 XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
   127 void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
    95 void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
   128 
    96 
   129 void XARadioItfImpl_Free(XARadioItfImpl* self);
    97 void XARadioItfImpl_Free(XARadioItfImpl* self);
   130 
    98 
       
    99 
   131 #endif /* XARADIOITF_H */
   100 #endif /* XARADIOITF_H */