TTimeIntervalMicroSeconds

Login to reply to this topic.
Fri, 2005-02-18 15:16
Joined: 2005-02-18
Forum posts: 10
Code:
TTimeIntervalMicroSeconds a(0);
iMdaAudioPlayerUtility->GetPosition(a+500);
a=a+500;

trying to fastforward audio playback.. not sure if im going about it the right way. The above code doesn't work just put it there to give an idea of the way im thinking.

i know to add there is
Quote
TTime operator+(TTimeIntervalMicroSeconds aMicroSecond) const;
but dont know how to use it

any help

Fri, 2005-02-18 15:33
Joined: 2004-07-28
Forum posts: 1379
TTimeIntervalMicroSeconds
GetPosition gives you the current position - and is used like this

TTimeIntervalMicroSeconds aTime;
iMdaAudioPlayerUtility->GetPosition(aTime);

SetPosition would be used to set the position, so to fastforward 500 microseconds:

TTimeIntervalMicroSeconds aTime;
iMdaAudioPlayerUtility->GetPosition(aTime);

aTime += TTimeIntervalMicroSeconds(500);

iMdaAudioPlayerUtility->SetPosition(aTime);

didster

Fri, 2005-02-18 17:05
Joined: 2005-02-18
Forum posts: 10
TTimeIntervalMicroSeconds
thanks

still doesnt work though, get the following error

Quote
error C2676: binary '+=' : 'class TTimeIntervalMicroSeconds' does not define this operator or a conversion to a type acceptable to the predefined operator
Sat, 2005-02-19 11:59
Joined: 2004-07-28
Forum posts: 1379
TTimeIntervalMicroSeconds
Ok,

Try aTime += 500;

and if that doesn't work,

try

aTime = aTime + TTimeIntervalMicroSeconds(500);

didster

Sat, 2005-02-19 14:26
Joined: 2005-02-18
Forum posts: 10
TTimeIntervalMicroSeconds
still the same error for first one but second gives
Quote
error C2678: binary '+' : no operator defined which takes a left-hand operand of type 'class TTimeIntervalMicroSeconds' (or there is no acceptable conversion)


must be something stupid I've missed,
I've included   #include <e32std.h>

can't think what else  I'm doing wrong though
Sat, 2005-02-19 23:33
Joined: 2004-10-31
Forum posts: 92
Use the Int64() method
I think you need to use Int64() to retrieve the interval as a value you can manipulate with a + operator.
Mon, 2005-02-21 09:47
Joined: 2004-07-28
Forum posts: 1379
TTimeIntervalMicroSeconds
Ive just checked, and that wont work either as Int64 returns a const TInt64&.

You will have to do it like this:

TTimeIntervalMicroSeconds aTime;
iMdaAudioPlayerUtility->GetPosition(aTime);

TTimeIntervalMicroSeconds aTimeNew = aTime.Int64() + 500;
iMdaAudioPlayerUtility->SetPosition(aTime);

didster

Mon, 2005-02-21 09:58
Joined: 2004-12-03
Forum posts: 192
TTimeIntervalMicroSeconds
Quote from: didster
You will have to do it like this:

TTimeIntervalMicroSeconds aTime;
iMdaAudioPlayerUtility->GetPosition(aTime);

TTimeIntervalMicroSeconds aTimeNew = aTime.Int64() + 500;
iMdaAudioPlayerUtility->SetPosition(aTimeNew);
Mon, 2005-02-21 10:00
Joined: 2004-07-28
Forum posts: 1379
TTimeIntervalMicroSeconds
lol yeah thats the one.  it's too early...

didster

Wed, 2005-02-23 11:45
Joined: 2005-02-18
Forum posts: 10
TTimeIntervalMicroSeconds
cool that works great thanks
Wed, 2005-02-23 11:51
Joined: 2005-02-18
Forum posts: 10
TTimeIntervalMicroSeconds
okay compiling was all going well then came up with fatal error u1077 'perl' 0x1 .....

had the 6.1 sdk then installed the 7.0 so could be something to do with that.. have the latest version of perl. do I need a different one for it to work ??
  • Login to reply to this topic.