upnpavcontroller/upnprenderingstatemachine/src/upnpretraces.cpp
branchIOP_Improvements
changeset 40 08b5eae9f9ff
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
       
     1 /*
       
     2 * Copyright (c) 2007,2009 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:  Implementation of upnprenderingstatemachine trace helper functions
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDES
       
    19 #include <e32base.h>
       
    20 #include "upnpavrenderingsessionobserver.h" // TUPnPAVInteractOperation
       
    21 #include "upnprenderingstatemachineconstants.h"
       
    22 #include "upnpretraces.h"
       
    23 
       
    24 // CONSTANTS
       
    25 
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 
       
    29 const TUint16* StateName( TInt aState )
       
    30     {
       
    31     switch ( aState )
       
    32         {
       
    33         case Upnp::EOffSync:   return (TUint16*)L"OffSync";
       
    34         case Upnp::EBusy:      return (TUint16*)L"Busy";
       
    35         case Upnp::EStopped:   return (TUint16*)L"Stopped";
       
    36         case Upnp::EPlaying:   return (TUint16*)L"Playing";
       
    37         case Upnp::EPaused:    return (TUint16*)L"Paused";
       
    38         case Upnp::EDead:      return (TUint16*)L"Dead";
       
    39         case Upnp::EBuffering: return (TUint16*)L"Buffering";
       
    40         default:               return (TUint16*)L"State?";
       
    41         }
       
    42     }
       
    43 
       
    44 const TUint16* CommandName( TInt aCommand )
       
    45     {
       
    46     switch ( aCommand )
       
    47         {
       
    48         case Upnp::ENone:      return (TUint16*)L"None";
       
    49         case Upnp::ESync:      return (TUint16*)L"Sync";
       
    50         case Upnp::EPlay:      return (TUint16*)L"Play";
       
    51         case Upnp::EStop:      return (TUint16*)L"Stop";
       
    52         case Upnp::EClose:     return (TUint16*)L"Close";
       
    53         case Upnp::EPause:     return (TUint16*)L"Pause";
       
    54         case Upnp::EResume:    return (TUint16*)L"Resume";
       
    55         case Upnp::ERestart:   return (TUint16*)L"Restart";
       
    56         case Upnp::ECalibrate: return (TUint16*)L"Calibrate";
       
    57         case Upnp::ESeek:      return (TUint16*)L"Seek";
       
    58         case Upnp::ENext:      return (TUint16*)L"Next";
       
    59         case Upnp::EPrev:      return (TUint16*)L"Prev";
       
    60         case Upnp::EBack:      return (TUint16*)L"Back";
       
    61         case Upnp::EJump:      return (TUint16*)L"Jump";
       
    62         case Upnp::ESetUri:    return (TUint16*)L"SetUri";
       
    63         default:               return (TUint16*)L"Cmd?";
       
    64         }
       
    65     }
       
    66 
       
    67 const TUint16* PropertyName( TInt aProperty )
       
    68     {
       
    69     switch ( aProperty )
       
    70         {
       
    71         case Upnp::EVolume:       return (TUint16*)L"Volume";
       
    72         case Upnp::EMute:         return (TUint16*)L"Mute";
       
    73         case Upnp::EMediaDuration:return (TUint16*)L"MediaDuration";
       
    74         case Upnp::EPosition:     return (TUint16*)L"Position";
       
    75         case Upnp::EOptions:      return (TUint16*)L"Options";
       
    76         case Upnp::ECurrentIndex: return (TUint16*)L"CurrentIndex";
       
    77         case Upnp::ECurrentState: return (TUint16*)L"CurrentState";
       
    78         default:                  return (TUint16*)L"Property?";
       
    79         }
       
    80     }
       
    81 
       
    82 const TUint16* InteractOperationName( TInt aInteractOperation )
       
    83     {
       
    84     switch ( aInteractOperation )
       
    85         {
       
    86         case EUPnPAVPlay:      return (TUint16*)L"UPnPAVPlay";
       
    87         case EUPnPAVPause:     return (TUint16*)L"UPnPAVPause";
       
    88         case EUPnPAVStop:      return (TUint16*)L"UPnPAVStop";
       
    89         case EUPnPAVPlayUser:  return (TUint16*)L"UPnPAVPlayUser";
       
    90         case EUPnPAVPauseUser: return (TUint16*)L"UPnPAVPauseUser";
       
    91         case EUPnPAVStopUser:  return (TUint16*)L"UPnPAVStopUser";
       
    92         default:               return (TUint16*)L"InteractOperation?";
       
    93         }
       
    94     }