PDA

View Full Version : Changing value of a variable



mdekort
April 23rd, 2009, 07:51 AM
I would like to do the following for playing movies in Zoomplayer:
When I push my "play" button in NR I want first to run a few actions (like dimming lights etc.) in Girder before the movie actually starts to play. What I mean is NR should wait to send the play command to Zoomplayer until Girder is done and gives the OK.
I guess this can be done by changing the value of a variable but it didn't work so far for me.

in NR I created those actions:

Girder: Register variable for feedback(MovieReady)
NR Basic: Set variable to value (MovieReady,0)
Girder: send event to Girder (PLAYFILE) --- changes light settings etc. ---
NR Basic: Stop all actions if the specified variable does not equal the value (MovieReady,1)
Zoom: play media file (E:\xxxx.mkv)

in Girder:
several actions to dim the lights etc.
then
Set variable(client) : [MovieReady] and value "1"

I thought NR would run all the actions and then stops until the variable "MovieReady" is changed to "1" by Girder and then continue with the ZOOM action.
It seems NR doesn't get the updated value from Girder.
Anything wrong with my actions or variables?

Thanks for help
Michael

Rob H
April 23rd, 2009, 08:50 AM
That won't work I don't think. Personally I would have Girder starting ZoomPlayer, or if you really want NR to do it then maybe use a bit of Lua to do it. e.g.


NetRemote.SetVariable('MovieReady', 0);
NetRemote.RegisterVariableWatch('MovieReady',
function(var, value)
if value == '1' then
-- add the action here to play the movie
end
end)

Then when Girder sets MovieReady to 1 NR will call that function.

mdekort
April 23rd, 2009, 09:08 AM
Thanks Rob. I will try this.
I put this code in the LUA file created by NRD associated to the CCF?


Actually I wanted Girder to start ZoomPlayer together with the movie I selected in NR and I posted a thread regarding this in the forum:
http://promixis.com/forums/showthread.php?t=19806
Vic tried to help me but unfortunately it still doesn't work.

Rob H
April 23rd, 2009, 10:52 AM
Yes, you'll need to supply the action to start ZoomPlayer where the comment is there. Something like


NetRemote.ExecuteAction(-1018, 0, 6224, pathOfMediaFile)
Where pathOfMediaFile is the path to the file you want to play. I got the magic numbers there by adding a ZoomPlayer:Play media file action to a button and examining the Action ID shown in the dialog that appears.

mdekort
April 23rd, 2009, 11:53 AM
Yes, you'll need to supply the action to start ZoomPlayer where the comment is there. Something like


NetRemote.ExecuteAction(-1018, 0, 6224, pathOfMediaFile)
Where pathOfMediaFile is the path to the file you want to play. I got the magic numbers there by adding a ZoomPlayer:Play media file action to a button and examining the Action ID shown in the dialog that appears.

Thanks again and sorry about all those questions. Just a little lost sometimes.

I stored the name from the movie in a variable called "slotnumber" in NR.
can pathOfMediaFile be : E:\{slotnumber}.mkv ??

Michael

Rob H
April 23rd, 2009, 01:40 PM
If that's a literal string then don't forget about the backslashes, ie use [[ and ]] to delimit the string