fmradio/fmradioengine/inc/fmradioengineradiosettings.h
changeset 0 f3d95d9c00ab
equal deleted inserted replaced
-1:000000000000 0:f3d95d9c00ab
       
     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 RadioEngine settings.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef FMRADIOSETTINGS_H
       
    21 #define FMRADIOSETTINGS_H
       
    22 
       
    23 #include "fmradioengine.h"
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KDefaultRadioVolume = 3;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 //class CRadioEngine;
       
    30 
       
    31 
       
    32 /**
       
    33 *  TRadioSettings class.
       
    34 *  Maintain the radio setting data.
       
    35 * 
       
    36 */
       
    37 class TRadioSettings
       
    38     {
       
    39     public:
       
    40         /**  
       
    41         * default constructor.
       
    42         */
       
    43        TRadioSettings();
       
    44    
       
    45         /**
       
    46         * return current headset volume.
       
    47         * @since Series 60 2.7
       
    48         * @return current headset volume
       
    49         */
       
    50        TInt HeadsetVolume() const; 
       
    51         /**
       
    52         * return current speaker volume.
       
    53         * @since Series 60 2.7
       
    54         * @return current speaker volume
       
    55         */
       
    56    	    TInt SpeakerVolume() const;
       
    57         /**
       
    58         * return current preset number.
       
    59         * @since Series 60 2.7
       
    60         * @return current preset number
       
    61         */
       
    62         TInt CurrentPreset() const; 
       
    63         /**
       
    64         * return current frequency.
       
    65         * @since Series 60 2.7
       
    66         * @return current frequency
       
    67         */
       
    68         TInt Frequency() const; 
       
    69         /**
       
    70         * return max frequency.
       
    71         * @return max frequency
       
    72         */
       
    73         TUint32 MaxFrequency() const;
       
    74 	    /**
       
    75         * return min frequency.
       
    76         * @return min frequency
       
    77         */
       
    78         TUint32 MinFrequency() const;
       
    79 	    /**
       
    80         * return step size for tuning.
       
    81         * @return step size
       
    82         */
       
    83         TUint32 FrequencyStepSize() const;
       
    84 	    /**
       
    85 	    * Returns decimal count for current region MHz information  
       
    86 	    * @return decimal count for current region
       
    87 	    */
       
    88 	    TInt DecimalCount() const;	
       
    89         /**
       
    90         * return current audio mode.
       
    91         * @since Series 60 2.7
       
    92         * @return stereo/mono
       
    93         */
       
    94         CRadioEngine::TFMRadioAudioMode AudioMode() const; 
       
    95         /**
       
    96         * return current audio output destination.
       
    97         * @since Series 60 2.7
       
    98         * @return headset/IHF
       
    99         */
       
   100         CRadioEngine::TFMRadioAudioOutput AudioOutput() const;
       
   101         /**
       
   102         * check if radio is mute.
       
   103         * @since Series 60 2.7
       
   104         * @return true/false
       
   105         */
       
   106         TBool IsMuteOn() const;
       
   107         /**
       
   108         * check if radio is on.
       
   109         * @since Series 60 2.7
       
   110         * @return true/false
       
   111         */
       
   112         TBool IsRadioOn() const;
       
   113         /**
       
   114         * return radio mode.
       
   115         * @since Series 60 2.7
       
   116         * @return tune/preset mode
       
   117         */
       
   118         CRadioEngine::TRadioMode RadioMode() const; 
       
   119         /**
       
   120         * check if headset is connected.
       
   121         * @since Series 60 2.7
       
   122         * @return true/false
       
   123         */
       
   124         TBool IsHeadsetConnected() const; 
       
   125         /**
       
   126         * check if flight mode is enabled.
       
   127         * @since Series 60 2.7
       
   128         * @return true/false
       
   129         */
       
   130        TBool IsFlightModeEnabled() const;
       
   131        /**
       
   132         * Retrieves the RDS alternate frequency search setting
       
   133         *
       
   134         * @return ETrue if AF search is enabled, otherwise EFalse
       
   135         */
       
   136        IMPORT_C TBool IsRdsAfSearchEnabled();
       
   137         /**
       
   138         * set speaker volume.
       
   139         * @since Series 60 2.7
       
   140         * @param aVolume the new volume
       
   141         * @return none
       
   142         */
       
   143        void SetSpeakerVolume(const TInt aVolume);
       
   144         /**
       
   145         * set headset volume.
       
   146         * @since Series 60 2.7
       
   147         * @param aVolume the new volume
       
   148         * @return none
       
   149         */
       
   150        void SetHeadsetVolume(const TInt aVolume);
       
   151         /**
       
   152         * Set current preset number.
       
   153         * @since Series 60 2.7
       
   154         * @return current preset number
       
   155         */
       
   156        void SetCurrentPreset(const TInt aChannel);
       
   157         /**
       
   158         * set current frequency .
       
   159         * @since Series 60 2.7
       
   160         * @param aFrequency the frequency to be set
       
   161         * @return none
       
   162         */
       
   163        void SetFrequency(const TInt aFrequency);
       
   164         /**
       
   165         * set max frequency.
       
   166         * @param aMaxFrequency the frequency to be set
       
   167         * @return none
       
   168         */
       
   169 	   void SetMaxFrequency( const TUint32 aMaxFrequency );
       
   170 	    /**
       
   171         * set min frequency.
       
   172         * @param aMinFrequency the frequency to be set
       
   173         * @return none
       
   174         */
       
   175 	    void SetMinFrequency( const TUint32 aMinFrequency );
       
   176 	    /**
       
   177         * set step size for manual tuning.
       
   178         * @param aFrequencyStepSize frequency step
       
   179         * @return none
       
   180         */
       
   181 	    void SetFrequencyStepSize( const TUint32 aFrequencyStepSize );
       
   182 	    /**
       
   183 	    * Set decimal count for current region MHz information  
       
   184 	    * @param aDecimalCount decimals used
       
   185 	    * @return none
       
   186 	    */
       
   187 	    void SetDecimalCount( const TInt aDecimalCount );	
       
   188         /**
       
   189         * set audio mode.
       
   190         * @since Series 60 2.7
       
   191         * @param aAudioMode stereo/mono
       
   192         * @return none
       
   193         */
       
   194        void SetAudioMode(CRadioEngine::TFMRadioAudioMode aAudioMode);
       
   195         /**
       
   196         * set audio output.
       
   197         * @since Series 60 2.7
       
   198         * @param aAudioOutput headset/IHF
       
   199         */
       
   200        void SetAudioOutput(const CRadioEngine::TFMRadioAudioOutput aAudioOutput );
       
   201         /**
       
   202         * set mute on.
       
   203         * @since Series 60 2.7
       
   204         * @return none
       
   205         */
       
   206        void SetMuteOn();
       
   207         /**
       
   208         * set mute on.
       
   209         * @since Series 60 2.7
       
   210         * @return none
       
   211         */
       
   212        void SetMuteOff();
       
   213         /**
       
   214         * set radio on.
       
   215         * @since Series 60 2.7
       
   216         * @return none
       
   217         */
       
   218        void SetRadioOn();
       
   219         /**
       
   220         * set radio off.
       
   221         * @since Series 60 2.7
       
   222         * @return none
       
   223         */
       
   224        void SetRadioOff();
       
   225         /**
       
   226         * set radio mode.
       
   227         * @since Series 60 2.7
       
   228         * @param aRadioMode preset/tune mode
       
   229         * @return none
       
   230         */
       
   231        void SetRadioMode(const CRadioEngine::TRadioMode aRadioMode);
       
   232         /**
       
   233         * set headset connected.
       
   234         * @since Series 60 2.7
       
   235         * @return none
       
   236         */
       
   237        void SetHeadsetConnected();
       
   238         /**
       
   239         * set headset disconnected.
       
   240         * @since Series 60 2.7
       
   241         * @return none
       
   242         */
       
   243        void SetHeadsetDisconnected();
       
   244         /**
       
   245         * set flight mode.
       
   246         * @since Series 60 2.7
       
   247         * @param aEnabled true/false
       
   248         * @return none
       
   249         */
       
   250        void SetFlightMode( TBool aEnabled );
       
   251        /**
       
   252        * set startup count
       
   253        * @param aStartupCount number of app startups
       
   254        */
       
   255        void SetStartupCount( const TInt aStartupCount );
       
   256        /**
       
   257        * return startup count
       
   258        * @return number of app startups
       
   259        */
       
   260 	   TInt StartupCount() const;
       
   261 
       
   262        /**
       
   263         * Set rds af search enabled.
       
   264         * @return none
       
   265         */
       
   266        void SetRdsAfSearchEnabled();
       
   267        /**
       
   268         * Set rds af search disabled.
       
   269         * @return none
       
   270         */
       
   271        void SetRdsAfSearchDisabled();
       
   272        /**
       
   273         * Set Japan region support on/off.
       
   274         * @param aAllowed true/false
       
   275         * @return none
       
   276         */
       
   277        void SetJapanRegionAllowed( const TBool aAllowed );
       
   278        /**
       
   279         * Return status of the Japan region support
       
   280         * @return ETrue if supported
       
   281         */       
       
   282        TBool IsJapanRegionAllowed() const;
       
   283               
       
   284     private: 
       
   285         /// current headset volume level
       
   286         TInt iFMRadioHeadsetVolume;
       
   287         /// current speaker volume level
       
   288         TInt iFMRadioSpeakerVolume;
       
   289         /// currently selected channel.
       
   290         TInt iCurrentPreset; 
       
   291         /// current frequency
       
   292         TInt iFrequency; 
       
   293         // max frequency 
       
   294         TUint32 iMaxFrequency;
       
   295         //  min frequency
       
   296         TUint32 iMinFrequency;
       
   297         // step size
       
   298         TUint32 iFrequencyStepSize;
       
   299         // decimal count
       
   300         TInt iDecimalCount;
       
   301         /// stereo or mono
       
   302         CRadioEngine::TFMRadioAudioMode iAudioMode; 
       
   303         /// audio output
       
   304         CRadioEngine::TFMRadioAudioOutput iAudioOutput;
       
   305         /// current mute state
       
   306         TBool iMuteOn;
       
   307         //  radio on/off flag
       
   308         TBool iRadioOn;
       
   309         /// preset or direct frequency flag
       
   310         CRadioEngine::TRadioMode iRadioMode; 
       
   311         /// headset connected flag
       
   312         TBool iIsHeadsetConnected; 
       
   313         /// flight mode enabled flag
       
   314         TBool iFlightModeEnabled;
       
   315         // first startup case flag
       
   316         TInt iStartupCount;        
       
   317         //  rds af search enabled flag
       
   318         TBool iRdsAfSearchEnabled;
       
   319         //  Japan region support flag
       
   320         TBool iJapanRegionAllowed;
       
   321 
       
   322     };
       
   323 
       
   324 #endif  // FMRADIOSETTINGS_H
       
   325 
       
   326 // End of File