Hi All.
Ok, I have it working⊠so far⊠based on everything I learned from reading and you folks. For someone in the future, hopefully this helps them.
In the graphic interface, the user chooses options they want (fullscreen, loop, no audio, etc)
When the app starts, in the Opening event, the 3 timers I have are disabled
// disable the timer so we can select what we want first
windowNewSequentialMoviePlayerVLC.Timer1.Enabled = FALSE
windowNewSequentialMoviePlayerVLC.TimerCountdownToStart.Enabled = FALSE
windowNewSequentialMoviePlayerVLC.timerEndVLC.Enabled = FALSE
Then they push the button to start the program where my timers are enabled.
// set a variable for the progress bar counter
var counterForStartProgressBar as Integer
// reset the progress counter bar to zero
windowNewSequentialMoviePlayerVLC.progressCountdownBar.Value = 0
// set the timer1 (start time timer) maximum value to what has been chosen
// yes I know that I can⊠precompress 60 * 1000 to 60000 to convert the minutes the user
// added to milliseconds, but I prefer to do it this way. 60 seconds in a minute, times 1000
// to convert it to milliseconds.
windowNewSequentialMoviePlayerVLC.timer1.Period = (windowNewSequentialMoviePlayerVLC.textStartAfterTime.text.toInteger * 60 * 1000)
windowNewSequentialMoviePlayerVLC.timerEndVLC.Period = (windowNewSequentialMoviePlayerVLC.textStartAfterTime.text.ToInteger * 60 * 1000) + (windowNewSequentialMoviePlayerVLC.textPlayForTime.text.ToInteger * 60 * 1000)
// enable the timer and start the show
windowNewSequentialMoviePlayerVLC.Timer1.Enabled = TRUE
windowNewSequentialMoviePlayerVLC.TimerCountdownToStart.Enabled = TRUE
windowNewSequentialMoviePlayerVLC.timerEndVLC.Enabled = TRUE
Timer1, the start time (how long to wait before running the program, etc) I do the following:
// now run the shell
app.testTheShellCommand = New Shell
app.testTheShellCommand.ExecuteMode = Shell.ExecuteModes.Asynchronous
app.testTheShellCommand.Execute ("/Applications/VLC.app/Contents/MacOS/VLC " + app.fullScreenValue + " " + app.randomPlayingOrder + " " + app.loopVideos + " " + app.muteTheAudio + " /Users/xxxxxxxxxx/Desktop/basicMovieVideos/*.*â)
// for testing only
System.DebugLog "app.fullscreen = " + app.fullScreenValue
System.DebugLog "app.randomPlayingOrder = " + app.randomPlayingOrder
System.DebugLog "app.loopVideos = " + app.loopVideos
System.DebugLog "app.muteTheAudio = " + app.muteTheAudio
Note that I took the advice to make the varible to make the run Asynchronous is now a shared property⊠as was suggested by Kevin G, and put it into Async mode, as was suggested by Tim Hare
I have a timer (timerCountdownToStart) which gives a graphic representation of how long before the program starts. Without it, the user doesnât see activity. And I figure it is good idea.
' show a progress bar so the user knows how long until the program starts
var counterForStartProgressBar as Integer
'set the maximum of the progressbar based on what the start time was.
' take the start time value, and multiply by 60
counterForStartProgressBar = (windowNewSequentialMoviePlayerVLC.textStartAfterTime.text.ToInteger * 60)
progressCountdownBar.MaximumValue = counterForStartProgressBar
' see if we have reached value of counterForStartProgressBar... meaning the program should run
if progressCountdownBar.Value < progressCountdownBar.MaximumValue then
'it hasn't reached the max value? Increment
progressCountdownBar.Value = progressCountdownBar.Value + 1
'for testing
System.DebugLog "start ProgressBar value is : " + progressCountdownBar.Value.ToString
else
end if
My third timer (timerEndVLC) is set to terminate the program with a shell command.
var killVLCprogram as New Shell
killVLCprogram.Execute ("pkill VLCâ)
'MessageBox "End timer firedâ
As of this writing, and I am doing more testing, it seems to be operating the way I like it.
I will probably find other things as I add âfeaturesâ but so far so good.
Thanks for all of the help provided. Though I do have one question I need explained.
What is DataAvailable and how do I use it?
Once again, thank you for all of your help.
Regards