mmserv/radioutility/radio_utility/src/RadioPlayerUtility.cpp
changeset 16 43d09473c595
parent 0 71ca22bcf22a
child 46 0ac9a5310753
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    17 
    17 
    18 
    18 
    19 #include <RadioPlayerUtility.h>
    19 #include <RadioPlayerUtility.h>
    20 #include "RadioPlayerUtilityBody.h"
    20 #include "RadioPlayerUtilityBody.h"
    21 #include "RadioSession.h"
    21 #include "RadioSession.h"
       
    22 #include "trace.h"
    22 
    23 
    23 // ======== MEMBER FUNCTIONS ========
    24 // ======== MEMBER FUNCTIONS ========
    24 
    25 
    25 // -----------------------------------------------------------------------------
    26 // -----------------------------------------------------------------------------
    26 // CRadioPlayerUtility::NewL
    27 // CRadioPlayerUtility::NewL
    29 //
    30 //
    30 CRadioPlayerUtility* CRadioPlayerUtility::NewL(
    31 CRadioPlayerUtility* CRadioPlayerUtility::NewL(
    31      RRadioSession& aRadioSession,
    32      RRadioSession& aRadioSession,
    32      MRadioPlayerObserver& aObserver)
    33      MRadioPlayerObserver& aObserver)
    33     {
    34     {
       
    35     FUNC_LOG;
    34     CRadioPlayerUtility* self = new(ELeave) CRadioPlayerUtility;
    36     CRadioPlayerUtility* self = new(ELeave) CRadioPlayerUtility;
    35     CleanupStack::PushL(self);
    37     CleanupStack::PushL(self);
    36     self->iBody = CRadioPlayerUtility::CBody::NewL(aRadioSession, aObserver);
    38     self->iBody = CRadioPlayerUtility::CBody::NewL(aRadioSession, aObserver);
    37     CleanupStack::Pop();
    39     CleanupStack::Pop();
    38     return self;
    40     return self;
    43 // Destructor
    45 // Destructor
    44 // -----------------------------------------------------------------------------
    46 // -----------------------------------------------------------------------------
    45 //
    47 //
    46 EXPORT_C CRadioPlayerUtility::~CRadioPlayerUtility()
    48 EXPORT_C CRadioPlayerUtility::~CRadioPlayerUtility()
    47     {
    49     {
       
    50     FUNC_LOG;
    48     delete iBody;
    51     delete iBody;
    49     }
    52     }
    50 
    53 
    51 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    52 // CRadioPlayerUtility::CRadioPlayerUtility
    55 // CRadioPlayerUtility::CRadioPlayerUtility
    53 // (other items were commented in a header).
    56 // (other items were commented in a header).
    54 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    55 //
    58 //
    56 CRadioPlayerUtility::CRadioPlayerUtility()
    59 CRadioPlayerUtility::CRadioPlayerUtility()
    57     {
    60     {
       
    61     FUNC_LOG;
    58     }
    62     }
    59 
    63 
    60 // -----------------------------------------------------------------------------
    64 // -----------------------------------------------------------------------------
    61 // CRadioPlayerUtility::PlayerState
    65 // CRadioPlayerUtility::PlayerState
    62 // (other items were commented in a header).
    66 // (other items were commented in a header).
    63 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
    64 //
    68 //
    65 EXPORT_C TPlayerState CRadioPlayerUtility::PlayerState() const
    69 EXPORT_C TPlayerState CRadioPlayerUtility::PlayerState() const
    66     {
    70     {
       
    71     FUNC_LOG;
    67     TPlayerState playerState;
    72     TPlayerState playerState;
    68     ASSERT(iBody);
    73     ASSERT(iBody);
    69     iBody->PlayerState(playerState);
    74     iBody->PlayerState(playerState);
    70 
    75 
    71     return playerState;
    76     return playerState;
    77 // (other items were commented in a header).
    82 // (other items were commented in a header).
    78 // -----------------------------------------------------------------------------
    83 // -----------------------------------------------------------------------------
    79 //
    84 //
    80 EXPORT_C void CRadioPlayerUtility::Close()
    85 EXPORT_C void CRadioPlayerUtility::Close()
    81     {
    86     {
       
    87     FUNC_LOG;
    82     ASSERT(iBody);
    88     ASSERT(iBody);
    83     iBody->Close();
    89     iBody->Close();
    84     }
    90     }
    85 
    91 
    86 // -----------------------------------------------------------------------------
    92 // -----------------------------------------------------------------------------
    89 // (other items were commented in a header).
    95 // (other items were commented in a header).
    90 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
    91 //
    97 //
    92 EXPORT_C void CRadioPlayerUtility::Play()
    98 EXPORT_C void CRadioPlayerUtility::Play()
    93     {
    99     {
       
   100     FUNC_LOG;
    94     ASSERT(iBody);
   101     ASSERT(iBody);
    95     iBody->Play();
   102     iBody->Play();
    96     }
   103     }
    97 
   104 
    98 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   101 // (other items were commented in a header).
   108 // (other items were commented in a header).
   102 // -----------------------------------------------------------------------------
   109 // -----------------------------------------------------------------------------
   103 //
   110 //
   104 EXPORT_C void CRadioPlayerUtility::Stop()
   111 EXPORT_C void CRadioPlayerUtility::Stop()
   105     {
   112     {
       
   113     FUNC_LOG;
   106     ASSERT(iBody);
   114     ASSERT(iBody);
   107     iBody->Stop();
   115     iBody->Stop();
   108     }
   116     }
   109 
   117 
   110 // -----------------------------------------------------------------------------
   118 // -----------------------------------------------------------------------------
   113 // (other items were commented in a header).
   121 // (other items were commented in a header).
   114 // -----------------------------------------------------------------------------
   122 // -----------------------------------------------------------------------------
   115 //
   123 //
   116 EXPORT_C TInt CRadioPlayerUtility::Mute(TBool aMute)
   124 EXPORT_C TInt CRadioPlayerUtility::Mute(TBool aMute)
   117     {
   125     {
       
   126     FUNC_LOG;
   118     ASSERT(iBody);
   127     ASSERT(iBody);
   119     return iBody->Mute(aMute);
   128     return iBody->Mute(aMute);
   120     }
   129     }
   121 
   130 
   122 // -----------------------------------------------------------------------------
   131 // -----------------------------------------------------------------------------
   125 // (other items were commented in a header).
   134 // (other items were commented in a header).
   126 // -----------------------------------------------------------------------------
   135 // -----------------------------------------------------------------------------
   127 //
   136 //
   128 EXPORT_C TBool CRadioPlayerUtility::IsMute()
   137 EXPORT_C TBool CRadioPlayerUtility::IsMute()
   129     {
   138     {
       
   139     FUNC_LOG;
   130     ASSERT(iBody);
   140     ASSERT(iBody);
   131     return iBody->IsMute();
   141     return iBody->IsMute();
   132     }
   142     }
   133 
   143 
   134 
   144 
   138 // (other items were commented in a header).
   148 // (other items were commented in a header).
   139 // -----------------------------------------------------------------------------
   149 // -----------------------------------------------------------------------------
   140 //
   150 //
   141 EXPORT_C TInt CRadioPlayerUtility::SetVolume(TInt aVolume)
   151 EXPORT_C TInt CRadioPlayerUtility::SetVolume(TInt aVolume)
   142     {
   152     {
       
   153     FUNC_LOG;
   143     ASSERT(iBody);
   154     ASSERT(iBody);
   144     return iBody->SetVolume(aVolume);
   155     return iBody->SetVolume(aVolume);
   145     }
   156     }
   146 
   157 
   147 // -----------------------------------------------------------------------------
   158 // -----------------------------------------------------------------------------
   150 // (other items were commented in a header).
   161 // (other items were commented in a header).
   151 // -----------------------------------------------------------------------------
   162 // -----------------------------------------------------------------------------
   152 //
   163 //
   153 EXPORT_C TInt CRadioPlayerUtility::GetVolume(TInt& aVolume) const
   164 EXPORT_C TInt CRadioPlayerUtility::GetVolume(TInt& aVolume) const
   154     {
   165     {
       
   166     FUNC_LOG;
   155     ASSERT(iBody);
   167     ASSERT(iBody);
   156     return iBody->GetVolume(aVolume);
   168     return iBody->GetVolume(aVolume);
   157     }
   169     }
   158 
   170 
   159 // -----------------------------------------------------------------------------
   171 // -----------------------------------------------------------------------------
   163 // -----------------------------------------------------------------------------
   175 // -----------------------------------------------------------------------------
   164 //
   176 //
   165 EXPORT_C TInt CRadioPlayerUtility::SetVolumeRamp(
   177 EXPORT_C TInt CRadioPlayerUtility::SetVolumeRamp(
   166     const TTimeIntervalMicroSeconds& aRampInterval)
   178     const TTimeIntervalMicroSeconds& aRampInterval)
   167     {
   179     {
       
   180     FUNC_LOG;
   168     ASSERT(iBody);
   181     ASSERT(iBody);
   169     return iBody->SetVolumeRamp(aRampInterval);
   182     return iBody->SetVolumeRamp(aRampInterval);
   170     }
   183     }
   171 
   184 
   172 // -----------------------------------------------------------------------------
   185 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   189 // -----------------------------------------------------------------------------
   177 //
   190 //
   178 EXPORT_C TInt CRadioPlayerUtility::GetMaxVolume(
   191 EXPORT_C TInt CRadioPlayerUtility::GetMaxVolume(
   179     TInt& aMaxVolume ) const
   192     TInt& aMaxVolume ) const
   180     {
   193     {
       
   194     FUNC_LOG;
   181     ASSERT(iBody);
   195     ASSERT(iBody);
   182     return iBody->GetMaxVolume(aMaxVolume);
   196     return iBody->GetMaxVolume(aMaxVolume);
   183     }
   197     }
   184 
   198 
   185 // -----------------------------------------------------------------------------
   199 // -----------------------------------------------------------------------------
   190 //
   204 //
   191 EXPORT_C TInt CRadioPlayerUtility::SetBalance(
   205 EXPORT_C TInt CRadioPlayerUtility::SetBalance(
   192     TInt aLeftPercentage,
   206     TInt aLeftPercentage,
   193     TInt aRightPercentage )
   207     TInt aRightPercentage )
   194     {
   208     {
       
   209     FUNC_LOG;
   195     ASSERT(iBody);
   210     ASSERT(iBody);
   196     return iBody->SetBalance(aLeftPercentage, aRightPercentage);
   211     return iBody->SetBalance(aLeftPercentage, aRightPercentage);
   197     }
   212     }
   198 
   213 
   199 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   204 //
   219 //
   205 EXPORT_C TInt CRadioPlayerUtility::GetBalance(
   220 EXPORT_C TInt CRadioPlayerUtility::GetBalance(
   206     TInt& aLeftPercentage,
   221     TInt& aLeftPercentage,
   207     TInt& aRightPercentage ) const
   222     TInt& aRightPercentage ) const
   208     {
   223     {
       
   224     FUNC_LOG;
   209     ASSERT(iBody);
   225     ASSERT(iBody);
   210     return iBody->GetBalance(aLeftPercentage, aRightPercentage);
   226     return iBody->GetBalance(aLeftPercentage, aRightPercentage);
   211     }
   227     }
   212 
   228 
   213 // -----------------------------------------------------------------------------
   229 // -----------------------------------------------------------------------------
   217 // -----------------------------------------------------------------------------
   233 // -----------------------------------------------------------------------------
   218 //
   234 //
   219 EXPORT_C TAny* CRadioPlayerUtility::CustomInterface(
   235 EXPORT_C TAny* CRadioPlayerUtility::CustomInterface(
   220     TUid aInterfaceId )
   236     TUid aInterfaceId )
   221     {
   237     {
       
   238     FUNC_LOG;
   222     ASSERT(iBody);
   239     ASSERT(iBody);
   223     return iBody->CustomInterface(aInterfaceId);
   240     return iBody->CustomInterface(aInterfaceId);
   224     }
   241     }
   225 
   242 
   226 
   243