mmserv/metadatautility/Src/MetaDataParserID3v23.cpp
changeset 22 128eb6a32b84
parent 0 71ca22bcf22a
child 28 ebf79c79991a
equal deleted inserted replaced
16:43d09473c595 22:128eb6a32b84
   664 	TInt encoding = (TInt) (des.Left(1))[0];
   664 	TInt encoding = (TInt) (des.Left(1))[0];
   665 	TPtrC8 info = StripTrailingZeroes( des.Mid(1), encoding ); // $00
   665 	TPtrC8 info = StripTrailingZeroes( des.Mid(1), encoding ); // $00
   666 	TInt length = info.Length();
   666 	TInt length = info.Length();
   667 	if ( length )
   667 	if ( length )
   668 		{
   668 		{
   669 		TReal sec = ((TReal) atoi((char*)info.Ptr())) / 1000;
   669 		HBufC* data16 = HBufC::NewLC( length );
   670 		TBuf16<10> info1;
   670 		TPtr unicode( data16->Des() );
   671 		info1.Num(sec, TRealFormat (9, 3));
   671 		if ( ConvertToUnicodeL(encoding, info, unicode) == KErrNone )
   672 		iContainer->AppendL( EMetaDataDuration, info1 );
   672 			{
   673 		}
   673 			TLex16 lex(unicode);
   674 
   674 			TReal milliSec = 0;
       
   675 			TBuf16<10> info1;
       
   676 			
       
   677 			lex.Val(milliSec);				
       
   678 			info1.Num(milliSec/1000, TRealFormat (9, 3));
       
   679 			iContainer->AppendL( EMetaDataDuration, info1 );
       
   680 			}
       
   681 		CleanupStack::PopAndDestroy();  // data16
       
   682 		}
   675 	CleanupStack::PopAndDestroy();  // frame
   683 	CleanupStack::PopAndDestroy();  // frame
   676 	}
   684 	}
   677 
   685 
   678 
   686 
   679 // -----------------------------------------------------------------------------
   687 // -----------------------------------------------------------------------------