mmserv/radioutility/radio_utility/stub/src/StubRadioFmTunerUtilityBody.cpp
changeset 38 9e9fc5ab059f
equal deleted inserted replaced
36:73253677b50a 38:9e9fc5ab059f
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Radio FM Tuner Utility implementation body's stub.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "RadioFmTunerUtilityBody.h"
       
    20 #include "RadioUtilityBody.h"
       
    21 #include "RadioStubManager.h"
       
    22 
       
    23 
       
    24 #define STUB  CRadioStubManager::GetRadioStubManager()->iTuner
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CRadioFmTunerUtility::CBody::NewL
       
    28 // Two-phased constructor.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CRadioFmTunerUtility::CBody* CRadioFmTunerUtility::CBody::NewL(
       
    32     RRadioSession& aRadioSession,
       
    33     MRadioFmTunerObserver& aObserver )
       
    34     {
       
    35     if ( STUB.iLeaveNewL.iError )
       
    36         {
       
    37         User::Leave( STUB.iLeaveNewL.iError );
       
    38         }
       
    39     CRadioFmTunerUtility::CBody* s = new(ELeave) CRadioFmTunerUtility::CBody( aRadioSession, aObserver );
       
    40     CleanupStack::PushL(s);
       
    41     s->ConstructL();
       
    42     CleanupStack::Pop();
       
    43     return s;
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CRadioFmTunerUtility::ConstructL
       
    48 // Two-phased constructor.
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 void CRadioFmTunerUtility::CBody::ConstructL()
       
    52     {
       
    53     if ( STUB.iLeaveErrorForConstructL.iError )
       
    54         {
       
    55         User::Leave( STUB.iLeaveErrorForConstructL.iError );
       
    56         }
       
    57     STUB.iRadioFmTunerUtilityClient = &iRadioFmTunerUtilityClient;
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CRadioFmTunerUtility::CBody::CBody
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CRadioFmTunerUtility::CBody::CBody(
       
    65         RRadioSession& aRadioSession,
       
    66         MRadioFmTunerObserver& aObserver )
       
    67     :iRadioSession( aRadioSession ), 
       
    68     iRadioFmTunerUtilityClient( aObserver )
       
    69     
       
    70     {
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CRadioFmTunerUtility::CBody::~CBody
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 CRadioFmTunerUtility::CBody::~CBody()
       
    78     {
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CRadioFmTunerUtility::CBody::RequestTunerControl
       
    83 // (other items were commented in a header).
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 void CRadioFmTunerUtility::CBody::RequestTunerControl()
       
    87     {
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CRadioFmTunerUtility::CBody::Close
       
    92 // (other items were commented in a header).
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void CRadioFmTunerUtility::CBody::Close()
       
    96     {
       
    97     // Consider releasing tuner control here.
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CRadioFmTunerUtility::CBody::GetCapabilities
       
   102 // (other items were commented in a header).
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CRadioFmTunerUtility::CBody::GetCapabilities(
       
   106     TFmTunerCapabilities& aCaps ) const
       
   107     {
       
   108     aCaps.iTunerBands = STUB.iCaps.iTunerBands;
       
   109     aCaps.iTunerFunctions = STUB.iCaps.iTunerFunctions;
       
   110     aCaps.iAdditionalFunctions1 = STUB.iCaps.iAdditionalFunctions1;
       
   111     aCaps.iAdditionalFunctions2 = STUB.iCaps.iAdditionalFunctions2;
       
   112     return STUB.iGetCapabilitiesError.Error();
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CRadioFmTunerUtility::CBody::EnableTunerInOfflineMode
       
   117 // (other items were commented in a header).
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 TInt CRadioFmTunerUtility::CBody::EnableTunerInOfflineMode(
       
   121     TBool aEnable )
       
   122     {
       
   123     STUB.iTunerInOfflineMode = aEnable;
       
   124     return STUB.iEnableTunerInOfflineModeError.Error();
       
   125     }
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // CRadioFmTunerUtility::CBody::GetFrequencyRange
       
   129 // (other items were commented in a header).
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 TInt CRadioFmTunerUtility::CBody::GetFrequencyRange(
       
   133     TFmRadioFrequencyRange& aRange,
       
   134     TInt& aMinFreq,
       
   135     TInt& aMaxFreq ) const
       
   136     {
       
   137 
       
   138     aRange = STUB.iRange;
       
   139     aMinFreq = STUB.iMinFreq;
       
   140     aMaxFreq = STUB.iMaxFreq;
       
   141 #ifdef _DEBUG
       
   142     RDebug::Print(_L("CRadioFmTunerUtility::CBody::GetFrequencyRange, aRange = %d, aMinFreq = %d, aMaxFreq = %d"),
       
   143         aRange, aMinFreq, aMaxFreq);
       
   144 #endif
       
   145     return STUB.iGetFrequencyRangeError.Error();
       
   146     }
       
   147 
       
   148 
       
   149 // -----------------------------------------------------------------------------
       
   150 // CRadioFmTunerUtility::CBody::SetFrequencyRange
       
   151 // (other items were commented in a header).
       
   152 // -----------------------------------------------------------------------------
       
   153 //
       
   154 void CRadioFmTunerUtility::CBody::SetFrequencyRange(
       
   155     TFmRadioFrequencyRange aRange )
       
   156     {
       
   157 #ifdef _DEBUG
       
   158     RDebug::Print(_L("CRadioFmTunerUtility::CBody::SetFrequencyRange, aRange = %d"), aRange);
       
   159 #endif
       
   160     STUB.iPreviousRange = STUB.iRange;
       
   161     STUB.iRange = aRange;
       
   162     }
       
   163 
       
   164 
       
   165 // -----------------------------------------------------------------------------
       
   166 // CRadioFmTunerUtility::CBody::CancelSetFrequencyRange
       
   167 // (other items were commented in a header).
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 void CRadioFmTunerUtility::CBody::CancelSetFrequencyRange()
       
   171     {
       
   172     STUB.iRange = STUB.iPreviousRange;
       
   173     }
       
   174 
       
   175 // -----------------------------------------------------------------------------
       
   176 // CRadioFmTunerUtility::CBody::SetFrequency
       
   177 // (other items were commented in a header).
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CRadioFmTunerUtility::CBody::SetFrequency(
       
   181     TInt aFrequency )
       
   182     {
       
   183 #ifdef _DEBUG
       
   184     RDebug::Print(_L("CRadioFmTunerUtility::CBody::SetFrequency, aFrequency = %d"), aFrequency);
       
   185 #endif
       
   186     STUB.iPreviousFrequency = STUB.iFrequency;
       
   187     STUB.iFrequency = aFrequency;
       
   188     }
       
   189 
       
   190 // -----------------------------------------------------------------------------
       
   191 // CRadioFmTunerUtility::CBody::CancelSetFrequencyRange
       
   192 // Body of CancelSetFrequencyRange
       
   193 // (other items were commented in a header).
       
   194 // -----------------------------------------------------------------------------
       
   195 //
       
   196 void CRadioFmTunerUtility::CBody::CancelSetFrequency()
       
   197     {
       
   198     STUB.iFrequency = STUB.iPreviousFrequency;
       
   199     STUB.iPreviousFrequency = 0;
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CRadioFmTunerUtility::CBody::GetFrequency
       
   204 // (other items were commented in a header).
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 TInt CRadioFmTunerUtility::CBody::GetFrequency(
       
   208     TInt& aFrequency ) const
       
   209     {
       
   210     aFrequency = STUB.iFrequency;
       
   211     return STUB.iGetFrequencyError.Error();
       
   212     }
       
   213 
       
   214 // -----------------------------------------------------------------------------
       
   215 // CRadioFmTunerUtility::CBody::StationSeek
       
   216 // (other items were commented in a header).
       
   217 // -----------------------------------------------------------------------------
       
   218 //
       
   219 void CRadioFmTunerUtility::CBody::StationSeek(
       
   220     TBool aUpwards )
       
   221     {
       
   222 #ifdef _DEBUG
       
   223     RDebug::Print(_L("CRadioFmTunerUtility::CBody::StationSeek, aUpwards = %d"), aUpwards);
       
   224 #endif
       
   225     STUB.iStationSeekUpwards = aUpwards;
       
   226     }
       
   227 
       
   228 // -----------------------------------------------------------------------------
       
   229 // CRadioFmTunerUtility::CBody::CancelStationSeek
       
   230 // (other items were commented in a header).
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 void CRadioFmTunerUtility::CBody::CancelStationSeek()
       
   234     {
       
   235     STUB.iStationSeekUpwards = EFalse;
       
   236     }
       
   237 
       
   238 // -----------------------------------------------------------------------------
       
   239 // CRadioFmTunerUtility::CBody::GetSignalStrength
       
   240 // (other items were commented in a header).
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243 TInt CRadioFmTunerUtility::CBody::GetSignalStrength(
       
   244     TInt& aSignalStrength ) const
       
   245     {
       
   246     aSignalStrength = STUB.iSignalStrength;
       
   247     return STUB.iGetSignalStrengthError.Error();
       
   248     }
       
   249 
       
   250 // -----------------------------------------------------------------------------
       
   251 // CRadioFmTunerUtility::GetMaxSignalStrength
       
   252 // (other items were commented in a header).
       
   253 // -----------------------------------------------------------------------------
       
   254 //
       
   255 TInt CRadioFmTunerUtility::CBody::GetMaxSignalStrength(
       
   256     TInt& aMaxSignalStrength ) const
       
   257     {
       
   258     aMaxSignalStrength = STUB.iMaxSignalStrength;
       
   259     return STUB.iGetMaxSignalStrengthError.Error();
       
   260     }
       
   261 
       
   262 // -----------------------------------------------------------------------------
       
   263 // CRadioFmTunerUtility::CBody::GetStereoMode
       
   264 // (other items were commented in a header).
       
   265 // -----------------------------------------------------------------------------
       
   266 //
       
   267 TInt CRadioFmTunerUtility::CBody::GetStereoMode(
       
   268     TBool& aStereo ) const
       
   269     {
       
   270     aStereo = STUB.iStereoMode;
       
   271     return STUB.iGetStereoModeError.Error();
       
   272     }
       
   273 
       
   274 // -----------------------------------------------------------------------------
       
   275 // CRadioFmTunerUtility::CBody::ForceMonoReception
       
   276 // (other items were commented in a header).
       
   277 // -----------------------------------------------------------------------------
       
   278 //
       
   279 TInt CRadioFmTunerUtility::CBody::ForceMonoReception(
       
   280     TBool aForcedMono)
       
   281     {
       
   282     STUB.iForcedMono = aForcedMono;
       
   283     return STUB.iForcedMonoReceptionError.Error();
       
   284     }
       
   285 
       
   286 // -----------------------------------------------------------------------------
       
   287 // CRadioFmTunerUtility::CBody::GetForcedMonoReception
       
   288 // (other items were commented in a header).
       
   289 // -----------------------------------------------------------------------------
       
   290 //
       
   291 TInt CRadioFmTunerUtility::CBody::GetForcedMonoReception(
       
   292     TBool& aForcedMono ) const
       
   293     {
       
   294     aForcedMono = STUB.iForcedMono;
       
   295     return STUB.iGetForcedMonoReceptionError.Error();
       
   296     }
       
   297 
       
   298 // -----------------------------------------------------------------------------
       
   299 // CRadioFmTunerUtility::CBody::SetSquelch
       
   300 // (other items were commented in a header).
       
   301 // -----------------------------------------------------------------------------
       
   302 //
       
   303 TInt CRadioFmTunerUtility::CBody::SetSquelch(
       
   304     TBool aSquelch )
       
   305     {
       
   306     STUB.iSquelch = aSquelch;
       
   307     return STUB.iSetSquelchError.Error();
       
   308     }
       
   309 
       
   310 // -----------------------------------------------------------------------------
       
   311 // CRadioFmTunerUtility::CBody::GetSquelch
       
   312 // (other items were commented in a header).
       
   313 // -----------------------------------------------------------------------------
       
   314 //
       
   315 TInt CRadioFmTunerUtility::CBody::GetSquelch(
       
   316     TBool& aSquelch ) const
       
   317     {
       
   318     aSquelch = STUB.iSquelch;
       
   319     return STUB.iGetSquelchError.Error();
       
   320     }
       
   321 
       
   322 // End of File
       
   323 
       
   324 
       
   325 
       
   326 
       
   327