Beispiel #1
0
 def sel_cor_manager(self):
     contextMenu(funcs=[(
         tr(32033),
         self.sel_import_correction), (
             tr(32028),
             self.sel_delete_correction), (tr(32032), self.sel_playsweep)])
     self.sel_correction()
Beispiel #2
0
 def sel_main_menu(self):
     contextMenu(funcs=[(tr(32006),
                         self.sel_profile), (tr(32007), self.sel_equalizer),
                        (tr(32008),
                         self.sel_device), (tr(32027), self.sel_correction),
                        (tr(32010),
                         self.sel_latency), (
                             tr(32036),
                             self.sel_sysvol), (tr(32750),
                                                self.sel_keymap)])
Beispiel #3
0
    def sel_manager(self):
        func_available, eqid, _, _, _, _ = self.check_func_available()
        if not func_available: return

        self.eqid = eqid
        contextMenu(funcs=[(
            tr(32014),
            self.sel_new_profile), (
                tr(32015),
                self.sel_delete_profile), (tr(32016), self.sel_load_defaults)])
Beispiel #4
0
    def onAction(self, action):
        t = time.time()
        aid = action.getId()
        fid = self.getFocusId()
        buc = action.getButtonCode() & 255
        #log("eqdialog: key: %s fid: %s"%(aid,fid))

        #OK pressed
        if aid in [7]:
            self.save_profile()
            self._close()

        if aid in [100]:
            if fid == 1800:
                #self.save_profile()
                self.load_profile()
                self._close()

        #Cancel
        if aid in [92, 10]:
            if self.is_changed:
                contextMenu(funcs=[(tr(32622),
                                    self.sel_cancel), (tr(32623),
                                                       self.sel_save)])
            else:
                self.close()

        self.dyn_step.dynamic_step(buc)

        if aid in [3, 104]:
            ctl = self.getControl(self.controlId)
            new = ctl.getInt() + self.dyn_step.dynstep
            if ctl.getInt() < 50 and new > 50: new = 50
            pos = new
            if pos > 100: pos = 100
            ctl.setInt(pos, 0, 0, 100)

        if aid in [4, 105]:
            ctl = self.getControl(self.controlId)
            new = ctl.getInt() - self.dyn_step.dynstep
            if ctl.getInt() > 50 and new < 50: new = 50
            pos = new
            if pos < 0: pos = 0
            ctl.setInt(pos, 0, 0, 100)

        if aid in [3, 4, 104, 105, 106]:
            self.setFocusId(self.controlId)
            self.setFilter()

        self.last_key = t
Beispiel #5
0
    def sel_profile(self):
        func_available, eqid, _, is_playing, _, is_dyn = self.check_func_available(
        )
        if not func_available: return

        self.eqid = eqid

        include_switch_off = is_dyn and is_playing

        profiles = SocketCom("server").call_func("get", "eq_profiles")
        profile = SocketCom("server").call_func("get", "eq_base_profile")

        if include_switch_off: profiles = [tr(32011)] + profiles

        funcs = [(tr(32014), self.sel_new_profile),
                 (tr(32015), self.sel_delete_profile),
                 (tr(32016), self.sel_load_defaults)]

        sel = contextMenu(items=profiles, default=profile, funcs=funcs)

        if sel is None: return
        if include_switch_off and sel == 0:
            SocketCom("server").call_func("switch", "eq_off")
        else:
            SocketCom("server").call_func("load", "eq_profile",
                                          [eqid, profiles[sel]])
	def on_sel_repeats(self):
		numbers = ["- %s -" % str(i+1) for i in range(10)]

		nsel = contextMenu(items = numbers, default = numbers[self.repeats])
		if nsel is None: return

		self.repeats = nsel
		self.getControl(303).setLabel(str(nsel+1))
	def on_sel_channel(self):
		sel_list = [tr(32412) + "  (0)"] + [tr(32500 + i)+ "  (%s)"%(i+1) for i in self.channel]

		nsel = contextMenu(items = sel_list, default = sel_list[self.channel_sel])
		if nsel is None: return

		self.channel_sel=nsel
		self.getControl(302).setLabel(sel_list[nsel])
	def on_sel_correction(self):
		nsel = contextMenu(items = self.corrections, default = self.corrections[self.sel_correction])
		if nsel is None: return

		if nsel == 0: self.sock.call_func("unset","room_correction", [self.eqid])
		else: self.sock.call_func("set","room_correction" , [self.eqid, self.corrections[nsel]])
		self.sel_correction = nsel

		self.getControl(301).setLabel(self.corrections[nsel])
	def on_sel_profile(self):
		nsel = contextMenu(items = self.profiles, default = self.profiles[self.sel_profile])

		if nsel is None: return

		if nsel == 0: self.sock.call_func("unload","eq_profile",[self.eqid])
		else: self.sock.call_func("load","eq_profile" , [self.eqid, self.profiles[nsel]])
		self.sel_profile = nsel
		self.getControl(300).setLabel(self.profiles[self.sel_profile])
Beispiel #10
0
    def sel_delete_correction(self):
        corrections = SocketCom("server").call_func("get", "room_corrections")

        if not corrections: return

        nr = contextMenu(items=corrections)
        if nr is None: return

        del_correction = corrections[nr]
        # sure to delete
        if xbmcgui.Dialog().yesno(
                tr(32030) % del_correction,
                tr(32031) % del_correction) is True:
            SocketCom("server").call_func("remove", "room_correction",
                                          [del_correction])
        self.sel_correction()
Beispiel #11
0
    def sel_delete_profile(self):
        profiles = SocketCom("server").call_func("get", "eq_profiles")

        if not profiles: return

        nr = contextMenu(items=profiles)
        if nr is None: return

        # sure to delete
        del_profile = profiles[nr]
        if xbmcgui.Dialog().yesno(
                tr(32018) % del_profile,
                tr(32019) % del_profile) is True:
            SocketCom("server").call_func("remove", "eq_profile",
                                          [del_profile])
        self.sel_profile()
Beispiel #12
0
    def sel_device():
        response = xbmc.executeJSONRPC(
            '{"jsonrpc":"2.0", "method":"Settings.GetSettings", "params":{ "filter": {"section":"system", "category":"audio"}}, "id":1}'
        )
        r_dict = json.loads(response)

        settings = r_dict["result"]["settings"]
        for s in settings:
            if s["id"] == "audiooutput.audiodevice":
                value = s["value"]
                options = s["options"]

                sel_lables = []
                sel_values = []
                preselect = 0
                index = 0
                for o in options:
                    if "eq-auto-load" in o["value"]: continue

                    if o["value"] == value:
                        preselect = index

                    sel_values.append(o["value"])
                    sel_lables.append(o["label"].replace("(PULSEAUDIO)", ''))
                    index = index + 1

        # device selection Dialog

        sel = contextMenu(items=sel_lables,
                          default=sel_lables[preselect],
                          width=1000)

        if sel is None: return

        response = xbmc.executeJSONRPC(
            '{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice", "value":"%s"}, "id":1}'
            % (sel_values[sel]))
        SocketCom("server").call_func("set", "device", [sel_values[sel]])
Beispiel #13
0
    def sel_correction(self):
        func_available, eqid, _, _, _, _ = self.check_func_available()
        if not func_available: return

        corrections = SocketCom("server").call_func("get", "room_corrections")
        correction = SocketCom("server").call_func("get", "room_correction")
        if correction is None: correction = tr(32411)

        corrections = [tr(32411)] + corrections

        funcs = [(tr(32033), self.sel_import_correction),
                 (tr(32028), self.sel_delete_correction),
                 (tr(32032), self.sel_playsweep)]

        sel = contextMenu(items=corrections, default=correction, funcs=funcs)

        if sel is None: return
        if sel == 0:
            SocketCom("server").call_func("unset", "room_correction", [eqid])
            return

        SocketCom("server").call_func("set", "room_correction",
                                      [eqid, corrections[sel]])