Additional component implementation
PhreaK
Senior Member
Hey there fellow duet-ers and duet-ettes. I've run into some interesting behavior that's got me stumped.
Normally to extend a base device type to implement additional functionality (adding say the DialerComponent to an AudioConferencer etc) you implement the desired component interface, set up the mapping in components.xml and then SNAPI calls the appropriate methods and everything plays nice. Also, if you want to implement a component multiple times, make sure your class handles it appropriately and map it on the number of ports your require in components.xml. This is all nice, simple and neat... assuming none of the component API's conflict.
Where I'm stuck is say in the case of a combined CD / cassette deck where you'd want to implement both the DiscTransport (or DiscTransport2) and TapeTransport components to handle things neatly and allow both to be operated independently. I was hoping this would be the case of just implementing them then mapping one to port 1 and one to port 2 in components.xml with both given index 1.
Where this fails is that regardless of the index you assign component.getXXComponent(..) is always called with an index equivalent to the port assignment. The fix if you only require a single implementation of the extending component is to ignore the index passed into your getXXComponent(..) method and always return the first component. Surely there must be a less hacky way to do this.
Normally to extend a base device type to implement additional functionality (adding say the DialerComponent to an AudioConferencer etc) you implement the desired component interface, set up the mapping in components.xml and then SNAPI calls the appropriate methods and everything plays nice. Also, if you want to implement a component multiple times, make sure your class handles it appropriately and map it on the number of ports your require in components.xml. This is all nice, simple and neat... assuming none of the component API's conflict.
Where I'm stuck is say in the case of a combined CD / cassette deck where you'd want to implement both the DiscTransport (or DiscTransport2) and TapeTransport components to handle things neatly and allow both to be operated independently. I was hoping this would be the case of just implementing them then mapping one to port 1 and one to port 2 in components.xml with both given index 1.
Where this fails is that regardless of the index you assign component.getXXComponent(..) is always called with an index equivalent to the port assignment. The fix if you only require a single implementation of the extending component is to ignore the index passed into your getXXComponent(..) method and always return the first component. Surely there must be a less hacky way to do this.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums