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