dlnasrv_exampleapp/src/exampleappui.cpp
author Sampo Huttunen <sampo.huttunen@nokia.com>
Fri, 05 Nov 2010 18:31:17 +0200
branchIOP_Improvements
changeset 43 9b689d9d3a1c
parent 41 b4d83ea1d6e2
permissions -rw-r--r--
Added signed SIS. Also updated package definition file and did some capitalization corrections to few mmp files.
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 <qlabel.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    19
#include <qboxlayout.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    20
#include <qgroupbox.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    21
#include <qpushbutton.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    22
#include <qcombobox.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    23
#include <qlayoutitem.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    24
#include <qfiledialog.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    25
#include <qaction.h>
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    26
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    27
#include "exampleappui.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    28
#include "exampleappengine.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    29
#include "trace.h"
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    30
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
    \class ExampleAppUi
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    33
    \brief Implements the application UI for Dlnasrv example application.
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    34
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    35
    The application provides a simple UI for selecting a renderer device
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    36
    (from a connected WLAN AP, if none is connected that needs to be done
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    37
    outside the application UI) and selecting a file to be rendered and
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    38
    control buttons for controlling the playback on the renderer device.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    39
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    40
    So the first step is to have a WLAN connection active. Only then the
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    41
    renderer search and selection can be done.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    42
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    43
    The next step is to select a rendering device. When rendering device
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    44
    search is initiated, the underlying UPnP AV control server is queried
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    45
    for existing renderers. Also all new renderers appearing in the AP
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    46
    get signalled with renderingDeviceFound()
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    47
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    48
    When a renderer is selected, the next step is to select a file to be
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    49
    pushed to the renderer. When selecting a file, it gets published in
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    50
    the push server as a DLNA item. When that is done, the controls for
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    51
    playback are enabled and the renderer can be controlled with those.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    52
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    53
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    54
/*!
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    55
    ExampleAppUi constructor.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    56
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    57
ExampleAppUi::ExampleAppUi():
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    58
    mEngine(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    59
    mSelectedRenderer(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    60
    mSelectedFileLabel(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    61
    mPlaybackStatus(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    62
    mRenderingDevices(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    63
    mPauseButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    64
    mStopButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    65
    mRewButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    66
    mFfButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    67
    mSelectFileButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    68
    mSearchDevicesButton(0),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    69
    mSelectedFile("")
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    72
}
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
/*!
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    75
    ExampleAppUi destructor.
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    76
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    77
ExampleAppUi::~ExampleAppUi()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    78
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    79
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    80
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    81
    delete mEngine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    82
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    83
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    84
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    85
    Creates application engine and the UI. Also the state of the WLAN AP
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    86
    connection gets queried and updated on the UI.
40
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
void ExampleAppUi::construct()
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
    FUNC_LOG
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
    createEngine();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    93
    createUi();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    94
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    95
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    96
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
    97
    Creates the UI components.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    98
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
    99
void ExampleAppUi::createUi()
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
    FUNC_LOG
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
    // create main view
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   104
    QWidget *view = new QWidget;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   105
    setCentralWidget(view);
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
    // create main view layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   108
    QVBoxLayout *mainLayout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   109
    view->setLayout(mainLayout);
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
    // create accesspoint selection
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   112
    QLayout *layout = createApSelectionUi();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   113
    mainLayout->addLayout(layout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   114
    mainLayout->addSpacing(40);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   115
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   116
    // create renderer selection
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   117
    layout = createRendererSelectionUi();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   118
    mainLayout->addLayout(layout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   119
    mainLayout->addSpacing(40);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   120
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   121
    // create file selection
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   122
    layout = createFileSelectionUi();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   123
    mainLayout->addLayout(layout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   124
    mainLayout->addSpacing(40);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   125
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   126
    // create playback ui
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   127
    layout = createPlaybackUi();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   128
    mainLayout->addLayout(layout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   129
    mainLayout->addSpacing(40);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   130
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   131
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   132
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   133
    Creates the UI for showing and selecting WLAN AP connection status.
40
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
QLayout *ExampleAppUi::createApSelectionUi()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   136
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   137
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   138
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   139
    QVBoxLayout *layout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   140
    QHBoxLayout *topLayout = new QHBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   141
    QLabel *titleLabel = new QLabel(tr("Access point:"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   142
    QLabel *statusLabel = new QLabel(tr("Not connected"));    
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
    // connect signals
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   145
    connect(mEngine, SIGNAL(iapUpdated(const QString &)), statusLabel, SLOT(setText(const QString &)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   146
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   147
    // add widgets to top layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   148
    topLayout->addWidget(titleLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   149
    topLayout->addWidget(statusLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   150
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   151
    // add sub layouts to main layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   152
    layout->addLayout(topLayout);
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
    // update iap
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   155
    QString iapName = mEngine->getIapName();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   156
    if (iapName.length())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   157
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   158
        statusLabel->setText(iapName);
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
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   161
    return layout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   162
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   165
    Creates the UI for showing and selecting renderer device.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   166
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   167
QLayout *ExampleAppUi::createRendererSelectionUi()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   168
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   169
    FUNC_LOG
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
    QVBoxLayout *layout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   172
    QHBoxLayout *topLayout = new QHBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   173
    QVBoxLayout *bottomLayout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   174
    QLabel *titleLabel = new QLabel(tr("Rendering device:"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   175
    QLabel *statusLabel = new QLabel(tr("Not connected"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   176
    QPushButton *searchButton = new QPushButton(tr("Search for new devices"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   177
    QComboBox *selectionComboBox = new QComboBox;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   178
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   179
    // connect signals
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   180
    connect(searchButton, SIGNAL(clicked()), mEngine, SLOT(searchRenderingDevices()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   181
    connect(selectionComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectRenderingDevice(int)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   182
    connect(mEngine, SIGNAL(iapUpdated(int)), this, SLOT(enableRenderingDeviceSelection(int)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   183
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   184
    // add widgets to top layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   185
    topLayout->addWidget(titleLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   186
    topLayout->addWidget(statusLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   187
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   188
    // add widgets to bottom layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   189
    bottomLayout->addWidget(searchButton);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   190
    bottomLayout->addWidget(selectionComboBox);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   191
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   192
    // add sub layouts to main layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   193
    layout->addLayout(topLayout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   194
    layout->addLayout(bottomLayout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   195
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   196
    // store rendering devices
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   197
    mRenderingDevices = selectionComboBox;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   198
    mSelectedRenderer = statusLabel;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   199
    mSearchDevicesButton = searchButton;
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
    // disable search button if iap has not been defined
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   202
    if (!mEngine->getIap())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   203
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   204
        disableRenderingDeviceSelection();
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
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   207
    return layout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   208
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   211
    Creates the UI for showing and selecting media file to be rendered.
40
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
QLayout *ExampleAppUi::createFileSelectionUi()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   214
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   215
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   216
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   217
    QVBoxLayout *layout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   218
    QHBoxLayout *topLayout = new QHBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   219
    QVBoxLayout *bottomLayout = new QVBoxLayout;    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   220
    QLabel *titleLabel = new QLabel(tr("Selected file:"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   221
    QLabel *statusLabel = new QLabel(tr("None"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   222
    QPushButton *selectButton = new QPushButton(tr("Select media file"));
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
    // connect signals
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   225
    connect(selectButton, SIGNAL(clicked()), this, SLOT(selectFile()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   226
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   227
    // add widgets to top layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   228
    topLayout->addWidget(titleLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   229
    topLayout->addWidget(statusLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   230
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   231
    // add widgets to bottom layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   232
    bottomLayout->addWidget(selectButton);
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
    // add sub layouts to main layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   235
    layout->addLayout(topLayout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   236
    layout->addLayout(bottomLayout);
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
    // store status label and select file button
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   239
    mSelectedFileLabel = statusLabel;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   240
    mSelectFileButton = selectButton;
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
    // disable select file button by default
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   243
    disableFileSelection();
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
    return layout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   246
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   247
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   248
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   249
    Creates the push buttons for controlling the playback.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   250
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   251
QLayout *ExampleAppUi::createPlaybackUi()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   252
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   253
    FUNC_LOG
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
    QVBoxLayout *layout = new QVBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   256
    QHBoxLayout *topLayout = new QHBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   257
    QHBoxLayout *bottomLayout = new QHBoxLayout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   258
    QLabel *titleLabel = new QLabel(tr("Playback status:"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   259
    QLabel *statusLabel = new QLabel(tr("Stopped"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   260
    QPushButton *rewButton = new QPushButton(tr("Rew"));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   261
    QPushButton *playButton = new QPushButton(tr("Play"));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   262
    QPushButton *pauseButton = new QPushButton(tr("Pause"));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   263
    QPushButton *stopButton = new QPushButton(tr("Stop"));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   264
    QPushButton *ffButton = new QPushButton(tr("Ff"));    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   265
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   266
    // connect signals
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   267
    connect(rewButton, SIGNAL(clicked()), mEngine, SLOT(rew()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   268
    connect(playButton, SIGNAL(clicked()), mEngine, SLOT(play()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   269
    connect(pauseButton, SIGNAL(clicked()), mEngine, SLOT(pause()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   270
    connect(stopButton, SIGNAL(clicked()), mEngine, SLOT(stop()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   271
    connect(ffButton, SIGNAL(clicked()), mEngine, SLOT(ff()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   272
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   273
    // add widgets to top layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   274
    topLayout->addWidget(titleLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   275
    topLayout->addWidget(statusLabel);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   276
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   277
    // add widgets to bottom layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   278
    bottomLayout->addWidget(rewButton);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   279
    bottomLayout->addWidget(playButton);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   280
    bottomLayout->addWidget(pauseButton);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   281
    bottomLayout->addWidget(stopButton);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   282
    bottomLayout->addWidget(ffButton);
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
    // add sub layouts to main layout
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   285
    layout->addLayout(topLayout);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   286
    layout->addLayout(bottomLayout);
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
    // store status label
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   289
    mPlaybackStatus = statusLabel;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   290
    mPlayButton = playButton;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   291
    mPauseButton = pauseButton;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   292
    mStopButton = stopButton;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   293
    mRewButton = rewButton;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   294
    mFfButton = ffButton;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   295
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   296
    // disable all buttons by default
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   297
    disablePlayback();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   298
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   299
    return layout;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   300
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   303
    Creates the application engine and resolves the current connection status.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   304
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   305
void ExampleAppUi::createEngine()
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   308
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   309
    mEngine = new ExampleAppEngine;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   310
    mEngine->construct();
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
    // connect signals
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   313
    connect(mEngine, SIGNAL(stateChanged(int)), this, SLOT(updateState(int)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   314
    connect(mEngine, SIGNAL(renderingDeviceSearchStarted()), this, SLOT(deviceSearchStarted()));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   315
    connect(mEngine, SIGNAL(renderingDeviceFound(const QString &, const QString &)), this, SLOT(addRenderingDevice(const QString &, const QString &)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   316
    connect(mEngine, SIGNAL(renderingDeviceDisappeared(const QString &, const QString &)), this, SLOT(removeRenderingDevice(const QString &, const QString &)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   317
    connect(mEngine, SIGNAL(initComplete(int)), this, SLOT(enablePlayback(int)));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   318
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   319
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   320
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   321
    This function gets called by the engine, when the renderer changes its state.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   322
 */
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   323
void ExampleAppUi::updateState(int newState)
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   326
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   327
    switch (newState)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   328
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   329
        case ExampleAppEngine::PlaybackStateBuffering:
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
            mPlaybackStatus->setText(tr("Buffering"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   332
            break;
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
        case ExampleAppEngine::PlaybackStatePlaying:
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
            mPlaybackStatus->setText(tr("Playing"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   337
            break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   338
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   339
        case ExampleAppEngine::PlaybackStatePaused:
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
            mPlaybackStatus->setText(tr("Paused"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   342
            break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   343
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   344
        case ExampleAppEngine::PlaybackStateStopped:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   345
            // fall through
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   346
        default:
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
            mPlaybackStatus->setText(tr("Stopped"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   349
            break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   350
        }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   351
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   352
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   353
    // update playback controls
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   354
    enablePlayback();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   355
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   356
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   357
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   358
    Launches QFile dialog for selecting a media file from the local
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   359
    file system. Then the file is sent to the engine for sharing, i.e.
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   360
    it will get resolved as an URI on the UPnP push server.
40
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
void ExampleAppUi::selectFile()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   363
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   364
    FUNC_LOG
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
    mSelectedFile = QFileDialog::getOpenFileName(this,
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   367
        tr("Open file"),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   368
        tr("e:\\"),
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   369
        tr("Media Files (*.mp3 *.jpg *.mp4)"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   370
    if (mSelectedFile.length())
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
        // convert all '/' to '\' since symbian does not understand '/' 
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   373
        // characters in the file path
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   374
        mSelectedFile.replace("/", "\\");
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
        // update text to ui
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   377
        QFileInfo fileInfo(mSelectedFile);
43
9b689d9d3a1c Added signed SIS. Also updated package definition file and did some capitalization corrections to few mmp files.
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 41
diff changeset
   378
        // use only 16 characters to fit text on screen 
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   379
        // since otherwise qt will panic with bad alloc
43
9b689d9d3a1c Added signed SIS. Also updated package definition file and did some capitalization corrections to few mmp files.
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 41
diff changeset
   380
        mSelectedFileLabel->setText(fileInfo.fileName().left(16));
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
        // resolve and init file for rendering
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   383
        int err = mEngine->initFile(mSelectedFile);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   384
        if (err != 0)
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
            ERROR_1(err, "Failed to init file %s", mSelectedFile.utf16());
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
            mSelectedFile = "";
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
            mSelectedFileLabel->setText(tr("Could not init"));
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
            disablePlayback();
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
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   395
    else
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   396
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   397
        mSelectedFileLabel->setText(tr("Not selected"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   398
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   399
        disablePlayback();
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
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   404
    Shows searching string on UI during search if no renderers are found yet.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   405
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   406
void ExampleAppUi::deviceSearchStarted()
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   409
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   410
    if (!mRenderingDevices->count())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   411
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   412
        mSelectedRenderer->setText(tr("Searching"));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   413
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   414
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   415
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   416
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   417
    Adds a renderer to the UI's model.
40
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
void ExampleAppUi::addRenderingDevice(const QString &name, const QString &uuid)
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
    FUNC_LOG
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
    mRenderingDevices->addItem(name, QVariant(uuid));
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   426
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   427
    Removes a renderer from the UI's model.
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 ExampleAppUi::removeRenderingDevice(const QString &/*name*/, const QString &uuid)
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
    int count(mRenderingDevices->count());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   434
    for (int i = 0; i < count; i++)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   435
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   436
        QVariant userData(mRenderingDevices->itemData(i));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   437
        if (userData.toString() == uuid)
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
            mRenderingDevices->removeItem(i);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   440
            break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   441
        }
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
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   446
    Set the renderer selected from the UI as the current renderer on the engine side.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   447
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   448
void ExampleAppUi::selectRenderingDevice(int index)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   449
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   450
    FUNC_LOG
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
    // use only 16 characters to fit on screen otherwise qt will panic with bad alloc
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   453
    mSelectedRenderer->setText(mRenderingDevices->itemText(index).left(16));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   454
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   455
    QVariant userData(mRenderingDevices->itemData(index));
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   456
    mEngine->prepareRenderingDevice(userData.toString());
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
    enablePlayback();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   459
    enableFileSelection();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   460
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   463
    Enables/disables the pushbuttons for renderer control according to the
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   464
    current state.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   465
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   466
void ExampleAppUi::enablePlayback(int result)
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   467
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   468
    FUNC_LOG
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
    if (result == 0 &&
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   471
        mSelectedFile.length())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   472
    {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   473
        switch (mEngine->getPlaybackState())
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   474
        {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   475
            case ExampleAppEngine::PlaybackStateBuffering:
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
                // disable all controls when buffering
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   478
                disablePlayback();
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   479
                break;
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
            case ExampleAppEngine::PlaybackStatePlaying:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   482
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   483
                mRewButton->setEnabled(mEngine->isSeekSupported());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   484
                mPlayButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   485
                mPauseButton->setEnabled(mEngine->isPauseSupported());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   486
                mStopButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   487
                mRewButton->setEnabled(mEngine->isSeekSupported());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   488
                break;
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
            case ExampleAppEngine::PlaybackStatePaused:
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
                mRewButton->setEnabled(mEngine->isSeekSupported());
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   493
                mPlayButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   494
                mPauseButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   495
                mStopButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   496
                mRewButton->setEnabled(mEngine->isSeekSupported());
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 ExampleAppEngine::PlaybackStateStopped:
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
                mRewButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   502
                mPlayButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   503
                mPauseButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   504
                mStopButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   505
                mRewButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   506
                break;
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   507
            }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   508
            default:
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   509
            {
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   510
                // invalid state, disable all buttons
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   511
                disablePlayback();
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
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   518
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   519
    Disables all renderer control pushbuttons.
40
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
void ExampleAppUi::disablePlayback()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   522
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   523
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   524
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   525
    mPlayButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   526
    mPauseButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   527
    mStopButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   528
    mRewButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   529
    mFfButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   530
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   533
    Enables file selection button. Called when a renderer is selected.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   534
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   535
void ExampleAppUi::enableFileSelection()
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
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   538
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   539
    mSelectFileButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   540
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   543
    Disables file selection.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   544
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   545
void ExampleAppUi::disableFileSelection()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   546
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   547
    FUNC_LOG
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
    mSelectFileButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   550
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   551
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   552
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   553
    Enables the rendering device selection pushbutton. Called when a WLAN AP is in use.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   554
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   555
void ExampleAppUi::enableRenderingDeviceSelection(int iap)
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
    if (iap)
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
        mSearchDevicesButton->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   562
        mRenderingDevices->setEnabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   563
    }
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   564
}
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
/*!
41
b4d83ea1d6e2 Added comments to the example application
Sampo Huttunen <sampo.huttunen@nokia.com>
parents: 40
diff changeset
   567
    Disables the rendering device selection pushbutton.
40
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   568
*/
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   569
void ExampleAppUi::disableRenderingDeviceSelection()
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   570
{
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   571
    FUNC_LOG
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   572
    
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   573
    mSearchDevicesButton->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   574
    mRenderingDevices->setDisabled(true);
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   575
}
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   576
08b5eae9f9ff merge from Nokia's internal development branch
Sampo Huttunen <sampo.huttunen@nokia.com>
parents:
diff changeset
   577
// End of file