473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Shouldn't GetRate() return a float?


Hi.

I'm using a QuickTime movie.
This code:

document.movie.SetRate(0.5);
alert( document.movie.GetRate() );

will correctly set the movie rate to 0.5, but GetRate() will return 0,
not 0.5 .

How can I solve this problem?
I have tried to parseFloat() the value returned from GetRate(), but it
hasn't worked.

Thanks.
Tristan
Aug 21 '06 #1
4 1601
Tristan wrote:
>
Hi.

I'm using a QuickTime movie.
This code:

document.movie.SetRate(0.5);
alert( document.movie.GetRate() );

will correctly set the movie rate to 0.5, but GetRate() will return 0,
not 0.5 .

How can I solve this problem?
I have tried to parseFloat() the value returned from GetRate(), but it
hasn't worked.

Thanks.
Tristan
Hi,

Yes, according to the API setRate expects a float, so you are not making a
mistake.

But getRate() returns 0 if:
1) The movie is finished.
2) The movie is paused (via userinteraction eg)

Could any of them apply to your situation when you call getRate()?

Regards,
Erwin Moller
Aug 21 '06 #2
Erwin Moller wrote:
Tristan wrote:
>>
Hi.

I'm using a QuickTime movie.
This code:

document.movie.SetRate(0.5);
alert( document.movie.GetRate() );

will correctly set the movie rate to 0.5, but GetRate() will return 0,
not 0.5 .

How can I solve this problem?
I have tried to parseFloat() the value returned from GetRate(), but it
hasn't worked.

Thanks.
Tristan

Hi,

Yes, according to the API setRate expects a float, so you are not making a
mistake.

But getRate() returns 0 if:
1) The movie is finished.
2) The movie is paused (via userinteraction eg)

Could any of them apply to your situation when you call getRate()?

Regards,
Erwin Moller

Oh, here is the rather long URL for the API and also the notes on when it
returns 0.

http://developer.apple.com/documenta...ipt/index.html
click a few times 'next page' to reach it.

Regards,
Erwin Moller
Aug 21 '06 #3
On Mon, 21 Aug 2006 15:01:08 +0200, Erwin Moller
<si******************************************@spam yourself.comwrote:
Yes, according to the API setRate expects a float, so you are not making a
mistake.
Yes, and the movie correctly will slow down.
But getRate() returns 0 if:
1) The movie is finished.
2) The movie is paused (via userinteraction eg)
Could any of them apply to your situation when you call getRate()?
No, I execute that code while the movie is playing, and if it'd be
paused, SetRate(0.5) should start it. :-(
click a few times 'next page' to reach it.
Here it is (it's the reference I'm using):
<http://snipurl.com/v9np>

The problem is that GetRate() seems to return an integer:

m = '';
mov.SetRate(0.98); m += mov.GetRate() + ' ';
mov.SetRate(-0.44); m += mov.GetRate() + ' ';
mov.SetRate(3.75); m += mov.GetRate() + ' ';
mov.SetRate(-3.5); m += mov.GetRate() + ' ';
alert(m);

will return me this alert msg: '0 0 3 -3 '.

The movie will correctly run at the rates specified, but GetRate() won't
give the correct (float) values.

I've tried the code on Firefox 1.5, Opera 9 and IE7beta2.
Whit the QT plugin v7.0.4.

I can't find any solution with google. :/
I'll try to contact the Apple Team.

Thanks,
Tristan
Aug 21 '06 #4
On Mon, 21 Aug 2006 15:01:08 +0200, Erwin Moller
<si******************************************@spam yourself.comwrote:
Yes, according to the API setRate expects a float, so you are not making a
mistake.
Yes, and the movie correctly will slow down.
But getRate() returns 0 if:
1) The movie is finished.
2) The movie is paused (via userinteraction eg)
Could any of them apply to your situation when you call getRate()?
No, I execute that code while the movie is playing, and if it'd be
paused, SetRate(0.5) should start it. :-(
click a few times 'next page' to reach it.
Here it is (it's the reference I'm using):
<http://snipurl.com/v9np>

The problem is that GetRate() seems to return an integer:

m = '';
mov.SetRate(0.98); m += mov.GetRate() + ' ';
mov.SetRate(-0.44); m += mov.GetRate() + ' ';
mov.SetRate(3.75); m += mov.GetRate() + ' ';
mov.SetRate(-3.5); m += mov.GetRate() + ' ';
alert(m);

will return me this alert msg: '0 0 3 -3 '.

The movie will correctly run at the rates specified, but GetRate() won't
give the correct (float) values.

I've tried the code on Firefox 1.5, Opera 9 and IE7beta2.
Whit the QT plugin v7.0.4.

I can't find any solution with google. :/
I'll try to contact the Apple Team.

Thanks,
Tristan

ps. sorry for a possible double-post: I posted with my brother's
account, too.

Aug 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tim Wesson | last post by:
Does anyone know if it is possible to choose between the below templates (or similar ones) according to the promotion rules for types T and U? Thanks, Tim Wesson.
4
by: Ahmed Ossman | last post by:
hi, I want to save the return value from the signal() function, what is the type of the variable. i.e. I want to do the following: <variable type?> ret_sig = signal(......); I need it soo...
2
by: Aryeh M. Friedman | last post by:
If I have something like this: class NumberException { }; class Number { public: ... virtual unsigned long getValue() {throw(NumberException);}; ...
3
by: Pushker Pradhan | last post by:
I have a function which should allocate memory, initialize it to some values and return the address of the initialized memory to the calling function. void getWaveletCoeffs(float *ld, float *hd,...
11
by: Marcus Jacobs | last post by:
Dear Group I have written a file conversion program that uses strtof to convert text strings to floats. It works as I intended except for my error messages. It is my understanding that strtof...
5
by: jmd | last post by:
hello. i am trying VC++ 7.1 (with vsnet 2003). my example : class Complex { public: Complex ( float re_ = 0.0, float im_ = 0.0 ) : re(re_), im(im_) {} float Re () { return ( re ); } float...
18
by: skishorev | last post by:
Hi, Here I am taking two functions. void f(int,int) and another one is float f(int,int). Is it possible to overload with return values. Thx, kishore
5
by: C++Liliput | last post by:
Consider the following code template<class T1, class T2> T2 sum(T1 a, T1 b) { T2 ret = a + b; return ret; } int main()
2
by: alishaikhji | last post by:
I am working on a program which will need several different integer and float random numbers at different stages, for example: - At one point, I need a random number (float) in the range 0.1 to 10.0...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.