dlnasrv_exampleapp/src/exampleappengine.cpp
branchIOP_Improvements
changeset 40 08b5eae9f9ff
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "exampleappengine.h"
       
    19 #include "exampleappengine_p.h"
       
    20 #include "trace.h"
       
    21 
       
    22 /*!
       
    23     /class ExampleAppEngine
       
    24     /brief Implements the playback engine and DLNA interface for the UI.
       
    25 */
       
    26 
       
    27 /*!
       
    28     C++ constructor.
       
    29 */
       
    30 ExampleAppEngine::ExampleAppEngine(): d_ptr(new ExampleAppEnginePrivate())
       
    31 {
       
    32     FUNC_LOG
       
    33     
       
    34     if (d_ptr)
       
    35     {
       
    36         d_ptr->q_ptr = this;
       
    37     }
       
    38 }
       
    39 
       
    40 /*!
       
    41     C++ destructor.
       
    42 */
       
    43 ExampleAppEngine::~ExampleAppEngine()
       
    44 {
       
    45     FUNC_LOG
       
    46     
       
    47     delete d_ptr;
       
    48 }
       
    49 
       
    50 /*!
       
    51     description
       
    52     
       
    53     /a
       
    54     /return
       
    55 */
       
    56 void ExampleAppEngine::construct()
       
    57 {
       
    58     FUNC_LOG
       
    59     
       
    60     if (d_ptr)
       
    61     {
       
    62         d_ptr->construct();
       
    63     }
       
    64 }
       
    65 
       
    66 /*!
       
    67     description
       
    68     
       
    69     /a
       
    70     /return
       
    71 */
       
    72 int ExampleAppEngine::getIap() const
       
    73 {
       
    74     FUNC_LOG
       
    75     
       
    76     int iap(0);
       
    77     
       
    78     if (d_ptr)
       
    79     {
       
    80         iap = d_ptr->getConnectedIap();
       
    81     }
       
    82     
       
    83     return iap;
       
    84 }
       
    85 
       
    86 /*!
       
    87     description
       
    88     
       
    89     /a
       
    90     /return
       
    91 */
       
    92 QString ExampleAppEngine::getIapName() const
       
    93 {
       
    94     FUNC_LOG
       
    95     
       
    96     QString iapName;
       
    97     
       
    98     if (d_ptr)
       
    99     {
       
   100         iapName = d_ptr->getConnectedIapName();
       
   101     }
       
   102     
       
   103     return iapName;
       
   104 }
       
   105 
       
   106 /*!
       
   107     description
       
   108     
       
   109     /a
       
   110     /return
       
   111 */
       
   112 bool ExampleAppEngine::isSeekSupported() const
       
   113 {
       
   114     FUNC_LOG
       
   115     
       
   116     bool isSupported(false);
       
   117     
       
   118     if (d_ptr)
       
   119     {
       
   120         isSupported = d_ptr->isSeekSupported();
       
   121     }
       
   122     
       
   123     return isSupported;
       
   124 }
       
   125 
       
   126 /*!
       
   127     description
       
   128     
       
   129     /a
       
   130     /return
       
   131 */
       
   132 int ExampleAppEngine::getPlaybackState() const
       
   133 {
       
   134     FUNC_LOG
       
   135     
       
   136     int state(ExampleAppEngine::PlaybackStateStopped);
       
   137     
       
   138     if (d_ptr)
       
   139     {
       
   140         state = d_ptr->getPlaybackState();
       
   141     }
       
   142     
       
   143     return state;
       
   144 }
       
   145 
       
   146 /*!
       
   147     description
       
   148     
       
   149     /a
       
   150     /return
       
   151 */
       
   152 bool ExampleAppEngine::isPauseSupported() const
       
   153 {
       
   154     FUNC_LOG
       
   155     
       
   156     bool isSupported(false);
       
   157     
       
   158     if (d_ptr)
       
   159     {
       
   160         isSupported = d_ptr->isPauseSupported();
       
   161     }
       
   162     
       
   163     return isSupported;
       
   164 }
       
   165 
       
   166 /*!
       
   167     description
       
   168     
       
   169     /a
       
   170     /return
       
   171 */
       
   172 void ExampleAppEngine::searchRenderingDevices()
       
   173 {
       
   174     FUNC_LOG
       
   175     
       
   176     if (d_ptr)
       
   177     {
       
   178         d_ptr->searchRenderingDevices();
       
   179     }
       
   180 }
       
   181 
       
   182 /*!
       
   183     description
       
   184     
       
   185     /a
       
   186     /return
       
   187 */
       
   188 void ExampleAppEngine::prepareRenderingDevice(const QString &uuid)
       
   189 {
       
   190     FUNC_LOG
       
   191     
       
   192     if (d_ptr)
       
   193     {
       
   194         d_ptr->prepareRenderingDevice(uuid);
       
   195     }
       
   196 }
       
   197 
       
   198 /*!
       
   199     description
       
   200     
       
   201     /a
       
   202     /return
       
   203 */
       
   204 int ExampleAppEngine::initFile(const QString& file)
       
   205 {
       
   206     FUNC_LOG
       
   207     
       
   208     int err(-1);
       
   209     
       
   210     if (d_ptr)
       
   211     {
       
   212         err = d_ptr->initFile(file);
       
   213     }
       
   214     
       
   215     return err;
       
   216 }
       
   217 
       
   218 /*!
       
   219     description
       
   220     
       
   221     /a
       
   222     /return
       
   223 */
       
   224 void ExampleAppEngine::play()
       
   225 {
       
   226     FUNC_LOG
       
   227     
       
   228     if (d_ptr)
       
   229     {
       
   230         d_ptr->play();
       
   231     }
       
   232 }
       
   233 
       
   234 /*!
       
   235     description
       
   236     
       
   237     /a
       
   238     /return
       
   239 */
       
   240 void ExampleAppEngine::pause()
       
   241 {
       
   242     FUNC_LOG
       
   243     
       
   244     if (d_ptr)
       
   245     {
       
   246         d_ptr->pause();
       
   247     }
       
   248 }
       
   249 
       
   250 /*!
       
   251     description
       
   252     
       
   253     /a
       
   254     /return
       
   255 */
       
   256 void ExampleAppEngine::stop()
       
   257 {
       
   258     FUNC_LOG
       
   259     
       
   260     if (d_ptr)
       
   261     {
       
   262         d_ptr->stop();
       
   263     }
       
   264 }
       
   265 
       
   266 /*!
       
   267     description
       
   268     
       
   269     /a
       
   270     /return
       
   271 */
       
   272 void ExampleAppEngine::volumeUp()
       
   273 {
       
   274     FUNC_LOG
       
   275     
       
   276     if (d_ptr)
       
   277     {
       
   278         d_ptr->volumeUp();
       
   279     }
       
   280 }
       
   281 
       
   282 /*!
       
   283     description
       
   284     
       
   285     /a
       
   286     /return
       
   287 */
       
   288 void ExampleAppEngine::volumeDown()
       
   289 {
       
   290     FUNC_LOG
       
   291     
       
   292     if (d_ptr)
       
   293     {
       
   294         d_ptr->volumeDown();
       
   295     }
       
   296 }
       
   297 
       
   298 /*!
       
   299     description
       
   300     
       
   301     /a
       
   302     /return
       
   303 */
       
   304 void ExampleAppEngine::rew()
       
   305 {
       
   306     FUNC_LOG
       
   307     
       
   308     if (d_ptr)
       
   309     {
       
   310         d_ptr->rew();
       
   311     }
       
   312 }
       
   313 
       
   314 /*!
       
   315     description
       
   316     
       
   317     /a
       
   318     /return
       
   319 */
       
   320 void ExampleAppEngine::ff()
       
   321 {
       
   322     FUNC_LOG
       
   323     
       
   324     if (d_ptr)
       
   325     {
       
   326         d_ptr->ff();
       
   327     }
       
   328 }
       
   329 
       
   330 // End of file