Anonymous - 2015-03-17

Originally posted by: bill-auger

datatypes for default nodes are restored in LinJamConfig::restoreVarTypeInfo() and then vaildated only for debug build in TraceLinjamConfig.h (DEBUG_TRACE_VALIDATE_CONFIG, DEBUG_TRACE_VALIDATE_USER, DEBUG_TRACE_VALIDATE_CHANNEL)

currently only ConfigAudio (a GUI class) sanitizes any of its initial config data (which should o/c be done in the model class LinJamConfig)

Constants.h has enumerated constraints for ConfigAudio but for many (such as ConfigClient) options are still hard-coded into the GUI classes per LinJam.jucer

the following methods currently exist for this

  • LinJamConfig::configRoot
  • LinJamConfig::validateConfig() - validates root schema
  • LinJamConfig::configRoot (all default child nodes recursively)
  • LinJamConfig::sanitizeConfig() - transfers any default nodes and properties missing in stored xml
  • LinJamConfig::restoreVarTypeInfo() - restore datatype for all properties from default metadata
  • LinJamConfig::gui
  • nyi
  • LinJamConfig::client
  • nyi
  • LinJamConfig::subscriptions
  • nyi
  • LinJamConfig::audio
  • ConfigAudio::restoreDefaults() - this method is the action of the ConfigAudio::defaultsButton that clobbers brutally values corresponding to the currently selected API - but as of now this happens programatically only when invalid API selection is detected in ConfigAudio::broughtToFront()
  • LinJamConfig::server, LinJamConfig::servers
  • LinJamConfig::validateServers() - nyi
  • LinJamConfig::remoteUsers
  • LinJamConfig::validateUsers() - destroys storage for users with corrupt schema
  • LinJamConfig::masterChannels, LinJamConfig::localChannels, LinJamConfig::remoteUsers[n]
  • LinJamConfig::validateChannels() - destroys storage for channels with corrupt schema

it should be decided whether to separate concerns for each such as LinJamConfig::validateConfig() vs LinJamConfig::sanitizeConfig() and DEBUG_TRACE_SANITIZE_ vs DEBUG_VALIDATE_CONFIG_ in TraceLinJamConfig.h

this issue may as well cover datatype info which is currently not restored for <servers>, <master-channels>, <local-channels>, <remote-channels> - (though it is still unclear if restoring datatype info is beneficial)