Esempio n. 1
0
File: main.py Progetto: swak/pisound
def hs_menu(button, *selection):
    title = 'Pisound Hotspot Settings'
    description = 'Here you can change Pisound Hotspot name, password and channel.'
    items = values.get_hs_config()
    callback = hs_param_menu
    parent = main_menu
    widget = views.list_view(loop, title, description, items, callback, parent)
Esempio n. 2
0
File: main.py Progetto: swak/pisound
def cards_menu(button, *selection):
    title = 'Change Default Card'
    active_card = values.get_active_card()
    description = 'Currently active card is {}'.format(active_card['title'])
    items = values.get_cards()
    for item in items:
        item['current'] = active_card['key']
    parent = main_menu
    callback = set_card_silent
    view = views.list_view(loop, title, description, items, callback, parent=parent)
Esempio n. 3
0
File: main.py Progetto: swak/pisound
def btn_menu(button, *selection):
    title = 'Pisound Button Settings'
    description = "Here you can assign different "\
        "actions to different Button interactions. We know it sounds funny."\
        "\n\n'OTHER_CLICKS' - when 4 and more consecutive clicks are received."\
        "\n'HOLD_OTHER' - when pressed for 7 and more seconds."
    items = values.get_btn_config()
    callback = btn_action_menu
    parent = main_menu
    view = views.list_view(loop, title, description, items, callback, parent)
Esempio n. 4
0
File: main.py Progetto: swak/pisound
def install_menu(button, *selection):
    title = 'Install Additional Software'
    description = 'Choose software package to install/update.'
    callback = run_sh
    items = [{'title': 'PureData', 'file': 'install-puredata.sh'},
        {'title': 'Audacity', 'file': 'install-audacity.sh'},
        {'title': 'SuperCollider', 'file': 'install-supercollider.sh'},
        {'title': 'TouchOSC2MIDI', 'file': 'install-touchosc2midi.sh'}]
    parent = main_menu
    view = views.list_view(loop, title, description, items, callback, parent)
Esempio n. 5
0
File: main.py Progetto: swak/pisound
def btn_action_menu(button, selection):
    interaction = selection['key']
    title = "Button '{}' Action".format(interaction)
    description = "To assign your own script, place it inside '{}' directory.".format(
            values.get_btn_scripts_path())
    items = values.get_btn_scripts()
    for item in items:
        item['key'] = interaction
    callback = btn_update_silent
    parent = btn_menu
    view = views.list_view(loop, title, description, items, callback, parent)
Esempio n. 6
0
def rpi4_compatibility_menu(button, selection):
    title = 'Raspberry Pi 4 Compatibility'

    description_long = """Raspberry Pi 4 has broken the behavior of the 3.3V line on the 40-pin GPIO header. This causes an issue on reboot which is described here:

https://community.blokas.io/t/pisound-with-raspberry-pi-4/1238/12

You may use the options below to enable or disable a software workaround to avoid the issue. In particular, it disables the '1.8V' communication mode of the SD card. It has a downside that it limits the SD card speeds to the ones available on Raspberry Pi 3, which are still quite fast. You'd be impacted only if you use one of the high end SD cards, but then you could opt to instead have the workaround off and keep the reboot issue in mind.

The software workaround gets applied to /boot/cmdline.txt - it has to be re-applied every time you format the SD card.

Since hardware version 1.1, Pisound has a built-in hardware workaround to fix the compatibility with RPi 4.

----

Bootloader EEPROM Update Recommended: {}

Software Workaround Enabled: {}"""

    if not values.is_rpi4_compatible():
        description = description_long.format(
            values.get_rpi4_bootloader_update_recommendation(),
            'Yes' if values.is_rpi4_workaround_enabled() else 'No')
    else:
        description = 'Your Pisound is fully compatible with RPi 4.'
        if values.is_rpi4_workaround_enabled():
            description += "\n\nThe software workaround is enabled (https://community.blokas.io/t/pisound-with-raspberry-pi-4/1238/12), it's recommended to disable it."
        else:
            description += "\n\nThe software workaround is disabled (https://community.blokas.io/t/pisound-with-raspberry-pi-4/1238/12), it's recommended to keep it disabled."

    callback = toggle_rpi4_workaround

    items = [{
        'title':
        'Enable Workaround'
        if not values.is_rpi4_workaround_enabled() else 'Disable Workaround'
    }]
    view = views.list_view(loop, title, description, items, callback,
                           main_menu)
Esempio n. 7
0
def list_offices():
    return list_view(Office)
Esempio n. 8
0
def list_employees():
    return list_view(Employee)
Esempio n. 9
0
def list_departments():
    return list_view(Department)