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