mmserv/radioutility/radio_utility/src/RadioFmTunerUtility.cpp
branchRCL_3
changeset 46 0ac9a5310753
parent 45 095bea5f582e
equal deleted inserted replaced
45:095bea5f582e 46:0ac9a5310753
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <RadioFmTunerUtility.h>
    19 #include <RadioFmTunerUtility.h>
    20 #include "RadioFmTunerUtilityBody.h"
    20 #include "RadioFmTunerUtilityBody.h"
    21 #include "trace.h"
       
    22 
    21 
    23 // -----------------------------------------------------------------------------
    22 // -----------------------------------------------------------------------------
    24 // CRadioFmTunerUtility::NewL
    23 // CRadioFmTunerUtility::NewL
    25 // Destructor
    24 // Destructor
    26 // -----------------------------------------------------------------------------
    25 // -----------------------------------------------------------------------------
    27 //
    26 //
    28 CRadioFmTunerUtility* CRadioFmTunerUtility::NewL(
    27 CRadioFmTunerUtility* CRadioFmTunerUtility::NewL(
    29     RRadioSession& aRadioSession,
    28     RRadioSession& aRadioSession,
    30     MRadioFmTunerObserver& aObserver)
    29     MRadioFmTunerObserver& aObserver)
    31     {
    30     {
    32     FUNC_LOG;
       
    33     CRadioFmTunerUtility* self = new(ELeave) CRadioFmTunerUtility;
    31     CRadioFmTunerUtility* self = new(ELeave) CRadioFmTunerUtility;
    34     CleanupStack::PushL(self);
    32     CleanupStack::PushL(self);
    35     self->iBody = CRadioFmTunerUtility::CBody::NewL(aRadioSession, aObserver);
    33     self->iBody = CRadioFmTunerUtility::CBody::NewL(aRadioSession, aObserver);
    36     CleanupStack::Pop();
    34     CleanupStack::Pop();
    37     return self;
    35     return self;
    42 // Destructor
    40 // Destructor
    43 // -----------------------------------------------------------------------------
    41 // -----------------------------------------------------------------------------
    44 //
    42 //
    45 EXPORT_C CRadioFmTunerUtility::~CRadioFmTunerUtility()
    43 EXPORT_C CRadioFmTunerUtility::~CRadioFmTunerUtility()
    46     {
    44     {
    47     FUNC_LOG;
       
    48     delete iBody;
    45     delete iBody;
    49     }
    46     }
    50 
    47 
    51 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    52 // CRadioFmTunerUtility::CRadioFmTunerUtility
    49 // CRadioFmTunerUtility::CRadioFmTunerUtility
    53 // (other items were commented in a header).
    50 // (other items were commented in a header).
    54 // -----------------------------------------------------------------------------
    51 // -----------------------------------------------------------------------------
    55 //
    52 //
    56 CRadioFmTunerUtility::CRadioFmTunerUtility()
    53 CRadioFmTunerUtility::CRadioFmTunerUtility()
    57     {
    54     {
    58     FUNC_LOG;
       
    59     }
    55     }
    60 
    56 
    61 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    62 // CRadioFmTunerUtility::RequestTunerControl
    58 // CRadioFmTunerUtility::RequestTunerControl
    63 // (other items were commented in a header).
    59 // (other items were commented in a header).
    64 // -----------------------------------------------------------------------------
    60 // -----------------------------------------------------------------------------
    65 //
    61 //
    66 EXPORT_C void CRadioFmTunerUtility::RequestTunerControl()
    62 EXPORT_C void CRadioFmTunerUtility::RequestTunerControl()
    67     {
    63     {
    68     FUNC_LOG;
       
    69     ASSERT(iBody);
    64     ASSERT(iBody);
    70     iBody->RequestTunerControl();
    65     iBody->RequestTunerControl();
    71     }
    66     }
    72 
    67 
    73 // -----------------------------------------------------------------------------
    68 // -----------------------------------------------------------------------------
    75 // (other items were commented in a header).
    70 // (other items were commented in a header).
    76 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    77 //
    72 //
    78 EXPORT_C void CRadioFmTunerUtility::Close()
    73 EXPORT_C void CRadioFmTunerUtility::Close()
    79     {
    74     {
    80     FUNC_LOG;
       
    81     ASSERT(iBody);
    75     ASSERT(iBody);
    82     iBody->Close();
    76     iBody->Close();
    83     }
    77     }
    84 
    78 
    85 // -----------------------------------------------------------------------------
    79 // -----------------------------------------------------------------------------
    88 // -----------------------------------------------------------------------------
    82 // -----------------------------------------------------------------------------
    89 //
    83 //
    90 EXPORT_C TInt CRadioFmTunerUtility::GetCapabilities(
    84 EXPORT_C TInt CRadioFmTunerUtility::GetCapabilities(
    91     TFmTunerCapabilities& aCaps)
    85     TFmTunerCapabilities& aCaps)
    92     {
    86     {
    93     FUNC_LOG;
       
    94     ASSERT(iBody);
    87     ASSERT(iBody);
    95     return iBody->GetCapabilities(aCaps);
    88     return iBody->GetCapabilities(aCaps);
    96     }
    89     }
    97 
    90 
    98 // -----------------------------------------------------------------------------
    91 // -----------------------------------------------------------------------------
   102 //
    95 //
   103 EXPORT_C TInt CRadioFmTunerUtility::EnableTunerInOfflineMode(
    96 EXPORT_C TInt CRadioFmTunerUtility::EnableTunerInOfflineMode(
   104     TBool aEnable )
    97     TBool aEnable )
   105 
    98 
   106     {
    99     {
   107     FUNC_LOG;
       
   108     ASSERT(iBody);
   100     ASSERT(iBody);
   109     return iBody->EnableTunerInOfflineMode(aEnable);
   101     return iBody->EnableTunerInOfflineMode(aEnable);
   110     }
   102     }
   111 
   103 
   112 // -----------------------------------------------------------------------------
   104 // -----------------------------------------------------------------------------
   115 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   116 //
   108 //
   117 EXPORT_C void CRadioFmTunerUtility::SetFrequency(
   109 EXPORT_C void CRadioFmTunerUtility::SetFrequency(
   118     TInt aFrequency )
   110     TInt aFrequency )
   119     {
   111     {
   120     FUNC_LOG;
       
   121     ASSERT(iBody);
   112     ASSERT(iBody);
   122     iBody->SetFrequency(aFrequency);
   113     iBody->SetFrequency(aFrequency);
   123     }
   114     }
   124 
   115 
   125 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
   127 // (other items were commented in a header).
   118 // (other items were commented in a header).
   128 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   129 //
   120 //
   130 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequency()
   121 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequency()
   131     {
   122     {
   132     FUNC_LOG;
       
   133     ASSERT(iBody);
   123     ASSERT(iBody);
   134     iBody->CancelSetFrequency();
   124     iBody->CancelSetFrequency();
   135     }
   125     }
   136 
   126 
   137 // -----------------------------------------------------------------------------
   127 // -----------------------------------------------------------------------------
   140 // -----------------------------------------------------------------------------
   130 // -----------------------------------------------------------------------------
   141 //
   131 //
   142 EXPORT_C TInt CRadioFmTunerUtility::GetFrequency(
   132 EXPORT_C TInt CRadioFmTunerUtility::GetFrequency(
   143     TInt& aFrequency ) const
   133     TInt& aFrequency ) const
   144     {
   134     {
   145     FUNC_LOG;
       
   146     ASSERT(iBody);
   135     ASSERT(iBody);
   147     return iBody->GetFrequency(aFrequency);
   136     return iBody->GetFrequency(aFrequency);
   148     }
   137     }
   149 
   138 
   150 // -----------------------------------------------------------------------------
   139 // -----------------------------------------------------------------------------
   153 // -----------------------------------------------------------------------------
   142 // -----------------------------------------------------------------------------
   154 //
   143 //
   155 EXPORT_C void CRadioFmTunerUtility::SetFrequencyRange(
   144 EXPORT_C void CRadioFmTunerUtility::SetFrequencyRange(
   156     TFmRadioFrequencyRange aRange )
   145     TFmRadioFrequencyRange aRange )
   157     {
   146     {
   158     FUNC_LOG;
       
   159     ASSERT(iBody);
   147     ASSERT(iBody);
   160     iBody->SetFrequencyRange(aRange);
   148     iBody->SetFrequencyRange(aRange);
   161     }
   149     }
   162 
   150 
   163 // -----------------------------------------------------------------------------
   151 // -----------------------------------------------------------------------------
   165 // (other items were commented in a header).
   153 // (other items were commented in a header).
   166 // -----------------------------------------------------------------------------
   154 // -----------------------------------------------------------------------------
   167 //
   155 //
   168 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequencyRange()
   156 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequencyRange()
   169     {
   157     {
   170     FUNC_LOG;
       
   171     ASSERT(iBody);
   158     ASSERT(iBody);
   172     iBody->CancelSetFrequencyRange();
   159     iBody->CancelSetFrequencyRange();
   173     }
   160     }
   174 
   161 
   175 // -----------------------------------------------------------------------------
   162 // -----------------------------------------------------------------------------
   180 EXPORT_C TInt CRadioFmTunerUtility::GetFrequencyRange(
   167 EXPORT_C TInt CRadioFmTunerUtility::GetFrequencyRange(
   181     TFmRadioFrequencyRange& aRange,
   168     TFmRadioFrequencyRange& aRange,
   182     TInt& aMinFreq,
   169     TInt& aMinFreq,
   183     TInt& aMaxFreq ) const
   170     TInt& aMaxFreq ) const
   184     {
   171     {
   185     FUNC_LOG;
       
   186     ASSERT(iBody);
   172     ASSERT(iBody);
   187     return iBody->GetFrequencyRange(aRange, aMinFreq, aMaxFreq);
   173     return iBody->GetFrequencyRange(aRange, aMinFreq, aMaxFreq);
   188     }
   174     }
   189 
   175 
   190 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   179 // -----------------------------------------------------------------------------
   194 //
   180 //
   195 EXPORT_C void CRadioFmTunerUtility::StationSeek(
   181 EXPORT_C void CRadioFmTunerUtility::StationSeek(
   196     TBool aUpwards )
   182     TBool aUpwards )
   197     {
   183     {
   198     FUNC_LOG;
       
   199     ASSERT(iBody);
   184     ASSERT(iBody);
   200     iBody->StationSeek(aUpwards);
   185     iBody->StationSeek(aUpwards);
   201     }
   186     }
   202 
   187 
   203 // -----------------------------------------------------------------------------
   188 // -----------------------------------------------------------------------------
   205 // (other items were commented in a header).
   190 // (other items were commented in a header).
   206 // -----------------------------------------------------------------------------
   191 // -----------------------------------------------------------------------------
   207 //
   192 //
   208 EXPORT_C void CRadioFmTunerUtility::CancelStationSeek()
   193 EXPORT_C void CRadioFmTunerUtility::CancelStationSeek()
   209     {
   194     {
   210     FUNC_LOG;
       
   211     ASSERT(iBody);
   195     ASSERT(iBody);
   212     iBody->CancelStationSeek();
   196     iBody->CancelStationSeek();
   213     }
   197     }
   214 
   198 
   215 // -----------------------------------------------------------------------------
   199 // -----------------------------------------------------------------------------
   218 // -----------------------------------------------------------------------------
   202 // -----------------------------------------------------------------------------
   219 //
   203 //
   220 EXPORT_C TInt CRadioFmTunerUtility::GetSignalStrength(
   204 EXPORT_C TInt CRadioFmTunerUtility::GetSignalStrength(
   221     TInt& aSignalStrength ) const
   205     TInt& aSignalStrength ) const
   222     {
   206     {
   223     FUNC_LOG;
       
   224     ASSERT(iBody);
   207     ASSERT(iBody);
   225     return iBody->GetSignalStrength(aSignalStrength);
   208     return iBody->GetSignalStrength(aSignalStrength);
   226     }
   209     }
   227 
   210 
   228 // -----------------------------------------------------------------------------
   211 // -----------------------------------------------------------------------------
   231 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   232 //
   215 //
   233 EXPORT_C TInt CRadioFmTunerUtility::GetMaxSignalStrength(
   216 EXPORT_C TInt CRadioFmTunerUtility::GetMaxSignalStrength(
   234     TInt& aMaxSignalStrength ) const
   217     TInt& aMaxSignalStrength ) const
   235     {
   218     {
   236     FUNC_LOG;
       
   237     ASSERT(iBody);
   219     ASSERT(iBody);
   238     return iBody->GetMaxSignalStrength(aMaxSignalStrength);
   220     return iBody->GetMaxSignalStrength(aMaxSignalStrength);
   239     }
   221     }
   240 
   222 
   241 // -----------------------------------------------------------------------------
   223 // -----------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   245 //
   227 //
   246 EXPORT_C TInt CRadioFmTunerUtility::GetStereoMode(
   228 EXPORT_C TInt CRadioFmTunerUtility::GetStereoMode(
   247     TBool& aStereo ) const
   229     TBool& aStereo ) const
   248     {
   230     {
   249     FUNC_LOG;
       
   250     ASSERT(iBody);
   231     ASSERT(iBody);
   251     return iBody->GetStereoMode(aStereo);
   232     return iBody->GetStereoMode(aStereo);
   252     }
   233     }
   253 
   234 
   254 // -----------------------------------------------------------------------------
   235 // -----------------------------------------------------------------------------
   257 // -----------------------------------------------------------------------------
   238 // -----------------------------------------------------------------------------
   258 //
   239 //
   259 EXPORT_C TInt CRadioFmTunerUtility::ForceMonoReception(
   240 EXPORT_C TInt CRadioFmTunerUtility::ForceMonoReception(
   260     TBool aForcedMono )
   241     TBool aForcedMono )
   261     {
   242     {
   262     FUNC_LOG;
       
   263     ASSERT(iBody);
   243     ASSERT(iBody);
   264     return iBody->ForceMonoReception(aForcedMono);
   244     return iBody->ForceMonoReception(aForcedMono);
   265     }
   245     }
   266 
   246 
   267 // -----------------------------------------------------------------------------
   247 // -----------------------------------------------------------------------------
   270 // -----------------------------------------------------------------------------
   250 // -----------------------------------------------------------------------------
   271 //
   251 //
   272 EXPORT_C TInt CRadioFmTunerUtility::GetForcedMonoReception(
   252 EXPORT_C TInt CRadioFmTunerUtility::GetForcedMonoReception(
   273     TBool& aForcedMono ) const
   253     TBool& aForcedMono ) const
   274     {
   254     {
   275     FUNC_LOG;
       
   276     ASSERT(iBody);
   255     ASSERT(iBody);
   277     return iBody->GetForcedMonoReception(aForcedMono);
   256     return iBody->GetForcedMonoReception(aForcedMono);
   278     }
   257     }
   279 
   258 
   280 // -----------------------------------------------------------------------------
   259 // -----------------------------------------------------------------------------
   283 // -----------------------------------------------------------------------------
   262 // -----------------------------------------------------------------------------
   284 //
   263 //
   285 EXPORT_C TInt CRadioFmTunerUtility::SetSquelch(
   264 EXPORT_C TInt CRadioFmTunerUtility::SetSquelch(
   286     TBool aSquelch )
   265     TBool aSquelch )
   287     {
   266     {
   288     FUNC_LOG;
       
   289     ASSERT(iBody);
   267     ASSERT(iBody);
   290     return iBody->SetSquelch(aSquelch);
   268     return iBody->SetSquelch(aSquelch);
   291     }
   269     }
   292 
   270 
   293 // -----------------------------------------------------------------------------
   271 // -----------------------------------------------------------------------------
   296 // -----------------------------------------------------------------------------
   274 // -----------------------------------------------------------------------------
   297 //
   275 //
   298 EXPORT_C TInt CRadioFmTunerUtility::GetSquelch(
   276 EXPORT_C TInt CRadioFmTunerUtility::GetSquelch(
   299     TBool& aSquelch ) const
   277     TBool& aSquelch ) const
   300     {
   278     {
   301     FUNC_LOG;
       
   302     ASSERT(iBody);
   279     ASSERT(iBody);
   303     return iBody->GetSquelch(aSquelch);
   280     return iBody->GetSquelch(aSquelch);
   304     }
   281     }
   305 
   282 
   306 // End of File
   283 // End of File