javauis/mmapi_qt/baseline/src/cmmaplayer.cpp
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 47 f40128debb5d
equal deleted inserted replaced
23:98ccebc37403 26:dc7c549001d5
    32 _LIT(KPanicMethod, "method not found");
    32 _LIT(KPanicMethod, "method not found");
    33 #endif
    33 #endif
    34 
    34 
    35 CMMAPlayer::~CMMAPlayer()
    35 CMMAPlayer::~CMMAPlayer()
    36 {
    36 {
    37     LOG( EJavaMMAPI, EInfo, "CMMAPlayer::~CMMAPlayer()");
    37     LOG(EJavaMMAPI, EInfo, "CMMAPlayer::~CMMAPlayer()");
    38 
    38 
    39     iSourceStreams.ResetAndDestroy();
    39     iSourceStreams.ResetAndDestroy();
    40     if (iControls.Count() > 0)
    40     if (iControls.Count() > 0)
    41         iControls.ResetAndDestroy();
    41         iControls.ResetAndDestroy();
    42     iStateListeners.Reset();
    42     iStateListeners.Reset();
    57 }
    57 }
    58 
    58 
    59 
    59 
    60 void CMMAPlayer::ConstructL()
    60 void CMMAPlayer::ConstructL()
    61 {
    61 {
    62     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ConstructL + ");
    62     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ConstructL + ");
    63     iDurationUpdater = CMMADurationUpdater::NewL(*this);
    63     iDurationUpdater = CMMADurationUpdater::NewL(*this);
    64     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ConstructL - ");
    64     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ConstructL - ");
    65 }
    65 }
    66 
    66 
    67 
    67 
    68 void CMMAPlayer::StaticAddSourceStreamL(JNIEnv* aJniEnv,
    68 void CMMAPlayer::StaticAddSourceStreamL(JNIEnv* aJniEnv,
    69                                         CMMAPlayer* aPlayer,
    69                                         CMMAPlayer* aPlayer,
    70                                         MMAFunctionServer* aEventSource,
    70                                         MMAFunctionServer* aEventSource,
    71                                         jobject aReader,
    71                                         jobject aReader,
    72                                         CMMASourceStream** aSourceStream)
    72                                         CMMASourceStream** aSourceStream)
    73 {
    73 {
    74     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticAddSourceStreamL +");
    74     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticAddSourceStreamL +");
    75 
    75 
    76     // JNI interface pointer can't be passed to different thread, so
    76     // JNI interface pointer can't be passed to different thread, so
    77     // it is needed to get valid JNI interface pointer for Event Server thread
    77     // it is needed to get valid JNI interface pointer for Event Server thread
    78      aJniEnv = aEventSource-> getValidJniEnv();
    78     aJniEnv = aEventSource-> getValidJniEnv();
    79 
    79 
    80     *aSourceStream = aPlayer->AddSourceStreamL(aJniEnv,
    80     *aSourceStream = aPlayer->AddSourceStreamL(aJniEnv,
    81                      aEventSource,
    81                      aEventSource,
    82                      aReader);
    82                      aReader);
    83     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticAddSourceStreamL -");
    83     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticAddSourceStreamL -");
    84 }
    84 }
    85 
    85 
    86 
    86 
    87 
    87 
    88 void CMMAPlayer::StaticSetPlayerListenerObjectL(CMMAPlayer* aPlayer,
    88 void CMMAPlayer::StaticSetPlayerListenerObjectL(CMMAPlayer* aPlayer,
    89 		MMAFunctionServer* aEventsource,
    89         MMAFunctionServer* aEventsource,
    90         jobject aListenerObject,
    90         jobject aListenerObject,
    91         JNIEnv* aJni,
    91         JNIEnv* aJni,
    92         MMMAEventPoster* aPoster)
    92         MMMAEventPoster* aPoster)
    93 {
    93 {
    94 
    94 
    95     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticSetPlayerListenerObjectL +");
    95     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticSetPlayerListenerObjectL +");
    96 
    96 
    97     // JNI interface pointer can't be passed to different thread, so
    97     // JNI interface pointer can't be passed to different thread, so
    98     // it is needed to get valid JNI interface pointer for Event Server thread
    98     // it is needed to get valid JNI interface pointer for Event Server thread
    99      aJni = aEventsource-> getValidJniEnv();
    99     aJni = aEventsource-> getValidJniEnv();
   100 
   100 
   101     aPlayer->SetPlayerListenerObjectL(aListenerObject, aJni, aPoster);
   101     aPlayer->SetPlayerListenerObjectL(aListenerObject, aJni, aPoster);
   102 
   102 
   103     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticSetPlayerListenerObjectL -");
   103     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticSetPlayerListenerObjectL -");
   104 }
   104 }
   105 
   105 
   106 
   106 
   107 void CMMAPlayer::StaticInitPlayerL(CMMAPlayer* aPlayer,
   107 void CMMAPlayer::StaticInitPlayerL(CMMAPlayer* aPlayer,
   108 								   MMAFunctionServer* aEventsource,
   108                                    MMAFunctionServer* aEventsource,
   109                                    jobject aPlayerObject,
   109                                    jobject aPlayerObject,
   110                                    JNIEnv* aJni)
   110                                    JNIEnv* aJni)
   111 {
   111 {
   112     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticInitPlayerL +");
   112     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticInitPlayerL +");
   113 
   113 
   114     // JNI interface pointer can't be passed to different thread, so
   114     // JNI interface pointer can't be passed to different thread, so
   115     // it is needed to get valid JNI interface pointer for Event Server thread
   115     // it is needed to get valid JNI interface pointer for Event Server thread
   116  	aJni = aEventsource-> getValidJniEnv();
   116     aJni = aEventsource-> getValidJniEnv();
   117 
   117 
   118     jmethodID actionCompletedMethod = aJni->GetMethodID(
   118     jmethodID actionCompletedMethod = aJni->GetMethodID(
   119                                           aJni->GetObjectClass(aPlayerObject),
   119                                           aJni->GetObjectClass(aPlayerObject),
   120                                           "actionCompleted",
   120                                           "actionCompleted",
   121                                           "(I)V");
   121                                           "(I)V");
   122                                           
   122 
   123     jmethodID actionCompletedFileMethod = aJni->GetMethodID(
   123     jmethodID actionCompletedFileMethod = aJni->GetMethodID(
   124                                           aJni->GetObjectClass(aPlayerObject),
   124                                               aJni->GetObjectClass(aPlayerObject),
   125                                           "actionCompletedFile",
   125                                               "actionCompletedFile",
   126                                           "()V");    
   126                                               "()V");
   127                                           
   127 
   128     jmethodID actionCompletedStartMethod = aJni->GetMethodID(
   128     jmethodID actionCompletedStartMethod = aJni->GetMethodID(
   129                                           aJni->GetObjectClass(aPlayerObject),
   129                                                aJni->GetObjectClass(aPlayerObject),
   130                                           "actionCompletedStart",
   130                                                "actionCompletedStart",
   131                                           "()V");                                                                                 
   131                                                "()V");
   132 
   132 
   133     // Sanity Check, something is really wrong if methods cannot be found
   133     // Sanity Check, something is really wrong if methods cannot be found
   134     __ASSERT_DEBUG(actionCompletedMethod,
   134     __ASSERT_DEBUG(actionCompletedMethod,
   135                    User::Panic(KPanicMethod, KErrGeneral));
   135                    User::Panic(KPanicMethod, KErrGeneral));
   136 
   136 
   137     aPlayer->iActionCompletedEvent = new(ELeave) CMMAEvent(
   137     aPlayer->iActionCompletedEvent = new(ELeave) CMMAEvent(
   138         aPlayerObject,
   138         aPlayerObject,
   139         actionCompletedMethod,
   139         actionCompletedMethod,
   140         CMMAEvent::EReusableEvent);
   140         CMMAEvent::EReusableEvent);
   141             
   141 
   142     aPlayer->iActionCompletedFileEvent = new(ELeave) CMMAEvent(
   142     aPlayer->iActionCompletedFileEvent = new(ELeave) CMMAEvent(
   143         aPlayerObject,
   143         aPlayerObject,
   144         actionCompletedFileMethod,
   144         actionCompletedFileMethod,
   145         CMMAEvent::EReusableEvent);     
   145         CMMAEvent::EReusableEvent);
   146             
   146 
   147     aPlayer->iActionCompletedStartEvent = new(ELeave) CMMAEvent(
   147     aPlayer->iActionCompletedStartEvent = new(ELeave) CMMAEvent(
   148         aPlayerObject,
   148         aPlayerObject,
   149         actionCompletedStartMethod,
   149         actionCompletedStartMethod,
   150         CMMAEvent::EReusableEvent);
   150         CMMAEvent::EReusableEvent);
   151 
   151 
   152     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticInitPlayerL -");
   152     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticInitPlayerL -");
   153 }
   153 }
   154 
   154 
   155 CMMAControl* CMMAPlayer::StaticControl(CMMAPlayer* aPlayer, TInt aIndex)
   155 CMMAControl* CMMAPlayer::StaticControl(CMMAPlayer* aPlayer, TInt aIndex)
   156 {
   156 {
   157     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticControl +");
   157     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::StaticControl +");
   158     return aPlayer->Control(aIndex);
   158     return aPlayer->Control(aIndex);
   159 
   159 
   160 }
   160 }
   161 
   161 
   162 
   162 
   163 void CMMAPlayer::RealizeL()
   163 void CMMAPlayer::RealizeL()
   164 {
   164 {
   165     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::RealizeL +");
   165     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::RealizeL +");
   166     ChangeState(ERealized);
   166     ChangeState(ERealized);
   167 
   167 
   168 }
   168 }
   169 
   169 
   170 
   170 
   171 void CMMAPlayer::CloseL()
   171 void CMMAPlayer::CloseL()
   172 {
   172 {
   173     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::CloseL ");
   173     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::CloseL ");
   174     ChangeState(EClosed);
   174     ChangeState(EClosed);
   175     PostObjectEvent(CMMAPlayerEvent::EClosed, NULL);   
   175     PostObjectEvent(CMMAPlayerEvent::EClosed, NULL);
   176 }
   176 }
   177 
   177 
   178 
   178 
   179 void CMMAPlayer::GetDuration(TInt64* aDuration)
   179 void CMMAPlayer::GetDuration(TInt64* aDuration)
   180 {
   180 {
   181     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::GetDuration ");
   181     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::GetDuration ");
   182     *aDuration = iDuration;
   182     *aDuration = iDuration;
   183 }
   183 }
   184 
   184 
   185 
   185 
   186 void CMMAPlayer::SetMediaTimeL(TInt64* aTime)
   186 void CMMAPlayer::SetMediaTimeL(TInt64* aTime)
   187 {
   187 {
   188     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetMediaTimeL ");
   188     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetMediaTimeL ");
   189     *aTime = KErrNotSupported;
   189     *aTime = KErrNotSupported;
   190 }
   190 }
   191 
   191 
   192 void CMMAPlayer::GetMediaTime(TInt64* aMediaTime)
   192 void CMMAPlayer::GetMediaTime(TInt64* aMediaTime)
   193 {
   193 {
   194     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::GetMediaTime ");
   194     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::GetMediaTime ");
   195     *aMediaTime = KErrNotSupported;
   195     *aMediaTime = KErrNotSupported;
   196 }
   196 }
   197 
   197 
   198 
   198 
   199 EXPORT_C void CMMAPlayer::SetLoopCount(TInt aCount)
   199 EXPORT_C void CMMAPlayer::SetLoopCount(TInt aCount)
   200 {
   200 {
   201     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetLoopCount ");
   201     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetLoopCount ");
   202     iRepeatForever = (aCount == KJavaRepeatForever);
   202     iRepeatForever = (aCount == KJavaRepeatForever);
   203     iRepeatNumberOfTimes = aCount;
   203     iRepeatNumberOfTimes = aCount;
   204     iRepeatCount = 0;
   204     iRepeatCount = 0;
   205 }
   205 }
   206 
   206 
   207 HBufC* CMMAPlayer::ContentType() const
   207 HBufC* CMMAPlayer::ContentType() const
   208 {
   208 {
   209     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ContentType ");
   209     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ContentType ");
   210     return iContentType;
   210     return iContentType;
   211 }
   211 }
   212 
   212 
   213 void CMMAPlayer::SetPlayerListenerObjectL(jobject aListenerObject,
   213 void CMMAPlayer::SetPlayerListenerObjectL(jobject aListenerObject,
   214         JNIEnv* aJni,
   214         JNIEnv* aJni,
   215         MMMAEventPoster* aEventPoster)
   215         MMMAEventPoster* aEventPoster)
   216 {
   216 {
   217     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetPlayerListenerObjectL +");
   217     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetPlayerListenerObjectL +");
   218     iListenerObject = aListenerObject;
   218     iListenerObject = aListenerObject;
   219     iEventPoster = aEventPoster;
   219     iEventPoster = aEventPoster;
   220 
   220 
   221     jclass listenerClass = aJni->GetObjectClass(aListenerObject);
   221     jclass listenerClass = aJni->GetObjectClass(aListenerObject);
   222 
   222 
   254             iPostStringEvent,
   254             iPostStringEvent,
   255             CMMAEvent::EReusableEvent);
   255             CMMAEvent::EReusableEvent);
   256     iOOMErrorEvent->SetStringEventL(CMMAPlayerEvent::EError,
   256     iOOMErrorEvent->SetStringEventL(CMMAPlayerEvent::EError,
   257                                     KPanicOutOfMem);
   257                                     KPanicOutOfMem);
   258 
   258 
   259     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetPlayerListenerObjectL -");
   259     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::SetPlayerListenerObjectL -");
   260 }
   260 }
   261 
   261 
   262 
   262 
   263 EXPORT_C TInt CMMAPlayer::ControlCount()
   263 EXPORT_C TInt CMMAPlayer::ControlCount()
   264 {
   264 {
   282 
   282 
   283 }
   283 }
   284 
   284 
   285 EXPORT_C  void CMMAPlayer::AddStateListenerL(MMMAPlayerStateListener* aListener)
   285 EXPORT_C  void CMMAPlayer::AddStateListenerL(MMMAPlayerStateListener* aListener)
   286 {
   286 {
   287 	LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddStateListenerL +");
   287     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddStateListenerL +");
   288 	TInt err = iStateListeners.Append(aListener);
   288     TInt err = iStateListeners.Append(aListener);
   289 	LOG1( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddStateListenerL - err = %d ",err);
   289     LOG1(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddStateListenerL - err = %d ",err);
   290 		User::LeaveIfError(err);
   290     User::LeaveIfError(err);
   291     //User::LeaveIfError(iStateListeners.Append(aListener));
   291     //User::LeaveIfError(iStateListeners.Append(aListener));
   292 
   292 
   293 }
   293 }
   294 
   294 
   295 EXPORT_C void CMMAPlayer::RemoveStateListener(MMMAPlayerStateListener* aListener)
   295 EXPORT_C void CMMAPlayer::RemoveStateListener(MMMAPlayerStateListener* aListener)
   318 
   318 
   319 }
   319 }
   320 
   320 
   321 void CMMAPlayer::ResetSourceStreams()
   321 void CMMAPlayer::ResetSourceStreams()
   322 {
   322 {
   323     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ResetSourceStreams +");
   323     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ResetSourceStreams +");
   324     int sourceStreamsCount = iSourceStreams.Count();
   324     int sourceStreamsCount = iSourceStreams.Count();
   325     for (int i = 0; i < sourceStreamsCount; i++)
   325     for (int i = 0; i < sourceStreamsCount; i++)
   326     {
   326     {
   327         iSourceStreams[ i ]->ResetData();
   327         iSourceStreams[ i ]->ResetData();
   328     }
   328     }
   329     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ResetSourceStreams -");
   329     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ResetSourceStreams -");
   330 }
   330 }
   331 
   331 
   332 EXPORT_C void CMMAPlayer::AddControlL(CMMAControl* aControl)
   332 EXPORT_C void CMMAPlayer::AddControlL(CMMAControl* aControl)
   333 {
   333 {
   334 
   334 
   337 }
   337 }
   338 
   338 
   339 void CMMAPlayer::PostLongEvent(CMMAPlayerEvent::TEventType aEventType,
   339 void CMMAPlayer::PostLongEvent(CMMAPlayerEvent::TEventType aEventType,
   340                                const TInt64& aLongEventData)
   340                                const TInt64& aLongEventData)
   341 {
   341 {
   342     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostLongEvent ");
   342     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostLongEvent ");
   343     if (!iListenerObject || !iEventPoster)
   343     if (!iListenerObject || !iEventPoster)
   344     {
   344     {
   345         LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostLongEvent No listener");
   345         LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostLongEvent No listener");
   346         // return since player is not ready for posting any events and is not initialized
   346         // return since player is not ready for posting any events and is not initialized
   347         return;
   347         return;
   348     }
   348     }
   349 
   349 
   350     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   350     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   363 
   363 
   364 
   364 
   365 EXPORT_C void CMMAPlayer::PostStringEvent(CMMAPlayerEvent::TEventType aEventType,
   365 EXPORT_C void CMMAPlayer::PostStringEvent(CMMAPlayerEvent::TEventType aEventType,
   366         const TDesC& aStringEventData)
   366         const TDesC& aStringEventData)
   367 {
   367 {
   368     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostStringEvent ");
   368     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostStringEvent ");
   369     if (!iListenerObject || !iEventPoster)
   369     if (!iListenerObject || !iEventPoster)
   370     {
   370     {
   371         LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostStringEvent No listener");
   371         LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostStringEvent No listener");
   372         // return since player is not ready for posting any events and is not initialized
   372         // return since player is not ready for posting any events and is not initialized
   373         return;
   373         return;
   374     }
   374     }
   375 
   375 
   376     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   376     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   396 
   396 
   397 
   397 
   398 EXPORT_C void CMMAPlayer::PostObjectEvent(CMMAPlayerEvent::TEventType aEventType,
   398 EXPORT_C void CMMAPlayer::PostObjectEvent(CMMAPlayerEvent::TEventType aEventType,
   399         const jobject aEventData)
   399         const jobject aEventData)
   400 {
   400 {
   401     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostObjectEvent ");
   401     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostObjectEvent ");
   402 
   402 
   403     if (!iListenerObject || !iEventPoster)
   403     if (!iListenerObject || !iEventPoster)
   404     {
   404     {
   405         LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostObjectEvent No listener");
   405         LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostObjectEvent No listener");
   406         // return since player is not ready for posting any events and is not initialized
   406         // return since player is not ready for posting any events and is not initialized
   407         return;
   407         return;
   408     }
   408     }
   409 
   409 
   410     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   410     CMMAPlayerEvent* playerEvent = new CMMAPlayerEvent(iListenerObject,
   431 
   431 
   432 EXPORT_C CMMASourceStream* CMMAPlayer::AddSourceStreamL(JNIEnv* aJNIEnv,
   432 EXPORT_C CMMASourceStream* CMMAPlayer::AddSourceStreamL(JNIEnv* aJNIEnv,
   433         MMAFunctionServer* aEventSource,
   433         MMAFunctionServer* aEventSource,
   434         jobject aReader)
   434         jobject aReader)
   435 {
   435 {
   436     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddSourceStreamL ");
   436     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::AddSourceStreamL ");
   437     CMMASourceStream* sourceStream = CMMASourceStream::NewL(aJNIEnv,
   437     CMMASourceStream* sourceStream = CMMASourceStream::NewL(aJNIEnv,
   438                                      aEventSource,
   438                                      aEventSource,
   439                                      aReader,
   439                                      aReader,
   440                                      this);
   440                                      this);
   441 
   441 
   446 }
   446 }
   447 
   447 
   448 
   448 
   449 void CMMAPlayer::PostActionCompleted(TInt aError)
   449 void CMMAPlayer::PostActionCompleted(TInt aError)
   450 {
   450 {
   451 	LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompleted ");
   451     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompleted ");
   452     iActionCompletedEvent->SetEventData(aError);
   452     iActionCompletedEvent->SetEventData(aError);
   453     iEventPoster->PostEvent(iActionCompletedEvent,
   453     iEventPoster->PostEvent(iActionCompletedEvent,
   454                             CMMAEvent::ENotifyPriority);
   454                             CMMAEvent::ENotifyPriority);
   455 }
   455 }
   456 
   456 
   457 void CMMAPlayer::PostActionCompletedFile()
   457 void CMMAPlayer::PostActionCompletedFile()
   458 {
   458 {
   459 	LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompleted ");
   459     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompletedFile ");
   460    // iActionCompletedFileEvent->SetEventData(aError);
   460     // iActionCompletedFileEvent->SetEventData(aError);
   461     iEventPoster->PostEvent(iActionCompletedFileEvent,
   461     iEventPoster->PostEvent(iActionCompletedFileEvent,
   462                             CMMAEvent::ENotifyPriority);
   462                             CMMAEvent::ENotifyPriority);
   463 }
   463 }
   464 
   464 
   465 
   465 
   466 void CMMAPlayer::PostActionCompletedStart()
   466 void CMMAPlayer::PostActionCompletedStart()
   467 {
   467 {
   468 	   LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompleted ");
   468     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::PostActionCompletedStart ");
   469     iEventPoster->PostEvent(iActionCompletedStartEvent,
   469     iEventPoster->PostEvent(iActionCompletedStartEvent,
   470                             CMMAEvent::ENotifyPriority);
   470                             CMMAEvent::ENotifyPriority);
   471 }
   471 }
   472 
   472 
   473 void CMMAPlayer::ChangeState(TPlayerState aState)
   473 void CMMAPlayer::ChangeState(TPlayerState aState)
   474 {
   474 {
   475     iState = aState;
   475     iState = aState;
   476     LOG1( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ChangeState - iStateListeners count is %d", iStateListeners.Count());
   476     LOG1(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ChangeState - iStateListeners count is %d", iStateListeners.Count());
   477     for (TInt i(0); i<iStateListeners.Count(); i++)
   477     for (TInt i(0); i<iStateListeners.Count(); i++)
   478     {
   478     {
   479         iStateListeners[ i ]->StateChanged(aState);
   479         iStateListeners[ i ]->StateChanged(aState);
   480     }
   480     }
   481     LOG1( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ChangeState - State changed to %d", iState);
   481     LOG1(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ChangeState - State changed to %d", iState);
   482 }
   482 }
   483 
   483 
   484 void CMMAPlayer::ReadCompletedL(TInt /*aStatus*/, const TDesC8& /*aData*/)
   484 void CMMAPlayer::ReadCompletedL(TInt /*aStatus*/, const TDesC8& /*aData*/)
   485 {
   485 {
   486     // empty implementation
   486     // empty implementation
   487     LOG( EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ReadCompletedL ");
   487     LOG(EJavaMMAPI, EInfo, "MMA::CMMAPlayer::ReadCompletedL ");
   488 }
   488 }
   489 void CMMAPlayer:: DeleteControls()
   489 void CMMAPlayer:: DeleteControls()
   490 {
   490 {
   491     if (iControls.Count() > 0)
   491     if (iControls.Count() > 0)
   492     {
   492     {