dlnasrv_exampleapp/src/exampleappengine_p.cpp
branchIOP_Improvements
changeset 41 b4d83ea1d6e2
parent 40 08b5eae9f9ff
equal deleted inserted replaced
40:08b5eae9f9ff 41:b4d83ea1d6e2
    33 #include "trace.h"
    33 #include "trace.h"
    34 
    34 
    35 /*!
    35 /*!
    36     /class ExampleAppEnginePrivate
    36     /class ExampleAppEnginePrivate
    37     /brief Implements interface to Symbian side DLNA APIs.
    37     /brief Implements interface to Symbian side DLNA APIs.
       
    38 
       
    39     This is the "rendering engine" class, implementing various UPnP callback
       
    40     interfaces. Some of the callbacks are lacking implementation because this
       
    41     simple example application does not require all that functionality.
    38 */
    42 */
    39 
    43 
    40 /*!
    44 /*!
    41     C++ constructor.
    45     C++ constructor.
    42 */
    46 */
    96     
   100     
    97     delete mConnectionMonitor;
   101     delete mConnectionMonitor;
    98 }
   102 }
    99 
   103 
   100 /*!
   104 /*!
   101     description
   105     Checks for connected IAP.
   102     
       
   103     /a
       
   104     /return
       
   105 */
   106 */
   106 void ExampleAppEnginePrivate::construct()
   107 void ExampleAppEnginePrivate::construct()
   107 {
   108 {
   108     FUNC_LOG
   109     FUNC_LOG
   109 
   110 
   110     resolveIapL();
   111     resolveIapL();
   111     resolveIapNameL();
   112     resolveIapNameL();
   112 }
   113 }
   113 
   114 
   114 /*!
   115 /*!
   115     description
   116     Returns currently connected IAP.
   116     
       
   117     /a
       
   118     /return
       
   119 */
   117 */
   120 int ExampleAppEnginePrivate::getConnectedIap() const
   118 int ExampleAppEnginePrivate::getConnectedIap() const
   121 {
   119 {
   122     FUNC_LOG
   120     FUNC_LOG
   123     
   121     
   124     return mIap;
   122     return mIap;
   125 }
   123 }
   126 
   124 
   127 /*!
   125 /*!
   128     description
   126     Returns the name of the currently connected IAP.
   129     
       
   130     /a
       
   131     /return
       
   132 */
   127 */
   133 QString ExampleAppEnginePrivate::getConnectedIapName() const
   128 QString ExampleAppEnginePrivate::getConnectedIapName() const
   134 {
   129 {
   135     FUNC_LOG
   130     FUNC_LOG
   136     
   131     
   137     return mIapName;
   132     return mIapName;
   138 }
   133 }
   139 
   134 
   140 /*!
   135 /*!
   141     description
   136     Returns the current playback state.
   142     
       
   143     /a
       
   144     /return
       
   145 */
   137 */
   146 int ExampleAppEnginePrivate::getPlaybackState() const
   138 int ExampleAppEnginePrivate::getPlaybackState() const
   147 {
   139 {
   148     FUNC_LOG
   140     FUNC_LOG
   149     
   141     
   150     return mPlaybackState;
   142     return mPlaybackState;
   151 }
   143 }
   152 
   144 
   153 /*!
   145 /*!
   154     description
   146     Returns whether the currently selected renderer supports seek functionality.
   155     
       
   156     /a
       
   157     /return
       
   158 */
   147 */
   159 bool ExampleAppEnginePrivate::isSeekSupported() const
   148 bool ExampleAppEnginePrivate::isSeekSupported() const
   160 {
   149 {
   161     FUNC_LOG
   150     FUNC_LOG
   162 
   151 
   164     
   153     
   165     return false;
   154     return false;
   166 }
   155 }
   167 
   156 
   168 /*!
   157 /*!
   169     description
   158     Returns whether the currently selected renderer supports pause functionality.
   170     
       
   171     /a
       
   172     /return
       
   173 */
   159 */
   174 bool ExampleAppEnginePrivate::isPauseSupported() const
   160 bool ExampleAppEnginePrivate::isPauseSupported() const
   175 {
   161 {
   176     FUNC_LOG
   162     FUNC_LOG
   177     
   163     
   184     
   170     
   185     return isSupported;
   171     return isSupported;
   186 }
   172 }
   187 
   173 
   188 /*!
   174 /*!
   189     description
   175     This function causes renderingDeviceFound() signals to be emitted in two different ways:
   190     
   176     first the current device list in UPnP AV Controller is gone through and for each
   191     /a
   177     renderer device found from there one signal is emitted. Also, this object is set as a
   192     /return
   178     device observer to the UPnP AV Controller, causing it to call this class's callback
       
   179     function UPnPDeviceDiscovered() upon every new device that is discovered from the current network.
   193 */
   180 */
   194 void ExampleAppEnginePrivate::searchRenderingDevices()
   181 void ExampleAppEnginePrivate::searchRenderingDevices()
   195 {
   182 {
   196     FUNC_LOG
   183     FUNC_LOG
   197     
   184     
   212         TRAP_IGNORE(searchRenderingDevicesL());
   199         TRAP_IGNORE(searchRenderingDevicesL());
   213     }    
   200     }    
   214 }
   201 }
   215 
   202 
   216 /*!
   203 /*!
   217     description
   204     Start a rendering session with the renderer provided in /a uuid.
   218     
       
   219     /a
       
   220     /return
       
   221 */
   205 */
   222 void ExampleAppEnginePrivate::prepareRenderingDevice(const QString &uuid)
   206 void ExampleAppEnginePrivate::prepareRenderingDevice(const QString &uuid)
   223 {
   207 {
   224     FUNC_LOG
   208     FUNC_LOG
   225     
   209     
   226     TRAP_IGNORE(prepareRenderingDeviceL(uuid));    
   210     TRAP_IGNORE(prepareRenderingDeviceL(uuid));    
   227 }
   211 }
   228 
   212 
   229 /*!
   213 /*!
   230     description
   214     Start file initialization for sharing.
   231     
       
   232     /a
       
   233     /return
       
   234 */
   215 */
   235 int ExampleAppEnginePrivate::initFile(const QString& file)
   216 int ExampleAppEnginePrivate::initFile(const QString& file)
   236 {
   217 {
   237     FUNC_LOG
   218     FUNC_LOG
   238     
   219     
   240     
   221     
   241     return err;
   222     return err;
   242 }
   223 }
   243 
   224 
   244 /*!
   225 /*!
   245     description
   226     Issues the play() command to the renderer.
   246     
       
   247     /a
       
   248     /return
       
   249 */
   227 */
   250 void ExampleAppEnginePrivate::play()
   228 void ExampleAppEnginePrivate::play()
   251 {
   229 {
   252     FUNC_LOG
   230     FUNC_LOG
   253 
   231 
   254     TRAP_IGNORE(playL());
   232     TRAP_IGNORE(playL());
   255 }
   233 }
   256 
   234 
   257 /*!
   235 /*!
   258     description
   236     Issues the pause() command to the renderer.
   259     
       
   260     /a
       
   261     /return
       
   262 */
   237 */
   263 void ExampleAppEnginePrivate::pause()
   238 void ExampleAppEnginePrivate::pause()
   264 {
   239 {
   265     FUNC_LOG
   240     FUNC_LOG
   266     
   241     
   267     TRAP_IGNORE(pauseL());
   242     TRAP_IGNORE(pauseL());
   268 }
   243 }
   269 
   244 
   270 /*!
   245 /*!
   271     description
   246     Issues the stop() command to the renderer.
   272     
       
   273     /a
       
   274     /return
       
   275 */
   247 */
   276 void ExampleAppEnginePrivate::stop()
   248 void ExampleAppEnginePrivate::stop()
   277 {
   249 {
   278     FUNC_LOG
   250     FUNC_LOG
   279     
   251     
   280     TRAP_IGNORE(stopL());
   252     TRAP_IGNORE(stopL());
   281 }
   253 }
   282 
   254 
   283 /*!
   255 /*!
   284     description
   256     Issues the volumeUp() command to the renderer.
   285     
       
   286     /a
       
   287     /return
       
   288 */
   257 */
   289 void ExampleAppEnginePrivate::volumeUp()
   258 void ExampleAppEnginePrivate::volumeUp()
   290 {
   259 {
   291     FUNC_LOG
   260     FUNC_LOG
   292     
   261     
   293     // TODO: implement
   262     // TODO: implement
   294 }
   263 }
   295 
   264 
   296 /*!
   265 /*!
   297     description
   266     Issues the volumeDown() command to the renderer.
   298     
       
   299     /a
       
   300     /return
       
   301 */
   267 */
   302 void ExampleAppEnginePrivate::volumeDown()
   268 void ExampleAppEnginePrivate::volumeDown()
   303 {
   269 {
   304     FUNC_LOG
   270     FUNC_LOG
   305     
   271     
   306     // TODO: implement
   272     // TODO: implement
   307 }
   273 }
   308 
   274 
   309 /*!
   275 /*!
   310     description
   276     Issues the rew() command to the renderer.
   311     
       
   312     /a
       
   313     /return
       
   314 */
   277 */
   315 void ExampleAppEnginePrivate::rew()
   278 void ExampleAppEnginePrivate::rew()
   316 {
   279 {
   317     FUNC_LOG
   280     FUNC_LOG
   318     
   281     
   319     // TODO: implement
   282     // TODO: implement
   320 }
   283 }
   321 
   284 
   322 /*!
   285 /*!
   323     description
   286     Issues the ff() command to the renderer.
   324     
       
   325     /a
       
   326     /return
       
   327 */
   287 */
   328 void ExampleAppEnginePrivate::ff()
   288 void ExampleAppEnginePrivate::ff()
   329 {
   289 {
   330     FUNC_LOG
   290     FUNC_LOG
   331     
   291     
   332     // TODO: implement
   292     // TODO: implement
   333 }
   293 }
   334 
   294 
   335 /*!
   295 /*!    
   336     description
   296     Callback function that UPnP AV Controller calls when a new UPnP AV Device is
   337     
   297     found from the network.
   338     /a
   298     From MUPnPAVDeviceObserver
   339     /return
       
   340 */
   299 */
   341 void ExampleAppEnginePrivate::UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice)
   300 void ExampleAppEnginePrivate::UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice)
   342 {
   301 {
   343     FUNC_LOG
   302     FUNC_LOG
   344     
   303     
   345     TRAP_IGNORE(upnpDeviceDiscoveredL(aDevice));
   304     TRAP_IGNORE(upnpDeviceDiscoveredL(aDevice));
   346 }
   305 }
   347 
   306 
   348 /*!
   307 /*!
   349     description
   308     Callback function that UPnP AV Controller calls when a UPnP AV Device has
   350     
   309     disappeared from the network.
   351     /a
   310     From MUPnPAVDeviceObserver
   352     /return
       
   353 */
   311 */
   354 void ExampleAppEnginePrivate::UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice)
   312 void ExampleAppEnginePrivate::UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice)
   355 {
   313 {
   356     FUNC_LOG
   314     FUNC_LOG
   357 
   315 
   387         delete device;
   345         delete device;
   388     }
   346     }
   389 }
   347 }
   390 
   348 
   391 /*!
   349 /*!
   392     description
   350     Callback function that UPnP AV Controller calls when the WLAN
   393     
   351     connection has been lost. All existing sessions should be considered
   394     /a
   352     invalid.
   395     /return
   353     From MUPnPAVDeviceObserver
   396 */
   354 */
   397 void ExampleAppEnginePrivate::WLANConnectionLost()
   355 void ExampleAppEnginePrivate::WLANConnectionLost()
   398 {
   356 {
   399     FUNC_LOG
   357     FUNC_LOG
   400 
   358 
   401     // no implementation required
   359     // no implementation required
   402 }
   360 }
   403 
   361 
   404 /*!
   362 /*!
   405     description
   363     Just pass to volume state machine
   406     
   364     From MUPnPAVRenderingSessionObserver
   407     /a
       
   408     /return
       
   409 */
   365 */
   410 void ExampleAppEnginePrivate::VolumeResult(TInt aError,
   366 void ExampleAppEnginePrivate::VolumeResult(TInt aError,
   411     TInt aVolumeLevel,
   367     TInt aVolumeLevel,
   412     TBool aActionResponse)
   368     TBool aActionResponse)
   413 {
   369 {
   418         mVolumeStateMachine->VolumeResult(aError, aVolumeLevel, aActionResponse);
   374         mVolumeStateMachine->VolumeResult(aError, aVolumeLevel, aActionResponse);
   419     }
   375     }
   420 }
   376 }
   421 
   377 
   422 /*!
   378 /*!
   423     description
   379     Just pass to volume state machine
   424     
   380     From MUPnPAVRenderingSessionObserver
   425     /a
       
   426     /return
       
   427 */
   381 */
   428 void ExampleAppEnginePrivate::MuteResult(TInt aError,
   382 void ExampleAppEnginePrivate::MuteResult(TInt aError,
   429     TBool aMute,
   383     TBool aMute,
   430     TBool aActionResponse)
   384     TBool aActionResponse)
   431 {
   385 {
   436         mVolumeStateMachine->MuteResult(aError, aMute, aActionResponse);
   390         mVolumeStateMachine->MuteResult(aError, aMute, aActionResponse);
   437     }
   391     }
   438 }
   392 }
   439 
   393 
   440 /*!
   394 /*!
   441     description
   395     Just pass to rendering state machine
   442     
   396     From MUPnPAVRenderingSessionObserver
   443     /a
       
   444     /return
       
   445 */
   397 */
   446 void ExampleAppEnginePrivate::InteractOperationComplete(TInt aError,
   398 void ExampleAppEnginePrivate::InteractOperationComplete(TInt aError,
   447     TUPnPAVInteractOperation aOperation)
   399     TUPnPAVInteractOperation aOperation)
   448 {
   400 {
   449     FUNC_LOG
   401     FUNC_LOG
   453         mRenderingStateMachine->InteractOperationComplete(aError, aOperation);
   405         mRenderingStateMachine->InteractOperationComplete(aError, aOperation);
   454     }
   406     }
   455 }
   407 }
   456 
   408 
   457 /*!
   409 /*!
   458     description
   410     Just pass to rendering state machine
   459     
   411     From MUPnPAVRenderingSessionObserver
   460     /a
       
   461     /return
       
   462 */
   412 */
   463 void ExampleAppEnginePrivate::PositionInfoResult(TInt aError,
   413 void ExampleAppEnginePrivate::PositionInfoResult(TInt aError,
   464     const TDesC8& aTrackPosition,
   414     const TDesC8& aTrackPosition,
   465     const TDesC8& aTrackLength)
   415     const TDesC8& aTrackLength)
   466 {
   416 {
   471         mRenderingStateMachine->PositionInfoResult(aError, aTrackPosition, aTrackLength);
   421         mRenderingStateMachine->PositionInfoResult(aError, aTrackPosition, aTrackLength);
   472     }
   422     }
   473 }
   423 }
   474 
   424 
   475 /*!
   425 /*!
   476     description
   426     Just pass to rendering state machine
   477     
   427     From MUPnPAVRenderingSessionObserver
   478     /a
       
   479     /return
       
   480 */
   428 */
   481 void ExampleAppEnginePrivate::SetURIResult(TInt aError)
   429 void ExampleAppEnginePrivate::SetURIResult(TInt aError)
   482 {
   430 {
   483     FUNC_LOG
   431     FUNC_LOG
   484 
   432 
   487         mRenderingStateMachine->SetURIResult(aError);
   435         mRenderingStateMachine->SetURIResult(aError);
   488     }
   436     }
   489 }
   437 }
   490 
   438 
   491 /*!
   439 /*!
   492     description
   440     Just pass to rendering state machine
   493     
   441     From MUPnPAVRenderingSessionObserver
   494     /a
       
   495     /return
       
   496 */
   442 */
   497 void ExampleAppEnginePrivate::SetNextURIResult(TInt aError)
   443 void ExampleAppEnginePrivate::SetNextURIResult(TInt aError)
   498 {
   444 {
   499     FUNC_LOG
   445     FUNC_LOG
   500     
   446     
   503         mRenderingStateMachine->SetNextURIResult(aError);
   449         mRenderingStateMachine->SetNextURIResult(aError);
   504     }
   450     }
   505 }
   451 }
   506 
   452 
   507 /*!
   453 /*!
   508     description
   454     Renderer to which there was an active session has disappeared. The session should be
   509     
   455     considered invalid.
   510     /a
   456     From MUPnPAVRenderingSessionObserver
   511     /return
       
   512 */
   457 */
   513 void ExampleAppEnginePrivate::MediaRendererDisappeared(TUPnPDeviceDisconnectedReason /*aReason*/)
   458 void ExampleAppEnginePrivate::MediaRendererDisappeared(TUPnPDeviceDisconnectedReason /*aReason*/)
   514 {
   459 {
   515     FUNC_LOG
   460     FUNC_LOG
   516     
   461     
   517     // TODO: implement
   462     // TODO: implement
   518 }
   463 }
   519 
   464 
   520 /*!
   465 /*!
   521     description
   466     Callback for telling that the rendering state machine is in synch with
   522     
   467     the rendering device.
   523     /a
   468     From MUpnpRenderingStateMachineObserver
   524     /return
       
   525 */
   469 */
   526 void ExampleAppEnginePrivate::RendererSyncReady(TInt /*aError*/, Upnp::TState /*aState*/)
   470 void ExampleAppEnginePrivate::RendererSyncReady(TInt /*aError*/, Upnp::TState /*aState*/)
   527 {
   471 {
   528     FUNC_LOG
   472     FUNC_LOG
   529     
   473     
   530     // TODO: implement
   474     // TODO: implement
   531 }
   475 }
   532 
   476 
   533 /*!
   477 /*!
   534     description
   478     Rendering device's state has been changed.
   535     
   479     From MUpnpRenderingStateMachineObserver
   536     /a
       
   537     /return
       
   538 */
   480 */
   539 void ExampleAppEnginePrivate::RenderingStateChanged(TInt aError,
   481 void ExampleAppEnginePrivate::RenderingStateChanged(TInt aError,
   540     Upnp::TState aState,
   482     Upnp::TState aState,
   541     TBool /*aUserOriented*/,
   483     TBool /*aUserOriented*/,
   542     TInt /*aStateParam*/)
   484     TInt /*aStateParam*/)
   576     
   518     
   577     emit q_ptr->stateChanged(mPlaybackState);
   519     emit q_ptr->stateChanged(mPlaybackState);
   578 }
   520 }
   579 
   521 
   580 /*!
   522 /*!
   581     description
   523     For synchronizing UI with the progress of the playback on the
   582     
   524     rendering device.
   583     /a
   525     From MUpnpRenderingStateMachineObserver
   584     /return
       
   585 */
   526 */
   586 void ExampleAppEnginePrivate::PositionSync(TInt /*aError*/,
   527 void ExampleAppEnginePrivate::PositionSync(TInt /*aError*/,
   587     Upnp::TPositionMode /*aMode*/,
   528     Upnp::TPositionMode /*aMode*/,
   588     TInt /*aDuration*/,
   529     TInt /*aDuration*/,
   589     TInt /*aPosition*/)
   530     TInt /*aPosition*/)
   592     
   533     
   593     // TODO: implement
   534     // TODO: implement
   594 }
   535 }
   595 
   536 
   596 /*!
   537 /*!
   597     description
   538     Callback for telling that the volume state machine is in synch with
   598     
   539     the rendering device.
   599     /a
   540     From MUpnpVolumeStateMachineObserver
   600     /return
       
   601 */
   541 */
   602 void ExampleAppEnginePrivate::VolumeSyncReady(TInt /*aError*/)
   542 void ExampleAppEnginePrivate::VolumeSyncReady(TInt /*aError*/)
   603 {
   543 {
   604     FUNC_LOG
   544     FUNC_LOG
   605     
   545     
   606     // TODO: implement
   546     // TODO: implement
   607 }
   547 }
   608 
   548 
   609 /*!
   549 /*!
   610     description
   550     Rendering device's volume has changed.
   611     
   551     From MUpnpVolumeStateMachineObserver
   612     /a
       
   613     /return
       
   614 */
   552 */
   615 void ExampleAppEnginePrivate::VolumeChanged(TInt /*aError*/,
   553 void ExampleAppEnginePrivate::VolumeChanged(TInt /*aError*/,
   616     TInt /*aVolume*/,
   554     TInt /*aVolume*/,
   617     TBool /*aUserOriented*/)
   555     TBool /*aUserOriented*/)
   618 {
   556 {
   620     
   558     
   621     // TODO: implement
   559     // TODO: implement
   622 }
   560 }
   623 
   561 
   624 /*!
   562 /*!
   625     description
   563     Mute status of the rendering device has changed.
   626     
   564     From MUpnpVolumeStateMachineObserver
   627     /a
       
   628     /return
       
   629 */
   565 */
   630 void ExampleAppEnginePrivate::MuteChanged(TInt /*aError*/,
   566 void ExampleAppEnginePrivate::MuteChanged(TInt /*aError*/,
   631     TBool /*aMuteState*/,
   567     TBool /*aMuteState*/,
   632     TBool /*aUserOriented*/)
   568     TBool /*aUserOriented*/)
   633 {
   569 {
   635     
   571     
   636     // TODO: implement
   572     // TODO: implement
   637 }
   573 }
   638 
   574 
   639 /*!
   575 /*!
   640     description
   576     Resolving a file as an URI to be shared on media server has been completed.
   641     
   577     From MUPnPItemResolverObserver
   642     /a
       
   643     /return
       
   644 */
   578 */
   645 void ExampleAppEnginePrivate::ResolveComplete(const MUPnPItemResolver& /*aResolver*/,
   579 void ExampleAppEnginePrivate::ResolveComplete(const MUPnPItemResolver& /*aResolver*/,
   646     TInt aError)
   580     TInt aError)
   647 {
   581 {
   648     FUNC_LOG
   582     FUNC_LOG
   651     
   585     
   652     emit q_ptr->initComplete(aError);
   586     emit q_ptr->initComplete(aError);
   653 }
   587 }
   654 
   588 
   655 /*!
   589 /*!
   656     description
   590     WLAN connection has been lost.
   657     
   591     From MUPnPConnectionMonitorObserver
   658     /a
       
   659     /return
       
   660 */
   592 */
   661 void ExampleAppEnginePrivate::ConnectionLost(TBool /*aUserOriented*/)
   593 void ExampleAppEnginePrivate::ConnectionLost(TBool /*aUserOriented*/)
   662 {
   594 {
   663     FUNC_LOG
   595     FUNC_LOG
   664 
   596 
   670     emit q_ptr->iapUpdated(mIapName);
   602     emit q_ptr->iapUpdated(mIapName);
   671     emit q_ptr->iapUpdated(mIap);
   603     emit q_ptr->iapUpdated(mIap);
   672 }
   604 }
   673 
   605 
   674 /*!
   606 /*!
   675     description
   607     WLAN connection has been created.
   676     
   608     From MUPnPConnectionMonitorObserver
   677     /a
       
   678     /return
       
   679 */
   609 */
   680 void ExampleAppEnginePrivate::ConnectionCreated(TInt /*aConnectionId*/)
   610 void ExampleAppEnginePrivate::ConnectionCreated(TInt /*aConnectionId*/)
   681 {
   611 {
   682     FUNC_LOG
   612     FUNC_LOG
   683 
   613 
   687     emit q_ptr->iapUpdated(mIapName);
   617     emit q_ptr->iapUpdated(mIapName);
   688     emit q_ptr->iapUpdated(mIap);
   618     emit q_ptr->iapUpdated(mIap);
   689 }
   619 }
   690 
   620 
   691 /*!
   621 /*!
   692     description
   622     Iterate through the AV Devices of the UPnP AV Controller,
   693     
   623     i.e. the already found devices stored in the AV Controller.
   694     /a
       
   695     /return
       
   696 */
   624 */
   697 void ExampleAppEnginePrivate::searchRenderingDevicesL()
   625 void ExampleAppEnginePrivate::searchRenderingDevicesL()
   698 {
   626 {
   699     FUNC_LOG
   627     FUNC_LOG
   700     
   628     
   709     }
   637     }
   710     delete deviceList;
   638     delete deviceList;
   711 }
   639 }
   712 
   640 
   713 /*!
   641 /*!
   714     description
   642     Iterate through found AV Devices, and signal renderingDeviceFound()
   715     
   643     for each renderer.
   716     /a
       
   717     /return
       
   718 */
   644 */
   719 void ExampleAppEnginePrivate::upnpDeviceDiscoveredL(const CUpnpAVDevice& aDevice)
   645 void ExampleAppEnginePrivate::upnpDeviceDiscoveredL(const CUpnpAVDevice& aDevice)
   720 {
   646 {
   721     FUNC_LOG
   647     FUNC_LOG
   722 
   648 
   751         }
   677         }
   752     }
   678     }
   753 }
   679 }
   754 
   680 
   755 /*!
   681 /*!
   756     description
   682     Ensure that there is an active rendering session for the device
   757     
   683     passed in as /a uuid.
   758     /a
       
   759     /return
       
   760 */
   684 */
   761 void ExampleAppEnginePrivate::prepareRenderingDeviceL(const QString &uuid)
   685 void ExampleAppEnginePrivate::prepareRenderingDeviceL(const QString &uuid)
   762 {
   686 {
   763     FUNC_LOG
   687     FUNC_LOG
   764     
   688     
   796         }
   720         }
   797     }
   721     }
   798 }
   722 }
   799 
   723 
   800 /*!
   724 /*!
   801     description
   725     Start rendering session to /a device. Rendering state machine and
   802     
   726     volume state machine will call observer interface once they are in
   803     /a
   727     synch.
   804     /return
       
   805 */
   728 */
   806 void ExampleAppEnginePrivate::startRenderingSessionL(const CUpnpAVDevice &device)
   729 void ExampleAppEnginePrivate::startRenderingSessionL(const CUpnpAVDevice &device)
   807 {
   730 {
   808     FUNC_LOG
   731     FUNC_LOG
   809 
   732 
   821     mVolumeStateMachine->SetObserver(*this);
   744     mVolumeStateMachine->SetObserver(*this);
   822     mVolumeStateMachine->SyncL();
   745     mVolumeStateMachine->SyncL();
   823 }
   746 }
   824 
   747 
   825 /*!
   748 /*!
   826     description
   749     Stop rendering session and perform needed cleanup.
   827     
       
   828     /a
       
   829     /return
       
   830 */
   750 */
   831 void ExampleAppEnginePrivate::stopRenderingSession()
   751 void ExampleAppEnginePrivate::stopRenderingSession()
   832 {
   752 {
   833     FUNC_LOG
   753     FUNC_LOG
   834     
   754     
   856     
   776     
   857     mDevice = 0;
   777     mDevice = 0;
   858 }
   778 }
   859 
   779 
   860 /*!
   780 /*!
   861     description
   781     Start file initialization for sharing. If a renderer device is selected,
   862     
   782     instruct local item resolver to to resolve the /a file passed as a
   863     /a
   783     parameter, i.e. prepare the URI that can be used to locate the shared
   864     /return
   784     file on the push server. When resolving is done, the callback function
       
   785     ResolveComplete() is called.
       
   786 
   865 */
   787 */
   866 void ExampleAppEnginePrivate::initFileL(const QString &file)
   788 void ExampleAppEnginePrivate::initFileL(const QString &file)
   867 {
   789 {
   868     FUNC_LOG
   790     FUNC_LOG
   869     
   791     
   885         User::Leave(KErrNotReady);
   807         User::Leave(KErrNotReady);
   886     }
   808     }
   887 }
   809 }
   888 
   810 
   889 /*!
   811 /*!
   890     description
   812     Check if it's ok to issue playback commands.
   891     
       
   892     /a
       
   893     /return
       
   894 */
   813 */
   895 bool ExampleAppEnginePrivate::isReadyForPlayback() const
   814 bool ExampleAppEnginePrivate::isReadyForPlayback() const
   896 {
   815 {
   897     FUNC_LOG
   816     FUNC_LOG
   898     
   817     
   908     
   827     
   909     return isReady;
   828     return isReady;
   910 }
   829 }
   911 
   830 
   912 /*!
   831 /*!
   913     description
   832     Issues the play command to the renderer.
   914     
       
   915     /a
       
   916     /return
       
   917 */
   833 */
   918 void ExampleAppEnginePrivate::playL()
   834 void ExampleAppEnginePrivate::playL()
   919 {
   835 {
   920     FUNC_LOG
   836     FUNC_LOG
   921     
   837     
   928         User::Leave(KErrNotReady);
   844         User::Leave(KErrNotReady);
   929     }
   845     }
   930 }
   846 }
   931 
   847 
   932 /*!
   848 /*!
   933     description
   849     Issues the pause command to the renderer.
   934     
       
   935     /a
       
   936     /return
       
   937 */
   850 */
   938 void ExampleAppEnginePrivate::pauseL()
   851 void ExampleAppEnginePrivate::pauseL()
   939 {
   852 {
   940     FUNC_LOG
   853     FUNC_LOG
   941     
   854     
   956         User::Leave(KErrNotReady);
   869         User::Leave(KErrNotReady);
   957     }
   870     }
   958 }
   871 }
   959 
   872 
   960 /*!
   873 /*!
   961     description
   874     Issues the stop command to the renderer.
   962     
       
   963     /a
       
   964     /return
       
   965 */
   875 */
   966 void ExampleAppEnginePrivate::stopL()
   876 void ExampleAppEnginePrivate::stopL()
   967 {
   877 {
   968     FUNC_LOG
   878     FUNC_LOG
   969     
   879     
   976         User::Leave(KErrNotReady);
   886         User::Leave(KErrNotReady);
   977     }
   887     }
   978 }
   888 }
   979 
   889 
   980 /*!
   890 /*!
   981     description
   891     Check that there is an active connection and store that IAP for further
   982     
   892     usage. Note that there is no functionality in this application to
   983     /a
   893     initialize connection setup, if no active connection exists.
   984     /return
       
   985 */
   894 */
   986 void ExampleAppEnginePrivate::resolveIapL()
   895 void ExampleAppEnginePrivate::resolveIapL()
   987 {
   896 {
   988     FUNC_LOG
   897     FUNC_LOG
   989     
   898     
  1020     
   929     
  1021     mSettingsEngine->SetAccessPoint(mIap);
   930     mSettingsEngine->SetAccessPoint(mIap);
  1022 }
   931 }
  1023 
   932 
  1024 /*!
   933 /*!
  1025     description
   934     Resolve the IAP name that's stored in UPnP Settings Engine as the
  1026     
   935     currently active IAP.
  1027     /a
       
  1028     /return
       
  1029 */
   936 */
  1030 void ExampleAppEnginePrivate::resolveIapNameL()
   937 void ExampleAppEnginePrivate::resolveIapNameL()
  1031 {
   938 {
  1032     FUNC_LOG
   939     FUNC_LOG
  1033     
   940     
  1039         delete iapName;
   946         delete iapName;
  1040     }
   947     }
  1041 }
   948 }
  1042 
   949 
  1043 /*!
   950 /*!
  1044     description
   951     Helper function for Symbian descriptor to Qt string conversion.
  1045     
       
  1046     /a
       
  1047     /return
       
  1048 */
   952 */
  1049 QString ExampleAppEnginePrivate::asString(const TDesC &desc) const
   953 QString ExampleAppEnginePrivate::asString(const TDesC &desc) const
  1050 {
   954 {
  1051     return QString::fromUtf16(desc.Ptr(), desc.Length());
   955     return QString::fromUtf16(desc.Ptr(), desc.Length());
  1052 }
   956 }
  1053 
   957 
  1054 /*!
   958 /*!
  1055     description
   959     Helper function for Symbian descriptor to Qt string conversion.
  1056     
       
  1057     /a
       
  1058     /return
       
  1059 */
   960 */
  1060 QString ExampleAppEnginePrivate::asString8(const TDesC8 &desc) const
   961 QString ExampleAppEnginePrivate::asString8(const TDesC8 &desc) const
  1061 {
   962 {
  1062     return QString::fromUtf8((char*)desc.Ptr(), desc.Length());
   963     return QString::fromUtf8((char*)desc.Ptr(), desc.Length());
  1063 }
   964 }