radioengine/engine/inc/cradioengineimp.h
branchGCC_SURGE
changeset 37 451b2e1545b2
parent 14 63aabac4416d
parent 28 075425b8d9a4
equal deleted inserted replaced
26:6bcf277166c1 37:451b2e1545b2
    34 class CRadioRdsReceiverBase;
    34 class CRadioRdsReceiverBase;
    35 class CRadioNetworkInfoListener;
    35 class CRadioNetworkInfoListener;
    36 class MRadioEngineSettings;
    36 class MRadioEngineSettings;
    37 class MRadioSettingsSetter;
    37 class MRadioSettingsSetter;
    38 class MRadioEngineObserver;
    38 class MRadioEngineObserver;
    39 class MRadioScanObserver;
       
    40 
    39 
    41 /**
    40 /**
    42  * Radio class takes care of the FM-radio side.
    41  * Radio class takes care of the FM-radio side.
    43  */
    42  */
    44 NONSHARABLE_CLASS( CRadioEngineImp ) : public CRadioEngine
    43 NONSHARABLE_CLASS( CRadioEngineImp ) : public CRadioEngine
    54 
    53 
    55     ~CRadioEngineImp();
    54     ~CRadioEngineImp();
    56 
    55 
    57     void SetSystemEventCollector( CRadioSystemEventCollector* aCollector );
    56     void SetSystemEventCollector( CRadioSystemEventCollector* aCollector );
    58     void SetRadioSettings( CRadioSettings* aSettings );
    57     void SetRadioSettings( CRadioSettings* aSettings );
    59     void SetRadioPubSub( CRadioPubSub* aPubSub );
       
    60 
    58 
    61 private:
    59 private:
    62 
    60 
    63     CRadioEngineImp( CRadioAudioRouter* aAudioRouter );
    61     CRadioEngineImp( CRadioAudioRouter* aAudioRouter );
    64 
    62 
    65 // from base class CRadioEngine
    63 // from base class CRadioEngine
    66 
    64 
    67     CRadioAudioRouter& AudioRouter() const;
    65     CRadioAudioRouter& AudioRouter() const;
    68     CRadioSystemEventCollector& SystemEventCollector() const;
    66     CRadioSystemEventCollector& SystemEventCollector() const;
    69     CRadioSettings& Settings() const;
    67     CRadioSettings& Settings() const;
    70     CRadioPubSub* PubSub() const;
       
    71     TRadioRegion DetermineRegion();
    68     TRadioRegion DetermineRegion();
    72     void InitRadioL( TInt aRegionId, CRadioPubSub* aPubSub = 0 );
    69     void InitRadioL( TInt aRegionId );
    73     TBool RadioInitialized() const;
    70     TBool RadioInitialized() const;
    74     void EnableAudio( TBool aEnable, TBool aDelay = ETrue );
    71     void EnableAudio( TBool aEnable, TBool aDelay = ETrue );
    75     TBool RadioAudioEnabled() const;
    72     TBool RadioAudioEnabled() const;
    76     void SetAudioOverride( TBool aOverride );
    73     void SetAudioOverride( TBool aOverride );
    77     void AddObserverL( MRadioEngineObserver* aObserver );
    74     void AddObserverL( MRadioEngineObserver* aObserver );
    78     void RemoveObserver( MRadioEngineObserver* aObserver );
    75     void RemoveObserver( MRadioEngineObserver* aObserver );
    79     void SetAudioMode( TInt aAudioMode );
    76     void SetAudioMode( TInt aAudioMode );
    80     TBool IsFrequencyValid( TUint32 aFrequency = 0 ) const;
    77     TBool IsFrequencyValid( TUint32 aFrequency = 0 ) const;
       
    78     void SetManualSeekMode( TBool aManualSeekActive );
       
    79     TBool IsInManualSeekMode() const;
    81     void SetFrequency( TUint32 aFrequency,
    80     void SetFrequency( TUint32 aFrequency,
    82             RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown );
    81             RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown );
    83     void SetFrequencyFast( TUint32 aFrequency,
       
    84             RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown );
       
    85     void StepToFrequency( RadioEngine::TRadioTuneDirection aDirection );
       
    86     void Seek( RadioEngine::TRadioTuneDirection aDirection );
    82     void Seek( RadioEngine::TRadioTuneDirection aDirection );
    87     void CancelSeek();
    83     void CancelSeek();
    88     RadioEngine::TRadioSeeking Seeking() const;
    84     RadioEngine::TRadioSeeking Seeking() const;
    89     void StartScan( MRadioScanObserver& aObserver );
       
    90     void StopScan( TInt aError = KErrCancel );
       
    91     void AdjustVolume( RadioEngine::TRadioVolumeSetDirection aDirection );
    85     void AdjustVolume( RadioEngine::TRadioVolumeSetDirection aDirection );
    92     void SetVolume( TInt aVolume );
    86     void SetVolume( TInt aVolume );
    93     void SetVolumeMuted( TBool aMute );
    87     void SetVolumeMuted( TBool aMute, TBool aUpdateSettings = ETrue );
    94     TBool IsAntennaAttached();
    88     TBool IsAntennaAttached();
    95     TBool IsFmTransmitterActive() const;
    89     TBool IsFmTransmitterActive() const;
    96     void SetAntennaAttached( TBool aAntennaAttached );
    90     void SetAntennaAttached( TBool aAntennaAttached );
    97     TInt MaxVolumeLevel() const;
    91     TInt MaxVolumeLevel() const;
    98     TBool FrequencySetByRdsAf() const;
    92     TBool FrequencySetByRdsAf() const;
   199      * @param aErrorCode error code related to state change
   193      * @param aErrorCode error code related to state change
   200      */
   194      */
   201     void DoNotifyRadioEventL( TInt aRadioEvent, TInt aErrorCode = KErrNone );
   195     void DoNotifyRadioEventL( TInt aRadioEvent, TInt aErrorCode = KErrNone );
   202 
   196 
   203     /**
   197     /**
   204      * Notifies the observer of a radio scan event.
       
   205      *
       
   206      * @param   aEvent      Event to notify.
       
   207      * @param   aObserver   Scan observer.
       
   208      * @param   aError      Error code the event completed with.
       
   209      */
       
   210     void NotifyRadioScanEvent( TRadioScanEvent aEvent, MRadioScanObserver& aObserver,
       
   211                                TInt aError = KErrNone );
       
   212 
       
   213     /**
       
   214      * Notifies the observer of a radio scan event.
       
   215      *
       
   216      * @param   aEvent      Event to notify.
       
   217      * @param   aObserver   Scan observer.
       
   218      * @param   aError      Error code the event completed with.
       
   219      */
       
   220     void DoNotifyRadioScanEventL( TRadioScanEvent aEvent, MRadioScanObserver& aObserver,
       
   221                                   TInt aError );
       
   222 
       
   223     /**
       
   224      * Handles the change in audio routing
   198      * Handles the change in audio routing
   225      *
   199      *
   226      * @param aDestination The new routing destination
   200      * @param aDestination The new routing destination
   227      */
   201      */
   228     void HandleAudioRoutingEvent( RadioEngine::TRadioAudioRoute aDestination );
   202     void HandleAudioRoutingEvent( RadioEngine::TRadioAudioRoute aDestination );
   399      * Cause for the ongoing frequency change operation.
   373      * Cause for the ongoing frequency change operation.
   400      */
   374      */
   401     RadioEngine::TRadioFrequencyEventReason     iFreqEventReason;
   375     RadioEngine::TRadioFrequencyEventReason     iFreqEventReason;
   402 
   376 
   403     /**
   377     /**
   404      * Publish&Subscribe object. Can be NULL.
       
   405      * Owned if set
       
   406      */
       
   407     CRadioPubSub*                               iPubSub;
       
   408 
       
   409     /**
       
   410      * Radio scan observer. NULL when scanning is not ongoing
       
   411      * Not owned.
       
   412      */
       
   413     MRadioScanObserver*                         iScanObserver;
       
   414 
       
   415     /**
       
   416      * The previously scanned frequency, or <code>KErrNotFound</code> if none.
   378      * The previously scanned frequency, or <code>KErrNotFound</code> if none.
   417      */
   379      */
   418     TUint32                                     iPreviousScannedFrequency;
   380     TUint32                                     iPreviousScannedFrequency;
   419 
   381 
   420     /**
   382     /**
   421      * The state of mute before scan has been started.
   383      * The state of mute before scan has been started.
   422      */
   384      */
   423     TBool                                       iPreviousMuteState;
   385     TBool                                       iPreviousMuteState;
   424 
   386 
       
   387     /**
       
   388      * Manual seek mode flag
       
   389      */
       
   390     TBool                                       iManualSeekMode;
       
   391 
   425     };
   392     };
   426 
   393 
   427 #endif  // CRADIOENGINEIMP_H
   394 #endif  // CRADIOENGINEIMP_H
   428 
   395