本文整理汇总了C++中TTimeIntervalMicroSeconds函数的典型用法代码示例。如果您正苦于以下问题:C++ TTimeIntervalMicroSeconds函数的具体用法?C++ TTimeIntervalMicroSeconds怎么用?C++ TTimeIntervalMicroSeconds使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TTimeIntervalMicroSeconds函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoTestStepL
/**
*
* Do the test step.
* Each test step must supply an implementation for DoTestStepL.
*
* @return "TVerdict"
* The result of the test step
*
* @xxxx
*
*/
TVerdict CTestStepToneSetVolumeRamp::DoTestStepL()
{
iTestStepResult = EPass;
TInt ramp = 0;
for (ramp=0; ramp<=1000000; ramp+=1000)
{
iTone->SetVolumeRamp(TTimeIntervalMicroSeconds(ramp));
// no way to check directly since its a SoundDev property which is on the server side
// out of scope to check the SoundDev
//if (static_cast<CMMFMdaAudioToneUtility*>(iTone)->iDevSound->iRampDuration != TTimeIntervalMicroSeconds(ramp) )
// {
// iTestStepResult = EFail;
// }
//checked manualy the CMMFSoundDev and Set seems to work OK
}
// Try also with prepared Tone utility
iTone->PrepareToPlayTone(400,TTimeIntervalMicroSeconds(500000));
CActiveScheduler::Start();
if ( iError != KErrNone ||
iTone->State() != EMdaAudioToneUtilityPrepared )
return EInconclusive;
for (ramp=0; ramp<=1000000; ramp+=1000)
{
iTone->SetVolumeRamp(TTimeIntervalMicroSeconds(ramp));
//checked manualy the CMMFSoundDev and Set seems to work OK
}
INFO_PRINTF1(_L("finished with this test step"));
// test steps return a result
return iTestStepResult;
}
示例2: TTimeIntervalMicroSeconds
// helper function: calculates time between frames
void CMMFRawFormatRead::CalculateFrameTimeInterval()
{
if ((iFrameSize) && (iSampleRate) && (iBitsPerSample) && (iChannels))
{
iFrameTimeInterval = TTimeIntervalMicroSeconds((iFrameSize*KOneSecondInMicroSeconds)/iSampleRate);
iFrameTimeInterval =
TTimeIntervalMicroSeconds(iFrameTimeInterval.Int64()/(iBitsPerSample*iChannels));
iFrameTimeInterval = TTimeIntervalMicroSeconds(iFrameTimeInterval.Int64()*8);
}
}
示例3: __ASSERT_ALWAYS
void CMMFTestVideoDecodeHwDevice::SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition)
{
if (aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPositionFatal))
{
iProxy->MdvppFatalError(this, KErrDied);
}
else
{
__ASSERT_ALWAYS(aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPosition), DevVideoDecoderPanic(EDecoderPanicSetPosition));
}
}
示例4: DP_DTMF_WRITE
// ---------------------------------------------------------------------------
// CDTMFPayloadFormatWrite::FrameTimeInterval
// Gets audio frame size in milliseconds.
// ---------------------------------------------------------------------------
//
TTimeIntervalMicroSeconds CDTMFPayloadFormatWrite::FrameTimeInterval(
TMediaId aMediaType ) const
{
DP_DTMF_WRITE( _L("CDTMFPayloadFormatWrite::FrameTimeInterval") );
if ( KUidMediaTypeAudio == aMediaType.iMediaType )
{
return TTimeIntervalMicroSeconds( TInt64( 0 ) );
}
else
{
return TTimeIntervalMicroSeconds( TInt64( 0 ) );
}
}
示例5: clipLength
// returns the duration of the source clip
TTimeIntervalMicroSeconds CMMFRawFormatRead::Duration(TMediaId aMediaId) const
{
if ((aMediaId.iMediaType == KUidMediaTypeAudio) &&
(iClipLength) && (iSampleRate) && (iBitsPerSample) && (iChannels))
{//we have enough values to calculate the duration
TInt64 clipLength(iClipLength);
clipLength*=KOneSecondInMicroSeconds;
TTimeIntervalMicroSeconds duration = TTimeIntervalMicroSeconds(clipLength/iSampleRate);
duration = TTimeIntervalMicroSeconds(duration.Int64()/(iBitsPerSample*iChannels));
duration = TTimeIntervalMicroSeconds(duration.Int64()*8);
return duration;
}
else return TTimeIntervalMicroSeconds(0);
}
示例6: TTimeIntervalMicroSeconds
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::PositionL
// -----------------------------------------------------------------------------
//
EXPORT_C TTimeIntervalMicroSeconds CAdvancedAudioRecordController::PositionL() const
{
#ifdef _DEBUG
RDebug::Print(_L("CAdvancedAudioRecordController::PositionL"));
#endif
if ( iState == ERecording )
{
return TTimeIntervalMicroSeconds(iTimePositionInMicroSecs + iAudioInput->CalculateAudioInputPositionL());
}
else
{
return TTimeIntervalMicroSeconds(iTimePositionInMicroSecs);
}
}
示例7: TTimeIntervalMicroSeconds
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
void CAlfExAnalogDialerFeedback::Start( TInt aDurationMilliSeconds,
TInt aIntervalMilliSeconds)
{
iDuration = KFeedbackDefault;
iInterval = KFeedbackMinimumInterval;
// 1000: convert millis to micros
if (iFeedback)
{
iFeedback->InstantFeedback(ETouchFeedbackBasic);
}
if ( aIntervalMilliSeconds > KFeedbackMinimumInterval )
{
iInterval = 1000*aIntervalMilliSeconds;
}
if (aDurationMilliSeconds >= KFeedbackMinimumDuration)
{
iDuration = 1000*aDurationMilliSeconds;
iDurationStop.HomeTime();
iDurationStop += TTimeIntervalMicroSeconds(TInt64(iDuration));
iClock->Cancel();
iClock->Start( iInterval,
iInterval,
TCallBack( HandleInterval, this ));
}
}
示例8:
/** Verify CMMFPtrBuffer status checking
* Use case: N/A
* @test Req. under test PREQ 10
*/
TVerdict CTestStep_MMF_BASECL_U_0157::DoTestStepL( void )
{
TVerdict verdict = EPass;
const TInt KMMFTestTime = 1234567890;
CMMFPtrBuffer* ptrBuffer = CMMFPtrBuffer::NewL(); //create descriptor buffer
//check that the initial time to play is 0
if (ptrBuffer->TimeToPlay() != TTimeIntervalMicroSeconds(0)) verdict = EFail;
//assign a timestamp and check it is set correctly
ptrBuffer->SetTimeToPlay(TTimeIntervalMicroSeconds(KMMFTestTime));
if (ptrBuffer->TimeToPlay() != TTimeIntervalMicroSeconds(KMMFTestTime)) verdict = EFail;
delete ptrBuffer;
return verdict;
}
示例9: SetupPsyL
// ---------------------------------------------------------
// CT_LbsClientPosTp194::StartL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsClientPosTp194::StartL()
{
SetupPsyL(iUidMultiPsy);
TInt numberOfRuns = 100;
TTimeIntervalMicroSeconds interval5 = TTimeIntervalMicroSeconds(4000000);
TUid uid = iUidMultiPsy;
CT_LbsClientPeriodicTester* periodicTester1 = CT_LbsClientPeriodicTester::NewL(interval5, KServiceName1, iLog, uid, numberOfRuns);
CleanupStack::PushL(periodicTester1);
CT_LbsClientPeriodicTester* periodicTester2 = CT_LbsClientPeriodicTester::NewL(interval5, KServiceName2, iLog, uid, numberOfRuns);
CleanupStack::PushL(periodicTester2);
periodicTester1->RequestNotification();
periodicTester2->RequestNotification();
// Active scheduler is stopped two times.
CActiveScheduler::Start();
CActiveScheduler::Start();
//check for errors
TBool test1 = periodicTester1 -> IsCompletedOK();
TBool test2 = periodicTester2 -> IsCompletedOK();
CleanupStack::PopAndDestroy(2,periodicTester1);
if (!test1 || !test2)
{
_LIT(KError, "Test did not complete with no error, check log file");
LogErrorAndLeaveL(KError);
}
}
示例10: PackPositionData
void CPositionRequest::CompleteRequest(TInt aReason)
{
// Return fix to the client
if (aReason == KErrNone || aReason == KPositionPartialUpdate)
{
TInt err = PackPositionData();
// err - client cannot receive result data
CompleteClient((err != KErrNone) ? err : aReason);
// Save current fix to LastKnownPosition handler
// partial updates are not stored
if ( aReason == KErrNone )
{
SaveAsLastKnownPosition();
}
}
else
{
CompleteClient(aReason);
}
// If the request is not tracking mode, deactivate the indicator
// Tracking mode check and the last check for the error scenarios other than
// KErrNone and KPositionPartialUpdate.
if( ( ( iTrackingState == EPosFirstTrackingRequest || iTrackingState == EPosTracking ) &&
iTrackingUpdateInterval > KIndFlickerTresholdTracking ) ||
iTrackingUpdateInterval == TTimeIntervalMicroSeconds ( 0 ) ||
!( aReason == KErrNone || aReason == KPositionPartialUpdate ) )
{
DeActivatePositioningStatusIfNeeded();
}
}
示例11: TTimeIntervalMicroSeconds
// ---------------------------------------------------------------------------
// TEST CASE: Start timer with After (64 bit) without connecting first
// ---------------------------------------------------------------------------
//
TInt CTestRFlexTimer::After64WithoutConnect(
TTestResult& aResult,
CTestFlexTimer* aCallback )
{
TRequestStatus status;
// Test should panic with
// Category: "KERN-EXEC"
// Reason: 0
aCallback->TestModuleIf().SetExitReason(
CTestModuleIf::EPanic,
0 );
// Do the actual test
//-----------------------------------------------------
RFlexTimer timer;
timer.After( status, TTimeIntervalMicroSeconds( 1000000 ) );
User::WaitForRequest( status ); // PANIC
timer.Close();
//-----------------------------------------------------
// No panic, change result back to normal
aCallback->TestModuleIf().SetExitReason(
CTestModuleIf::ENormal,
KErrNone );
aResult.SetResult( KErrGeneral, _L("Test case failed. No panic.") );
return KErrNone;
}
示例12: SetAbsoluteTimeout
void SetAbsoluteTimeout(RTimer& aTimer, TUint aUs, TRequestStatus& aStatus)
{
TTime wakeup;
wakeup.HomeTime();
wakeup += TTimeIntervalMicroSeconds(aUs);
aTimer.At(aStatus, wakeup);
}
示例13: TTimeIntervalMicroSeconds
/**
* Implementation of the MMdaAudioPlayerCallback interface functions
**/
void CTestStepPlayerAllocFailOpenFile::MapcInitComplete(TInt aErrorcCode,
const TTimeIntervalMicroSeconds &/*aDuration*/)
{
#ifdef __WINS__
iKErrGeneralIgnored = EFalse;
if ( aErrorcCode == KErrGeneral )
iKErrGeneralIgnored = ETrue; //Ignore KErrGeneral on EMULATOR
#endif
if ( aErrorcCode == KErrNone || aErrorcCode == KErrNoMemory )
{
iAllocOK = ETrue;
if ( aErrorcCode == KErrNone
&& iPlayer->Duration() > TTimeIntervalMicroSeconds(0) )
{
iResultOK = ETrue;
}
}
else
{
INFO_PRINTF2(_L("Unexpected error %d seen"), aErrorcCode);
iAllocOK = EFalse;
}
CActiveScheduler::Stop();
}
示例14: _LIT
void CPosition::ConstructL()
{
User::LeaveIfError(iServer.Connect());
User::LeaveIfError(iPositioner.Open(iServer));
_LIT(KRequestor, "OpenMAR" );
User::LeaveIfError(iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KRequestor));
const TInt KSecond = 1000000;
TPositionUpdateOptions updateOptions;
updateOptions.SetUpdateInterval(TTimeIntervalMicroSeconds(10 * KSecond));
updateOptions.SetUpdateTimeOut(TTimeIntervalMicroSeconds(30 * KSecond));
updateOptions.SetMaxUpdateAge(TTimeIntervalMicroSeconds(1 * KSecond));
updateOptions.SetAcceptPartialUpdates(EFalse);
User::LeaveIfError(iPositioner.SetUpdateOptions(updateOptions));
}
示例15: FrameTimeIntervalCalculation
EXPORT_C TTimeIntervalMicroSeconds FrameTimeIntervalCalculation(
TUint aFrameSize,
TUint aAvgBytesPerSecond)
{
return(TTimeIntervalMicroSeconds(
TInt64(aFrameSize) * TInt64(KOneSecondInMicroSeconds) /
TInt64(aAvgBytesPerSecond)));
}