dlnasrv_exampleapp/src/exampleappengine_p.cpp
author Sampo Huttunen <sampo.huttunen@nokia.com>
Wed, 24 Nov 2010 09:39:46 +0200
branchIOP_Improvements
changeset 45 a6c41ca11adf
parent 41 b4d83ea1d6e2
permissions -rw-r--r--
Updated the SIS package, there was some BC issue with the earlier version. Also updated the platform UID to S^3 version.
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) 2010 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:
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
#include <es_sock.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    19
#include <es_enum.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    20
#include <upnpsettingsengine.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    21
#include <upnpavcontrollerfactory.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    22
#include <upnpavcontroller.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    23
#include <upnpavdevice.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    24
#include <upnpavdevicelist.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    25
#include <upnprenderingstatemachine.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    26
#include <upnpavrenderingsession.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    27
#include <upnpvolumestatemachine.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    28
#include <upnpitemresolverfactory.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    29
#include <upnpitemresolver.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    30
#include <upnpconnectionmonitor.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    31
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    32
#include "exampleappengine_p.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    33
#include "trace.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    34
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    35
/*!
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    36
    /class ExampleAppEnginePrivate
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    37
    /brief Implements interface to Symbian side DLNA APIs.
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    38
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    39
    This is the "rendering engine" class, implementing various UPnP callback
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    40
    interfaces. Some of the callbacks are lacking implementation because this
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    41
    simple example application does not require all that functionality.
40
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
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
    C++ constructor.
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
ExampleAppEnginePrivate::ExampleAppEnginePrivate():
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    48
    q_ptr(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    49
    mSettingsEngine(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    50
    mAVRenderingSession(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    51
    mRenderingStateMachine(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    52
    mVolumeStateMachine(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    53
    mAVController(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    54
    mIap(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    55
    mIapName(""),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    56
    mDevices(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    57
    mDevice(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    58
    mPlaybackState(ExampleAppEngine::PlaybackStateStopped),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    59
    mItemResolver(0)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    60
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    61
    FUNC_LOG    
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
    TRAP_IGNORE(mSettingsEngine = CUPnPSettingsEngine::NewL());
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
    TRAP_IGNORE(mDevices = CUpnpAVDeviceList::NewL());
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
    TRAP_IGNORE(mConnectionMonitor = CUPnPConnectionMonitor::NewL(0));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    68
    mConnectionMonitor->SetObserver(*this);
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
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
    C++ destructor.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    73
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    74
ExampleAppEnginePrivate::~ExampleAppEnginePrivate()
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
    FUNC_LOG
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
    delete mItemResolver;
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
    delete mDevices;
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
    delete mSettingsEngine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    83
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    84
    if (mAVRenderingSession)
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
        if (mAVController)
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
            mAVController->StopRenderingSession(*mAVRenderingSession);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    89
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    90
    }
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
    delete mRenderingStateMachine;
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
    delete mVolumeStateMachine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    95
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    96
    if (mAVController)
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
        mAVController->Release();
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
    delete mConnectionMonitor;
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   104
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   105
    Checks for connected IAP.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   106
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   107
void ExampleAppEnginePrivate::construct()
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
    FUNC_LOG
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
    resolveIapL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   112
    resolveIapNameL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   113
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   114
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   115
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   116
    Returns currently connected IAP.
40
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
int ExampleAppEnginePrivate::getConnectedIap() const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   119
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   120
    FUNC_LOG
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
    return mIap;
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   126
    Returns the name of the currently connected IAP.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   127
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   128
QString ExampleAppEnginePrivate::getConnectedIapName() const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   129
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   130
    FUNC_LOG
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
    return mIapName;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   133
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   134
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   135
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   136
    Returns the current playback state.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   137
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   138
int ExampleAppEnginePrivate::getPlaybackState() const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   139
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   140
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   141
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   142
    return mPlaybackState;
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   146
    Returns whether the currently selected renderer supports seek functionality.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   147
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   148
bool ExampleAppEnginePrivate::isSeekSupported() const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   149
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   150
    FUNC_LOG
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
    // TODO: return real value when seek is implemented
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   153
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   154
    return false;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   155
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   158
    Returns whether the currently selected renderer supports pause functionality.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   159
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   160
bool ExampleAppEnginePrivate::isPauseSupported() const
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
    FUNC_LOG
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
    bool isSupported(false);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   165
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   166
    if (mDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   167
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   168
        isSupported = mDevice->PauseCapability();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   169
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   170
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   171
    return isSupported;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   172
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   175
    This function causes renderingDeviceFound() signals to be emitted in two different ways:
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   176
    first the current device list in UPnP AV Controller is gone through and for each
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   177
    renderer device found from there one signal is emitted. Also, this object is set as a
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   178
    device observer to the UPnP AV Controller, causing it to call this class's callback
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   179
    function UPnPDeviceDiscovered() upon every new device that is discovered from the current network.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   180
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   181
void ExampleAppEnginePrivate::searchRenderingDevices()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   182
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   183
    FUNC_LOG
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
    if (mIap)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   186
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   187
        // first create av controller
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   188
        if (!mAVController)
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
            TRAP_IGNORE(mAVController = UPnPAVControllerFactory::NewUPnPAVControllerL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   191
            if (!mAVController)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   192
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   193
                return;
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
            mAVController->SetDeviceObserver(*this);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   196
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   197
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   198
        // check if devices have been found
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   199
        TRAP_IGNORE(searchRenderingDevicesL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   200
    }    
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   204
    Start a rendering session with the renderer provided in /a uuid.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   205
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   206
void ExampleAppEnginePrivate::prepareRenderingDevice(const QString &uuid)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   207
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   208
    FUNC_LOG
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
    TRAP_IGNORE(prepareRenderingDeviceL(uuid));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   211
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   212
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   213
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   214
    Start file initialization for sharing.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   215
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   216
int ExampleAppEnginePrivate::initFile(const QString& file)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   219
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   220
    TRAPD(err, initFileL(file));
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
    return err;
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   225
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   226
    Issues the play() command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   227
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   228
void ExampleAppEnginePrivate::play()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   229
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   230
    FUNC_LOG
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
    TRAP_IGNORE(playL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   233
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   236
    Issues the pause() command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   237
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   238
void ExampleAppEnginePrivate::pause()
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   241
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   242
    TRAP_IGNORE(pauseL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   243
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   244
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   245
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   246
    Issues the stop() command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   247
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   248
void ExampleAppEnginePrivate::stop()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   249
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   250
    FUNC_LOG
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
    TRAP_IGNORE(stopL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   253
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   256
    Issues the volumeUp() command to the renderer.
40
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
void ExampleAppEnginePrivate::volumeUp()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   259
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   260
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   261
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   262
    // TODO: implement
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   265
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   266
    Issues the volumeDown() command to the renderer.
40
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
void ExampleAppEnginePrivate::volumeDown()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   269
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   270
    FUNC_LOG
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
    // TODO: implement
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   276
    Issues the rew() command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   277
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   278
void ExampleAppEnginePrivate::rew()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   279
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   280
    FUNC_LOG
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
    // TODO: implement
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   285
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   286
    Issues the ff() command to the renderer.
40
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
void ExampleAppEnginePrivate::ff()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   289
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   290
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   291
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   292
    // TODO: implement
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
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   295
/*!    
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   296
    Callback function that UPnP AV Controller calls when a new UPnP AV Device is
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   297
    found from the network.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   298
    From MUPnPAVDeviceObserver
40
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
void ExampleAppEnginePrivate::UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   301
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   302
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   303
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   304
    TRAP_IGNORE(upnpDeviceDiscoveredL(aDevice));
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   307
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   308
    Callback function that UPnP AV Controller calls when a UPnP AV Device has
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   309
    disappeared from the network.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   310
    From MUPnPAVDeviceObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   311
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   312
void ExampleAppEnginePrivate::UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   313
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   314
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   315
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   316
    // search device from list
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   317
    CUpnpAVDevice *device(NULL);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   318
    int count(mDevices->Count());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   319
    int index(0);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   320
    for (int i = 0; i < count; i++)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   321
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   322
        device = (*mDevices)[i];
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   323
        if (device->Uuid() == aDevice.Uuid())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   324
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   325
            index = i;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   326
            break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   327
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   328
        device = NULL;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   329
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   330
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   331
    // remove if device was found
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   332
    if (device)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   333
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   334
        mDevices->Remove(index);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   335
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   336
        if (device->Uuid() == mDevice->Uuid())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   337
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   338
            stopRenderingSession();
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
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   341
        QString name = asString8(device->FriendlyName());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   342
        QString uuid = asString8(device->Uuid());        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   343
        emit q_ptr->renderingDeviceDisappeared(name, uuid);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   344
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   345
        delete device;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   346
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   347
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   348
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   349
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   350
    Callback function that UPnP AV Controller calls when the WLAN
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   351
    connection has been lost. All existing sessions should be considered
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   352
    invalid.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   353
    From MUPnPAVDeviceObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   354
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   355
void ExampleAppEnginePrivate::WLANConnectionLost()
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   358
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   359
    // no implementation required
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   360
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   361
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   362
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   363
    Just pass to volume state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   364
    From MUPnPAVRenderingSessionObserver
40
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
void ExampleAppEnginePrivate::VolumeResult(TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   367
    TInt aVolumeLevel,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   368
    TBool aActionResponse)
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
    FUNC_LOG
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
    if (mVolumeStateMachine)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   373
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   374
        mVolumeStateMachine->VolumeResult(aError, aVolumeLevel, aActionResponse);
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
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   379
    Just pass to volume state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   380
    From MUPnPAVRenderingSessionObserver
40
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
void ExampleAppEnginePrivate::MuteResult(TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   383
    TBool aMute,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   384
    TBool aActionResponse)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   385
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   386
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   387
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   388
    if (mVolumeStateMachine)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   389
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   390
        mVolumeStateMachine->MuteResult(aError, aMute, aActionResponse);
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   394
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   395
    Just pass to rendering state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   396
    From MUPnPAVRenderingSessionObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   397
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   398
void ExampleAppEnginePrivate::InteractOperationComplete(TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   399
    TUPnPAVInteractOperation aOperation)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   400
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   401
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   402
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   403
    if (mRenderingStateMachine)
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
        mRenderingStateMachine->InteractOperationComplete(aError, aOperation);
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   409
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   410
    Just pass to rendering state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   411
    From MUPnPAVRenderingSessionObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   412
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   413
void ExampleAppEnginePrivate::PositionInfoResult(TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   414
    const TDesC8& aTrackPosition,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   415
    const TDesC8& aTrackLength)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   416
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   417
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   418
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   419
    if (mRenderingStateMachine)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   420
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   421
        mRenderingStateMachine->PositionInfoResult(aError, aTrackPosition, aTrackLength);
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
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   426
    Just pass to rendering state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   427
    From MUPnPAVRenderingSessionObserver
40
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
void ExampleAppEnginePrivate::SetURIResult(TInt aError)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   432
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   433
    if (mRenderingStateMachine)
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
        mRenderingStateMachine->SetURIResult(aError);
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   440
    Just pass to rendering state machine
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   441
    From MUPnPAVRenderingSessionObserver
40
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 ExampleAppEnginePrivate::SetNextURIResult(TInt aError)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   446
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   447
    if (mRenderingStateMachine)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   448
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   449
        mRenderingStateMachine->SetNextURIResult(aError);
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
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   454
    Renderer to which there was an active session has disappeared. The session should be
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   455
    considered invalid.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   456
    From MUPnPAVRenderingSessionObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   457
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   458
void ExampleAppEnginePrivate::MediaRendererDisappeared(TUPnPDeviceDisconnectedReason /*aReason*/)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   461
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   462
    // TODO: implement
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   465
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   466
    Callback for telling that the rendering state machine is in synch with
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   467
    the rendering device.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   468
    From MUpnpRenderingStateMachineObserver
40
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
void ExampleAppEnginePrivate::RendererSyncReady(TInt /*aError*/, Upnp::TState /*aState*/)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   473
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   474
    // TODO: implement
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   475
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   476
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   477
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   478
    Rendering device's state has been changed.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   479
    From MUpnpRenderingStateMachineObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   480
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   481
void ExampleAppEnginePrivate::RenderingStateChanged(TInt aError,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   482
    Upnp::TState aState,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   483
    TBool /*aUserOriented*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   484
    TInt /*aStateParam*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   485
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   486
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   487
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   488
    int state(ExampleAppEngine::PlaybackStateStopped);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   489
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   490
    if (aError == KErrNone)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   491
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   492
        switch (aState)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   493
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   494
            case Upnp::EBuffering:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   495
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   496
                state = ExampleAppEngine::PlaybackStateBuffering;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   497
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   498
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   499
            case Upnp::EPlaying:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   500
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   501
                state = ExampleAppEngine::PlaybackStatePlaying;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   502
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   503
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   504
            case Upnp::EPaused:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   505
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   506
                state = ExampleAppEngine::PlaybackStatePaused;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   507
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   508
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   509
            default:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   510
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   511
                // no actions, stopped state is used
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   512
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   513
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   514
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   515
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   516
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   517
    mPlaybackState = state;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   518
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   519
    emit q_ptr->stateChanged(mPlaybackState);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   520
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   521
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   522
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   523
    For synchronizing UI with the progress of the playback on the
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   524
    rendering device.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   525
    From MUpnpRenderingStateMachineObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   526
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   527
void ExampleAppEnginePrivate::PositionSync(TInt /*aError*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   528
    Upnp::TPositionMode /*aMode*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   529
    TInt /*aDuration*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   530
    TInt /*aPosition*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   531
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   532
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   533
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   534
    // TODO: implement
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   535
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   536
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   537
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   538
    Callback for telling that the volume state machine is in synch with
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   539
    the rendering device.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   540
    From MUpnpVolumeStateMachineObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   541
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   542
void ExampleAppEnginePrivate::VolumeSyncReady(TInt /*aError*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   543
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   544
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   545
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   546
    // TODO: implement
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   547
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   548
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   549
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   550
    Rendering device's volume has changed.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   551
    From MUpnpVolumeStateMachineObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   552
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   553
void ExampleAppEnginePrivate::VolumeChanged(TInt /*aError*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   554
    TInt /*aVolume*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   555
    TBool /*aUserOriented*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   556
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   557
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   558
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   559
    // TODO: implement
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   560
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   561
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   562
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   563
    Mute status of the rendering device has changed.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   564
    From MUpnpVolumeStateMachineObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   565
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   566
void ExampleAppEnginePrivate::MuteChanged(TInt /*aError*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   567
    TBool /*aMuteState*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   568
    TBool /*aUserOriented*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   569
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   570
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   571
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   572
    // TODO: implement
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   573
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   574
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   575
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   576
    Resolving a file as an URI to be shared on media server has been completed.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   577
    From MUPnPItemResolverObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   578
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   579
void ExampleAppEnginePrivate::ResolveComplete(const MUPnPItemResolver& /*aResolver*/,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   580
    TInt aError)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   581
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   582
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   583
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   584
    ERROR(aError, "Error while resolving an item");
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   585
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   586
    emit q_ptr->initComplete(aError);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   587
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   588
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   589
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   590
    WLAN connection has been lost.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   591
    From MUPnPConnectionMonitorObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   592
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   593
void ExampleAppEnginePrivate::ConnectionLost(TBool /*aUserOriented*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   594
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   595
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   596
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   597
    stopRenderingSession();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   598
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   599
    mIap = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   600
    mIapName = "Not connected";
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   601
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   602
    emit q_ptr->iapUpdated(mIapName);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   603
    emit q_ptr->iapUpdated(mIap);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   604
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   605
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   606
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   607
    WLAN connection has been created.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   608
    From MUPnPConnectionMonitorObserver
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   609
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   610
void ExampleAppEnginePrivate::ConnectionCreated(TInt /*aConnectionId*/)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   611
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   612
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   613
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   614
    TRAP_IGNORE(resolveIapL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   615
    TRAP_IGNORE(resolveIapNameL());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   616
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   617
    emit q_ptr->iapUpdated(mIapName);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   618
    emit q_ptr->iapUpdated(mIap);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   619
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   620
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   621
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   622
    Iterate through the AV Devices of the UPnP AV Controller,
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   623
    i.e. the already found devices stored in the AV Controller.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   624
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   625
void ExampleAppEnginePrivate::searchRenderingDevicesL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   626
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   627
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   628
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   629
    emit q_ptr->renderingDeviceSearchStarted();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   630
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   631
    CUpnpAVDeviceList *deviceList = mAVController->GetMediaRenderersL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   632
    int count(deviceList->Count());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   633
    for (int i = count - 1; i >= 0; i--)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   634
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   635
        CUpnpAVDevice *device = (*deviceList)[i];
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   636
        upnpDeviceDiscoveredL(*device);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   637
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   638
    delete deviceList;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   639
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   640
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   641
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   642
    Iterate through found AV Devices, and signal renderingDeviceFound()
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   643
    for each renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   644
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   645
void ExampleAppEnginePrivate::upnpDeviceDiscoveredL(const CUpnpAVDevice& aDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   646
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   647
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   648
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   649
    if (aDevice.DeviceType() == CUpnpAVDevice::EMediaRenderer)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   650
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   651
        CUpnpAVDevice *device(0);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   652
        int count(mDevices->Count());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   653
        for (int i = 0; i < count; i++)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   654
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   655
            device = (*mDevices)[i];
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   656
            if (device->Uuid() == aDevice.Uuid())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   657
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   658
                // found
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   659
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   660
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   661
            device = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   662
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   663
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   664
        if (!device)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   665
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   666
            // create new device
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   667
            device = CUpnpAVDevice::NewL(aDevice);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   668
            mDevices->AppendDeviceL(*device);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   669
            
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   670
            QString name = asString8(device->FriendlyName());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   671
            QString uuid = asString8(device->Uuid());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   672
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   673
            INFO_2("New rendering device found: Name = %s, Uuid = %s",
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   674
                name.utf16(), uuid.utf16());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   675
            
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   676
            emit q_ptr->renderingDeviceFound(name, uuid);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   677
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   678
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   679
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   680
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   681
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   682
    Ensure that there is an active rendering session for the device
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   683
    passed in as /a uuid.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   684
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   685
void ExampleAppEnginePrivate::prepareRenderingDeviceL(const QString &uuid)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   686
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   687
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   688
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   689
    // get current uuid
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   690
    QString currentUuid;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   691
    if (mDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   692
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   693
        currentUuid = asString8(mDevice->Uuid());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   694
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   695
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   696
    // check if uuid is different than the requsted one
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   697
    if (currentUuid != uuid)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   698
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   699
        // search the rendering device
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   700
        CUpnpAVDevice *device = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   701
        int count(mDevices->Count());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   702
        for (int i = 0; i < count; i++)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   703
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   704
            device = (*mDevices)[i];
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   705
            QString deviceUuid = asString8(device->Uuid());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   706
            if (deviceUuid == uuid)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   707
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   708
                // device found
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   709
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   710
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   711
            device = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   712
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   713
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   714
        stopRenderingSession();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   715
        
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   716
        mDevice = device;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   717
        if (mDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   718
        {            
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   719
            startRenderingSessionL(*mDevice);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   720
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   721
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   722
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   723
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   724
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   725
    Start rendering session to /a device. Rendering state machine and
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   726
    volume state machine will call observer interface once they are in
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   727
    synch.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   728
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   729
void ExampleAppEnginePrivate::startRenderingSessionL(const CUpnpAVDevice &device)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   730
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   731
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   732
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   733
    // start new rendering session
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   734
    mAVRenderingSession = &mAVController->StartRenderingSessionL(device);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   735
    mAVRenderingSession->SetObserver(*this);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   736
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   737
    // start new rendering state machine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   738
    mRenderingStateMachine = CUpnpRenderingStateMachine::NewL(*mAVRenderingSession);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   739
    mRenderingStateMachine->SetObserver(*this);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   740
    mRenderingStateMachine->SyncL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   741
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   742
    // start new volume state machine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   743
    mVolumeStateMachine = CUpnpVolumeStateMachine::NewL(*mAVRenderingSession);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   744
    mVolumeStateMachine->SetObserver(*this);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   745
    mVolumeStateMachine->SyncL();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   746
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   747
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   748
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   749
    Stop rendering session and perform needed cleanup.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   750
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   751
void ExampleAppEnginePrivate::stopRenderingSession()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   752
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   753
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   754
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   755
    // stop ongoing playback
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   756
    if (mPlaybackState != ExampleAppEngine::PlaybackStateStopped)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   757
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   758
        stop();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   759
        RenderingStateChanged(KErrNone, Upnp::EStopped, EFalse, 0);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   760
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   761
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   762
    // release rendering state machine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   763
    delete mRenderingStateMachine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   764
    mRenderingStateMachine = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   765
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   766
    // release volume state machine
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   767
    delete mVolumeStateMachine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   768
    mVolumeStateMachine = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   769
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   770
    // stop and release rendering session
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   771
    if (mAVController && mAVRenderingSession)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   772
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   773
        mAVController->StopRenderingSession(*mAVRenderingSession);            
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   774
        mAVRenderingSession = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   775
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   776
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   777
    mDevice = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   778
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   779
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   780
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   781
    Start file initialization for sharing. If a renderer device is selected,
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   782
    instruct local item resolver to to resolve the /a file passed as a
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   783
    parameter, i.e. prepare the URI that can be used to locate the shared
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   784
    file on the push server. When resolving is done, the callback function
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   785
    ResolveComplete() is called.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   786
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   787
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   788
void ExampleAppEnginePrivate::initFileL(const QString &file)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   789
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   790
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   791
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   792
    delete mItemResolver;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   793
    mItemResolver = 0;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   794
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   795
    if (mDevice)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   796
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   797
        TPtrC filePath(file.utf16(), file.length());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   798
        TUPnPSelectDefaultResource selector;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   799
        mItemResolver =
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   800
            UPnPItemResolverFactory::NewLocalItemResolverL(
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   801
                filePath, *mAVController, selector);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   802
        mItemResolver->ResolveL(*this, mDevice);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   803
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   804
    else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   805
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   806
        // rendering device has not been selected
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   807
        User::Leave(KErrNotReady);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   808
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   809
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   810
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   811
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   812
    Check if it's ok to issue playback commands.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   813
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   814
bool ExampleAppEnginePrivate::isReadyForPlayback() const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   815
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   816
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   817
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   818
    bool isReady(false);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   819
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   820
    if (mDevice &&           // device is selected
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   821
        mAVRenderingSession &&      // av rendering session is created
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   822
        mRenderingStateMachine &&   // rendering state machine is created
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   823
        mVolumeStateMachine)        // volume state machine is created
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   824
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   825
        isReady = true;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   826
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   827
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   828
    return isReady;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   829
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   830
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   831
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   832
    Issues the play command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   833
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   834
void ExampleAppEnginePrivate::playL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   835
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   836
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   837
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   838
    if (isReadyForPlayback())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   839
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   840
        mRenderingStateMachine->CommandL(Upnp::EPlay, 0, &mItemResolver->Item());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   841
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   842
    else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   843
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   844
        User::Leave(KErrNotReady);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   845
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   846
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   847
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   848
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   849
    Issues the pause command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   850
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   851
void ExampleAppEnginePrivate::pauseL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   852
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   853
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   854
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   855
    if (isReadyForPlayback())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   856
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   857
        // double check that the rendering device supports pause capability
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   858
        if (mDevice->PauseCapability())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   859
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   860
            mRenderingStateMachine->CommandL(Upnp::EPause);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   861
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   862
        else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   863
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   864
            User::Leave(KErrNotSupported);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   865
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   866
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   867
    else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   868
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   869
        User::Leave(KErrNotReady);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   870
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   871
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   872
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   873
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   874
    Issues the stop command to the renderer.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   875
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   876
void ExampleAppEnginePrivate::stopL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   877
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   878
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   879
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   880
    if (isReadyForPlayback())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   881
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   882
        mRenderingStateMachine->CommandL(Upnp::EStop);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   883
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   884
    else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   885
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   886
        User::Leave(KErrNotReady);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   887
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   888
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   889
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   890
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   891
    Check that there is an active connection and store that IAP for further
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   892
    usage. Note that there is no functionality in this application to
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   893
    initialize connection setup, if no active connection exists.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   894
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   895
void ExampleAppEnginePrivate::resolveIapL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   896
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   897
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   898
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   899
    // code below could be optimized so that connections to socket server
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   900
    // are only made once
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   901
    RSocketServ socketServ;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   902
    int err = socketServ.Connect();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   903
    if (err == KErrNone)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   904
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   905
        RConnection connection;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   906
        err = connection.Open(socketServ);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   907
        if (err == KErrNone)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   908
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   909
            uint connectionCount(0);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   910
            err = connection.EnumerateConnections(connectionCount);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   911
            if (err == KErrNone &&
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   912
            connectionCount == 1)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   913
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   914
                // One active connection - find it and try using it
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   915
                TPckgBuf<TConnectionInfo> connectionInfo;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   916
                for (int i = 1; i <= connectionCount; ++i)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   917
                {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   918
                    if (connection.GetConnectionInfo(i, connectionInfo) == KErrNone)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   919
                    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   920
                        // resolve iap id and name
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   921
                        mIap = connectionInfo().iIapId;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   922
                    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   923
                }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   924
                connection.Close();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   925
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   926
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   927
        socketServ.Close();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   928
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   929
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   930
    mSettingsEngine->SetAccessPoint(mIap);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   931
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   932
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   933
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   934
    Resolve the IAP name that's stored in UPnP Settings Engine as the
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   935
    currently active IAP.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   936
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   937
void ExampleAppEnginePrivate::resolveIapNameL()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   938
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   939
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   940
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   941
    HBufC* iapName(NULL);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   942
    TRAP_IGNORE(iapName = CUPnPSettingsEngine::GetCurrentIapNameL(mIap));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   943
    if (iapName)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   944
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   945
        mIapName = asString(*iapName);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   946
        delete iapName;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   947
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   948
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   949
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   950
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   951
    Helper function for Symbian descriptor to Qt string conversion.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   952
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   953
QString ExampleAppEnginePrivate::asString(const TDesC &desc) const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   954
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   955
    return QString::fromUtf16(desc.Ptr(), desc.Length());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   956
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   957
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   958
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   959
    Helper function for Symbian descriptor to Qt string conversion.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   960
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   961
QString ExampleAppEnginePrivate::asString8(const TDesC8 &desc) const
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   962
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   963
    return QString::fromUtf8((char*)desc.Ptr(), desc.Length());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   964
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   965
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   966
// End of file