View Full Version : Newbie NR starting my project
rickd
July 3rd, 2008, 07:05 PM
Glad you've got it working.
re your final question - is this in the Flatstyle CCF? As far as I'm concerned FlatStyle is really a base and a demonstration of the flexibility of the DM. You would really be better off customising it to suit your own system.
The key thing is to use relative naming e.g. start with a frame that has your Girder installation's name as its name. Within that add a frame for your receiver's provider (suppose it's called 'Casablanca') which would be "<^>\Casablanca". Add a frame for the device e.g. <^>\System. Add a frame for e.g. the Mute button called "<^>\Mute". On that add a button with two states, with the On state being "<^> is On" and use a Lua Event action of DM.AutoToggle. ie
cordelia -- name of the machine running Girder
<^>\Casablanca -- the provider for this device
<^>\System
<^>\Mute
button:
state 1: - <^> is On
action: Lua Event - DM.AutoToggle
The reason for using a frame for the Mute button is that you can then just copy and paste the button to another frame for another toggle button and you only have to name the frame correctly. The button should just work.
(Actually, the FlatStyle CCF doesn't use this technique as I only thought of doing it yesterday :) )
If you want a button that e.g. sets the source to a particular value then you can call the button (or enclosing frame) something like <^>\Source:DVD and use a Lua Event action of DM.Auto. In this case you'll need to customise the state rule to ensure that the value is DVD (Hmm.. that gives me an idea - I need a Lua function to simplify that a bit)
There are a few other functions like DM.Cycle that will cycle through a set of values.
Note that if you want to display the current value of e.g. a Mute button on the button itself as text then you can put the name of the button in {} brackets as normal, the auto functions will cope with that, but they currently won't cope with more complex expressions.
If you need to give a button a name that's composed of several bits of text then you can't use the auto functions and will have to use the lower level functions from DM core e.g. DM.SetValue which takes the device path, control name and value.
For sliders, as always, you'll need to register the variables used - although I think this should be automatic for a receiver.
I seem to have gone on for longer than I intended! Hope this is useful information.
Ok this was cut from another post and is based on my work on the DM for my Theta Receiver.
I now want to build my first screens to control my home theater I am experienced with girder but new to NR.
I need to get some nice graphics to use so if anyone has some to download please help existing ccf
Also I have netremote designer how do I implement the above instuctions in Designer?
I want to start simply just leverage my DM for projector and Receiver and have gneric trnasport onscreen that will be mapped by girder based on what input and window is active.
Question how do I plug this into NR Designer
cordelia -- name of the machine running Girder
<^>\Casablanca -- the provider for this device
<^>\System
<^>\Mute
button:
state 1: - <^> is On
action: Lua Event - DM.AutoToggle
Rob H
July 4th, 2008, 01:15 AM
Each of those lines is a frame except for the Mute which is the button. It's supposed to be a representation of what you see in the treeview.
Mike C
July 4th, 2008, 04:54 AM
Rick, I am where you are at... know a lot of G but not much of NR/NRD. Starting to build a CCF like you. I have been using graphics from swampcat's WMP CCF but there are not enough widgets to do what I need.
rickd
July 7th, 2008, 03:16 PM
Ok so if my machine name is HTPC do I change the default Home to HTPC in NR
Then add a frame called "<^>Casablanca" (do I need {} around that name) and what is the significance of the <^> etc
Also I can not access the state box what am I missing there?
Rob H
July 7th, 2008, 03:38 PM
Where I have a frame called "cordelia" you'd call yours "HTPC".
<^> refers to the parent frame's name e.g. if you have a frame called HTPC and within it a frame called <^>\Casablanca then when you load that page the inner frame will be called HTPC\Casablanca.
Where this gets interesting is if you have a frame at the top level called <root> instead. What happens then is that NR will look for a NetRemote variable called "root" and substitute that variable's value for <root> e.g. suppose you have some code that does this
NetRemote.SetVariable("root", "HTPC");
NetRemote.Rebind() ;
When you execute that code, the top level frame will now be called HTPC, and the inner frame will be called HTPC\Casablanca. But of course you're not restricted to a machine called HTPC any more, you can change it on the fly.
Naturally, this applies at any point in the hierarchy, so if you were to get a second Casablanca receiver you would change the structure to something like -
HTPC
<^>\<receiver>
etc.
And you could switch between the two receivers by e.g.
NetRemote.SetVariable("receiver", "Casablanca2")
NetRemote.Rebind() ;
Re: the state box I assume you're talking about the box in the properties dialog for a frame or button? Right click on it and you'll get a context menu that will let you add or remove states.
rickd
July 7th, 2008, 08:21 PM
Sorry not sure I get it completely I assume your trying to show me how to build frames and a heiracy which will operate with device manager and be flexible enough to operate with any machine with girder on it ie not manually bound by girder instance.
I think I need to try a simple example of this button in NR designer to get my head around it using my casablanca DM. I want to use frames in the template to place source buttons, volume, lights etc on every page and simply alter the keys shown and events generated based on source selected.
So lets say I want a frame that has mute button.
Where is the code
NetRemote.SetVariable("root", "HTPC");
NetRemote.Rebind() ;
executed or called from is that in girder or NR designer? and how does it relate to the Device manager and provider I have for my Casabalnca
rickd
July 9th, 2008, 03:54 PM
I tried to setup a mute button to function with my Casablanca DM. So Netremote was connected to girdder and working good.
I need to workout where the code goes? I can see in selected state and option for DM
HTPC\CasablancaIII\Processor\Mute and then do I put "On" in the next box?
or should I select lua code and place your code in to that box
ordelia -- name of the machine running Girder
<^>\Casablanca -- the provider for this device
<^>\System
<^>\Mute
button:
state 1: - <^> is On
action: Lua Event - DM.AutoToggle
also in the action tab do I put dm.autotoggle?
Rob H
July 10th, 2008, 02:10 AM
In the FlatStyle CCF we use a pair of buttons on and off so in that case <^>\Mute is a frame.
If you're using a single button with two states then you'd call that button <^>\Mute and would use a state of <^>\Mute = On
And yes, you would put DM.AutoToggle in the Lua Event action (note that the case of this is important).
rickd
July 10th, 2008, 04:22 PM
So it is important to call these frames and buttons with that syntax else they will not work is that correct?
so I need to create a frame called "<^>HTPC" then a frame within that frame called "<^>CasablancaIII" - the name of my provider in DM and then a frame within that called "<^>Processor" -- as that is part of the path in DM and then the button called "<^>Mute"
then add a state and add the rule box HTPC\CasablancaIII\Processor\Mute or do I add <^>\Mute to the rule box and then in the "is" box type "On" and then add DM.AutoToogle into action designer.
Getting this right enables it to function correctly yes?
Rob H
July 11th, 2008, 02:29 AM
The names are important certainly but you don't have to use the <^> form, it just makes it easier to edit the CCF if you e.g. change the name of the PC running Girder or replace your Casablanca with some other receiver.
rickd
July 11th, 2008, 01:34 PM
thanks Rob I have the button changing state when I change the state of my mute on the receiver via ir or via the webpage and the button in NR changes state accordingly but pressing the button in NR is not actually changing mute state on reciever what am I missing?
Rob H
July 11th, 2008, 03:07 PM
I'd need to see the CCF (or at least the page in question)
rickd
July 11th, 2008, 06:03 PM
i cannot get the ccf to upload it is too big even when just one page how do i shrink it to be able to be uploaded?
rickd
July 11th, 2008, 09:07 PM
Ok try this one it does the same thanks
Also could you show me a simple volume slider for casablanca dm
and source button in that file thanks Rick
Rob H
July 11th, 2008, 10:39 PM
The button in that CCF has an action of "Send Event to Girder TT.Play" so it clearly couldn't possibly mute the Casablanca.
Did you send the wrong version of the file?
Do you also have a .lua file for your CCF?
You'll need one that does at least
require "DM.Core"
rickd
July 12th, 2008, 12:24 PM
sorry try again this one....and i get an error when trying require "DM.core"
lua error DM.Core not found
I assume you put this in the lua script under system
edit : I renamed it to DMCore all good on the loading it part still have same issue with showing state correctly when mute activated but button is not muting
Rob H
July 12th, 2008, 03:33 PM
You've misspelled DM.AutoToggle as DM.AutoToogle
rickd
July 12th, 2008, 09:02 PM
thanks ...still no go after changing that too?
Rob H
July 13th, 2008, 02:32 AM
Hmm... open the Lua console in NRD and see if you get any errors, also check the values in NRD's variable inspector to ensure that the naming is correct.
Note that this is case sensitive - so is the PC called htpc or HTPC?
rickd
July 13th, 2008, 02:34 PM
DM: Value = \CasablancaIII\Processor\Mute
DM: Device \CasablancaIII\Processor ctrl Mute
DM: Error - value is neither On nor Off -
DM: DM.AutoToggle call 0 name = \CasablancaIII\Processor\Mute
DM: DM.AutoToggle call -1 name = \CasablancaIII\Processor\Mute
DM: Name = "nil"
This is in console perhps I need the HTPC frame to find it I think I had name of page group HTPC will try again when at home
Rob H
July 13th, 2008, 11:58 PM
Yes, you'll need a top-level frame called HTPC
rickd
July 14th, 2008, 03:55 PM
ok great
Next ... how do I add a simple slider to hook to my DM volume and or Balance
and how do I do my source buttons...would I add a frames
HTPC
<^>\CasablancaIII
<^>\Processor
<^>\Source
<^>\DVD --what naming convention is needed here name in provider for each source?
button:
state 1: - <^> is On
action: Lua Event - DM.Auto
<^>\HTPC -- Button ie add all source buttons to this frame with same event?
button:
state 1: - <^> is On
action: Lua Event - DM.Auto
Also how would I display a variable from girder like Casablanca.Settings.Volume on screen in NR?
Thanks R.
Rob H
July 15th, 2008, 12:48 AM
For the sliders, just create the sliders as normal and create a function as follows
function RegisterSliders()
DM.RegisterVariableWatch(name, DM.GetGirderInstance())
end
where name is the DM path of e.g. the volume slider - you may as well register all the sliders in that one function.
To have this be called at the appropriate time you should use
DM.RegisterUpdater(RegisterSliders)For the source buttons I'd suggest having a frame with a name that resolves to HTPC\CasablancaIII\Processor\Source then have buttons in that frame like <^>: DVD (note the colon - don't include the space though, that's just to avoid it being converted to a grin) and states with e.g. "<^> is DVD" - you're right about the Lua event being DM.Auto.
To display the value just put the name of the variable in braces e.g. {<^>\Volume}
rickd
July 15th, 2008, 01:35 PM
Thanks Rob I have Source working well now...couple questions on sliders
Where do I place that code.... first bit I put it into the system lua and it hung NR...
The path for name I used was HTPC\CasablancaIII\Processor\Volume
When calling the second code at the appropriate time how and where is that called? Where do I put thaqt to insure it is?
Also my {<^>Volume } frame displays nothing am trying to display the volume of my processor ie Casablanca.Settings.Volume in my DM.
Also with the volume Slider do I still need the same frame hieracy?
HTPC\CasablancaIII\Processor\Volume is the variable I used for the slider is that the way to do it I suspect not :) here is my latest test ccf
Rob H
July 15th, 2008, 02:31 PM
There's no way that should hang NR - I'd need to see the .lua file
rickd
July 15th, 2008, 04:27 PM
here it is I have it getting updates when volume changes on reciever but its not sending the volume change from NR
I don't have the DM.RegisterUpdater(RegisterSliders) anywhere yet?? so that is probabl it
Rob H
July 16th, 2008, 01:06 AM
Just add the line
DM.RegisterUpdater(RegisterSliders)
at the end of the .lua file
rickd
July 16th, 2008, 01:37 AM
did that no chance?
Rob H
July 16th, 2008, 01:51 AM
I should have spotted it before - you need to double up the '\' characters in the path name, or use
DM.RegisterVariableWatch([[HTPC\CasablancaIII\Processor\Volume]], DM.GetGirderInstance())
rickd
July 16th, 2008, 02:43 AM
that did not do it must be getting close? :)
edit got it working commented out require DMSupport
Rob H
July 16th, 2008, 03:02 AM
Cool, I wonder why that was interfering?
rickd
July 16th, 2008, 03:23 AM
I am using require DMCore...
I notice that in the flatstyle there is only require DMSupport if I want to use that as my base so my music is done for me will I still need DMsupport as I note it is in the .lua file
Rob H
July 16th, 2008, 03:37 AM
No, the music support doesn't use the DM as far as I know so you won't need DMSupport for that.
DMCore should contain all that you need. DMSupport is there to provide automatic support for AV Receivers, Security, Lighting etc. but the CCF must use the same model as FlatStyle for this to work.
jwilson56
July 16th, 2008, 05:13 AM
I never used DM for my audio setup rather I just kept it as it I did it with hsGirder and Homeseer by using Girder scripts. Press a button on a NR screen and it sends a girder event which executes a Girder macro of all the IR commands I need for that button. Simple but reliable and easy to create and change. I do this for all six zones and use an Ocelot for multi IR zones.
Rob H
July 16th, 2008, 08:14 AM
The DM is particularly useful for devices with two-way control, e.g. those with serial or ethernet ports that provide feedback.
Using the hierarchical naming scheme means that you can more easily change the actual hardware without having to seriously modify the CCF.
rickd
July 16th, 2008, 05:12 PM
Ok so I can use the flatstyle as a base remove...all the specific receiver stuff and add mine as per my test ccf and remove dmsupport call. Is their a way to hide page groups or will I have to delete them ie the ones not used like HAVC Security etc. I plan to add them later but for now just want to get control and music working.
Music is nicely done in the Flatstyle so was going to just save time...and use that or if you think I should start over let me know.
I will have all my receiver controls and build one or two generic transport frames which will just send events these will be remapped in girder based on what source is active and or what program is active.
This means everything can be on one page.
I agree having the two way update is great as if I use my remote to up the volume it is reflected onscreen and all state is updated regardless of input via ir front panel or NR ...also I can see status of devices at a glance.
My receiver updates all data on it state to girder whenever anything changes. Which brings me to my projector. It is two way serial and state needs to be queried rather than sending all data...on anything changing.
I have a serial control file and will add a provider. What is the recommended way to keep track of the state. Polling the device at regular intervals?
I can on power up query the state of all items I need and then update anything that chances as I resceive an acknowledgement of a command executed. But what about if state changes due to remote being used? I guess I need to add a way of polling the projector.
Is that what you would recommend?
Rob H
July 17th, 2008, 02:03 AM
Well, you can leave the page groups in, just don't jump to them.
There are a number of options to choose in regards to dealing with the remote
1) Polling
2) Have a button in the CCF to explicitly request the settings.
3) If you have some form of IR input for Girder then you could possibly learn the projector's remote commands and when you detect that the user has pressed a button on the remote you could query the projector (possibly after a short timeout in case the user presses another button).
rickd
July 17th, 2008, 03:04 PM
Thanks Rob will use ir option to trigger a refresh...
another question how do I display a name on a button when it is named
<^>:MySky to handle the DM.Auto and DM feedback
I would like to display just MySky on the button
Also what lua code can be excluded from the .lua file in flatstyle ccf baring in mind I want to use the music...also is the music designed with ituned or jrmc in mind?
Thanks R.
Rob H
July 18th, 2008, 03:56 AM
The simplest solution is to use a graphic rather than text on the button.
Other than that you can use the non-Auto form e.g. for a toggle you can use DM.Toggle([[<^>\MySky]]) in a Lua OnRelease action (not a Lua event action).
I'm not sure you can exclude any code from Flatstyle's .lua - pretty much all of it is there to support the Music part of the CCF.
I suspect it was designed mostly to work with JRMC, but most if not all of it should be fine with iTunes.
jwilson56
July 18th, 2008, 04:04 AM
Push come to shove you can always overlay another small frame over the button with a transparent background and its own text for the name. Worked for me...
rickd
July 18th, 2008, 04:14 AM
DM.Toggle did not work....I used a frame and changed the text colour based on state to a nice blue likethe lights on my receiver looks good :) Thanks
have my first fully functioning screen
Will now add sliders panel and projector panel to finish it
rickd
September 7th, 2008, 04:55 PM
I am adding a popup panel based on state of Dobly digital to add some sliders for center delay etc.
I have added a panel within the path HTPC frame and some sliders within a frame inside the htpc frame....getting my paths right under these circumstances is a challenge
The sliders have to have CasasblancaIII\Processor\CL to work where CasablancaIII is the volume slider frame processor the slider range frame and CL the button frame challege is the frame it is sitting inside needs to have a name ....
Will having the high level frame sitting under HTPC and above CasasblancaIII\Processor\CL be named <^>\ to work or <^> to work and maintain the right pathways for the DM?
If not how do I achieve this given we would have HTPC within HTPC which would not work?
Rob H
September 7th, 2008, 11:53 PM
You can bypass an intermediate frame if you need to using e.g. <^^> instead of <^>
rickd
September 10th, 2008, 01:28 AM
Thanks for that next question is how do I make a panel state variable toggle based on the change in state of another variable....
I have HTPC\CasablancaIII\Processor\Presets\Dolby_Digital and when that changes to something else I want to reset variables DD.LFE and DD.Surround variables back to 0 in case thety are 1 as when the are 1 they display a panel specfic to Dolby Digital
I assume I need some lua somewhere??
Thanks Rick
Rob H
September 10th, 2008, 04:52 AM
Something like
NetRemote.RegisterVariableWatch([[HTPC\CasablancaIII\Processor\Presets\Dolby_Digital]],
function()
NetRemote.SetVariable("DD.LFE", 0) ;
NetRemote.SetVariable("DD.Surround", 0) ;
end)
should do the trick.
rickd
September 10th, 2008, 03:07 PM
Ok I want it to set them to zero when Preset is not Dolby_Digital ie it could be PrologicII
my presets are :
local PresetValues = {"Matrix", "Special_Matrix", "Dolby_Digital", "DTS_5.1", "Stereo", "Analog_Direct", "Analog_Matrix",
"Mono", "Circle_Cinema", "Circle_Music", "Circle_Mono_Matrix",
"PrologicIIx_Movie", "PrologicIIx_Music", "PrologicIIx_MonoMx", "DTS_NEO_Cinema", "DTS_NEO_Music"
}
so would that still work or would I need to change the logic?
Rob H
September 10th, 2008, 03:47 PM
You'll need to tweak it a bit.
The function that you pass to RegisterVariableWatch is passed two parameters, the variable name and the value to be set, so you could check the value in the function and set the other variables accordingly.
rickd
September 11th, 2008, 01:52 AM
NetRemote.RegisterVariableWatch([[HTPC\CasablancaIII\Processor\Presets]],
function()
if [[HTPC\CasablancaIII\Processor\Presets]]~="Dolby_Digital" then
NetRemote.SetVariable("DD.LFE", 0) ;
NetRemote.SetVariable("DD.Surround", 0) ;
end)
this work?
Rob H
September 11th, 2008, 04:48 AM
No, that won't work, you're directly comparing one string with another
Try this
NetRemote.RegisterVariableWatch([[HTPC\CasablancaIII\Processor\Presets]],
function(var, value)
if value ~= "Dolby_Digital" then
NetRemote.SetVariable("DD.LFE", 0) ;
NetRemote.SetVariable("DD.Surround", 0) ;
else
NetRemote.SetVariable("DD.LFE", 1) ;
NetRemote.SetVariable("DD.Surround", 1) ;
end
end)
rickd
March 18th, 2009, 02:56 PM
Rob I have another question
In my plugin for my processor I have a variable I want to display it is not a published variable but it is captured via the plugin into the state table.
eg in Girder it is referenced as CasablancaIII.Settings.Sample_rate
In NR it would be HTPC\CasablancaIII\Processor\Sample_rate? Yes? or does this need to be in the provider in order to be available this way?
How would I watch this....would it be
NetRemote.RegisterVariableWatch([[HTPC\CasablancaIII\Processor\Sample_rate]], function() end)
or would i need to use setvariable from girder when the state of the variable changes
Rob H
March 19th, 2009, 02:20 AM
It would need to be in the provider.
rickd
March 19th, 2009, 06:36 PM
something like this ok?
SampleRate = {Class = 'Dropdown', ID = 'SampleRate', Values = {"96Khz", "48KHz", "44.1KHz", "no lock"},
Command = function(value) self.Plugin.SampleRate(self.Plugin, value) end},
Then plugin side nothing is required as it is just a status display
Rob H
March 20th, 2009, 04:38 AM
If it's just a status display then you don't need to have a command for it. You may as well just make it a Label control too which will accept and display any value that the provider gives it.
rickd
March 22nd, 2009, 02:44 AM
ok you mean that when the plugin generates an event from it change that I send and netremote setvaiable from girder to a varaible which is displayed...ok might be easier don't have to change the plugin
Rob H
March 22nd, 2009, 05:16 AM
I'd keep it in the provider which will keep the naming consistent - just update that value as normal.
rickd
March 22nd, 2009, 01:35 PM
So Rob is the code for a label control in the provider any different from what I used above will that work ok? or would i just take the command function out like this...
SampleRate = {Class = 'Dropdown', ID = 'SampleRate', Values = {"96Khz", "48KHz", "44.1KHz", "no lock"},
end},
or is there a class for label? if so can you show me an example thanks
Rob H
March 22nd, 2009, 03:17 PM
Change the class to "Label", otherwise it looks fine.
rickd
April 8th, 2009, 02:35 AM
Where does this go in the provider under controls? The event is received but no data is coming through to NR
Controls = {
Presets = {Class = 'Dropdown', ID = 'Presets', Values = PresetValues,
Command = function(value) self.Plugin['Mode'..value](self.Plugin) end},
StepVolume = {Class = 'Dropdown', ID = 'StepVolume', Values = {"VolUp", "VolDown"},
Command = function(value) self.Plugin[value](self.Plugin) end},
DDCompression = {Class = 'Dropdown', ID = 'DDCompression', Values = {"On", "Off"},
Command = function(value) self.Plugin.DDCompression(self.Plugin, value) end},
DDialogNorm = {Class = 'Dropdown', ID = 'DDialogNorm', Values = {"Analog", "Digital"},
Command = function(value) self.Plugin.DDialogNorm(self.Plugin, value) end},
SampleRate = {Class = 'Label', ID = 'SampleRate', Values = {"96KHz", "48KHz", "44.1KHz", "32KHz", "no_lock"}, },
Rob H
April 8th, 2009, 02:44 AM
That looks okay to me, although you don't need the Values parameter there.
Is the provider updating the SampleRate?
rickd
April 8th, 2009, 03:48 PM
Actually turned out to be bad label name on the NR side it all seems ok now...
When you say you don't need the values what do you mean? something like this?
SampleRate = {Class = 'Label', ID = 'SampleRate', {"96KHz", "48KHz", "44.1KHz", "32KHz", "no_lock"}, },
Rob H
April 9th, 2009, 12:12 AM
No, I mean you can miss out the Values table as well - it's ignored by the Label control. Any text from the provider is passed on in its entirety.
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.