# Path: kano_settings/config_file.py
# def get_setting(variable):
# 
#     try:
#         value = read_json(settings_file)[variable]
#     except Exception:
#         if variable not in DEFAULTS:
#             logger.info("Defaults not found for variable: {}".format(variable))
#         value = DEFAULTS[variable]
#     return value
# 
# def set_setting(variable, value):
# 
#     if username == 'root':
#         return
# 
#     logger.debug(u"config_file / set_setting: {} {}".format(variable, value))
# 
#     data = read_json(settings_file)
#     if not data:
#         data = dict()
# 
#     data[variable] = value
#     write_json(settings_file, data)
#     chown_path(settings_file)
# 
# Path: kano_settings/boot_config.py
# def set_config_value(self, name, value=None, config_filter=Filter.ALL):
#     self.set_state_writable()
#     self.temp_config.set_value(name, value, config_filter)
# 
# def end_config_transaction():
#     _trans().close()
# 
# Path: kano_settings/paths.py
# ASOUND_CONF_PATH = join(ASOUND_CONF_BASE_PATH, ASOUND_CONF_NAME)


from kano.utils.shell import run_cmd, run_bg
from kano.logging import logger
from kano_peripherals.wrappers.detection import is_pi_hat_plugged
from kano_settings.config_file import get_setting, set_setting
from kano_settings.boot_config import set_config_value, end_config_transaction
from kano_settings.paths import ASOUND_CONF_PATH
        from kano_settings.system.display import get_edid
#!/usr/bin/env python

# audio.py
#
# Copyright (C) 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# Contains the audio backend functions







amixer_control = "name='PCM Playback Route'"

analogue_value = 1
hdmi_value = 2
hdmi_string = ": values={}".format(hdmi_value)

store_cmd = "service alsa-store restart"
#amixer_set_cmd = "amixer -c 0 cset {control} {{value}}".format(
#    control=amixer_control)
amixer_get_cmd = "amixer -c 0 cget {control}".format(control=amixer_control)

analogue_cmd = "amixer -c 0 cset numid=3 1"

# Path: kano_settings/config_file.py
# def get_setting(variable):
# 
#     try:
#         value = read_json(settings_file)[variable]
#     except Exception:
#         if variable not in DEFAULTS:
#             logger.info("Defaults not found for variable: {}".format(variable))
#         value = DEFAULTS[variable]
#     return value
# 
# def set_setting(variable, value):
# 
#     if username == 'root':
#         return
# 
#     logger.debug(u"config_file / set_setting: {} {}".format(variable, value))
# 
#     data = read_json(settings_file)
#     if not data:
#         data = dict()
# 
#     data[variable] = value
#     write_json(settings_file, data)
#     chown_path(settings_file)
# 
# Path: kano_settings/boot_config.py
# def set_config_value(self, name, value=None, config_filter=Filter.ALL):
#     self.set_state_writable()
#     self.temp_config.set_value(name, value, config_filter)
# 
# def end_config_transaction():
#     _trans().close()
# 
# Path: kano_settings/paths.py
# ASOUND_CONF_PATH = join(ASOUND_CONF_BASE_PATH, ASOUND_CONF_NAME)


# Path: kano_settings/system/audio.py
from kano.utils.shell import run_cmd, run_bg
from kano.logging import logger
from kano_peripherals.wrappers.detection import is_pi_hat_plugged
from kano_settings.config_file import get_setting, set_setting
from kano_settings.boot_config import set_config_value, end_config_transaction
from kano_settings.paths import ASOUND_CONF_PATH
        from kano_settings.system.display import get_edid

#!/usr/bin/env python

# audio.py
#
# Copyright (C) 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
# Contains the audio backend functions







amixer_control = "name='PCM Playback Route'"

analogue_value = 1
hdmi_value = 2
hdmi_string = ": values={}".format(hdmi_value)

store_cmd = "service alsa-store restart"
#amixer_set_cmd = "amixer -c 0 cset {control} {{value}}".format(
#    control=amixer_control)
amixer_get_cmd = "amixer -c 0 cget {control}".format(control=amixer_control)

analogue_cmd = "amixer -c 0 cset numid=3 1"

hdmi_cmd = "amixer -c 0 cset numid=3 2"