mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestCallbacks.cpp
changeset 16 43d09473c595
parent 0 71ca22bcf22a
child 46 0ac9a5310753
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    92 
    92 
    93         case ESourceControl:
    93         case ESourceControl:
    94  			    {
    94  			    {
    95  			    switch (aEventType)
    95  			    switch (aEventType)
    96 			        {
    96 			        {
    97 			        case MSourceControlObserver::KPercentageDownloadedChangedEvent:
       
    98 			        	{
       
    99 			        	TUint percent;
       
   100 			        	MProgDLSource* control1 = (MProgDLSource*)(aControl);
       
   101 			        	control1->GetPercentageBuffered(percent);
       
   102 			            iLog->Log(_L("KPercentageDownloadedChangedEvent"));
       
   103 			        	}
       
   104 			            break;
       
   105 			        case MSourceControlObserver::KBufferingTypesSupportChangedEvent:
    97 			        case MSourceControlObserver::KBufferingTypesSupportChangedEvent:
   106 			        	{
    98 			        	{
   107 			            iLog->Log(_L("KBufferingTypesSupportChangedEvent"));
    99 			            iLog->Log(_L("KBufferingTypesSupportChangedEvent"));
   108 			        	}
   100 			        	}
   109 			            break;
   101 			            break;
   120 			            iMFileSource->GetBitRate(rate);
   112 			            iMFileSource->GetBitRate(rate);
   121 			            RDebug::Print(_L("CEnhanMediaTestClass::Event:BitRateChanged[%d]"),rate);
   113 			            RDebug::Print(_L("CEnhanMediaTestClass::Event:BitRateChanged[%d]"),rate);
   122 			            iLog->Log(_L("CEnhanMediaTestClass::Event:BitRateChanged[%d]"),rate);
   114 			            iLog->Log(_L("CEnhanMediaTestClass::Event:BitRateChanged[%d]"),rate);
   123 			        	}
   115 			        	}
   124 			            break;
   116 			            break;
   125 			        case MSourceControlObserver::KDownloadStatusChangedEvent:
       
   126 			            {
       
   127 			            MProgDLSource* control1 = (MProgDLSource*)(aControl);
       
   128 			            RDebug::Print(_L("CMPlayerAudioUIController::Event:DownloadStatus[%d]"),control1->GetDownloadStatus());
       
   129 			            iLog->Log(_L("CMPlayerAudioUIController::Event:DownloadStatus[%d]"),control1->GetDownloadStatus());
       
   130 			            switch(control1->GetDownloadStatus())
       
   131 			            	{
       
   132 
       
   133 			            	case MProgDLSource::EConnecting:
       
   134 			            	    {
       
   135 			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [connecting]"));
       
   136 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [connecting]"));
       
   137 			            	    }
       
   138 			            	    break;
       
   139 
       
   140 			            	case MProgDLSource::EStarted:
       
   141 			            		{
       
   142 			            		RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [started]"));
       
   143 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [started]"));
       
   144 			            		}
       
   145 			            	    break;
       
   146 
       
   147 			            	case MProgDLSource::EPaused:
       
   148 			            		{
       
   149 			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [paused]"));
       
   150 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [paused]"));
       
   151 			            		}
       
   152 			            	    break;
       
   153 
       
   154 			            	case MProgDLSource::EDeleted:
       
   155 			            		{
       
   156 			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [deleted]"));
       
   157 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [deleted]"));
       
   158 			            		}
       
   159 			                    break;
       
   160 			            	case MProgDLSource::ECompleted:
       
   161 			            		{
       
   162 			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [completed]"));
       
   163 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [completed]"));
       
   164 			            		}
       
   165 			            	    break;
       
   166 			   	            case MProgDLSource::EFailed:
       
   167 			                    {
       
   168 			        	        RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [failed]"));
       
   169 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [failed]"));
       
   170 			                    break;
       
   171 			                    }
       
   172 			    	        case MProgDLSource::EUnknown:
       
   173 			        	        {
       
   174 			        	        RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [EUnknown]"));
       
   175 					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [EUnknown]"));
       
   176 			        	        }
       
   177 			        	        break;
       
   178 			            	default:
       
   179 			            	  break;
       
   180 			            	}
       
   181 			            }
       
   182 			            break;
       
   183 
       
   184 			        case MSourceControlObserver::KFileMoveCompleteEvent:
   117 			        case MSourceControlObserver::KFileMoveCompleteEvent:
   185 			            {
   118 			            {
   186 				            RDebug::Print(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
   119 				            RDebug::Print(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
   187 				            iLog->Log(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
   120 				            iLog->Log(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
   188 			            }
   121 			            }
   189 			            break;
   122 			            break;
   190 
       
   191 
       
   192 			        };
   123 			        };
   193 			    }
   124 			    }
   194        			break;
   125        			break;
   195 
   126 
   196        case ESinkControl:
   127        case ESinkControl:
   211         default:
   142         default:
   212             break;
   143             break;
   213 		};
   144 		};
   214 	}
   145 	}
   215 
   146 
   216 
       
   217 void CEnhanMediaTestClass::HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent )
       
   218     {
       
   219     RDebug::Print(_L("HandleDMgrEventL DownloadState[%d] ProgressState[%d]"),aEvent.iDownloadState,aEvent.iProgressState);
       
   220     iLog->Log(_L("HandleDMgrEventL DownloadState[%d] ProgressState[%d]"),aEvent.iDownloadState,aEvent.iProgressState);
       
   221 
       
   222     TInt32 downloadSize = 0;
       
   223     TInt32 length = 0;
       
   224     TInt status = aDownload.GetIntAttribute(EDlAttrDownloadedSize, downloadSize);
       
   225     status = aDownload.GetIntAttribute(EDlAttrLength, length);
       
   226 
       
   227 
       
   228     TInt percentageDL = (downloadSize*100/length);
       
   229 
       
   230     if(percentageDL > 8 && iActive->IsStarted())
       
   231         {
       
   232         iActive->AsyncStop();
       
   233         }
       
   234 
       
   235     //iLog->Log(_L("iMProgDLSource->GetDownloadingRate = [%d]"),rate);
       
   236    // RDebug::Print(_L("CEnhanMediaTestClass::Event:EStateChanged[Opened]"));
       
   237 
       
   238 
       
   239     if(aEvent.iDownloadState == EHttpDlPaused)
       
   240         {
       
   241         iDownload->Start();
       
   242         }
       
   243 
       
   244     if(aEvent.iDownloadState == EHttpDlCreated)
       
   245         {
       
   246         iLog->Log(_L("EHttpDlCreated"));
       
   247         }
       
   248 
       
   249     if(aEvent.iDownloadState == EHttpDlInprogress)
       
   250         {
       
   251         iLog->Log(_L("EHttpDlInprogress "));
       
   252         }
       
   253     if(aEvent.iDownloadState == EHttpDlPaused)
       
   254         {
       
   255         iLog->Log(_L("EHttpDlPaused "));
       
   256         }
       
   257     if(aEvent.iDownloadState == EHttpDlCompleted)
       
   258         {
       
   259         iLog->Log(_L("EHttpDlCompleted "));
       
   260         }
       
   261     if(aEvent.iDownloadState == EHttpDlFailed)
       
   262         {
       
   263         iLog->Log(_L("EHttpDlFailed "));
       
   264         }
       
   265     }
       
   266 // End of File
   147 // End of File