internetradio2.0/uiinc/irnowplayingwrapper.h
changeset 3 ee64f059b8e1
parent 2 2e1adbfc62af
child 4 3f2d53f144fe
child 5 0930554dc389
equal deleted inserted replaced
2:2e1adbfc62af 3:ee64f059b8e1
     1 /*
       
     2 * Copyright (c) 2006-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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /* ---------------------------------------------------------------------------
       
    20 *  Version history:
       
    21 *  Template version:
       
    22 *  <ccm_history>
       
    23 *
       
    24 *  Version: 19, Fri Sep 19 13:00:00 2008 by Rohit
       
    25 *  Ref:
       
    26 *  Added ASF detection and Integrated CIRAsfPlayer in Now Playing scenario
       
    27 *
       
    28 *  </ccm_history>
       
    29 * ============================================================================
       
    30 */
       
    31 
       
    32 #ifndef IRNOWPLAYINGWRAPPER_H
       
    33 #define IRNOWPLAYINGWRAPPER_H
       
    34 
       
    35 #include <e32base.h>
       
    36 #include <BADESCA.H>
       
    37 #include <AknProgressDialog.h>
       
    38 
       
    39 #include "irstreamsourceobserver.h"
       
    40 #include "irctrlcommand.h"
       
    41 #include "IRNetworkControllerObserver.h" //TIRConnectionType Defined
       
    42 #include "irsessionlogger.h" //TConnectedFrom defined
       
    43 #include <Etel3rdParty.h>
       
    44 #include "IRActiveNetworkObserver.h"
       
    45 class CIRStreamSource;
       
    46 class CIRCtrlCmdObserver;
       
    47 class CIRMediaClient;
       
    48 class CIRReportGenerator;
       
    49 class CIRSettings;
       
    50 class CIRIsdsWrapper;
       
    51 class CIRMetaData;
       
    52 class CIRIsdsPreset;
       
    53 class CIRUi;
       
    54 class CAknWaitDialog;
       
    55 class CIRAsfPlayer;
       
    56 
       
    57 //CONSTANTS
       
    58 
       
    59 //Ulr Validation
       
    60 const TInt KMaxBufferSize = 256;
       
    61 const TInt KMaxUrlSize = 256;
       
    62 enum TSyncState
       
    63 	{
       
    64 	ESyncStateNull,
       
    65 	ESyncReqPending,
       
    66 	ESyncPsChanged,
       
    67 	EPsConnectionFailed,
       
    68 	EPsConnectionSuccessful
       
    69 	};
       
    70 
       
    71 //for nowplaying view
       
    72 
       
    73 enum TIRViews
       
    74 {
       
    75   ELastplayed=0,
       
    76   EFav,
       
    77   ESearch,
       
    78   EHistoryView,
       
    79   EStations,
       
    80   EBrowseByTopStations,
       
    81   EPls
       
    82 };	
       
    83 
       
    84 
       
    85 class CIRNowPlayingWrapper:public CBase,
       
    86 						   public MIRStreamSourceObserver,
       
    87 						   public MIRCtrlCmdObserver,
       
    88 						   public MProgressDialogCallback,
       
    89 						   public MIRActiveNetworkObserver
       
    90 	{
       
    91 	
       
    92 public:
       
    93 
       
    94 	/* Function : NewL
       
    95 	 * function to return an instance of CIRIsdsWrapper
       
    96 	 * Two phase constructor
       
    97      */
       
    98  	static CIRNowPlayingWrapper* NewL(CIRUi& aAppUi,CIRSettings& aIRSettings,
       
    99  								CIRIsdsWrapper& aIsdsWrapper);        
       
   100 
       
   101     /**
       
   102      * NewLC.
       
   103      * Two-phased constructor.
       
   104      * Create a CIRIsdsWrapper object, which will draw itself
       
   105      * to aRect.
       
   106      */
       
   107     static CIRNowPlayingWrapper* NewLC(CIRUi& aAppUi,CIRSettings& aIRSettings,
       
   108     						CIRIsdsWrapper& aIsdsWrapper);        
       
   109 
       
   110     /**
       
   111      * ~CIRIsdsWrapper
       
   112      * Destructor.
       
   113      */
       
   114     ~CIRNowPlayingWrapper();
       
   115  
       
   116     /**
       
   117      * ConstructL
       
   118      * 2nd phase constructor.
       
   119      * Perform the second phase construction of a
       
   120      * CIRSearchView object.
       
   121      */
       
   122     void ConstructL();
       
   123 		
       
   124 	/**
       
   125      * CIRSearchView.
       
   126      * C++ default constructor.
       
   127      */
       
   128     CIRNowPlayingWrapper(CIRUi& aAppUi,CIRSettings& aIRSettings,CIRIsdsWrapper& aIsdsWrapper);  
       
   129 	
       
   130 	//MCLASSES FUNCTIONS
       
   131 	
       
   132 	/** 
       
   133 	 *  MIRStreamSourceObserver::OpenComplete()
       
   134 	 *  Called when connected to the channel server  
       
   135 	 *  To implement the fill of buffer
       
   136 	 */
       
   137 	void OpenComplete(); 
       
   138 
       
   139 	/** 
       
   140 	 *  MIRStreamSourceObserver::ErrorConnecting()
       
   141 	 *  Called when there is an error when connecting to the channel server  
       
   142 	 *  @Param aErrorCode Indicates the type of error as described in
       
   143 	 * 		   irstreamsourceerrors.h
       
   144 	 */
       
   145 	void ErrorConnecting(TInt aErrorCode);
       
   146 
       
   147 	/** 
       
   148 	 *  MIRStreamSourceObserver::PlayNow()
       
   149 	 *  Called to indicate to the player to start playing
       
   150 	 */
       
   151 	void PlayNow();
       
   152 
       
   153 	/** 
       
   154 	 *  MIRStreamSourceObserver::Play()
       
   155 	 *  Triggers the play after reconnecting to the channel
       
   156 	 */
       
   157 	void Play();
       
   158 	
       
   159 	/** 
       
   160 	 *  MIRStreamSourceObserver::StopBuffering()
       
   161 	 *  Called to indicate to the player to stop buffering
       
   162 	 */
       
   163 	void StopBuffering();
       
   164 
       
   165 	/** 
       
   166 	 *  MIRStreamSourceObserver::ConnectionEstablished(TInt aFeedValue)
       
   167 	 *  Called to indicate that the connection to channel server is sucessful
       
   168 	 */
       
   169 	void ConnectionEstablished();
       
   170 
       
   171 	/** 
       
   172 	 *  MIRStreamSourceObserver::UpdateProgress()
       
   173 	 *  Called to provide teh buffer values
       
   174 	 *  @param aFeedValue used to pump the buffering value
       
   175 	 */
       
   176 	void UpdateProgress(TInt aFeedValue);
       
   177 
       
   178     /**
       
   179      * Function : HandleMetaDataReceivedL
       
   180      * Invoked when meta data is received.
       
   181      * @param   aMetaData   The meta data that was received.
       
   182      */
       
   183     void HandleMetaDataReceivedL( const CIRMetaData& aMetaData );
       
   184 
       
   185 
       
   186 	// Callbacks for ASF Player
       
   187 
       
   188 	/** 
       
   189 	 *  MIRStreamSourceObserver::ErrorConnecting()
       
   190 	 *  Called when there is an error when connecting to the channel server  
       
   191 	 *  @Param aErrorCode Indicates the type of error as described in
       
   192 	 * 		   irstreamsourceerrors.h
       
   193 	 */
       
   194 	void Asf_ErrorConnecting(TInt aErrorCode);
       
   195 
       
   196 	/** 
       
   197 	 *  MIRStreamSourceObserver::Asf_ConnectionEstablished(TInt aFeedValue)
       
   198 	 *  Called to indicate that the connection to channel server is sucessful
       
   199 	 */
       
   200 	void Asf_ConnectionEstablished();
       
   201 
       
   202 	/** 
       
   203 	 *  MIRStreamSourceObserver::Asf_UpdateProgress()
       
   204 	 *  Called to provide teh buffer values
       
   205 	 *  @param aFeedValue used to pump the buffering value
       
   206 	 */
       
   207 	void Asf_UpdateProgress(TInt aFeedValue);
       
   208 
       
   209     /**
       
   210      * Function : Asf_HandleMetaDataReceivedL
       
   211      * Invoked when meta data is received.
       
   212      * @param   aMetaData   The meta data that was received.
       
   213      */
       
   214     void Asf_HandleMetaDataReceivedL( const CIRMetaData& aMetaData );
       
   215 
       
   216 	// MIRCtrlCmdObserver functions
       
   217 
       
   218     /**
       
   219      * Function : MCrtlCmdCommand
       
   220      * Function is pure virtual function which used to pass commands
       
   221      * @param TIRControlCommmand represents the commands,which determines 
       
   222      * what action to be taken
       
   223      * @param aValue represents any integer value if any, like buffering
       
   224      * percentage
       
   225      */
       
   226     void MCtrlCommand( TIRControlCommmand aCommand, TInt aValue );
       
   227 
       
   228     /**
       
   229      * Function : FetchVolume
       
   230      * Function is pure virtual function which sents Request to get the
       
   231      * current volume index
       
   232      * @return volume index
       
   233      */
       
   234     TInt FetchVolume();
       
   235     
       
   236     /**
       
   237      * Function : DoAudioFadeOut
       
   238      * Function is pure virtual function, it is used to sent request start 
       
   239      * audio Fade Out
       
   240      */
       
   241     void DoAudioFadeOut();
       
   242      
       
   243      /**
       
   244      * Function : PlayerChanged
       
   245      * Function is pure virtual function, it is Notified Wnen Audio Player Changes
       
   246      */
       
   247     void PlayerChanged();
       
   248     
       
   249     /**
       
   250     * ConnectToChannelL()
       
   251     * This function is called to connect to a particular channel
       
   252     */
       
   253 	void ConnectToChannelL(CIRIsdsPreset& aPreset);
       
   254 	
       
   255 	/**
       
   256 	* SelectUrlUsingBitRate()
       
   257 	* Selects the proper URL based on settings of quality according to current network
       
   258 	*/
       
   259 	void SelectUrlUsingBitRateL(CIRIsdsPreset& aPreset);
       
   260 	
       
   261 	/**
       
   262 	* DisplayErrorNoteL()
       
   263 	* Display the error note
       
   264 	*/
       
   265  	void DisplayErrorNoteL(TInt aResourceId);
       
   266 
       
   267  	/**
       
   268  	* DoConnectToServerL()
       
   269  	* Connects to Server.
       
   270  	*/ 
       
   271 	void DoConnectToServerL(const TDesC8& aUrl);
       
   272 	
       
   273 	/**
       
   274 	* GetAvailableBitRate()
       
   275 	* Selects proper bit rate from the settings
       
   276 	*/
       
   277  	TInt GetAvailableBitRate(TInt aQualiyRequired,const CIRIsdsPreset& aPreset) const;
       
   278 	
       
   279 	/**
       
   280 	* LogStartSession()
       
   281 	* Starts the session log session
       
   282 	*/
       
   283 	void LogStartSession();
       
   284 	
       
   285 	/**
       
   286 	* SetCurrentChannelID()
       
   287 	* Function sets currently playing channel ID
       
   288 	*/
       
   289 	void SetCurrentChannelID();
       
   290 	
       
   291 	/**
       
   292 	* ConnectToServerL()
       
   293 	* Starts playing the selected stream
       
   294 	*/
       
   295 	void ConnectToServerL();
       
   296 
       
   297 	/**
       
   298 	* SetCurrentConnectionSource
       
   299 	* Sets from where the current connection to the channel server is established.
       
   300 	*/
       
   301 	void SetCurrentConnectionSource(TConnectedFrom aConnectedFrom);
       
   302 
       
   303 	/**
       
   304 	* DoErrorConnectingL
       
   305 	* Called by ErrorConnectingL when there is an error in connectiong
       
   306 	*/
       
   307 	void DoErrorConnectingL(TInt aErrorCode);
       
   308 	
       
   309 	/**
       
   310 	* ProgressBarCancelL()
       
   311 	* Cancels the Network request and stops the buffering on progressbar cancel
       
   312 	*/
       
   313 	void ProgressBarCancel();
       
   314 	
       
   315 	/**
       
   316 	* DoPlayingStateChangedL()
       
   317 	* Handles internal state change and P&S when playing is stopped or started
       
   318 	*/
       
   319 	void DoPlayingStateChanged( TBool aPlaying );
       
   320 	
       
   321 	/**
       
   322 	* DoPlayL()
       
   323 	* First try to reconnect to the last played channel url
       
   324 	*/
       
   325 	void DoPlayL();
       
   326 	
       
   327 	/**
       
   328 	* StopNow() 
       
   329 	* Function calls stop functionality
       
   330 	*/
       
   331 	void StopNow();
       
   332 	
       
   333 	/**
       
   334 	* ClearMetaDataL
       
   335 	* Clears the current meta data information.
       
   336 	*/
       
   337 	void ClearMetaDataL();
       
   338 	
       
   339 	//TInt GetSupportedMimeTypeL()
       
   340 	/**
       
   341 	* ListenToChannelL()
       
   342 	* Requests for listening to a particular channel
       
   343 	*/
       
   344 	void ListenToChannelL(CIRIsdsPreset* aPreset);
       
   345 	
       
   346 	/**
       
   347 	* MetaData()
       
   348 	* Returns the current meta data information.
       
   349 	*/
       
   350 	const CIRMetaData& MetaData() const;
       
   351 	
       
   352 	/**
       
   353 	* DialogDismissedL()
       
   354 	* Called when the refresh dialog is dismissed.
       
   355 	* @param aButtonId The button that was used to dismiss the dialog.
       
   356 	*/
       
   357 	void DialogDismissedL( TInt aButtonId );
       
   358 	
       
   359 	/**
       
   360 	* BufferingTimerExpiredL()
       
   361 	* Called when the buffering times out
       
   362 	*/
       
   363 	static TInt BufferingTimerExpired(TAny* aPtr);
       
   364 	
       
   365 	/**
       
   366 	* HandlePlayError()
       
   367 	* Handles play error || should called only through MCtrlCommand
       
   368 	*/
       
   369 	void HandlePlayError();
       
   370 
       
   371 	/**
       
   372 	* SetOverlay()
       
   373 	* sets over lay enable flag
       
   374 	*/
       
   375 	void SetOverlay(TBool aPresent);
       
   376 
       
   377 	/**
       
   378 	* PlayAndStopL()
       
   379 	* Performs play and stop functionality
       
   380 	*/
       
   381 	void PlayAndStopL();
       
   382 	
       
   383 	/**
       
   384 	* LoadTerminateSession()
       
   385 	* The loading cancel result in session log end
       
   386 	*/
       
   387 	void LoadTerminateSessionL();
       
   388 
       
   389     /**
       
   390     * GetMediaClientInstance()
       
   391     * Returns the Media Client Instance
       
   392     */
       
   393 	CIRMediaClient* GetMediaClientInstance();
       
   394     
       
   395 	/**
       
   396 	* GetReportGeneratorInstance()
       
   397 	* Returns the ReportGenerator Instance
       
   398 	*/
       
   399 	CIRReportGenerator* GetReportGeneratorInstance();
       
   400 	
       
   401 	/**
       
   402 	* GetTerminatedLogOnCancelState()
       
   403 	* Returns the iTerminatedLogOnCancel Value
       
   404 	*/
       
   405 	TBool GetTerminatedLogOnCancelState();
       
   406 	
       
   407 	/**
       
   408 	* GetSessionStartState()
       
   409 	* Returns the iSessionStart Value
       
   410 	*/
       
   411 	TBool GetSessionStartState();
       
   412 
       
   413 	/**
       
   414 	* SetSessionStartState()
       
   415 	* Sets the iSessionStart Value
       
   416 	*/
       
   417 	void SetSessionStartState(TBool aSessionStart);
       
   418 	/**
       
   419 	* CancelNetworkRequestL()
       
   420 	* Cancels the Network Request
       
   421 	*/
       
   422 	void  CancelNetworkRequestL();
       
   423 	/**
       
   424 	* SetVolumeL()
       
   425 	* Set the Volume of the Player Via Hardware Media Keys
       
   426 	*/
       
   427 	void 	SetVolumeL(TInt aIndex);
       
   428 
       
   429 	/**
       
   430 	* IsProgress()
       
   431 	* Returns the iProgress Value
       
   432 	*/
       
   433 	TBool IsProgress();
       
   434 
       
   435 	/**
       
   436 	* SetConnectToServerState
       
   437 	* Sets the iConnectToServer Value
       
   438 	*/
       
   439 	void SetConnectToServerState(TBool aConnectToServer);
       
   440 
       
   441 	/**
       
   442 	* GetConnectToServerState
       
   443 	* Returns the iConnectToServer Value
       
   444 	*/
       
   445 	TBool GetConnectToServerState();
       
   446 		
       
   447 	/**
       
   448 	* GetPrevVolumeLevel
       
   449 	* Returns the Prev Volume When Message is Received
       
   450 	* Or Any NetWork Events
       
   451 	*/
       
   452 	TInt  GetPrevVolumeLevel();
       
   453 		
       
   454 	/**
       
   455 	* SetPrevVolumeLevel
       
   456 	* Sets the Volume For handling the Network Events
       
   457 	*/
       
   458 
       
   459     void  SetPrevVolumeLevel(TInt aPrevVolume);
       
   460     	
       
   461 	/**
       
   462 	* SetMetadataL
       
   463 	* Sets the Metadata
       
   464 	*/
       
   465 
       
   466     void  SetMetadataL();
       
   467     	
       
   468 	/**
       
   469 	* PublishDataL
       
   470 	* Publish the Metadata Required for History
       
   471 	*/
       
   472   	void  PublishDataL();
       
   473   	
       
   474   	
       
   475 	/**
       
   476 	* StopPlayer
       
   477 	* Stop the Player
       
   478 	*/
       
   479   	void  StopPlayer();
       
   480   	
       
   481  	/**
       
   482 	* SetMedadataForErrotrConditions
       
   483 	* Sets the Metadata Flag During Error Conditions
       
   484 	*/
       
   485   	void  SetMedadataForErrotrConditions(TBool aDisplayMetaData);
       
   486   	
       
   487   	/**
       
   488 	* GetMedadataForErrotrConditions
       
   489 	* Returns the Error condition to Nowplaying View
       
   490 	*/
       
   491   	TBool  GetMedadataForErrotrConditions();
       
   492   	/**
       
   493 	* GetMarquee
       
   494 	* Returns the iMarQuee which is Set During HandleMetadataReceived
       
   495 	*/
       
   496   	TBool  GetMarquee();
       
   497 
       
   498   	/**
       
   499 	* SetMarquee
       
   500 	* Sets the Marquee value required for NowPlaying view
       
   501 	*/
       
   502   	void  SetMarquee(TBool aMarquee);
       
   503     /**
       
   504 	* SetView
       
   505 	* Set by Every View to its TIRViews when Listen is Done
       
   506 	*/
       
   507   	void  SetView(TIRViews aContextViews);
       
   508 
       
   509 	/**
       
   510 	* GetView
       
   511 	* Returns the View Where Listen Has Done
       
   512 	*/
       
   513   	TIRViews  GetView();
       
   514   	
       
   515 	/**
       
   516 	* SetAudioVolume()
       
   517 	* Call CPeriodic after the period is over
       
   518 	* @param volume level.
       
   519 	*/
       
   520 	void SetAudioVolume(TInt aValue);
       
   521 
       
   522 
       
   523 	/**
       
   524 	* CreateWaitDialogL()
       
   525 	* Called whenever Connecting to channel
       
   526 	*/
       
   527 	void CreateWaitDialogL();
       
   528 	
       
   529 	/**
       
   530 	* DestroyWaitDialogL()
       
   531 	* Destroys the Wait Dialog
       
   532 	*/
       
   533 	void DestroyWaitDialogL();
       
   534 	
       
   535 	/**
       
   536 	* SetProgress()
       
   537 	* Sets The Progress Value
       
   538 	*/
       
   539 	void SetProgress(TBool aProgress);
       
   540 
       
   541 	/**
       
   542 	* GetChannelConnetedInfo()
       
   543 	* Returns Whether the channel connected or not
       
   544 	*/
       
   545 	TBool GetChannelConnetedInfo();
       
   546 	
       
   547 	/**
       
   548 	* HandleNetworkDisconnected()
       
   549 	* Function called when network got disconnected While Buffering
       
   550 	*/
       
   551 	void HandleNetworkDisconnected();
       
   552 
       
   553 	/**
       
   554 	* HandleNetworkEstablished()
       
   555 	* Function called when network Connection Established In ALr
       
   556 	*/
       
   557 
       
   558 	void HandleNetworkEstablished();
       
   559 	
       
   560 	  /**
       
   561 	 *  Removes whitespace characters. 
       
   562 	 *  Called from HandleMetaDataReceivedL.
       
   563 	 *  @param string to be cleaned.
       
   564 	 */
       
   565     void RemoveWhiteSpace( TDes& aBuf );
       
   566 
       
   567     /**
       
   568 	 * 	Checks The Call status. 
       
   569 	 *  Checks the Call status Whether it is Incoming Call or OutGoing Call
       
   570 	 */
       
   571 	TBool CheckCallStatusL();
       
   572 	//from MIRActiveNetworkObserver
       
   573 	
       
   574 	/**
       
   575 	 * Notifies all observers whose network request is active
       
   576 	 * to reissue the request  
       
   577 	 * NotifyActiveNetworkObserversL()
       
   578 	 */	
       
   579 	 void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   580 
       
   581 	 /**
       
   582 	 * Notifies all observers whose network request is active
       
   583 	 * to reset the pending request status  
       
   584 	 * ResetPendingRequests()
       
   585 	 */	
       
   586 	 void ResetPendingRequests(TBool aValue);
       
   587 
       
   588 
       
   589 	/**
       
   590 	*TriggerCommandL.()
       
   591 	*
       
   592 	* triggering the Commands to the view
       
   593 	*/
       
   594 	void TriggerCommandL(TInt iCommandId);
       
   595 
       
   596 
       
   597 	/**
       
   598 	* GetSessionStartedFlag()
       
   599 	* Returns the iSessionStarted Flag Value
       
   600 	*/
       
   601 	TBool GetSessionStartedFlag();
       
   602 	/**
       
   603 	* SetSessionStartedFlag()
       
   604 	* Sets the iSessionStartedFlag  Value
       
   605 	*/
       
   606 	void SetSessionStartedFlag(TBool aSessionStartedFlag);
       
   607 	/**
       
   608 	* UpdateNmsLogEventsL()
       
   609 	* Updates Nms Log events
       
   610 	*/
       
   611 	void UpdateNmsLogEventsL(const TDesC& aNmsType);
       
   612 	
       
   613 	 /**
       
   614      * Function :SetListenFromIsdsValue()
       
   615      * Sets when Listen from Isds is Done 
       
   616      * @param aListenFromIsds Sets when Listen from Isds is Done
       
   617      */
       
   618 	 void SetListenFromIsdsValue(TInt aListenFromIsds);  
       
   619    
       
   620    	 /**
       
   621      * Function :SetListenFromIsdsValue()
       
   622      * Sets When User Cancels Buffering 
       
   623      * @param aDialogCanceled Sets When User Cancels Buffering
       
   624      */
       
   625 	 void SetWhenUserCancelsBufferingWaitBar(TInt aDialogCanceled);  
       
   626 
       
   627    	 /**
       
   628      * Function :SetWhenUserCancelsIsdsBufferingWaitBar()
       
   629      * Sets When User Cancels Buffering WaitBar From Isds Listen
       
   630      * @param aCancelFrmIsds Sets When User Cancels Buffering
       
   631      */
       
   632 	 void SetWhenUserCancelsIsdsBufferingWaitBar(TInt aCancelFrmIsds);  
       
   633 
       
   634 	 /**
       
   635      * Function :GetWhenUserCancelsIsdsBufferingWaitBar()
       
   636      * Returns When User Cancels Isds Buffering WaitBar
       
   637      * @return Returns Cancels Isds Buffering WaitBar
       
   638      */
       
   639 	 TInt GetWhenUserCancelsIsdsBufferingWaitBar();  
       
   640 	/**
       
   641      * Function :SetLaunchNowPlayingView()
       
   642      * Sets the varible if NowPlaying is active
       
   643      * @param aLaunchNowplaying the variable being set
       
   644      */
       
   645 	 void SetLaunchNowPlayingView(TBool aLaunchNowplaying  );
       
   646  	 
       
   647  	 /**
       
   648      * Function :GetLaunchNowPlayingView()
       
   649      * Returns the active state of NowPlaying View
       
   650      * @return Returns the Nowplayinf View active State
       
   651      */
       
   652 	 TBool GetLaunchNowPlayingView(); 
       
   653 	/**
       
   654      * Function :SetFavFocus()
       
   655      * Sets the foucs in Mainview
       
   656      * @param aFavIndex Focus to set in MainView
       
   657      */
       
   658 	 void SetFavFocus(TInt aFavIndex  );
       
   659  	
       
   660  	 /**
       
   661      * Function :GetFavFocus()
       
   662      * Returns the Current Focus to set
       
   663      * @return Returns value to set focus  in MainView
       
   664      */
       
   665 	 TInt GetFavFocus(); 
       
   666 
       
   667 private:
       
   668    //Instance of MediaClient
       
   669 	CIRMediaClient* iPlayer;
       
   670 
       
   671 
       
   672 	//Instance of StreamSource
       
   673 	CIRStreamSource* iNetwork;
       
   674 	
       
   675 	//instance of command channel
       
   676 	CIRCtrlCmdObserver* iChannel;
       
   677 	
       
   678 	
       
   679 	
       
   680 	//Session Log
       
   681 	CIRReportGenerator *iReportGenerator;
       
   682 	
       
   683 	/**
       
   684 	* iIRSettings
       
   685 	* Instance of CurrentOperationSettings
       
   686 	*/
       
   687 	CIRSettings& iIRSettings;
       
   688 	
       
   689  	/**
       
   690 	* iIsdsWrapper
       
   691 	* Instance of ISDSWrapper
       
   692 	*/
       
   693     CIRIsdsWrapper& iIsdsWrapper;
       
   694     
       
   695     /**
       
   696     * CIRUi& aAppUi
       
   697     * Instance of CIRUi
       
   698     */
       
   699     CIRUi& iAppUi;
       
   700     
       
   701     /**
       
   702      * Current meta data information.
       
   703      * Owned.
       
   704      */
       
   705     CIRMetaData* iMetaData;
       
   706     
       
   707 	//index for URLs in iURLArray array
       
   708 	TInt iURLCount;
       
   709 	
       
   710 	//holds the array of URLs
       
   711 	CDesCArrayFlat* iURLArray;
       
   712 	
       
   713 	//multiple URL selection will be enabled only before connecting
       
   714 	//to particular channel server once connected this disabled until
       
   715 	//next time you try to connect to the channel this is monitored
       
   716 	//by this flag
       
   717 	TBool iMultipleURLSelect;
       
   718 	
       
   719 	TBool iConnectionRequestCancelled;
       
   720 	
       
   721 	//Indiacates that it is reconnecting to the channel
       
   722 	TBool iReConnecting;
       
   723 
       
   724 	//last connected channels preset id
       
   725 	TInt iLastConnectedPresetId;
       
   726 	
       
   727 	//last connected channel url
       
   728 	TBuf<KMaxBufferSize> iLastConnectedUrl;
       
   729 	
       
   730 	//Last played URL
       
   731 	TBuf<KMaxUrlSize> iLastPlayedUrl;
       
   732 	
       
   733 	//last played channel's unique id
       
   734 	TInt iLastConnectedPresetUniqId;
       
   735 	
       
   736 	//checks if session log should be terminated on loading cancel
       
   737 	TBool iTerminatedLogOnCancel;
       
   738 	
       
   739 	// Used for checking the Audio has been fadein/fadeout
       
   740 	TBool iAudioFadein;
       
   741 	
       
   742 	// URL
       
   743 	TBuf<KMaxUrlSize> iUrl;
       
   744 	
       
   745 	//checks whether a session is started
       
   746 	TBool iSessionStart;
       
   747 	
       
   748 	//this variable check whether the session should actually end or not
       
   749 	//in case of multiple url select
       
   750 	TBool iSessionShouldNotEnd;
       
   751 
       
   752 	// Checks whether channel is Connected to Server or not
       
   753 	TBool iConnectToServer;
       
   754 
       
   755 	// Check the Connection
       
   756 //	TSyncState iSyncState
       
   757 	
       
   758 	//stores the channel id of currently playing channel
       
   759 	TInt iChannelID;
       
   760 
       
   761 	//Bitrate to subscribe
       
   762     TInt iBitRateValue;
       
   763     
       
   764  	// Checks whether the channel is connected or not
       
   765 	TBool iChannelConnect;
       
   766 
       
   767 	//Holds the Network connection status
       
   768 	TBool iIsConnected;
       
   769 
       
   770 	//Connected from information is stored in iConnectedFrom
       
   771 	TConnectedFrom iConnectedFrom;
       
   772 
       
   773 	// Stores the error code 
       
   774 	TInt iConnErrCode;
       
   775 
       
   776 	// checks the Status of the Progress bar
       
   777 	TBool iProgress;	
       
   778 
       
   779 	//Flag used to test Radio Playback 
       
   780      TBool iPlayBack;
       
   781     //Unconnected URL
       
   782 	TBuf<KMaxUrlSize> iUnconnectedUrl;
       
   783 	
       
   784 	
       
   785 	/**
       
   786 	* iPrevVolumeLev
       
   787 	* Stores thr Prev Volume Level
       
   788 	*/
       
   789 
       
   790 	TInt iPrevVolumeLevel;
       
   791 	
       
   792 	/**
       
   793 	* iBufferigSteamText
       
   794 	* Data for checking the text of the WaitDialog
       
   795 	*/
       
   796 	TBool iBufferigSteamText;
       
   797 	
       
   798 	/**
       
   799 	* iWaitDialog
       
   800 	* calls the waitdialog owned by
       
   801 	* CAknWaitDialog
       
   802 	*/   
       
   803 	CAknWaitDialog* iWaitDialog;
       
   804 	
       
   805 	// Used for displaying Metadata
       
   806 	TBool iDisplayMetaData;
       
   807 	/**
       
   808 	* iMarquee
       
   809 	* Instance For Confirming Whether to Display Metadata
       
   810 	*/
       
   811 	TBool  iMarquee;
       
   812 
       
   813     //User for testing Existence of Network request
       
   814 	TBool iCancelNetworkRequest;
       
   815 	
       
   816 		//For context navigation in nowplaying view//
       
   817     TIRViews iContextViews;
       
   818     
       
   819    /**
       
   820 	* iCheckValue
       
   821 	* Instance Used to check While Connecting To a Channel
       
   822 	*/
       
   823 	TBool  iCheckValue;
       
   824 	
       
   825 	/**
       
   826 	* iChannelConnected
       
   827 	* Instance Used to check whether the current 
       
   828 	* channel is connected or not
       
   829 	*/
       
   830 	TBool  iChannelConnected;
       
   831 	
       
   832 	/**
       
   833 	* iPlayandStop
       
   834 	* Set when Play or Stop is Done Fom Nowplaying View
       
   835 	*/
       
   836 	TBool  iPlayandStop;
       
   837 
       
   838 	/**
       
   839 	* iNotify
       
   840 	* Set when Connection is established during ALR
       
   841 	*/
       
   842 	TBool iNotify;
       
   843 	
       
   844 	/**
       
   845 	* iAsfPlayer
       
   846 	* ASF Player instance for ASF streaming
       
   847 	*/
       
   848 	CIRAsfPlayer* iAsfPlayer;
       
   849 
       
   850 	/**
       
   851 	* iAsfStreaming
       
   852 	* Indicates ASF channel streaming is on
       
   853 	*/
       
   854 	TBool  iAsfStreaming;
       
   855 	
       
   856 	/**
       
   857 	* iSessionStartedFlag
       
   858 	* sets when session startedL is called
       
   859 	*/
       
   860 	TBool iSessionStartedFlag;
       
   861 	/**
       
   862 	* iListenFromIsds
       
   863 	* When Listen From Isds is Done 
       
   864 	*/
       
   865 
       
   866 	TBool iListenFromIsds;
       
   867 	
       
   868 	/**
       
   869 	* iDialogCanceled
       
   870 	* 	when dialog is dismissed
       
   871 	*/
       
   872 	TBool  iDialogCanceled;
       
   873 
       
   874 	/**
       
   875 	* iCancelFrmIsds
       
   876 	* Cancel is Done from ISds
       
   877 	*/
       
   878 	TBool iCancelFrmIsds;
       
   879 	/**
       
   880 	* iLaunchNowplaying
       
   881 	* Set if NowPlaying View is Active
       
   882 	*/
       
   883 	TBool iLaunchNowplaying;
       
   884 	
       
   885 	/**
       
   886 	* iBufferingRequestCancelled
       
   887 	* Sets this Value When User Cancels buffering
       
   888 	*/
       
   889 
       
   890 	TBool iBufferingRequestCancelled;
       
   891 	
       
   892 	TInt selectedbitrate ;
       
   893 	
       
   894 	TInt iUinqid;
       
   895 	
       
   896 	TInt iFavIndex;
       
   897 	TInt iQualityRequired;
       
   898 public:
       
   899 	//Instance of CIRIsdsPreset
       
   900 	//contains the preset on which the connection attempt is made
       
   901 	CIRIsdsPreset* iNowPlayingPreset;
       
   902 	
       
   903 	//Instance of CIRIsdsPreset
       
   904 	//Contains the preset which is editable
       
   905 	CIRIsdsPreset* iEditStationPreset;
       
   906 
       
   907 	//Holds the playing status
       
   908 	TBool iPlaying;
       
   909 	
       
   910 	/**
       
   911 	* iSyncPreset
       
   912 	* sets the status of synchronizing the preset
       
   913 	*/
       
   914 	TBool iSyncPreset;
       
   915 	};
       
   916 	
       
   917 #endif //IRNOWPLAYINGWRAPPER_H