PDA

View Full Version : Programming feedback buttons in NR



K-Wood
February 25th, 2003, 09:47 PM
I'm trying to develop a series of feedback buttons in NR to show the status of my Anthem AVM-2 pre/pro.

My goal is to have buttons in NR that trigger query commands and generate responses based on the status of the pre/pro: for example - what source is selected, whether Zone 2 is on/off and what source is selected for Zone 2, etc.

With the help of several experts on the Girder forum, I've written some short scripts to work with the serial plugin that parse the results from query commands sent to the Anthem. With these scripts, I've successfully generated Onscreen Display messages displaying the Anthem's status.

Now, I want to make buttons in NR that display this same information. I generally understand how to create feedback buttons (-1,0,2), but I need help in figuring out how the payloads work. For example, is the button name replaced with the payload? And if the payload is determined by the script I've written, how do I tell IEClient to match up the button name and the payload? As I understand it, in IEClient:

Server = IP Address of PPC running NR
Port = 1023 (must match port in IEServer Driver in NR)
Password = test (must match NR)
Eventstring = SET (is this always the same, or can it be different for each Girder command?)
Payload = ButtonName=[pldx] (where pldx is determined by my script)
Connection Timeout = 1000 (default)

Also, do I need to write a separate Girder command for each status report being sent to NR?

So far, I've made it work with one button, but not two.

Any thoughts?

Thanks,
Ken

brockgr
February 26th, 2003, 01:38 AM
Ken,

It's much easier than that - we have an API wrapping all the calls. Just make sure you have the LUA feedback group installed in your GML (the feedback is currently part of LDJ, but will be split into it's own distro soon. Use 0.06 as 0.07 has a bug).

Inside the LUA Feedback folder are some examples. To set a buttton, all you need to do is call:

NR_send_label_feedback({"LabelName","Value"})

However if you have multiple lables you may prefer to do a few at once:

NR_send_label_feedback({"LabelName","Value","LabelName2","Value2"})

You can use the IEvent plugin directly, but the wrapped version is more reliable.

Cheers,

Gavin

K-Wood
February 26th, 2003, 08:40 AM
Gavin:

Don't mistake me for someone who knows what he is doing! I'm a lawyer, not a computer programmer! LOL.

I've never really experimented with your Lua examples, but now I'm starting to look at them. I understand conceptually what is happening, but I'm having a little trouble with syntax.

Conceptually, I understand that I'll need to incorporate some of your scripts into my gml in order to establish the IE connections, define functions, and set certain global variables.

For example, in your Initialize command, what is the syntax for setting the global variables?


setglobal("NRClient.count",0) -- The total number of connected clients
setglobal("NRClients",{}) -- Table of clients, indexed by host and port
setglobal("NRCache",{}) -- Cache of payloads to send

I have only one client, so the count would be 1. But how do I write the table of clients? "IP Address", "Port"? Or something different?
And how do I write the cache of payloads? I assume I'll separately define each payload (using another script) based on what's coming back from my pre/pro. But do I put each payload name in quotes?

And in the Open an IEvent Connection script:

Open a IEvent connection
function NR_client_open(ipaddress,port)
local sock, err = connect(ipaddress, port)
if not sock then return nil, err end
sock:timeout(10)
sock:send("quintessence\n")
local x = sock:receive()
print("1:"..x.."\n")
sock:send("EMPTYPASS\n")
x = sock:receive()
print("2:"..x.."\n")
return sock
end

Do I just directly enter the IPAddress and Port of my PPC client?

Finally, in the various functions, I assume I again need to input IPAddress data directly?

I guess I just need a little handholding to get through this ....

Thanks,
Ken

brockgr
February 26th, 2003, 09:32 AM
Ken,

:lol:

You seem to be making life difficult for yourself. The idea of the "NetRemote LUA Feedback" group is that it's recyclable. Just steal the whole lot, and put in in your GML. It will load itself on startup and define all the fuctions in the examples. This avoids you needing to know how NR feedback really works, and avoids you reinventing it.

However, in the interests of documentation, I'll explain what is going on in there. On entering a feedback panel NetRemote sends an NR.RESEND event. This does two things - first it registers the NR instance in the NRClients table. It then triggers a resend of all variables in the NRCache to that client only.

The cache is needed if a client is disconnected, and reconnects - it needs to get the intial state. Images are currently cached too.

When you send feedback, a copy of the key/value pair(s) are stored in the cache, and then that data is sent to every registered client. If you send an event with a null value, it will be removed from the cache.

Now - none of this is set in stone. The internal working of the feedback is still under development. For example, if your PPC goes down - Girder currently does not handle this and will backlog events. The register/unregister stuff needs improvement.

But as I said above, this is not a problem for you (unless you want to join in) - I promise that I won't change the "API" calls. If you use a NR_send_label_feedback(), and have the "NetRemote LUA Feedback" group in your GML - it will always do the same thing - even if the way it does it changes.

Hope this makes sence.

Gavin

K-Wood
February 26th, 2003, 12:57 PM
I think I'm understanding now. I just need to put your "NetRemote LUA Feedback Group" into my gml and it will automatically take care of establishing the IEvent connections between NR and Girder. Then all I would need to do on my own is: (1) create commands in Girder that generate values -- based on feedback from my pre/pro -- and assign those values to variable names; and (2) create feedback buttons in ProntoEdit that link to those variables.

For example, I have a Girder command that sends a query (via the serial plugin) to my Anthem to determine what source has been selected. The return data (in ASCII format) is assigned to a variable named "AnthemResponse" by a short script written into the serial plugin. I then have created a seperate command (script) that parses the ASCII data and returns a result based on the data. For example, if the source is "DVD", the query command would return ASCII "P1S2". The script uses "if" and "elseif" logic to return a result of "DVD" whenever AnthemResponse = "P1S2". The result is then assigned to a variable name of "MainSource".

I guess what I'm missing is how your Lua script knows to match up my NR button with a particular variable. You said:

When you send feedback, a copy of the key/value pair(s) are stored in the cache, and then that data is sent to every registered client. If you send an event with a null value, it will be removed from the cache.

How does that happen? Or is it automatic, once I create a variable in a script?

For example, if I create a feedback button in NR named "Main.Source", how will Girder know to match up that button with the variable "MainSource"?

I'm getting there! Thanks for your patience.

- Ken

brockgr
February 26th, 2003, 05:05 PM
Okay, so your value is in a variable "MainSource", and your button is called "Main.Source".

Then all you do is add the following like to your code (after the if statement):

NR_send_label_feedback({"Main.Source",MainSource})

i.e. put the value of the MainSource variable in the label called Main.Source.

Gavin

K-Wood
February 26th, 2003, 05:53 PM
I'd just call the function NR_send_label_feedback()!

Doh!

I'd probably have figured that out if I was sitting at my HTPC, instead of blowing off work.

Gavin -- are you really in Tokyo, where it's 6:42 am? Ouch.

Thanks for all the help.

I'll post my gml for anyone who's interested once it get it working.

- Ken

brockgr
February 26th, 2003, 06:13 PM
Ken,

Glad to hear it's coming together. It was actually 7:42 in Tokyo - I was off to work. I'm actually a coder by day too - however you guys are a much better customers than the day time ones (but the pay is not so differnet :cry:).

Gavin

K-Wood
February 26th, 2003, 07:11 PM
Every time I try the function call NR_send_label_feedback, I get a parse error:


error: bad argument #1 to `getn' (table expected, got string)
stack traceback:
1: function `getn' [C]
2: function `NR_send_label_feedback' [(none)]

Reviewing the variable display in the script editor, I show values for variables MainSource, key, AnthemResponse, etc. But I show no values for NRCache, which I believe should be populated with each of the variables, right?

Again, the problem may be syntax: I notice you're using {} brackets around certain items -- why is that?

Finally, I noticed that I get a parse error whenever a NRClient.Resend event is sent to Girder. Not sure why this is happening.

Thanks for the continuing help!

- Ken

brockgr
February 26th, 2003, 07:26 PM
My usual question - have you reset the script engine (blue/red arrow icon)? Girder loads (i.e. executes) the Feedback library at startup, reset or device enable. If you havn't loaded it, the functions are not defined.

Also make sue theat feedback is near the top of your GML. It must be defined before your first call to send feedback.

Actually, now I think I should talk to Ron (of girder fame :wink:) about a LUA plugin interface so I can hide all of this.

Cheers,

Gavin

K-Wood
February 26th, 2003, 10:46 PM
I like the idea of an interface plugin that would hide the guts of the scripting. Its pretty daunting for a layman like me.

As of now, I don't have it working. But I may give it another try in the light of morning.

I also need to think about HOW I can use all of this newfound feedback power -- neat ways to use feedback to make controlling the system idiot-proof.

Obviously DVD Profiler and MC9 are great examples of feedback in action. Buy why not tap into other data, like outside devices (pre/pro, projector, multi-zone controller), or Motherboard Monitor? Basically, anything that people use their LCDs for would be good candidates for NR feedback.

Just rambling ... must go to bed.

Ciao,
Ken

brockgr
February 26th, 2003, 10:57 PM
My next project is a more interactive Zoomplayer DVD front end.

I want to have things like track time and chapter fed back. If you change the subtitle/audio, it will also feedback which one is selected. Best of all if the DVD enters a menu, it will switch to the menu panel with a nice big navigator pad. When Zoomplayer leaves the menu - NR will return you to the transport controls.

Gavin

jeroen020
March 2nd, 2003, 12:16 PM
Thanks for this thread! I'm in a similar position as Ken, and have some questions about how to get it to work too if you don't mind...

First of all, what is working:
- I can get feedback in Girder from my Denon amp connected by a serial cable to the Girder PC (e.g. I can OSD the master volume, active input etc)
- I can register the Netremote client and it shows up when I test the Debug - Show Clients multigroup in the NR LUA feedback group

I configured the CCF as follows:
- Created to test buttons in Tonto, named them Amp.Vol and Amp.Input (or should this be [Amp.Vol] and [Amp.Input]?)
- The Action/IR reads (5001 0000 0000 0002 ffff 0000 0002 0000), the name is [IR] RC5x 65535 0 2

I adusted the LUA feedback group:
- The registerscript with my IP address:
local ipaddress = "192.168.1.103" (the IP address of the other computer I'm testing the CCF's on)
port is set to 1023
the script gives the 'Script finished - Return Value=0' back
- In the initialize script I changed EMPTYPASS in line 23 to the password, as specified in the NR client
This script too gives 'Script finished - Return Value=0' back

I tried the NR_send_label_feedback in various places in the GML. After attributing values to the labels, I can see them in the Debut - Show Payload Cache multigroup.

My questions:
1. Where _exactly_ do I put the NR_send_label_feedback commands? Can I put it in a completely different toplever group (like the one where I read out the amp variables)? Do I have to put the password in the initialize script?
2. How about the password and other things needed for the NR client to receive feedback? Since the client does register, what is the easiest way to test this? Am I right about button names/IR etc? Do I have to restart netremote or the network on the client to get things running?

Hope you can help! And keep up the good work - looking forward to a plugin!

Thanks,

Jeroen

brockgr
March 2nd, 2003, 07:10 PM
Jeroen,

Glad to see you're getting your hands dirty - feedback is the most fun part of NetRemote (IMHO).

First things, you shouldn't need to change any code in the "LUA Feedback Group" on the client side. NR and Grider are designed to handshake. You may need to restart (or reeset at least) girder after adding the Group to your GML, but that's all.

(This also stops you spotting the dirty little secrets, like the lack of a password :wink:)

Oke, the answers:

1 Anywhere - you have one LUA namespace for all of Girder. If you define a funtion in any Girder command, it is usable to everyone. This is handy, but dnagerous. This is why all my functions start LDJ_ or NR_. If you start duplicating names, you're in trouble.

2 As above, you shouldn't need to hack in IP's or passwords. Just use the Feedback Group as it comes in LDJ. The just throw your NR_send_label_feedback into any command. If you are thinking your buttons maybe at fault, copy and paste some out of the LDJ panels.

BTW - I now have the necessary changes in Girder to support LUA plugins (I'm gonna beta test it), so we may be able to eliminate the Feedback Group entirly from your GMLs.

Hope this helps,

Gavin

jeroen020
March 3rd, 2003, 03:58 PM
Gavin,

Thanks for your swift reply, but even if I follow your directions as closely as possible, I can't get it to work. Here's what I tried:

I created a button in my CCF that is an exact copy from your CCF and is named LDJ_DVD_Title.

I imported the NR LUA feedback group from your GML and changed nothing in the configuration. The group is that the top of the group hierarchy.

Now, when I do an F9 and enable input devices, the debug commands show no registered clients and no payload cache present.

Then I call a a command that sets the LDF_DVD_Title variable, a single line of script:

NR_send_label_feedback({"LDJ_DVD_Title","I'm alone"})

After testing that command, the payload cache OSD shows:
LDJ_DVD_Title=I'm alone

But nothing changes on the PPC with the CCF yet.

However, when I try to test the Register command, I get a parse error message. Opening the script editor, the error message is:

error: attempt to call global `connect' (a nil value)
stack traceback:
1: function `NR_client_open' [(none)]
2: function `NR_send_label_feedback_to_client' [(none)]
3: main of (none)

When I then test the Debug - Show Clients apparently it did find the PPC, because the OSD displays:

There are (1) Netremote clients registered : 1023

When I now test the script with:
NR_send_label_feedback({"LDJ_DVD_Title","I'm alone"})

I get a parse error too, and the script editor shows the following error:

error: attempt to call global `connect' (a nil value)
stack traceback:
1: function `NR_client_open' [(none)]
2: function `NR_send_label_feedback_to_client' [(none)]
3: function `NR_send_label_feedback' [(none)]
4: main of string "?" at line 1

I feel like I'm getting close, but still one problem eludes me... I agree that feedback should be the most fun part, so I hope I will get it to work someday... And it would be nice to eliminate the feedback group alltogether, but for debugging it's handy to be able to see the code I guess...

Hope to hear from you soon!

maxtrash
March 3rd, 2003, 05:34 PM
Jeroen,

this looks similar to a problem I had. I think upgrading to the latest version of netremote (and the LUA script) should help.

if you remove the -- before print("pld2 = "..pld2); in the register script. Does it show 1023?

brockgr
March 3rd, 2003, 05:43 PM
:idea: Just thought:


error: attempt to call global `connect' (a nil value)

Connect is is nil - means the connect() function is undefined. Two reasons:

1. It's never been defined
2. It's been overwritten

For 1 - have you enabled the LUA-Socket library plugin?
For 2 - Do you have anything other than LUA Feedback in the GML? Could another LUA script be using the "connect" variable?

There still seems to be ongoing trouble with the port number - but that's a similar but different error. Please hard code ii if you get "connect bad arguement #2" errors.

Cheers,

Gavin

jeroen020
March 3rd, 2003, 07:08 PM
It seems to be working now - I can receive feedback of my amp on the Ipaq!!! Thanks guys! I did not activate the Lua socket plugin, that was the culprit... I'm sorry, I don't seem to have seen that mentioned anywhere... anyway, I'm now off to implement a lot of feedback ideas...

I did notice that it takes quite some time before the feedback is displayed on the Ipaq and that in the mean time additional triggers are queued: when I adjust the volume on my amp from -20 to -10 dB for example, girder will pass 10 times an adjustment on Netremote, at about 2 to 3 seconds each... I'll try to tweak this later...

Cheers,

Jeroen

K-Wood
March 3rd, 2003, 07:14 PM
I get precisely the same error as jeroen. With Gavin's help, I took the feedback to exactly the same point as jereon, and have been hitting the same roadblock.

When I first go to a panel with feedback, I see Girder successfully receive the NRClinet.Resend command and it runs the Register script, returning a result of "0". But when I try the feedback buttons, all I get is a parse error like this:

error: bad argument #2 to `connect' (number expected, got string)
stack traceback:
1: function `connect' [C]
2: function `NR_client_open' [(none)]
3: function `NR_send_label_feedback_to_client' [(none)]
4: function `NR_send_label_feedback' [(none)]
5: main of string "?" at line 17


where my command script is this:

if (AnthemResponse == "P1S0") then
MainSource = "Off"
elseif (AnthemResponse == "P1S1") then
MainSource = "DVD"
elseif (AnthemResponse == "P1S2") then
MainSource = "HTPC"
elseif (AnthemResponse == "P1S3") then
MainSource = "Tape"
elseif (AnthemResponse == "P1S4") then
MainSource = "AM/FM"
elseif (AnthemResponse == "P1S5") then
MainSource = "VCR"
elseif (AnthemResponse == "P1S6") then
MainSource = "SAT"
end

NR_send_label_feedback({"Main.Source",MainSource})
-- TriggerEvent("Query_Main_Source",18,MainSource)

The script works fine with the TriggerEvent command (now rem'd out), but the NR_send_label_feedback command croaks because of a problem with the Connect function.

One more interesting troubleshooting point: running the Debug-Show Clients command yields this result:

There are two (2) NR clients registered:
:
192.168.0.4:


Not sure what that means -- I have only one PPC, and it is the .04 client. Is it somehow registering a bogus client that is throwing things off? If so, what bit of script should I look at to troubleshoot?

Thanks,
Ken

K-Wood
March 3rd, 2003, 07:17 PM
Oh - and one other thing. I'm not sure I'm working with the latest Lua feedback group. Gavin -- can you repost it somewhere or send it via email?

Thanks,
Ken

kdwoodrow @ hotmail.com

P.S. - I do have Lua Socket plugin running.

brockgr
March 3rd, 2003, 07:30 PM
Ken,

Thanks for the comments. There is a subtle difference between the two errors:

error: bad argument #2 to `connect' (number expected, got string)
--> this means that you have a bad port number

error: attempt to call global `connect' (a nil value)
--> this means connect() is undefined

Even so, you should not be getting those junk client addresses when you do the debug. First make sure you've got the latest verion of feedback (0.09 (http://brock-family.org/luadvdjb/luadvdjb-0.09.zip)) and NR (0.981 (http://www.netremote.org/phpBB2/viewtopic.php?p=487#487))

If you are still getting port issues, let me know whether you have the PPC or Win32 versions. You should not need to hard code the port in the LUA code!

Cheers

Gavin

K-Wood
March 3rd, 2003, 09:37 PM
I've got it working -- thanks for the links to the latest versions. But it seems to work only intermittently -- I still get parse errors, and it seems to require triggering the feedback commands several times for the result to actually show up in NR.

Is there a particular order I should use in launching Girder and NR? My usual practice is to leave Girder running 24/7 on my HTPC, and to launch NR when I'm in the HT. But sometimes I leave NR running and the Axim in its recharging cradle. Should I change these practices?

And - one strange phenomenon -- when I check the Script Editor's Variable Display, I get this rapid-fire shimmering - almost like it is constantly sending and resending a command or being refreshed. Any idea what could be causing this? Could it have something to do with the response being received from the Anthem?

Strange!

K-Wood
March 3rd, 2003, 09:47 PM
One more thing I noticed -- it seems to work fine if I exit the feedback screen between sending feedback commands. For example, if change the input status of the Anthem from within Girder and send a feedback command, it doesn't register the status change. But if I leave the feedback screen and return to it, sending the feedback command works fine.

:roll:

brockgr
March 3rd, 2003, 10:36 PM
Yes leaving the screen and coming back is common solution. The problem is that NR must register itself as feedback device (this is incase you have multiple) remotes. When you enter a feedback screen, NR sends the registration.

If Girder is shutdown (or the script engine reset), it loses it's list of registered devices.

I wonder if it's worth reworking all this registration stuff. We could just use timeouts. e.g each NR remote registers on start-up/wake-up and then sends a hearbeat (say every 30 seconds), regardless of whether feedback is enabled or not. If girder hasn't seen a device for over 30 seconds, it drops it. Thoughts Ben?

Cheers,

Gavin

K-Wood
March 4th, 2003, 07:39 AM
Another thought would be an option to hard-code the registration if you have only one PPC. But I like the polling idea best. One other thought - perhaps the registration could update in conjunction with the transmission of any feedback command? or would that be too cumbersome?

Gavin - how's the plugin testing going?

thanks for all of your help -- now I need to write some cool feedback functions into my ccf!

- Ken

brockgr
March 4th, 2003, 09:05 AM
Another option suggested today was to have a permanent TCP connection to NetRemote. That might have performace benefits.

The plugin is coming along great. Mark (of Girder fame :)) has been very helpful. You can follow the fun here: http://www.girder.nl/phpBB2/viewtopic.php?t=3864

Anyway - development has been on hold today - I destroyed my firewall machine and have had to rebuild it all evening :cry:.

Gavin

kanman
March 10th, 2003, 05:59 PM
I have been reading this thread for a couple of days trying to get feedback to my ipaq working. I have it displaying song title and artist info from MC9 through buttons, but I cannot get feedback of what zone is currently being controlled. I am using Mastiff's gml and ccf that I have modified slightly, I can have the zone displayed through an OSD on the computer screen (for testing) and it works fine.

I have imported the gml that has the lau feedback and I have checked the debug sections of that gml to confirm that the ipaq has registered and that there is a payload to send - there is both. I do not get any error now that I have hard coded that port in (I was getting the same error as k-wood - error: bad argument #2 to `connect' (number expected, got string)) but I still do not see the zone on the ipaq in the button I have set up. Here is how it is set:

Button name - zone
IR control - RC5x 65535 0 3 (I saw this earlier in this post - is this the correct parameter?)

In the script I create a variable and send it to the zone button
songname = strsub(songname, 15, strlen(songname) -1 )
--- this is from Mastiff's gml - strips out the zone from the MC9 display

NR_send_label_feedback({"Zone",songname})
--- sending the feedback to the created button on the ipaq

Sorry about the length of this post, I feel that I am close and that I have either missed something obvious or haven't set something up quite right.

Thanks for any help

Kevin

maxtrash
March 11th, 2003, 01:20 PM
Button name - zone
IR control - RC5x 65535 0 3 (I saw this earlier in this post - is this the correct parameter?)

In the script I create a variable and send it to the zone button
songname = strsub(songname, 15, strlen(songname) -1 )
--- this is from Mastiff's gml - strips out the zone from the MC9 display

NR_send_label_feedback({"Zone",songname})
--- sending the feedback to the created button on the ipaq

\

just a quick answer: RC5x 65535 0 3 is for image feedback. You should try RC5x 65535 0 2 for text.

you might want to have a look at the LUA DVD Jukebox script and the demo-CCF that comes with it. Good luck

brockgr
March 11th, 2003, 06:38 PM
Just as an update - Ben and I have agreed on a new feedback protocol, and development is under way. I may change the function syntax (again - sorry), but I will include a compatibility library with the first few releases - so any development here is not wasted.

I am also planning to put together a propper document containg these codes.

Gavin

QuickCarl
March 11th, 2003, 06:59 PM
Please tell me that it will include multiple image feeback!!!!????

No Problem for me... I am waiting for things to get stable before doing any real extensions beyond the buttons you guys have in sample files...LOL

Let me know if you need a beta tester... I volunteer. -Carl

brockgr
March 11th, 2003, 07:10 PM
Carl,

Multiple feedback is part of the design. We have also removed the Base64 encoding/decoding of images so performance should be better too.

My LDJ work is on hold until the new feedback is sorted out. As soon as we have something that works, you'll all get to play with it.

Gavin

claude34
March 31st, 2003, 09:05 AM
I've just about got feedback buttons working (after scraping together bits of info from Girder, and here)....I can now create two NetRemote buttons - one sends a Girder IR command, which runs a LUA feedback script. That script sends label_feedback to my 2nd NetRemote button. When I press the first button, the text on the 2nd button changes appropriately.

What I would really like, is just one button (e.g. toggle between play and pause), which you can press to play/pause Winamp, and the button text changes to show the current playback state.

I've tried creating one button which is called Feedback_Test (this is the value which gets changed by the Feedback Script), and is a Girder Text Feedback (rather than just a Girder Command), and it triggers an eventstring in Girder - except that it never triggers the eventstring.

My understanding from all this is that you can't trigger an eventstring unless you use a Girder Command.

Is there anyway for me to create a button which triggers a command, but ALSO is updateable using Text Feedback?

brockgr
March 31st, 2003, 09:10 AM
Claude,

Should be possible - just make sure that the button has teh two special IR codes. One to say the label is settable, and the other to say that it sends the button name to girder. I don't think the code order matters.

I have been playing with this for a "Subtitle" button for Zoomplayer.

Cheers,

Gavin

claude34
March 31st, 2003, 09:21 AM
I've tried that - using Tonto, I've set the Button name to be "Winamp2PlayStatus", with two IR actions - one is Girder Command, name Winamp2.SmartPlay (the eventstring which triggers Winamp to Play, and sends label feedback to Winamp2PlayStatus). The second IR action is Girder Text Feedback, also named Winamp2.SmartPlay. So this one button sends a command and is settable by Text Feedback.

It triggers the eventstring, and makes Winamp play, but no change in the button text....

Ben S
March 31st, 2003, 10:19 AM
I've tried that - using Tonto, I've set the Button name to be "Winamp2PlayStatus", with two IR actions - one is Girder Command, name Winamp2.SmartPlay (the eventstring which triggers Winamp to Play, and sends label feedback to Winamp2PlayStatus). The second IR action is Girder Text Feedback, also named Winamp2.SmartPlay. So this one button sends a command and is settable by Text Feedback.

It triggers the eventstring, and makes Winamp play, but no change in the button text....

Hi Claude. Just to be clear, although I think I'm reading your post correctly and you understand this. The IR Name is used to send the action to Girder. The button name is used for feedback. So the IR name of the feedback action is unused.

In addition (and this is important) make sure the feedback IR code is before the action IR code. If not, the feedback won't work. NetRemote only registers the button using the first action it finds. This is so no two drivers try to render / modify the button directly. All actions will fire correctly, but only the first action is registered for special types (IE: special render types or feedback mechanisms).

claude34
March 31st, 2003, 10:22 AM
excellent! That now works - thanks Ewok - the last post by brockgr saying code order doesn't matter threw me to think it wouldn't work.

Cheers :-) I'm onto brighter and bigger things with feedback now :-)

brockgr
March 31st, 2003, 03:58 PM
Order does matter :( - I;ll remember that in future. Gavin

claude34
April 1st, 2003, 03:22 AM
Having just managed to get Feedback working, and thinking there isn't a useful tutorial for newbies, I thought I'd start one off, so that someone could complete it and include it in the NetRemote Tutorial:

To get Feedback working between NetRemote and Girder, you'll have to do some work in Girder and Tonto/ProntoEdit (GUI tools that let you create/edit NetRemote CCF screens).

Girder
1. You'll need to import the NetRemote LUA feedback group (available as part of Lua DVD Jukebox Group: http://www.brock-family.org/luadvdjb/luadvdjb-0.06.zip
2. Close and restart Girder, and you will see the initialise function is called when Girder starts up. This makes the feedback function available for use.
3. Create a command, which includes Variable Manipulation Script as the Action. Within the script, include this line:


NR_send_label_feedback({"ButtonName","New Button Text"})

4. If you'd like more info about whether it's all working, add another command to this one (i.e. both within a multigroup), so that something visible happens on your PC (e.g. opening Notepad).
5. Add an eventstring to the command, for example Test.Feedback
6. Press F9 to toggle/enable input devices.


Tonto/ProntoEdit
Edit 0. Add a button which will Add the Client (NetRemote) to Girder's list of known clients. The button will send a Girder_Command, with Signal Name: NRCLIENT.ADD(1023)
1. Create a button in a CCF file. In properties tab for that button, set the Name to ButtonName.
2. In the Actions tab for that e-mail, add two IR codes. The first one will be the feedback code. If you haven't already got the IR Code Database, get it from http://www.netremote.org/phpBB2/viewtopic.php?t=114
3. For the first IR code, the IR Signal Name should be Test.Feedback. The IR Data below that should be Girder_Text_Feedback (chosen from the IR Code Database) - this just inserts the standard code of:

5001 0000 0000 0002 ffff 0000 0002 0000

4. Add a second IR code, with the same name (Test.Feedback), but this time the IR code will be Girder_Command:

5001 0000 0000 0002 ffff 0000 0001 0000

5. Save the CCF, open it in NetRemote. Click on File > Configuration, and click on GirderDriver at the bottom. Click on Configure - make sure all the ports and password details will work with Girder, but especially make sure the Listen Port is set to 1023.
Edit 6. You'll first need to click on Add Client - then click on your feedback button - hopefully, you'll see ButtonName change to New Button Text, and if you chose to, Notepad should open.



Please make any corrections to this, and reword or adapt it if you think it will make it clearer. Hopefully, this'll help beginners get going with feedback. Does anyone know of a better way of Adding the Client so that Feedback works, rather than having to press Add Client? If you don't press Add Client, Feedback doesn't work...

Claude

z.mash
April 1st, 2003, 05:21 AM
Thanks, Claude! I will test this out and incorporate it into the guide.

-Zak

brockgr
April 1st, 2003, 05:33 AM
Claude - You put me to shame - thanks. :D
Gavin

Ben S
April 1st, 2003, 06:34 AM
Does anyone know of a better way of Adding the Client so that Feedback works, rather than having to press Add Client?

Great job Claude. Looks great. The new system doesn't require add client, it will register automatically on NetRemote startup.


I will test this out and incorporate it into the guide.

However, the new system is slightly different, so you might want to hold off a day or so until the new system is released.

claude34
April 1st, 2003, 06:38 AM
Thanks for all the feedback guys :)

I do realise that feedback and NetRemote are in a state of flux at the moment, but at least this post should allow newbies to get going until then, and will serve as a template for the next version covering whatever changes are made.

z.mash
April 1st, 2003, 07:17 AM
However, the new system is slightly different, so you might want to hold off a day or so until the new system is released.

No problem - I am an excellent procrastinator.

QuickCarl
April 13th, 2003, 04:45 PM
Gavin - I have upgraded to Win32 v.9831 and I have installed the new feedback and new lua script sutff. I installed the 'feedback test.gml' from your download.

I am working with version 3.2.9 of grider.... I seem to be doing soemthing wrong. I have feedback buttons set up on my DVD panel, but all they do is send the commend to girder (I can see the LDJ.jump) command in the status window but I don't get any image.

What am I doing wrong?

brockgr
April 14th, 2003, 05:37 PM
Carl,

Are you using the feedback test CCF as well, or LDJ CCF? The currently released LDJ is a little broken by the new feedback system so it's not a good test. I almost have an updated release.

Gavin

QuickCarl
April 15th, 2003, 11:53 AM
Gavin - I tried using the included feedback CCF, but I didn't see what it was doing, or supposed to do...

I heard from Ben that feedback was changing AGAIN...true?

-Carl

Mastiff
April 15th, 2003, 01:53 PM
Yes. From what I hear it will be easier to use an program and a lot more stable.

Ben S
April 20th, 2003, 09:40 AM
-Very- true.

It -will- require changing your ccf for both Girder and MC feedback, but for the -much- -much- -much- better.

Much more stable, and really opens the floodgates on what/how we can use feedback.

I think you'll be very happy with the new feedback system. It also is much better in the performance department.

Mastiff
April 20th, 2003, 09:48 AM
Now you're just being cruel! Not one word about when this will arrive for us to download! :wink:

Ben S
April 20th, 2003, 10:07 AM
Here's one word: Soon.

I'm hoping sometime this week. I need to make sure my new MC plugin doesn't lock up the rest of Media Center, and then see if Matt will integrate it, and then I can release my side.

I told them I would stop offering my "rogue" plugin versions. :)

Mastiff
April 20th, 2003, 10:16 AM
I hope they have time soon, they are in a middle of the annual "going gold" frenzy over there... :lol: