upnpavcontroller/upnpavcontrollerserver/inc/upnpavcontrollerimpl.h
branchnew development branch with rendering state machine and other goodies
changeset 38 5360b7ddc251
parent 0 7f85d04be362
equal deleted inserted replaced
32:3785f754ee62 38:5360b7ddc251
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    24 #ifndef C_UPNPAVCONTROLLERIMPL_H
    24 #ifndef C_UPNPAVCONTROLLERIMPL_H
    25 #define C_UPNPAVCONTROLLERIMPL_H
    25 #define C_UPNPAVCONTROLLERIMPL_H
    26 
    26 
    27 // INDLUDE FILES
    27 // INDLUDE FILES
    28 #include <e32base.h>
    28 #include <e32base.h>
    29 #include <upnpavcontrolpointobserver.h>
       
    30 #include <upnpmediaserverclient.h>
       
    31 #include "upnpavcontrollerglobals.h"
    29 #include "upnpavcontrollerglobals.h"
    32 #include "upnpconnectionmonitorobserver.h"
       
    33 
    30 
    34 // FORWARD DECLARATIONS
    31 // FORWARD DECLARATIONS
    35 class MUPnPAVDeviceObserver;
    32 
    36 class MUPnPAVMediaObserver;
       
    37 class MUPnPAVFileObserver;
       
    38 class CUPnPPlaybackSession;
    33 class CUPnPPlaybackSession;
    39 class CUpnpAVControllerServer;
    34 class CUpnpAVControllerServer;
    40 class CUpnpAVDevice;
    35 class CUpnpAVDevice;
    41 class CUpnpHttpMessage;
       
    42 class CUpnpDevice;
       
    43 class CUpnpAVDeviceExtended;
    36 class CUpnpAVDeviceExtended;
    44 class CUPnPBrowsingSession;
    37 class CUPnPBrowsingSession;
    45 class CUpnpDeviceDiscoveryMessage;
    38 class CUpnpDeviceDiscoveryMessage;
    46 
       
    47 class CUPnPUploadSession;
    39 class CUPnPUploadSession;
    48 class CUPnPDownloadSession;
    40 class CUPnPDownloadSession;
    49 
    41 
    50 /**
    42 /**
    51  *  AV Controller server side implementation. Impmements the base session. 
    43  *  AV Controller server side implementation. Impmements the base session. 
    52  *  Rendering and browsing sessions are created from this session.
    44  *  Rendering and browsing sessions are created from this session.
    53  *  Handles device discovery and fetching of device listst.
    45  *  Handles device discovery and fetching of device listst.
    54  *
    46  *
    55  *  @lib upnpavcontrollerclient.lib
    47  *  @exe upnpavcontrollerserver.exe
    56  *  @since S60 v3.1
    48  *  @since S60 v3.1
    57  */
    49  */
    58 class CUPnPAVControllerImpl :   public CBase,
    50 class CUPnPAVControllerImpl : public CBase
    59                                 public MUPnPConnectionMonitorObserver
       
    60                                 
    51                                 
    61     {
    52     {
    62 
    53 
    63 public:
    54 public:
    64 
    55 
    65     /**
    56     /**
    66      * Two-phased constructor.
    57      * Two-phased constructor.
    67      *
    58      *
    68      * @param aControlPoint control point reference
       
    69      * @param aClient media server client reference
    59      * @param aClient media server client reference
    70      * @param aDispatcher callback dispatcher reference
       
    71      * @param aServer server class reference
    60      * @param aServer server class reference
    72      */
    61      */
    73     static CUPnPAVControllerImpl* NewL
    62     static CUPnPAVControllerImpl* NewL
    74         (
    63         (
    75         RUpnpMediaServerClient& aClient,
       
    76         CUpnpAVControllerServer& aServer
    64         CUpnpAVControllerServer& aServer
    77         );
    65         );
    78     
    66     
    79     /**
    67     /**
    80      * Destructor
    68      * Destructor
    84 private:
    72 private:
    85 
    73 
    86     /**
    74     /**
    87      * Private constructor
    75      * Private constructor
    88      *
    76      *
    89      * @param aControlPoint control point reference
       
    90      * @param aClient media server client reference
    77      * @param aClient media server client reference
    91      * @param aDispatcher callback dispatcher reference
       
    92      * @param aServer server class reference          
    78      * @param aServer server class reference          
    93      */
    79      */
    94     CUPnPAVControllerImpl
    80     CUPnPAVControllerImpl( CUpnpAVControllerServer& aServer );    
    95     (
       
    96     RUpnpMediaServerClient& aClient,
       
    97     CUpnpAVControllerServer& aServer
       
    98     );    
       
    99     
    81     
   100     /**
    82     /**
   101      * Destructor
    83      * Destructor
   102      */
    84      */
   103     void ConstructL();    
    85     void ConstructL();    
   104 
    86 
   105 public: // From MUPnPConnectionMonitorObserver
    87 public: // New functions
   106     
    88 
   107     /**
    89     /**
   108      * See upnpconnectionmonitorobserver.h
    90      * Handles connection lost.
   109      */
    91      */
   110     void ConnectionLost();
    92     void ConnectionLost();
   111     
    93     
   112 public: // New functions
       
   113 
       
   114     /**
    94     /**
   115      * Handles UPnP device discoveries.
    95      * Handles UPnP device discoveries.
   116      * @since Series 60 2.6
    96      * @since Series 60 2.6
   117      * @param aDevice Device that is discovered.
    97      * @param aDevice Device that is discovered.
   118      */
    98      */
   122      * Handles UPnP device disappears.
   102      * Handles UPnP device disappears.
   123      * @since Series 60 2.6
   103      * @since Series 60 2.6
   124      * @param aDevice Device that disappeared.
   104      * @param aDevice Device that disappeared.
   125      */
   105      */
   126     void DeviceDisappearedL( CUpnpAVDeviceExtended& aDevice );
   106     void DeviceDisappearedL( CUpnpAVDeviceExtended& aDevice );
   127     
   107 
       
   108     /**
       
   109      * Handles UPnP device icon download completions.
       
   110      * @param aDevice Device that's icon was downloaded.
       
   111      */
       
   112     void DeviceIconDownloadedL( CUpnpAVDeviceExtended& aDevice );
   128 
   113 
   129     /**
   114     /**
   130      * Enables device discovery by storing a message to server side, which
   115      * Enables device discovery by storing a message to server side, which
   131      * is completed when a device has been discovered.
   116      * is completed when a device has been discovered.
   132      *
   117      *
   157      * Returns the device list to client side.
   142      * Returns the device list to client side.
   158      *
   143      *
   159      * @param aMessage message
   144      * @param aMessage message
   160      */
   145      */
   161     void GetDeviceListL( const RMessage2& aMessage );
   146     void GetDeviceListL( const RMessage2& aMessage );
   162     
   147 
       
   148     /**
       
   149      * Returns the icon to client side.
       
   150      *
       
   151      * @param aMessage message
       
   152      */
       
   153     void GetDeviceIconRequestL( const RMessage2& aMessage );
       
   154 
   163     /**
   155     /**
   164      * Creates a rendering session.
   156      * Creates a rendering session.
   165      *
   157      *
   166      * @param aMessage message
   158      * @param aMessage message
   167      */
   159      */
   326      * Cancels getpositioninfo (basically just ignores the result)
   318      * Cancels getpositioninfo (basically just ignores the result)
   327      *
   319      *
   328      * @param aMessage message
   320      * @param aMessage message
   329      */
   321      */
   330     void CancelGetPositionInfoL( const RMessage2& aMessage );
   322     void CancelGetPositionInfoL( const RMessage2& aMessage );
       
   323     
       
   324     /**
       
   325      * Send the seek action with unit REL_TIME.
       
   326      *
       
   327      * @param aMessage message
       
   328      */
       
   329     void SeekRelTimeL( const RMessage2& aMessage );
       
   330         
       
   331     /**
       
   332      * Get initial state of the renderer
       
   333      *
       
   334      * @param aMessage message
       
   335      */
       
   336     void GetRendererStateL( const RMessage2& aMessage );
       
   337     
       
   338     /**
       
   339      * Cancels seeking with unit REL_TIME (basically just ignores the result).
       
   340      *
       
   341      * @param aMessage message
       
   342      */
       
   343     void CancelSeekRelTimeL( const RMessage2& aMessage );
   331     
   344     
   332     /**
   345     /**
   333      * Create a browsing session
   346      * Create a browsing session
   334      *
   347      *
   335      * @param aMessage message
   348      * @param aMessage message
   458      * @param aMessage message
   471      * @param aMessage message
   459      */
   472      */
   460     void MonitorConnectionL( const RMessage2& aMessage );
   473     void MonitorConnectionL( const RMessage2& aMessage );
   461     
   474     
   462     /**
   475     /**
   463      * Cancels the msg.
   476      * Cancels the connection monitoring message.
   464      *
   477      *
   465      * @param aMessage message
   478      * @param aMessage message
   466      */
   479      */
   467     void CancelMonitorConnectionL( const RMessage2& aMessage );
   480     void CancelMonitorConnectionL( const RMessage2& aMessage );
   468 
   481     
       
   482     /**
       
   483      * Create a download session
       
   484      *
       
   485      * @param aMessage message
       
   486      */
   469     void CreateDownloadSessionL( const RMessage2& aMessage );
   487     void CreateDownloadSessionL( const RMessage2& aMessage );
   470     
   488     
       
   489     /**
       
   490      * Destroy the download session
       
   491      *
       
   492      * @param aMessage message
       
   493      */
   471     void DestroyDownloadSessionL( const RMessage2& aMessage );
   494     void DestroyDownloadSessionL( const RMessage2& aMessage );
   472 
   495     
       
   496     /**
       
   497      * Start download
       
   498      *
       
   499      * @param aMessage message
       
   500      */
   473     void StartDownloadL( const RMessage2& aMessage );
   501     void StartDownloadL( const RMessage2& aMessage );
   474     
   502     
       
   503     /**
       
   504      * Start FHL download.
       
   505      *
       
   506      * @param aMessage message
       
   507      */
   475     void StartDownloadFHL( const RMessage2& aMessage );
   508     void StartDownloadFHL( const RMessage2& aMessage );
   476     
   509     
       
   510     /**
       
   511      * Cancel download
       
   512      *
       
   513      * @param aMessage message
       
   514      */
   477     void CancelDownloadL( const RMessage2& aMessage );
   515     void CancelDownloadL( const RMessage2& aMessage );
   478 
   516     
       
   517     /**
       
   518      * Cancel all download
       
   519      *
       
   520      * @param aMessage message
       
   521      */
   479     void CancelAllDownloadsL( const RMessage2& aMessage );
   522     void CancelAllDownloadsL( const RMessage2& aMessage );
   480     
   523     
       
   524     /**
       
   525      * Start tracking the download progress
       
   526      *
       
   527      * @param aMessage message
       
   528      */
   481     void StartTrackingDownloadProgressL( const RMessage2& aMessage );
   529     void StartTrackingDownloadProgressL( const RMessage2& aMessage );
   482 
   530     
       
   531     /**
       
   532      * Stop tracking the download progress
       
   533      *
       
   534      * @param aMessage message
       
   535      */
   483     void StopTrackingDownloadProgressL( const RMessage2& aMessage );
   536     void StopTrackingDownloadProgressL( const RMessage2& aMessage );
   484 
   537     
       
   538     /**
       
   539      * Get download event
       
   540      *
       
   541      * @param aMessage message
       
   542      */
   485     void GetDownloadEventL( const RMessage2& aMessage );
   543     void GetDownloadEventL( const RMessage2& aMessage );
   486     
   544     
       
   545     /**
       
   546      * Cancel download event
       
   547      *
       
   548      * @param aMessage message
       
   549      */
   487     void CancelGetDownloadEventL( const RMessage2& aMessage );
   550     void CancelGetDownloadEventL( const RMessage2& aMessage );
   488 
   551 
       
   552     /**
       
   553      * Create upload session
       
   554      *
       
   555      * @param aMessage message
       
   556      */
   489     void CreateUploadSessionL( const RMessage2& aMessage );
   557     void CreateUploadSessionL( const RMessage2& aMessage );
   490     
   558     
       
   559     /**
       
   560      * Destroy upload session
       
   561      *
       
   562      * @param aMessage message
       
   563      */
   491     void DestroyUploadSessionL( const RMessage2& aMessage );    
   564     void DestroyUploadSessionL( const RMessage2& aMessage );    
   492 
   565     
       
   566     /**
       
   567      * Start upload
       
   568      *
       
   569      * @param aMessage message
       
   570      */
   493     void StartUploadL( const RMessage2& aMessage );
   571     void StartUploadL( const RMessage2& aMessage );
   494     
   572     
       
   573     /**
       
   574      * Cancel upload
       
   575      *
       
   576      * @param aMessage message
       
   577      */
   495     void CancelUploadL( const RMessage2& aMessage );
   578     void CancelUploadL( const RMessage2& aMessage );
   496 
   579     
       
   580     /**
       
   581      * Cancel all upload
       
   582      *
       
   583      * @param aMessage message
       
   584      */
   497     void CancelAllUploadsL( const RMessage2& aMessage );
   585     void CancelAllUploadsL( const RMessage2& aMessage );
   498     
   586     
       
   587     /**
       
   588      * Start tracking the upload progress
       
   589      *
       
   590      * @param aMessage message
       
   591      */
   499     void StartTrackingUploadProgressL( const RMessage2& aMessage );
   592     void StartTrackingUploadProgressL( const RMessage2& aMessage );
   500 
   593     
       
   594     /**
       
   595      * Stop tracking upload progress
       
   596      *
       
   597      * @param aMessage message
       
   598      */
   501     void StopTrackingUploadProgressL( const RMessage2& aMessage );
   599     void StopTrackingUploadProgressL( const RMessage2& aMessage );
   502 
   600     
       
   601     /**
       
   602      * Get upload event
       
   603      *
       
   604      * @param aMessage message
       
   605      */
   503     void GetUploadEventL( const RMessage2& aMessage );
   606     void GetUploadEventL( const RMessage2& aMessage );
   504     
   607     
       
   608     /**
       
   609      * Cancel get upload event
       
   610      *
       
   611      * @param aMessage message
       
   612      */
   505     void CancelGetUploadEventL( const RMessage2& aMessage );
   613     void CancelGetUploadEventL( const RMessage2& aMessage );
   506 
   614 
   507 private:
   615 private:
   508 
   616 
   509     /**
   617     /**
   514      */
   622      */
   515     void DequeDeviceL( const CUpnpAVDevice& aDevice,
   623     void DequeDeviceL( const CUpnpAVDevice& aDevice,
   516         TAVControllerDeviceDiscovery aType );
   624         TAVControllerDeviceDiscovery aType );
   517 
   625 
   518 private:
   626 private:
   519     
   627        
   520     RUpnpMediaServerClient&     iMediaServer; // Not own       
       
   521     
       
   522     CUpnpAVControllerServer&    iServer; // Not own       
   628     CUpnpAVControllerServer&    iServer; // Not own       
   523     
   629     
   524     RMessage2*                  iDeviceDiscoveryMsg; // Own
   630     RMessage2*                  iDeviceDiscoveryMsg; // Own
   525     
   631     
   526     TBool                       iDeviceDiscoveryEnabled;
   632     TBool                       iDeviceDiscoveryEnabled;