def getString(self): """Returns a string of the actions taken Returns: str: actions taken """ # Return that no action was taken if list is empty if len(self.list) == 0: return internal.getTab(self.name + ":", 2) + "[No actions]" # No indentation required if there was only one action elif len(self.list) == 1: ret = internal.getTab(self.name + ":", 2) + self.list[0].act # If there are multiple actions, indent them else: ret = self.name + ":" for i in range(len(self.list)): ret += '\n' + internal.getTab("") + self.list[i].act if self.handle_type == internal.consts.EVENT_HANDLE: ret += '\n' + internal.getTab("") + "[Handled]" elif self.handle_type == internal.consts.EVENT_IGNORE: ret += '\n' + internal.getTab("") + "[Ignored]" return ret
def getType(self): """Returns string detailing type and ID of event Returns: str: Type and ID of event info """ a = "" b = "" if self.type is eventconsts.TYPE_UNRECOGNISED: a = "Unrecognised" elif self.type is eventconsts.TYPE_SYSEX_EVENT: a = "Sysex" elif self.type is eventconsts.TYPE_NOTE: a = "Note" b = utils.GetNoteName(self.note) + " (Ch. " + str( self.channel) + ')' elif self.type is eventconsts.TYPE_SYSTEM_MSG: a = "System" b = self.getID_System() elif self.type is eventconsts.TYPE_INCONTROL: a = "InControl" b = self.getID_InControl() elif self.type is eventconsts.TYPE_TRANSPORT: a = "Transport" b = self.getID_Transport() elif self.type is eventconsts.TYPE_KNOB or self.type is eventconsts.TYPE_BASIC_KNOB: a = "Knob" b = self.getID_Knobs() elif self.type is eventconsts.TYPE_FADER or self.type is eventconsts.TYPE_BASIC_FADER: a = "Fader" b = self.getID_Fader() elif self.type is eventconsts.TYPE_FADER_BUTTON or self.type is eventconsts.TYPE_BASIC_FADER_BUTTON: a = "Fader Button" b = self.getID_FaderButton() elif self.type is eventconsts.TYPE_PAD: a = "Pad" b = self.getID_Pads() elif self.type is eventconsts.TYPE_BASIC_PAD: a = "Pad (Basic)" b = self.getID_Pads() elif self.type is eventconsts.TYPE_BASIC_EVENT: a = "Basic Event" b = self.getID_Basic() elif self.type is eventconsts.TYPE_INTERNAL_EVENT: a = "Internal event" else: internal.debugLog("Bad event type") a = "ERROR!!!" a = internal.getTab(a) return a + b
def getValue(self): """Returns (formatted) value of event Returns: str: Formatted value (data2) of event """ a = str(self.value) b = "" if self.isBinary: if self.value == 0: b = "(Off)" else: b = "(On)" a = internal.getTab(a, length=5) return a + b
def getInfo(self): """Returns info about event Returns: str: Details about the event """ out = "Event:" out = internal.getTab(out) # Event type and ID temp = self.getType() out += temp out = internal.getTab(out) # Event value temp = self.getValue() out += temp out = internal.getTab(out) # Event full data temp = self.getDataString() out += temp out = internal.getTab(out) if self.is_double_click: out += "[Double Click]" out = internal.getTab(out) if self.is_long_press: out += "[Long Press]" out = internal.getTab(out) if internal.shifts.query(): out += "[Shifted | " + internal.shifts.current_down + "]" out = internal.getTab(out) """ # Add this back soon hopefully if self.id == config.SHIFT_BUTTON: out += "[Shift Key]" out = internal.getTab(out) """ # For internal events, have a different printing flag if self.type == eventconsts.TYPE_INTERNAL_EVENT: if not internal.consts.DEBUG.PRINT_INTERNAL_EVENTS in config.CONSOLE_DEBUG_MODE: out = "" return out