Tutorial on Transport Controls

Simple advice that you may find useful. Feel free to discuss or add your own.
Post Reply
Circe640
Advanced Member
Posts: 206
Joined: Tue Oct 07, 2003 10:01 am
Location: Columbus, OH
Contact:

Tutorial on Transport Controls

Post by Circe640 »

This is a short tutorial on how to build transport controls.



Transport Controls --- a set of mutually exclusive buttons. This is the symbolic representation of mechanically interlocked controls as found on older tape/cassette recorders or modern logic interlocked controls on modern CD/DVD players. The basic logic is that at any one time only one state can be active.



Any number of interlocking buttons can be built with the process described. "Interlocking" --- a set of buttons that function like radio station preset buttons where only one of the set of buttons can be active at any point in time



To prevent confusion with other terms used in HouseBot, I will use the term 'disengaged' to represent the normal (not active) state and 'engaged' to represent the pushed-in(active) state for a button.



For each button, you will need two double bitmaps. (a double bitmap contains the bitmap images for the button and the button's momentary depression) The first double bitmap contains the button's 'disengaged' image as the first part of the pair. The second double bitmap contains the button's 'engaged' image as the first part of the pair.



All buttons except 'Pause' are set up the same way.



Setting up all the Other buttons.



Normally transport controls are associated with the predefined 'A/V Status' Property and I will use this property as an example to follow.



Go to the Property editor from the Settings ---> Property Manager



Use the Property Manager to edit the A/V Status property and add any additional values needed for your transport. If the A/V Status property is not appropriate for what you are trying to do, create a new

property and add the required values.



Now on the appropriate panel add the first multi-state button and assign the property to it (e.g. A/V Status) on the property tab

and then go to the 'State' tab



For each button start with the 'Default mode and for this mode assign the 'disengaged' bitmap as the bitmap to be associated with the default value. Set the 'Change Value to' value to the value that corresponds to the button ( if this was the 'Play' button the appropriate value for AV Status is 'Playing'.



Now create a new state 'Playing'. Assign the 'engaged' button bitmap to this state. Set the 'Change Value To'

to 'Playing' This means that if 'Play' is already engaged and you hit the 'Play' button nothing happens. Alternatively you could set the 'Change Value to' to 'Stopped'. This would mean that if 'Play' was engaged and you pressed the 'Play' button you would go to 'Stop' engaged.



Setting up Pause



Pause is setup as above but for the 'Paused' state you would set the 'Change Value to' value to 'Playing'.

This means when 'Pause' is engaged, pressing the 'Pause' button would result in the transport going to 'Play' engaged.



Setting up Stop



Stop is setup as above and for the 'Stopped' state you would set the 'Change Value to' to 'Stopped'. This means that when 'Stop' is engaged, pressing the 'Stop' button has no effect.

Alternatively you could set the 'Change Value to' to 'Playing' which means that if 'Stop' is engaged and you press the 'Stop' button you would go to 'Play' engaged.



In the Property definition, you should set the initial property value to 'Stopped'. This means when the system starts the transport will show with the 'Stop' button engaged and all other transport buttons 'disengaged'



With this set of definitions, all buttons except the one representing the current value of the property will display the 'disengaged' image as the default state will be the current state for those buttons. The one button whose 'engaged' state matches the property value will show the 'engaged' state bitmap as the 'engaged' state matches the value of the property.





As I continue to get the pieces of HouseBot that I am using working, I will try to continue to post short tutorials like this one. Hopefully, it will avoid some of the questions asked and allow Scott to concentrate on bug fixes and new functionality.
Post Reply