upnpavcontroller/upnprenderingstatemachine/inc/upnprenderingstatemachine.h
author Sampo Huttunen <sampo.huttunen@nokia.com>
Wed, 03 Nov 2010 11:45:09 +0200
branchIOP_Improvements
changeset 40 08b5eae9f9ff
permissions -rw-r--r--
merge from Nokia's internal development branch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     1
/*
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2007,2009 Nokia Corporation and/or its subsidiary(-ies).
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     8
*
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    11
*
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    12
* Contributors:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    13
*
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    14
* Description:  Generic upnp remote rendering state machine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    15
*
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    16
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    17
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    18
#ifndef C_UPNPRENDERINGSTATEMACHINE_H
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    19
#define C_UPNPRENDERINGSTATEMACHINE_H
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    20
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    21
// INCLUDES
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    22
#include <e32base.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    23
#include "upnpavrenderingsessionobserver.h" // TUPnPAVInteractOperation
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    24
#include "upnpresourceselector.h" // TUPnPSelectDefaultResource
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    25
#include "upnprenderingstatemachineconstants.h" // types
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    26
#include "upnprenderingoperationexecutor.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    27
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    28
// FORWARD DECLARATIONS
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    29
class MUPnPAVRenderingSession;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    30
class MUpnpRenderingStateMachineObserver;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    31
class TUpnpRenderingOperation;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    32
class CUpnpRenderingPlaytimeCalculator;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    33
class CUpnpRenderingStateMachineStates;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    34
class CUpnpRenderingOperationQueue;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    35
class MUPnPResourceSelector;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    36
class CUpnpItem;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    37
class CPeriodic;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    38
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    39
// CONSTANTS
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    40
const TInt KUriBuffer = 256;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    41
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    42
/**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    43
 * Class for handling renderer states
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    44
 *
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    45
 * @lib upnprenderingstatemachine.lib
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    46
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    47
class CUpnpRenderingStateMachine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    48
    : public CBase
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    49
    , public MUpnpRenderingOperationExecutor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    50
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    51
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    52
public: // construction / destruction
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    53
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    54
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    55
     * static constructor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    56
     *
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    57
     * @param aSession session where to send volume events
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    58
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    59
    IMPORT_C static CUpnpRenderingStateMachine* NewL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    60
        MUPnPAVRenderingSession& aSession );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    61
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    62
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    63
     * Destructor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    64
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    65
    IMPORT_C virtual ~CUpnpRenderingStateMachine();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    66
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    67
private: // construction, private part
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    68
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    69
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    70
     * static constructor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    71
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    72
    CUpnpRenderingStateMachine(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    73
        MUPnPAVRenderingSession& aSession );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    74
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    75
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    76
     * 2nd phase constructor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    77
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    78
    void ConstructL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    79
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    80
public: // the interface
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    81
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    82
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    83
     * sets the state machine options (future extension)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    84
     * @param aOptions options bit mask
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    85
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    86
    IMPORT_C void SetOptions( TInt aOptions );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    87
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    88
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    89
     * returns current options
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    90
     * @return the options bitmask
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    91
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    92
    IMPORT_C TInt Options() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    93
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    94
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    95
     * sets the state machine observer
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    96
     * @param aObserver the observer to set
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    97
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    98
    IMPORT_C void SetObserver( MUpnpRenderingStateMachineObserver& aObserver );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    99
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   100
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   101
     * removes the current observer
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   102
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   103
    IMPORT_C void RemoveObserver();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   104
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   105
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   106
     * sets the resource selector for media to play
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   107
     * if not called, TUPnPSelectDefaultResource will be used.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   108
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   109
    IMPORT_C void SetResourceSelector( MUPnPResourceSelector& aSelector );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   110
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   111
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   112
     * Synchronises the state machine with the remote renderer
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   113
     * (updates the state)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   114
     * this is an aynchronous operation and calls back RendererSyncReady()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   115
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   116
    IMPORT_C void SyncL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   117
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   118
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   119
     * Forces the state machine off sync
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   120
     * (sets the cached state to OffSync)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   121
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   122
    IMPORT_C void SetOffSync();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   123
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   124
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   125
     * Checks if the state machine is synchronised
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   126
     * with the remote renderer ie. in operation
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   127
     * @return ETrue if state machine is operational
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   128
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   129
    IMPORT_C TBool IsInSync() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   130
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   131
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   132
     * Executes a command on the renderer.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   133
     * If a command is currently running, the command is queued.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   134
     * see Upnp::TCommand on upnprenderingstatemachineconstants.h
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   135
     * @param aCommand the command to execute
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   136
     * @param aCommandParameter command-specific parameter
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   137
     * @param aMedia the media to be played (specific to PLAY command)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   138
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   139
    IMPORT_C void CommandL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   140
        Upnp::TCommand aCommand,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   141
        TInt aCommandParameter = 0,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   142
        const CUpnpItem* aMedia = NULL
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   143
        );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   144
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   145
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   146
     * Checks if the state machine is busy executing a command
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   147
     * @return ETrue if the state machine is busy
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   148
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   149
    IMPORT_C TBool IsBusy() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   150
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   151
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   152
     * Cancels currently ongoing operation and cleans up the
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   153
     * queue of operations
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   154
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   155
    IMPORT_C void Cancel();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   156
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   157
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   158
     * returns the current renderer state
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   159
     * Note: this is not a network operation - returns a cached value
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   160
     * @return the renderer state
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   161
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   162
    IMPORT_C Upnp::TState State() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   163
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   164
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   165
     * returns current track duration.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   166
     * Note: this is NOT a network operation - returns a cached value.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   167
     * NOTE ALSO: The method only works in case ERenderingOptionAutoSyncPos
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   168
     * option is in use or ERenderingCommandSyncPos has been called to
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   169
     * synchronise the position/duration.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   170
     * @return the current track duration, or -1 if it is not available
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   171
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   172
    IMPORT_C TInt Duration() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   173
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   174
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   175
     * returns current position within the track.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   176
     * Note: this is NOT a network operation - returns the position within an
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   177
     * internal position timer. The timer can be calibrated with the renderer
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   178
     * position using ECalibrate command, after which the Position values are
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   179
     * again more accurate.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   180
     * @return the current estimated position, or -1 if it is not available
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   181
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   182
    IMPORT_C TInt Position() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   183
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   184
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   185
     * Tests if this renderer has pause capability.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   186
     * Requesting PAUSE for a renderer that does not have this capability
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   187
     * wil result into an error.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   188
     * @return ETrue if device has volume control capability.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   189
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   190
    IMPORT_C TBool HasPauseCapability() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   191
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   192
public: // methods like in MUPnPRenderingSessionObserver
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   193
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   194
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   195
     * @see MUPnPRenderiongSessionObserver
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   196
     * client of this state machine should forward the corresponding method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   197
     * from the rendering session directly to this method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   198
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   199
    IMPORT_C void InteractOperationComplete(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   200
        TInt aError, TUPnPAVInteractOperation aOperation );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   201
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   202
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   203
     * @see MUPnPRenderiongSessionObserver
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   204
     * client of this state machine should forward the corresponding method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   205
     * from the rendering session directly to this method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   206
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   207
    IMPORT_C void PositionInfoResult( 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   208
        TInt aError, const TDesC8& aPosition, const TDesC8& aLength );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   209
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   210
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   211
     * @see MUPnPRenderiongSessionObserver
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   212
     * client of this state machine should forward the corresponding method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   213
     * from the rendering session directly to this method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   214
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   215
    IMPORT_C void SetURIResult( TInt aError );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   216
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   217
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   218
     * @see MUPnPRenderiongSessionObserver
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   219
     * client of this state machine should forward the corresponding method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   220
     * from the rendering session directly to this method
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   221
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   222
    IMPORT_C void SetNextURIResult( TInt aError );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   223
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   224
public: // internal methods for the state algorithms
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   225
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   226
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   227
     * Reports SynReady to observer
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   228
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   229
    void ReportSyncReady( TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   230
        Upnp::TState aNewState );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   231
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   232
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   233
     * Reports StateChanged to observers
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   234
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   235
    void ReportStateChanged( TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   236
        Upnp::TState aNewState,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   237
        TBool aActionResponse = ETrue,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   238
        TInt aStateParam = 0 );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   239
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   240
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   241
     * Reports PositionSync to observers
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   242
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   243
    void ReportPositionSync( TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   244
        Upnp::TPositionMode aMode,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   245
        TInt aDuration, TInt aPosition );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   246
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   247
private: // data
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   248
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   249
    // Rendering session
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   250
    MUPnPAVRenderingSession&            iSession;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   251
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   252
    // the observer (no ownership!)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   253
    MUpnpRenderingStateMachineObserver* iObserver;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   254
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   255
    // the current state
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   256
    Upnp::TState                        iState;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   257
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   258
    // rendering state machine option flags
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   259
    TInt                                iOptions;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   260
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   261
    // playtime calculator
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   262
    CUpnpRenderingPlaytimeCalculator*   iPlaytimeCalculator;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   263
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   264
    // state when buffering started with 'set uri' request
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   265
    Upnp::TState                        iStateBeforeSetUri;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   266
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   267
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   268
/**************************
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   269
 ** State machine states **
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   270
 **************************/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   271
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   272
public: // Operation execution methods
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   273
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   274
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   275
     * from MUpnpRenderingOperationExecutor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   276
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   277
    TResult ExecuteOperationL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   278
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   279
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   280
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   281
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   282
     * from MUpnpRenderingOperationExecutor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   283
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   284
    TResult ProcessOperationL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   285
        const TUpnpRenderingOperation& aOperation, TInt aEvent,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   286
        TInt aError, const TAny* aParam1, const TAny* aParam2 );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   287
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   288
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   289
     * from MUpnpRenderingOperationExecutor
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   290
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   291
    void HandleAsyncError(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   292
        const TUpnpRenderingOperation& aOperation, TInt aError );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   293
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   294
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   295
     * processing events
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   296
     * used in context of the operation queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   297
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   298
    enum TOperationEvents
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   299
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   300
        EInteractOperationComplete,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   301
        EPositionInfo,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   302
        ESetUriResult,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   303
        ETimeout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   304
        };
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   305
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   306
private: // internal state machinery
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   307
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   308
    // these are all called from the operation queue.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   309
    // in all below methods, aOperation is the currently ongoing operation.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   310
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   311
    // executes an operation
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   312
    TResult ExecuteOperationSyncL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   313
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   314
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   315
    TResult ExecuteOperationPlayL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   316
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   317
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   318
    TResult ExecuteOperationStopL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   319
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   320
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   321
    TResult ExecuteOperationPauseL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   322
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   323
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   324
    TResult ExecuteOperationResumeL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   325
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   326
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   327
    TResult ExecuteOperationRestartL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   328
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   329
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   330
    TResult ExecuteOperationSeekL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   331
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   332
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   333
    TResult ExecuteOperationCalibrateL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   334
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   335
        const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   336
    TResult ExecuteOperationSetUriL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   337
            const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   338
            const TUpnpRenderingOperation& aCurrent );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   339
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   340
    // handles network events
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   341
    TResult ProcessPositionInfo(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   342
        const TUpnpRenderingOperation& aOperation,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   343
        TInt aError, const TDesC8& aPosition, const TDesC8& aLength );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   344
    TResult ProcessSetURIResultL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   345
        const TUpnpRenderingOperation& aOperation, TInt aError );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   346
    TResult ProcessAVEvents( 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   347
            const TUpnpRenderingOperation& aOperation, 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   348
            const TUPnPAVInteractOperation aIntOp,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   349
            TInt aError );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   350
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   351
protected: // internal
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   352
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   353
    // retrieves a resource from given media using the media selector
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   354
    const CUpnpElement& ResourceFromL( const CUpnpItem& aMedia );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   355
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   356
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   357
    // user-defined resource selector (NOT OWNED!)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   358
    MUPnPResourceSelector*              iSelector;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   359
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   360
    // the default resource selector (used if not explicitly set by user)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   361
    TUPnPSelectDefaultResource          iDefaultSelector;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   362
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   363
    // currently playing HTTP URI
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   364
    TBuf8<KUriBuffer>                   iCurrentUri;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   365
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   366
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   367
/***********
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   368
 ** Queue **
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   369
 ***********/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   370
public: // methods
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   371
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   372
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   373
     * Count of operations in the queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   374
     * @return count of operations in the queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   375
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   376
    TInt Size() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   377
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   378
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   379
     * Checks if the queue is free for new operations
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   380
     * @return ETrue if new operation can be run immediately
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   381
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   382
    TBool IsFree() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   383
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   384
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   385
     * push operation to queue.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   386
     * Don't even try to execute it at this stage.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   387
     * @param aOperation the operation to be added
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   388
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   389
    void PushL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   390
        const TUpnpRenderingOperation& aOperation );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   391
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   392
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   393
     * push operation to queue and execute
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   394
     * @param aOperation the operation to be added
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   395
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   396
    void PushAndExecuteL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   397
        const TUpnpRenderingOperation& aOperation );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   398
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   399
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   400
     * executes the first operation in the queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   401
     * note: non-leaving version.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   402
     * if the operation completes, continues recursively to next
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   403
     * until queue is empty
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   404
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   405
    void Execute();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   406
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   407
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   408
     * Processes an item in the queue with given data
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   409
     * if the operation completes, continues recursively to next
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   410
     * until queue is empty
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   411
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   412
    void Process( TInt aEvent,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   413
        TInt aError=0, const TAny* aParam1=NULL, const TAny* aParam2=NULL );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   414
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   415
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   416
     * Finds and removes deprecated commands from queue.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   417
     * E.g. If the last command is stop, then all other except the current 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   418
     * (ongoing) and the stop command are removed.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   419
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   420
    void CompressQueueL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   421
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   422
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   423
     * removes all dup. commands but not the latest one and ongoing
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   424
     * 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   425
     * @param aCommand commands to be removed from queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   426
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   427
    void RemoveAllDublicateCommands( Upnp::TCommand aCommand );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   428
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   429
public: // own methods
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   430
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   431
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   432
     * Returns currently ongoing operation. ENone, if queue empty
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   433
     * @return operation at first position
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   434
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   435
    TUpnpRenderingOperation Current() const;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   436
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   437
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   438
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   439
     * executes the current operation recursively
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   440
     * if the operation completes, continues recursively to next
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   441
     * until queue is empty
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   442
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   443
    void ExecuteRecursivelyL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   444
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   445
    /**
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   446
     * executes an operation parallel to an ongoing operation
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   447
     */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   448
    void ExecuteParallelL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   449
        const TUpnpRenderingOperation& aOperation );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   450
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   451
private:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   452
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   453
    void SetUriL( const TUpnpRenderingOperation& aOperation );
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   454
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   455
private:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   456
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   457
    // the array that implements the queue
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   458
    RArray<TUpnpRenderingOperation>  iQueue;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   459
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   460
    // Seek position to be used for playbacktimecalculator 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   461
    // when seek is completed 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   462
    TInt                             iSeekPostion;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   463
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   464
    // Start timestamp for getting position; it is used to add 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   465
    // half of the delay when get position request is made and 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   466
    // when the response is received to avoid lag with the renderer  
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   467
    TTime                            iGetPositionStartMark;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   468
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   469
    };
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   470
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   471
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   472
#endif // C_UPNPRENDERINGSTATEMACHINE_H
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   473