khronosfws/openmax_al/src/radio/xaradioitf.h
branchRCL_3
changeset 19 095bea5f582e
equal deleted inserted replaced
18:a36789189b53 19:095bea5f582e
       
     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 "xaadptbasectx.h"
       
    22 #include "xaradioitfadaptation.h"
       
    23 
       
    24 /** MACROS **/
       
    25 #define RADIO_NUM_OF_PRESETS 20
       
    26 /** TYPES **/
       
    27 
       
    28 /** ENUMERATIONS **/
       
    29 
       
    30 /** STRUCTURES **/
       
    31 typedef struct RadioPreset_
       
    32 {
       
    33     XAuint32    freq;
       
    34     XAuint8     range;
       
    35     XAuint32    stereoMode;
       
    36     char*       name;
       
    37 } RadioPreset;
       
    38 
       
    39 
       
    40 /* Definition of XAEqualizerItf implementation */
       
    41 typedef struct XARadioItfImpl_
       
    42 {
       
    43     /* parent interface */
       
    44     struct XARadioItf_ itf;
       
    45     /* pointer to self */
       
    46     struct XARadioItfImpl_* self;
       
    47 
       
    48     /* variables */
       
    49     XAboolean   squelch;
       
    50     XAuint32    stereoMode;
       
    51 
       
    52     XARadioItf         cbPtrToSelf;
       
    53     xaRadioCallback    callback;
       
    54     void               *context;
       
    55    	XAuint32    preset;
       
    56    	XAuint32    numOfPresets;
       
    57 
       
    58     RadioPreset presets[RADIO_NUM_OF_PRESETS];    
       
    59 
       
    60     /*Adaptation variables*/
       
    61     XAAdaptationBaseCtx *adapCtx;
       
    62 } XARadioItfImpl;
       
    63 
       
    64 /** METHODS **/
       
    65 
       
    66 /* Base interface XARadioItf implementation */
       
    67 XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range);
       
    68 
       
    69 XAresult XARadioItfImpl_GetFreqRange(XARadioItf self, XAuint8 * pRange);
       
    70 
       
    71 XAresult XARadioItfImpl_IsFreqRangeSupported(XARadioItf self,
       
    72                                              XAuint8 range,
       
    73                                              XAboolean * pSupported);
       
    74 
       
    75 XAresult XARadioItfImpl_GetFreqRangeProperties(XARadioItf self,
       
    76                                                XAuint8 range,
       
    77                                                XAuint32 * pMinFreq,
       
    78                                                XAuint32 * pMaxFreq,
       
    79                                                XAuint32 * pFreqInterval);
       
    80 
       
    81 XAresult XARadioItfImpl_SetFrequency(XARadioItf self, XAuint32 freq);
       
    82 
       
    83 XAresult XARadioItfImpl_CancelSetFrequency(XARadioItf self);
       
    84 
       
    85 XAresult XARadioItfImpl_GetFrequency(XARadioItf self, XAuint32 * pFreq);
       
    86 
       
    87 XAresult XARadioItfImpl_SetSquelch(XARadioItf self, XAboolean squelch);
       
    88 
       
    89 XAresult XARadioItfImpl_GetSquelch(XARadioItf self, XAboolean * pSquelch);
       
    90 
       
    91 XAresult XARadioItfImpl_SetStereoMode(XARadioItf self, XAuint32 mode);
       
    92 
       
    93 XAresult XARadioItfImpl_GetStereoMode(XARadioItf self, XAuint32 * pMode);
       
    94 
       
    95 XAresult XARadioItfImpl_GetSignalStrength(XARadioItf self, XAuint32 * pStrength);
       
    96 
       
    97 XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards);
       
    98 
       
    99 XAresult XARadioItfImpl_StopSeeking(XARadioItf self);
       
   100 
       
   101 XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
       
   102                                               xaRadioCallback callback,
       
   103                                               void * pContext);
       
   104                                               
       
   105 XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets);
       
   106 
       
   107 XAresult XARadioItfImpl_SetPreset(XARadioItf self,
       
   108                                   XAuint32 preset,
       
   109                                   XAuint32 freq,
       
   110                                   XAuint8 range,
       
   111                                   XAuint32 mode,
       
   112                                   const XAchar * name);
       
   113 
       
   114 XAresult XARadioItfImpl_GetPreset(XARadioItf self,
       
   115                                   XAuint32 preset,
       
   116                                   XAuint32 * pFreq,
       
   117                                   XAuint8 * pRange,
       
   118                                   XAuint32 * pMode,
       
   119                                   XAchar * pName,
       
   120                                   XAuint16 * pNameLength);                                              
       
   121 
       
   122 /* XARadioItfImpl -specific methods */
       
   123 XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
       
   124 void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
       
   125 
       
   126 void XARadioItfImpl_Free(XARadioItfImpl* self);
       
   127 
       
   128 
       
   129 #endif /* XARADIOITF_H */