Re: Denon & Marantz Network Control Plugin
Posted: Wed Jan 18, 2017 12:19 am
I am trying to make this a really simple means to move information back and forth.. so if say the person closes the API you would be able to shut down the thread. and when the person reconnects there wouldn't have to be another query to everything for statuses. it's right there.. only the marantz plugin would have to do the status query on startup. This will take care of any needlessly sending and receiving things. but this will also make a sweet means for you to send data as well.. because all you would have to do is to set the same attribute that you use to grab the data from...
so this is how I have Started setting it up..
assumed
data = eg.plugin.Marantz.Storage (or whatever i decide to name it)
so
if a command is received from the AVR the plugin will use the same mechanism to set the data that you would but it will include the whole received message..
the plugin knows to convert anything it has to and to trigger an event if the data has changed. no reason to trigger an event if the data is the same. that will cause macros and what have you to fire off for no reason.
and if you want to send a command from your plugin leave off any none "specific" command characters
so if you want to turn the volume up you would set the attribute to 'UP'
and down is 'DOWN' and a specific value would be the number.
upper case lower case. ints strings floats... doesn't matter.. it does any conversions it needs to. save for one thing... specific to the volume... if you want to send over the actual Db to set to it has to be a string with the Db on the end. put the decimal in don't put the decimal in. doesn't matter on any of the formats. for Db it has to have the - in the string. this is due to the fact there is a +10.0 db and a -10.0 db. space or no space. between the value and Db. doesn't matter. anything that has a value that is - and + that could be the same.. the - HAS to be included
and I do know this API that i am working with is only good for AVR's made since 2011. and there really can't be that many to choose from.. but the big issue is not the model numbers... it's the firmware.. because they can add functionality from the firmware. I am going to send off an e-mail to them for a list of the firmware.. and what each firmware supports for commands.. as well as an actual complete copy of every single command since the documentation on their API is all messed up.
and if and when i get a list of supported command to the firmware i will be able to reply with None if the avr does not support that command.. for the whole command
This should be by far the easiest way to send data back and forth..
because if there is no one connected... there is no need for a timer to update information. when someone connects.. set the timer.. so every 100 ms or so get the data. I do not believe I will need to implement thread locking. but if i do it's no biggie because the last object class in the chain would be the one in the run. so Volume is a "command" object. and MainZone is a parent.
You will have more layers.
it will follow the same grouping structure that I set for the macros when they get added.
I think it's a very simple API. the only thing that has any complexities are the volumes. the only commands that i recollect that don't make any sense are the left and right in the surround mode. those do not conform to everything else.. but i think for the surround modes i will "fix" the none standard API for them. Everything else is Up and Down. except that one..
so this is how I have Started setting it up..
assumed
data = eg.plugin.Marantz.Storage (or whatever i decide to name it)
so
Code: Select all
volume = data.MainZone.Volume.value
description = data.MainZone.Volume.description
commands = data.MainZone.Volume.commands
the plugin knows to convert anything it has to and to trigger an event if the data has changed. no reason to trigger an event if the data is the same. that will cause macros and what have you to fire off for no reason.
Code: Select all
data.MainZone.Volume.value = receivedData (received Data being MV425)
so if you want to turn the volume up you would set the attribute to 'UP'
and down is 'DOWN' and a specific value would be the number.
upper case lower case. ints strings floats... doesn't matter.. it does any conversions it needs to. save for one thing... specific to the volume... if you want to send over the actual Db to set to it has to be a string with the Db on the end. put the decimal in don't put the decimal in. doesn't matter on any of the formats. for Db it has to have the - in the string. this is due to the fact there is a +10.0 db and a -10.0 db. space or no space. between the value and Db. doesn't matter. anything that has a value that is - and + that could be the same.. the - HAS to be included
Code: Select all
data.MainZone.Volume.value = '535' , 535, '53.5', 53.5 and in Db '-265Db', '-26.5Db', '-265 Db', '-26.5 Db' (leave off the MV)
and if and when i get a list of supported command to the firmware i will be able to reply with None if the avr does not support that command.. for the whole command
Code: Select all
if data.MainZone.Volumeis not None:
do code here
This should be by far the easiest way to send data back and forth..
because if there is no one connected... there is no need for a timer to update information. when someone connects.. set the timer.. so every 100 ms or so get the data. I do not believe I will need to implement thread locking. but if i do it's no biggie because the last object class in the chain would be the one in the run. so Volume is a "command" object. and MainZone is a parent.
You will have more layers.
Code: Select all
data.MainZone.ChannelVolume.SurroundBackLeft
data.MainZone.ChannelVolume.SurroundBackLeft = 'UP'
data.MainZone.ChannelVolume.SurroundBackLeft = 'DOWN'
data.MainZone.ChannelVolume.SurroundBackLeft = 5
I think it's a very simple API. the only thing that has any complexities are the volumes. the only commands that i recollect that don't make any sense are the left and right in the surround mode. those do not conform to everything else.. but i think for the surround modes i will "fix" the none standard API for them. Everything else is Up and Down. except that one..