ExecFile in BlitzMax?

BlitzMax Forums/BlitzMax Beginners Area/ExecFile in BlitzMax?

Yeshu777(Posted 2010) [#1]
Have to say the documentation for BlitzMax reads like a tax return.

Whats the easiest way to call something like mplayer from within BlitzMax?

eg. a similar command to ExecFile in Blitz+.


Secondly, on B+ when drawing text over an image, i used to use

Color(255,0,255)
DrawText(etc)

This also affects the colour of the background image..

Am I missing somthing simple here?

All help appreciated.

Regards


Ked(Posted 2010) [#2]
eg. a similar command to ExecFile in Blitz+.

OpenURL()

Secondly, on B+ when drawing text over an image, i used to use

Color(255,0,255)
DrawText(etc)

This also affects the colour of the background image..

Presently, it would be something like:
SetBlend ALPHABLEND
SetColor 255,0,255
DrawText("Whatever",10,10)

SetBlend SOLIDBLEND 'or ALPHABLEND or LIGHTBLEND or whatever
SetColor 255,255,255
DrawImage(img,0,0)



Yeshu777(Posted 2010) [#3]
Cheers, still getting to grips with BMax.

So OpenURL will execute mplayer on Linux with arguements?


Ked(Posted 2010) [#4]
Yep, it should. I remember OpenURL being "rewritten" in the past to fully execute files, instead of just webpages.


Otus(Posted 2010) [#5]
I'd use System_ "mplayer "+args


Htbaa(Posted 2010) [#6]
To execute processes and have control of them take a look at PUB.FreeProcess. Sadly it isn't documented but just take a look at the source on how to use it. I think CreateProcess(cmd:String) will do the trick.


Ked(Posted 2010) [#7]
I'd use System_ "mplayer "+args

Which is what the linux system driver uses behind OpenURL. :)


Yeshu777(Posted 2010) [#8]
Many thanks for your advice, will give it a whirl.

Best Regards,


GfK(Posted 2010) [#9]
If memory serves, you should probably use driver.OpenURL(). This is called from the regular OpenURL() function after some processing to check for http and such.


Yeshu777(Posted 2010) [#10]
Ok, I've created a few scripts to set system volume, mainly:

amixer -q -c 0 set Master 64

These are all located in the game directory.

When opening a temrinal and in the directory, running the scripts with:

./volume10.sh

works fine.

In my BMax application, using:

System_ ("./volume10.sh")

does nothing if not lock my app up.

What am I missing here?

Best Regards,


Nate the Great(Posted 2010) [#11]
I dont know about whats causing your app to lock up but personally I cant stand games or apps that set the system volume, its really kind of intrusive unless they have a volume control that you can change that will change the system value if you wish to change it but not on startup...


Yeshu777(Posted 2010) [#12]
This is an embedded project, whereby the operator can set the volume of the game terminal in an arcade - however this needs to be done from withing the game code via a menu system.

Anyway, all sorted - BMax V1.36 sorted the problem.

system_("./volume10.sh") does exactly what it should.

;)


Nate the Great(Posted 2010) [#13]
wow I didnt know about the system command...