def is_service_active(self, service):
     return zynconf.is_service_active(service)
    def fill_list(self):
        self.list_data = []

        self.list_data.append((self.audio_recorder, 0, "Audio Recorder"))
        self.list_data.append((self.midi_recorder, 0, "MIDI Recorder"))

        self.list_data.append((None, 0, "-----------------------------"))

        if zynthian_gui_config.midi_single_active_channel:
            self.list_data.append(
                (self.toggle_single_channel, 0, "[x] Single Channel Mode"))
        else:
            self.list_data.append(
                (self.toggle_single_channel, 0, "[  ] Single Channel Mode"))

        if zynthian_gui_config.midi_prog_change_zs3:
            self.list_data.append(
                (self.toggle_prog_change_zs3, 0, "[x] Program Change ZS3"))
        else:
            self.list_data.append(
                (self.toggle_prog_change_zs3, 0, "[  ] Program Change ZS3"))

        if zynthian_gui_config.preset_preload_noteon:
            self.list_data.append(
                (self.toggle_preset_preload_noteon, 0, "[x] Preset Preload"))
        else:
            self.list_data.append(
                (self.toggle_preset_preload_noteon, 0, "[  ] Preset Preload"))

        if zynconf.is_service_active("qmidinet"):
            self.list_data.append(
                (self.stop_qmidinet, 0, "[x] QmidiNet (MIDI over IP)"))
        else:
            self.list_data.append(
                (self.start_qmidinet, 0, "[  ] QmidiNet (MIDI over IP)"))

        if zynconf.is_service_active("touchosc2midi"):
            self.list_data.append(
                (self.stop_touchosc2midi, 0, "[x] TouchOSC MIDI Bridge"))
        else:
            self.list_data.append(
                (self.start_touchosc2midi, 0, "[  ] TouchOSC MIDI Bridge"))

        if zynconf.is_service_active("aubionotes"):
            self.list_data.append(
                (self.stop_aubionotes, 0, "[x] AubioNotes (Audio2MIDI)"))
        else:
            self.list_data.append(
                (self.start_aubionotes, 0, "[  ] AubioNotes (Audio2MIDI)"))

        self.list_data.append((self.midi_profile, 0, "MIDI Profile"))

        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.network_info, 0, "Network Info"))

        if zynconf.is_wifi_active():
            if zynconf.is_service_active("hostapd"):
                self.list_data.append((self.stop_wifi, 0, "[x] WIFI Hotspot"))
            else:
                self.list_data.append((self.stop_wifi, 0, "[x] WIFI"))
        else:
            self.list_data.append((self.start_wifi, 0, "[  ] WIFI"))
            self.list_data.append(
                (self.start_wifi_hotspot, 0, "[  ] WIFI Hotspot"))

        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.test_audio, 0, "Test Audio"))
        self.list_data.append((self.test_midi, 0, "Test MIDI"))
        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.update_software, 0, "Update Software"))
        #self.list_data.append((self.update_library,0,"Update Zynthian Library"))
        #self.list_data.append((self.update_system,0,"Update Operating System"))
        self.list_data.append((self.restart_gui, 0, "Restart UI"))
        #self.list_data.append((self.exit_to_console,0,"Exit to Console"))
        self.list_data.append((self.reboot, 0, "Reboot"))
        self.list_data.append((self.power_off, 0, "Power Off"))
        super().fill_list()
    def fill_list(self):
        self.list_data = []

        if self.zyngui.allow_headphones():
            if zynthian_gui_config.rbpi_headphones:
                self.list_data.append(
                    (self.stop_rbpi_headphones, 0, "[x] Headphones"))
            else:
                self.list_data.append(
                    (self.start_rbpi_headphones, 0, "[  ] Headphones"))

        if zynthian_gui_config.midi_single_active_channel:
            self.list_data.append(
                (self.toggle_single_channel, 0, "->  Stage Mode"))
        else:
            self.list_data.append(
                (self.toggle_single_channel, 0, "=>  Multi-timbral Mode"))

        if zynthian_gui_config.midi_prog_change_zs3:
            self.list_data.append(
                (self.toggle_prog_change_zs3, 0, "[x] Program Change ZS3"))
        else:
            self.list_data.append(
                (self.toggle_prog_change_zs3, 0, "[  ] Program Change ZS3"))

        if zynthian_gui_config.preset_preload_noteon:
            self.list_data.append(
                (self.toggle_preset_preload_noteon, 0, "[x] Preset Preload"))
        else:
            self.list_data.append(
                (self.toggle_preset_preload_noteon, 0, "[  ] Preset Preload"))

        if zynthian_gui_config.snapshot_mixer_settings:
            self.list_data.append((self.toggle_snapshot_mixer_settings, 0,
                                   "[x] Mixer Settings on Snapshots"))
        else:
            self.list_data.append((self.toggle_snapshot_mixer_settings, 0,
                                   "[  ] Mixer Settings on Snapshots"))

        if zynthian_gui_config.midi_filter_output:
            self.list_data.append(
                (self.toggle_midi_filter_output, 0, "[x] MIDI Filter Ouput"))
        else:
            self.list_data.append(
                (self.toggle_midi_filter_output, 0, "[  ] MIDI Filter Output"))

        if zynthian_gui_config.midi_sys_enabled:
            self.list_data.append(
                (self.toggle_midi_sys, 0, "[x] MIDI System Messages"))
        else:
            self.list_data.append(
                (self.toggle_midi_sys, 0, "[  ] MIDI System Messages"))

        if zynconf.is_service_active("jack-midi-clock"):
            self.list_data.append(
                (self.stop_midi_clock, 0, "[x] MIDI Clock Internal"))
        else:
            self.list_data.append(
                (self.start_midi_clock, 0, "[  ] MIDI Clock Internal"))

        if zynconf.is_service_active("jackrtpmidid"):
            self.list_data.append((self.stop_rtpmidi, 0, "[x] RTP-MIDI"))
        else:
            self.list_data.append((self.start_rtpmidi, 0, "[  ] RTP-MIDI"))

        if zynconf.is_service_active("qmidinet"):
            self.list_data.append(
                (self.stop_qmidinet, 0, "[x] QmidiNet (IP Multicast)"))
        else:
            self.list_data.append(
                (self.start_qmidinet, 0, "[  ] QmidiNet (IP Multicast)"))

        if zynconf.is_service_active("touchosc2midi"):
            self.list_data.append(
                (self.stop_touchosc2midi, 0, "[x] TouchOSC MIDI Bridge"))
        else:
            self.list_data.append(
                (self.start_touchosc2midi, 0, "[  ] TouchOSC MIDI Bridge"))

        if zynconf.is_service_active("aubionotes"):
            self.list_data.append(
                (self.stop_aubionotes, 0, "[x] AubioNotes (Audio2MIDI)"))
        else:
            self.list_data.append(
                (self.start_aubionotes, 0, "[  ] AubioNotes (Audio2MIDI)"))

        self.list_data.append((self.midi_profile, 0, "MIDI Profile"))

        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.network_info, 0, "Network Info"))

        if zynconf.is_wifi_active():
            if zynconf.is_service_active("hostapd"):
                self.list_data.append((self.stop_wifi, 0, "[x] Wi-Fi Hotspot"))
            else:
                self.list_data.append((self.stop_wifi, 0, "[x] Wi-Fi"))
        else:
            self.list_data.append((self.start_wifi, 0, "[  ] Wi-Fi"))
            self.list_data.append(
                (self.start_wifi_hotspot, 0, "[  ] Wi-Fi Hotspot"))

        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.test_audio, 0, "Test Audio"))
        self.list_data.append((self.test_midi, 0, "Test MIDI"))
        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append(
            (self.zyngui.calibrate_touchscreen, 0, "Calibrate Touchscreen"))
        self.list_data.append((self.update_software, 0, "Update Software"))
        #self.list_data.append((self.update_system,0,"Update Operating System"))
        self.list_data.append((None, 0, "-----------------------------"))
        self.list_data.append((self.restart_gui, 0, "Restart UI"))
        #self.list_data.append((self.exit_to_console,0,"Exit to Console"))
        self.list_data.append((self.reboot, 0, "Reboot"))
        self.list_data.append((self.power_off, 0, "Power Off"))
        super().fill_list()