mmserv/radioutility/fmpresetutility/src/RadioFmPresetRadioSettings.cpp
changeset 12 5a06f39ad45b
parent 0 71ca22bcf22a
child 14 80975da52420
equal deleted inserted replaced
0:71ca22bcf22a 12:5a06f39ad45b
     1 /*
       
     2 * Copyright (c) 2005 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:  Contains implementation of the TRadioSettings class, which holds 
       
    15 *                       the RadioFmPresetUtility settings.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 //  INCLUDES
       
    21 #include <RadioFmPresetUtility.h>
       
    22 #include <RadioPresetUtility.h>
       
    23 #include "RadioFmPresetUtilityBody.h"
       
    24 #include "RadioFmPresetRadioSettings.h"
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // ----------------------------------------------------
       
    30 // TRadioSettings::TRadioSettings
       
    31 // Default class constructor.
       
    32 // ----------------------------------------------------
       
    33 //
       
    34 TRadioSettings::TRadioSettings():
       
    35                     iCurrentPreset(0),
       
    36                     iFrequency(KDefaultRadioFrequency),
       
    37                     iRadioOn(EFalse)
       
    38     {
       
    39     }
       
    40 
       
    41 // ----------------------------------------------------
       
    42 // TRadioSettings::CurrentPreset
       
    43 // retrieve currently selected channel
       
    44 // Returns: iCurrentPreset: current preset index number
       
    45 // ----------------------------------------------------
       
    46 //
       
    47 TInt TRadioSettings::CurrentPreset() const
       
    48     {
       
    49     return iCurrentPreset;
       
    50     }
       
    51 
       
    52 // ----------------------------------------------------
       
    53 // TRadioSettings::Frequency
       
    54 // retrieve current frequency
       
    55 // Returns: iFrequency: current frequency
       
    56 // ----------------------------------------------------
       
    57 //
       
    58 TInt TRadioSettings::Frequency() const
       
    59     {
       
    60     return iFrequency;
       
    61     }
       
    62 
       
    63 // ----------------------------------------------------
       
    64 // TRadioSettings::IsRadioOn
       
    65 // retrieve current radio on state (on/off)
       
    66 // Returns: iRadioOn: a flag indicating radio on/off
       
    67 // ----------------------------------------------------
       
    68 //
       
    69 TBool TRadioSettings::IsRadioOn() const
       
    70     {
       
    71     return iRadioOn;
       
    72     }
       
    73 
       
    74 // ----------------------------------------------------
       
    75 // TRadioSettings::SetCurrentPreset
       
    76 // set the current preset
       
    77 // Returns: none
       
    78 // ----------------------------------------------------
       
    79 //
       
    80 void TRadioSettings::SetCurrentPreset(
       
    81     const TInt aChannel) //new channel to be set
       
    82     {
       
    83     iCurrentPreset = aChannel;
       
    84     }
       
    85 
       
    86 // ----------------------------------------------------
       
    87 // TRadioSettings::SetFrequency
       
    88 // set the current frequency
       
    89 // Returns: none
       
    90 // ----------------------------------------------------
       
    91 //
       
    92 void TRadioSettings::SetFrequency(
       
    93     const TInt aFrequency) // new frequency
       
    94     {
       
    95     iFrequency = aFrequency;
       
    96     }
       
    97 
       
    98 // ----------------------------------------------------
       
    99 // TRadioSettings::SetRadioOn
       
   100 // set radio state to "on"
       
   101 // Returns: none
       
   102 // ----------------------------------------------------
       
   103 //
       
   104 void TRadioSettings::SetRadioOn()
       
   105     {
       
   106     iRadioOn = ETrue;
       
   107     }
       
   108 
       
   109 // ----------------------------------------------------
       
   110 // TRadioSettings::SetRadioOff
       
   111 // set radio state to "off"
       
   112 // Returns: none
       
   113 // ----------------------------------------------------
       
   114 //
       
   115 void TRadioSettings::SetRadioOff()
       
   116     {
       
   117     iRadioOn = EFalse;
       
   118     }
       
   119 
       
   120 
       
   121 
       
   122 // end of file
       
   123