melomania;433009 Wrote: > Is it possible for me to adapt your code? > For instance by filling in the RS232 sequences needed for the Tact?
Sure. All the code is there, and you're welcome to change it as needed -- my code is released under the GPL. Here's the core rs232 logic, in a nutshell: - there's a single queue of commands to be sent (shared by all players) - each queue entry knows what player it's for, what to send to the rs232 port, and how many lines of response to expect from the amp - after sending a command, the plugin won't expect a response for some period of time (fraction of a second), and it uses the SqueezeCenter scheduler API to let SqueezeCenter do other things in the meantime - once it starts reading the response, the plugin keeps reading until either -- it gets the expected number of response lines (there's also some logic to try and figure out if the expected # of response lines has changed; for instance, the Denon will send different #s of response lines depending on things like whether the amp is on or in standby mode) -- a certain maximum response time has elapsed -- a certain amount of time has elapsed since the last response line - the responses are bundled into an array and processed by a routine - once it has finished reading a response, it will not send another command for a certain amount of time (give the amp a break) -- again, using the SqueezeCenter scheduler API There are 3 basic queries that it sends -- power status (PW?), volume level (MV?), and input source (SI?). And currently three basic commands: set volume (MVnnn), unset muting (MUOFF), set power (PWON|PWSTANDBY). I intend to add the ability to set source, and possibly to set/unset other Denon attributes, like sound processing modes. If the Tact protocol is similar ("lines" terminated by carriage returns and/or linefeeds), it shouldn't be too bad to modify my code. You'd mainly want to look at the routines processCommandFromQueue, getResponse, processResponses, any place that my code calls the enqueue routine, and the volumeSBToDenon/volumeDenonToSB routines. getResponse is rather ugly at the moment (dearth of comments, logic basically pasted into two spots instead of being pushed into a method). If you can point me to Tact serial protocol documentation, I could give you a better idea how tough I think it'd be. And, who knows, maybe even be inspired to make my plugin support both brands. I might've done that for Yamaha since they also make relatively inexpensive gear w/ serial ports, but IIRC they had some annoying web site that requires users to create login accounts before getting any documentation. Best way to stop an open source project from supporting your hardware is to put the docs behind some annoying clickthrough barrier. -- peterw http://www.tux.org/~peterw/ free plugins: http://www.tux.org/~peterw/#slim AllQuiet BlankSaver ContextMenu FuzzyTime KidsPlay KitchenTimer PlayLog PowerCenter/BottleRocket SaverSwitcher SettingsManager SleepFade StatusFirst SyncOptions VolumeLock ------------------------------------------------------------------------ peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107 View this thread: http://forums.slimdevices.com/showthread.php?t=63486 _______________________________________________ plugins mailing list plugins@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/plugins