123
Senior Member
I'm creating a CustomDevice to support an LG TV. It has a serial port and a well-documented control protocol.
I created an LG Module and, using the class wizard, added a generic TV class. This class offers a maximum of four Audio-Video Inputs ... I need six.
Right-clicking the newly created TV class, results in a menu offering to create a "Modulated Input" (and three other choices). I used it to create two additional Modulated Inputs and renamed them VideoIn5 and VideoIn6.
It looked promising until I attempted to add serial commands to these new video inputs. Whereas they are visible in the Explorer tree:
Devices
..CustomDevices
....LG TV
......VideoIn1
......VideoIn2
......VideoIn3
......VideoIn4
......VideoIn5
......VideoIn6
They are not seen in the central Devices pane:
AudioVideo Switch
..Current Source
....PreviousGroup
....PreviousItem
....Clear
....NextItem
....NextGroup
....VideoIn1
....VideoIn2
....VideoIn3
....VideoIn4
The list is limited to the original video inputs created by the class wizard. The two inputs I created are missing so I can't program them with the correct text-string command.
The Modulated Input appears to be derived from Audio-Video Input so I thought everything would be OK ... but it isn't.
How do I add two new AV inputs properly?
======================
This isn't easily done, but here you go...
--jim
======================
Jim,
Many thanks for the detailed instructions! I added the missing AV Inputs and now my TV class has six inputs.
I had scoured the help file, forums, and tutorials and couldn't find an example of how to use Builder to add AV Inputs. I didn't realize one could modify a class's definition in XML. Obviously, this is an easy way to break something and should be used very carefully.
You've helped me gain a deeper appreciation for Premise's capabilities. Kudos to the development team for crafting this gem!
Cheers,
Taras
I created an LG Module and, using the class wizard, added a generic TV class. This class offers a maximum of four Audio-Video Inputs ... I need six.
Right-clicking the newly created TV class, results in a menu offering to create a "Modulated Input" (and three other choices). I used it to create two additional Modulated Inputs and renamed them VideoIn5 and VideoIn6.
It looked promising until I attempted to add serial commands to these new video inputs. Whereas they are visible in the Explorer tree:
Devices
..CustomDevices
....LG TV
......VideoIn1
......VideoIn2
......VideoIn3
......VideoIn4
......VideoIn5
......VideoIn6
They are not seen in the central Devices pane:
AudioVideo Switch
..Current Source
....PreviousGroup
....PreviousItem
....Clear
....NextItem
....NextGroup
....VideoIn1
....VideoIn2
....VideoIn3
....VideoIn4
The list is limited to the original video inputs created by the class wizard. The two inputs I created are missing so I can't program them with the correct text-string command.
The Modulated Input appears to be derived from Audio-Video Input so I thought everything would be OK ... but it isn't.
How do I add two new AV inputs properly?
======================
This isn't easily done, but here you go...
- Add/Create your device with 4 inputs.
- Delete the device from custom devices (this leaves the class around though)
- Use "File|Backup to client" and save the .xdo as something like c:\temp.xdo
- Use a text editor (i.e. notepad) to open c:\temp.xdo.
- Search for "VideoIn4". You will see a line like this although the ID will be different. <Object ID="{4B871AD4-5906-48B6-AADD-C31CD6AC61BD}" Name="VideoIn4" Class="sys://Schema/Device/AudioVideoInput" Description="Video Input 4" />
- Copy the whole line and insert a copy below.
- Change the text of the inserted line from "VideoIn4" to "VideoIn5".
- VERY IMPORTANT... Change the ID to a new GUID. If you don't have the guidgen.exe or uuidgen.exe tool around, you can use http://www.guidgen.com to generate one.
- Search for the next instance of "VideoIn4". It will look like this...
Code:<Object ID="{0BAB92A1-31E7-4958-A2B4-4604DD3EBE36}" Name="CurrentSource VideoIn4" Class="sys://Schema/System/Command" Value="{4B871AD4-5906-48B6-AADD-C31CD6AC61BD}" Property="{31DB62B4-4832-4DC0-B5DE-CEA674607FE1}" />
- Make a copy of this line and paste it below the original.
- Change the text from "CurrentSource VideoIn4" to "CurrentSource VideoIn5".
- Change the ID to a new unique value. Again use guidgen or guidgen.com to do this.
- Change the "Value" property (also a GUID) from its value to the value you used for the ID in STEP 8 (this maps this line back to the first line you inserted).
- Repeat for however many inputs you need.
- Save the file and exit the editor.
- From SYS do a "File|Restore from Client" and pick the file you edited.
- You will get a disconnect message and then the connect dialog will appear. The server is restarting with the file you just specified. Give it 10-30 seconds for it to reappear in the connect dialog.
- Connect to your server
- Go to custom devices, right-click and add your device.
--jim
======================
Jim,
Many thanks for the detailed instructions! I added the missing AV Inputs and now my TV class has six inputs.
I had scoured the help file, forums, and tutorials and couldn't find an example of how to use Builder to add AV Inputs. I didn't realize one could modify a class's definition in XML. Obviously, this is an easy way to break something and should be used very carefully.
You've helped me gain a deeper appreciation for Premise's capabilities. Kudos to the development team for crafting this gem!
Cheers,
Taras