BlitzMovie Question

Community Forums/Developer Stations/BlitzMovie Question

jfk EO-11110(Posted 2004) [#1]
Did someone of you try BlitzMovie 1.1? Does it support to set the Audio Volume of a Movie stream?


IPete2(Posted 2004) [#2]
Jfk,

why don't you try it yourself as no-one else seems to have tried it?

IPete2.


jfk EO-11110(Posted 2004) [#3]
Because I need to set up a local network to copy the file to my dev machine and because I hate to start an EXE just to unpack a library. - why does it have to be EXE anyway?


Rhyolite(Posted 2004) [#4]
I just tried it, and no volume commands listed in documentation.

Also, maybe I am doing something wrong but the standard blitz direct show commands play quicker than the non-D3D Blitzmovie1.1 commands.

I am having problems with the D3D commands. They work fine in the demo, even when I use my own avi file. But can not incorporate into my project for some reason (obviously a mistake on my part). So, can not comment too much on B3D commands, but the demo runs at least as smoothly as blitz native direct show commands.

Lastly, there does not appear to be any 'IsMoviePlaying' command. Without this, its a bit of a pain to use for my purposes.

Maybe I am missing something, but I will be sticking with native blitz commands (which also cuts out the risk of 'middleware'). All I want to do is play an intro movie! Forgive me if I am misrepresenting this tool due to my own ignorance ;)


xmlspy(Posted 2004) [#5]
Solution to Movie volume controls:
Separate Sound from Movie
Start them individually, or create functions to manage everything for you.

Here's something I made in about five to ten minutes, it could help you.

;XMovie  - Jesse Andersen ( jesse_andersengt@... )

Type Movie
	Field MovieFileName$
	Field Movie
	Field x#, y#, width#, height#
	Field SoundFileName$
	Field Channel
	Field Volume#, Pitch, Pan#
End Type


Function LoadMovie( MovieFileName$, SoundFileName$ = "", x# = 0, y# = 0, width# = 0, height# = 0, Volume# = 1, Pitch = 44000, Pan# = 0 )
	If FileType( MovieFileName$ ) = 1 Then
		Movie.Movie = New Movie
			Movie\MovieFileName$ = MovieFileName$
			Movie\SoundFileName$ = SoundFileName$
			Movie\x# = x#
			Movie\y# = y#
			If width# = 0 Then width# = GraphicsWidth()
			If height# = 0 Then height# = GraphicsHeight
			Movie\width# = width#
			Movie\height# = height
			Movie\Volume# = Volume#
			Movie\Pitch = Pitch
			Movie\Pan = Pan#
			
			Return Handle( Movie )
	EndIf
	Return False
End Function

Function PlayMovie( Id )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Movie\Movie = OpenMovie( Movie\MovieFileName$ )
		Movie\Channel = PlayMusic( Movie\SoundFileName$ )
		Return True
	EndIf
	Return False
End Function

Function RenderMovie( )
	For Movie.Movie = Each Movie
		DrawMovie Movie\Movie, Movie\x#, Movie\y#, Movie\width#, Movie\height#
	Next
End Function

Function MovieDrawArea( Id, x# = 0, y# = 0, width# = 0, height# = 0 )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Movie\x# = x#
		Movie\y# = y#
		If width# = 0 Then width# = GraphicsWidth()
		If height# = 0 Then height# = GraphicsHeight
		Movie\width# = width#
		Movie\height# = height#
	EndIf
End Function
		

Function MovieVolume( Id, Volume# = 1 )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Movie\Volume# = Volume#
		ChannelVolume Movie\Channel, Movie\Volume#
	EndIf
End Function

Function MoviePitch( Id, Pitch = 44000 )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Movie\Pitch = Pitch
		ChannelPitch Movie\Channel, Movie\Pitch
	EndIf
End Function

Function MoviePan( Id, Pan# = 0 )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Movie\Pan# = Pan#
		ChannelPan Movie\Channel, Movie\Pan#
	EndIf
End Function

Function IsMoviePlaying( Id )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		Return MoviePlaying( Movie\Movie )
	EndIf
End Function

Function StopMovie( Id )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		If MoviePlaying( Movie\Movie ) Then CloseMovie( Movie\Movie )
		If ChannelPlaying( Movie\Channel ) Then StopChannel( Movie\Channel )
	EndIf
End Function

Function DeleteMovie( Id )
	Movie.Movie = Object.Movie( Id )
	If Movie.Movie <> Null Then
		If MoviePlaying( Movie\Movie ) Then CloseMovie( Movie\Movie )
		If ChannelPlaying( Movie\Channel ) Then StopChannel( Movie\Channel )
		Delete Movie
	EndIf
End Function



dcs(Posted 2004) [#6]
Hi all, this weekend or soon after, I'll add volume control of a movie and an "IsMoviePlaying" command. Busy playing Half Life 2 at the moment... Any other requests?


jfk EO-11110(Posted 2004) [#7]
Hey, cool! BTW is it possible to open and play multiple (well, 2) Movies simultanously? I mean, in the same App window?


dcs(Posted 2004) [#8]
@jfk: From inside the dll, it's possible to open / play / render multiple movies but it's not supported with the current BlitzMovie Blitz-to-dll interface. I will probably add support for this in the next major version.

Also, the latest version was packed into an exe because it used the very efficient 7-zip format to save bandwidth on my website (gigs are being downloaded currently), without the need to have 7-zip itself installed.