improvements for movie

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
jcoggins
User
User
Posts: 25
Joined: Sat Apr 12, 2008 12:30 am

improvements for movie

Post by jcoggins »

1. MovieDuration = returns the length (in milliseconds) of a movie (including .mp3 files). Perhaps MovieInfo could be expanded to include this.

2. MovieStatus needs to be expanded to return a status for audio files (such as .mp3 files) in addition to video files.

Jason
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: improvements for movie

Post by traumatic »

I know this is the "Feature Requests and Wishlists" section and your request
is perfectly valid but I thought I'd let you know that LoadMovie() kind of gives
you full access to DirectShow (on windows). Don't know if this helps...

http://www.purebasic.fr/english/viewtopic.php?t=13282 (old code, old PB)
Good programmers don't comment their code. It was hard to write, should be hard to read.
jcoggins
User
User
Posts: 25
Joined: Sat Apr 12, 2008 12:30 am

Post by jcoggins »

I currently use LoadMovie() but I am need a way to put a list of songs in an array and play each song in the array one after another one at a time. I am having trouble starting subsequent songs after the first because I can find no way of knowing when the first song has finished.

If these new commands were available, especially the MovieStatus() command, I could do this easily.

Jason
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: improvements for movie

Post by UserOfPure »

From the manual:
Note: Be careful with this function when using sounds (e.g. MP3) as no pictures (frames) exist.
So how is the command supposed to know when a song is finished if it has no frames for a reference?
jcoggins
User
User
Posts: 25
Joined: Sat Apr 12, 2008 12:30 am

Post by jcoggins »

My point exactly. There is no way to tell if an audio file has finished playing. It would be nice to have a command which detects when an audio file has finished playing.

It would also be nice to have another command that gives the length of an audio file (in milliseconds).

Just two ideas that would make the language better.

Jason
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re:

Post by PB »

I was going to have an MP3 player in my app but then discovered that
there's no way to know when a song has finished (because MP3s don't
have video frames, and thus the MovieStatus() command can't help).
Has anyone ever found a solution for this, yet? There is a procedure
in the forums for "IsSoundPlaying" (or something) but that's only for
WAVs and not MP3s. :(

Actually, it looks like the code here might have the solution:

http://www.codeproject.com/KB/audio-vid ... Winmm.aspx

Have to have a play and see what I come up with. But a native way
to know when an MP3 (or any given media file) has finished would be
the best outcome.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: improvements for movie

Post by Marco2007 »

I remember, that there were problems (= I had problems with Songs longer than 3:33 min or so) , but I just tried some mp3-Files again with 4.51RC1 x86 (XP and Win7)...
MovieStatus seems to work also with mp3-Files now...
...will test more...
PureBasic for Windows
Post Reply