dlnasrv_exampleapp/inc/exampleappengine_p.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
       
     1 /*
       
     2 * Copyright (c) 2010 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: Dlna private interface definitions
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef EXAMPLEAPPENGINE_P_H
       
    19 #define EXAMPLEAPPENGINE_P_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <upnpavdeviceobserver.h>
       
    23 #include <upnpavrenderingsessionobserver.h>
       
    24 #include <upnprenderingstatemachineobserver.h>
       
    25 #include <upnpvolumestatemachineobserver.h>
       
    26 #include <upnpitemresolverobserver.h>
       
    27 #include <upnpconnectionmonitorobserver.h>
       
    28 
       
    29 #include "exampleappengine.h"
       
    30 
       
    31 class CUPnPSettingsEngine;
       
    32 class MUPnPAVRenderingSession;
       
    33 class CUpnpRenderingStateMachine;
       
    34 class CUpnpVolumeStateMachine;
       
    35 class MUPnPAVController;
       
    36 class CUpnpAVDeviceList;
       
    37 class CUPnPConnectionMonitor;
       
    38 
       
    39 class ExampleAppEnginePrivate : public QObject,
       
    40 public MUPnPAVDeviceObserver,
       
    41 public MUPnPAVRenderingSessionObserver,
       
    42 public MUpnpRenderingStateMachineObserver,
       
    43 public MUpnpVolumeStateMachineObserver,
       
    44 public MUPnPItemResolverObserver,
       
    45 public MUPnPConnectionMonitorObserver
       
    46 {
       
    47     Q_OBJECT
       
    48     Q_DECLARE_PUBLIC(ExampleAppEngine)
       
    49 
       
    50 public:
       
    51     ExampleAppEnginePrivate();
       
    52     virtual ~ExampleAppEnginePrivate();
       
    53     
       
    54 public:
       
    55     void construct();
       
    56     int getConnectedIap() const;
       
    57     QString getConnectedIapName() const;
       
    58     int getPlaybackState() const;
       
    59     bool isSeekSupported() const;
       
    60     bool isPauseSupported() const;
       
    61     void searchRenderingDevices();
       
    62     void prepareRenderingDevice(const QString &uuid);
       
    63     int initFile(const QString& file);
       
    64     void play();
       
    65     void pause();
       
    66     void stop();
       
    67     void volumeUp();
       
    68     void volumeDown();
       
    69     void rew();
       
    70     void ff();
       
    71     
       
    72 protected:
       
    73     // from MUPnPAVDeviceObserver
       
    74     void UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice);
       
    75     void UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice);
       
    76     void WLANConnectionLost();
       
    77     
       
    78     // from MUPnPAVRenderingSessionObserver
       
    79     void VolumeResult(TInt aError, TInt aVolumeLevel, TBool aActionResponse);
       
    80     void MuteResult(TInt aError, TBool aMute, TBool aActionResponse);
       
    81     void InteractOperationComplete(TInt aError, TUPnPAVInteractOperation aOperation);
       
    82     void PositionInfoResult(TInt aError, const TDesC8& aTrackPosition, const TDesC8& aTrackLength);
       
    83     void SetURIResult(TInt aError);
       
    84     void SetNextURIResult(TInt aError);
       
    85     void MediaRendererDisappeared(TUPnPDeviceDisconnectedReason aReason);
       
    86     
       
    87     // from MUpnpRenderingStateMachineObserver
       
    88     void RendererSyncReady(TInt aError, Upnp::TState aState);
       
    89     void RenderingStateChanged(TInt aError, Upnp::TState aState, TBool aUserOriented, TInt aStateParam);
       
    90     void PositionSync(TInt aError, Upnp::TPositionMode aMode, TInt aDuration, TInt aPosition);
       
    91     
       
    92     // from MUpnpVolumeStateMachineObserver
       
    93     void VolumeSyncReady(TInt aError);
       
    94     void VolumeChanged(TInt aError, TInt aVolume, TBool aUserOriented);
       
    95     void MuteChanged(TInt aError, TBool aMuteState, TBool aUserOriented);
       
    96 
       
    97     // from MUPnPItemResolverObserver
       
    98     void ResolveComplete(const MUPnPItemResolver& aResolver, TInt aError);
       
    99     
       
   100     // from MUPnPConnectionMonitorObserver
       
   101     void ConnectionLost(TBool aUserOriented);
       
   102     void ConnectionCreated(TInt aConnectionId);
       
   103     
       
   104 private:
       
   105     void searchRenderingDevicesL();
       
   106     void upnpDeviceDiscoveredL(const CUpnpAVDevice& aDevice);
       
   107     void prepareRenderingDeviceL(const QString &uuid);
       
   108     void startRenderingSessionL(const CUpnpAVDevice &device);
       
   109     void stopRenderingSession();
       
   110     void initFileL(const QString& file);
       
   111     bool isReadyForPlayback() const;
       
   112     void playL();
       
   113     void pauseL();
       
   114     void stopL();
       
   115     void resolveIapL();
       
   116     void resolveIapNameL();
       
   117     
       
   118     QString asString(const TDesC &desc) const;
       
   119     QString asString8(const TDesC8 &desc) const;
       
   120 
       
   121 private:
       
   122     ExampleAppEngine *q_ptr;
       
   123     CUPnPSettingsEngine *mSettingsEngine;
       
   124     MUPnPAVRenderingSession *mAVRenderingSession;
       
   125     CUpnpRenderingStateMachine *mRenderingStateMachine;
       
   126     CUpnpVolumeStateMachine *mVolumeStateMachine;
       
   127     MUPnPAVController *mAVController;
       
   128     int mIap;
       
   129     QString mIapName;
       
   130     CUpnpAVDeviceList *mDevices;
       
   131     CUpnpAVDevice *mDevice;
       
   132     int mPlaybackState;
       
   133     MUPnPItemResolver *mItemResolver;
       
   134     CUPnPConnectionMonitor *mConnectionMonitor;
       
   135 };
       
   136 
       
   137 #endif // EXAMPLEAPPENGINE_P_H