For app to correctly show status of buttons like Guide and Lights as well as correct status of playback controls the app must know the current state of the piano. There are no midi-messages defined to read the status from the piano.
Therefore our app must set certain functions of the piano in order to know the status if these functions. This is also how Smart Pianist app works - when it starts it initialises all piano functions to bring the piano into a known state (the state the app had the last time it was used).
We will do the same - when our app starts it should set functions Guide, Lights etc. to certain values. Then we can show correct status of the buttons. Default values at the moment are:
Guide=off;
Lights=on;
Tone=on.
Later we can implement saving and restoring of the last app status but for now we will use the above values.
When should these values be set? We add a new button "Connect" which must be clicked first after the app is started. All other controls remains disabled until the button "Connect" is clicked. In addition to initialising the above functions the connect-procedure will read piano model and firmware version and show them for information purposes.
In the future the app should connect on start automatically but this function is not part of this issue; we need to implement saving of settings (midi-port and ip-address) first before the automatic connection can be implement. That's for later.
For app to correctly show status of buttons like Guide and Lights as well as correct status of playback controls the app must know the current state of the piano. There are no midi-messages defined to read the status from the piano.
Therefore our app must set certain functions of the piano in order to know the status if these functions. This is also how Smart Pianist app works - when it starts it initialises all piano functions to bring the piano into a known state (the state the app had the last time it was used).
We will do the same - when our app starts it should set functions Guide, Lights etc. to certain values. Then we can show correct status of the buttons. Default values at the moment are:
Later we can implement saving and restoring of the last app status but for now we will use the above values.
When should these values be set? We add a new button "Connect" which must be clicked first after the app is started. All other controls remains disabled until the button "Connect" is clicked. In addition to initialising the above functions the connect-procedure will read piano model and firmware version and show them for information purposes.
In the future the app should connect on start automatically but this function is not part of this issue; we need to implement saving of settings (midi-port and ip-address) first before the automatic connection can be implement. That's for later.