EXPORT_C void COggVorbisFile::SetPositionL(TTimeIntervalMicroSeconds aPos) { // using tremor: so milliseconds not seconds TInt64 milliseconds = aPos.Int64()/TInt64(1000); //RDebug::Printf("SetPositionL: %f\n", milliseconds.GetTInt()); iBody->SetPositionL(milliseconds.GetTInt()); }
EXPORT_C int symbian_get_cpu_time(long* sec, long* usec) { // The RThread().GetCpuTime() does not seem to work? // (it always returns KErrNotSupported) // TTimeIntervalMicroSeconds ti; // TInt err = me.GetCpuTime(ti); dTHX; TInt periodus; /* tick period in microseconds */ if (HAL::Get(HALData::ESystemTickPeriod, periodus) != KErrNone) return -1; TUint tick = User::TickCount(); if (PL_timesbase.tms_utime == 0) { PL_timesbase.tms_utime = tick; PL_clocktick = PERL_SYMBIAN_CLK_TCK; } tick -= PL_timesbase.tms_utime; TInt64 tickus = TInt64(tick) * TInt64(periodus); TInt64 tmps = tickus / 1000000; #ifdef __SERIES60_3X__ if (sec) *sec = I64LOW(tmps); if (usec) *usec = I64LOW(tickus) - I64LOW(tmps) * 1000000; #else if (sec) *sec = tmps.Low(); if (usec) *usec = tickus.Low() - tmps.Low() * 1000000; #endif //__SERIES60_3X__ return 0; }
void CSettingsClient::StoreSettingL(const TDesC& aCategory,const TDesC& aNameHigh,const TDesC& aNameLow,const TInt64& aValue) { TInt old; TInt err=iSettings.Get(aCategory,aNameHigh,old); if(err!=KErrNotFound) User::LeaveIfError(err); if(err==KErrNotFound||(TUint)old!=aValue.High()) User::LeaveIfError(iSettings.Set(aCategory,aNameHigh,aValue.High())); err=iSettings.Get(aCategory,aNameLow,old); if(err!=KErrNotFound) User::LeaveIfError(err); if(err==KErrNotFound||(TUint)old!=aValue.Low()) User::LeaveIfError(iSettings.Set(aCategory,aNameLow,aValue.Low())); }
EXPORT_C void TE64Addr::SetAddr(const TInt64& aAddr) { #ifdef I64HIGH u.iAddr32[0] = I64HIGH(aAddr); u.iAddr32[1] = I64LOW(aAddr); #else u.iAddr32[0] = aAddr.High(); u.iAddr32[1] = aAddr.Low(); #endif }
void CSettingsClient::LoadSettingL(const TDesC& aCategory,const TDesC& aNameHigh,const TDesC& aNameLow,TInt64& aValue) { TInt high,low; TInt err=iSettings.Get(aCategory,aNameHigh,high); if(err!=KErrNotFound) User::LeaveIfError(err); if(err==KErrNone) err=iSettings.Get(aCategory,aNameLow,low); if(err!=KErrNotFound) User::LeaveIfError(err); if(err==KErrNone) aValue.Set(high,low); else aValue.Set(6,0xb49d2000); }
CVMInt64 CVMtimeMillis(void) { TTime now; now.HomeTime(); TInt64 t = now.Int64(); TInt64 millis = (t - SYMBIANjavaEpoc) / 1000; #ifdef EKA2 return (CVMInt64)millis; #else CVMInt64 delta = millis.Low(); delta += (CVMInt64)millis.High() << 32; return delta; #endif }
EXPORT_C void TSTStringFormatter::AppendFileLength(TInt64 aLength, TDes &aLengthStr) { if (aLength<0) return; TInt range; for (range=0;range<3;++range) { if (aLength<1000*1000) break; // keep some digits from fraction aLength/=1000; } #ifdef EKA2 TReal len=aLength; #else TReal len=aLength.GetTInt(); #endif if (len>1000) { len/=1000; ++range; } if (range==0) aLengthStr.AppendFormat(_L("%.0f"),len); else aLengthStr.AppendFormat(_L("%.1f"),len); switch (range) { case 0: aLengthStr.Append(_L(" B")); break; case 1: aLengthStr.Append(_L(" kB")); break; case 2: aLengthStr.Append(_L(" MB")); break; case 3: aLengthStr.Append(_L(" GB")); break; case 4: aLengthStr.Append(_L(" TB")); break; default: __ASSERT_DEBUG(false,User::Panic(_L("#TStringFormatter"),0)); } }
void DMediaDriverTest::DoFormat(TInt64 &aPos,TInt aLength) // // Format the specified area of the media. // { Mem::Fill(&iBuf[aPos.Low()],aLength,0xFF); iFormatTickLink.OneShotInMicroSeconds(KFormatAsyncTime,DMediaDriverTest::FormatCompleteCallBack,this); }
void DMediaDriverTest::DoWrite(TInt64 &aPos,TInt aLength,TMediaDrvDescData &aSrc) // // Write to specifed area of media. // { if (!aSrc.IsCurrentThread()) Complete(KMediaDrvWriteReq,KErrGeneral); else { Mem::Copy(&iBuf[aPos.Low()],((TDesC8*)aSrc.iPtr)->Ptr()+aSrc.iOffset,aLength); iWriteTickLink.OneShotInMicroSeconds(KWriteAsyncTime,DMediaDriverTest::WriteCompleteCallBack,this); } }
void DMediaDriverTest::DoRead(TInt64 &aPos,TInt aLength,TMediaDrvDescData &aTrg) // // Read from specified area of media. // { TInt ret=KErrNone; if (!aTrg.IsCurrentThread()) ret=KErrGeneral; else { if ((ret=aTrg.CurrentThreadDescCheck(aLength))==KErrNone) { TDes8 &t=*((TDes8*)aTrg.iPtr); Mem::Copy((TAny*)(t.Ptr()+aTrg.iOffset),&iBuf[aPos.Low()],aLength); t.SetLength(aLength+aTrg.iOffset); } } Complete(KMediaDrvReadReq,ret); }