def setup(self, p): self.p = p self.no_keygroups = self.p.no_keygroups self.clear_widgets() rbg = None # radio button group for i in range(self.no_keygroups): kg = keygroup.get_keygroup_cached(p, i) # TODO: Switch to a radio button. tb = gtk.RadioButton(rbg, str(i + 1)) tb.connect("toggled", self.on_button_press_event, (i + 1)) if not rbg: rbg = tb tb.set_active(True) kghboxall = gtk.HBox() kghboxall.pack_start(tb, False, False, 1) kghboxall.pack_start(rangewidget.KeygroupRangeWidget(kg)) #kghboxall.pack_start(rangewidget.AkComboBox(kg.zones[0], "sample", self.s.samplesmodel, False)) kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), False, False, 2) kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), False, False, 2) self.pack_start(kghboxall, False, False, 2)
def setup(self, p): self.p = p self.no_keygroups = self.p.no_keygroups self.clear_widgets() rbg = None # radio button group for i in range(self.no_keygroups): kg = keygroup.get_keygroup_cached(p, i) # TODO: Switch to a radio button. tb = gtk.RadioButton(rbg, str(i + 1)) tb.connect("toggled", self.on_button_press_event, (i + 1)) if not rbg: rbg = tb tb.set_active(True) kghboxall = gtk.HBox() kghboxall.pack_start(tb, False, False, 1) kghboxall.pack_start(rangewidget.KeygroupRangeWidget(kg)) #kghboxall.pack_start(rangewidget.AkComboBox(kg.zones[0], "sample", self.s.samplesmodel, False)) kghboxall.pack_start( rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), False, False, 2) kghboxall.pack_start( rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), False, False, 2) self.pack_start(kghboxall, False, False, 2)
def __init__(self, s, p): base.Base.__init__(self, p, "keygroupEditorZ") self.s = p.s self.p = p if self.p.type == 1: self.keygroupEditor = editors.DrumEditorTable(s, p) else: self.keygroupEditor = editors.KeygroupEditorVBox(s, p) self.keygroupEditor.on_toggled_callback = self.on_toggled_callback # get first keygroup self.curr_keygroup = keygroup.get_keygroup_cached(p, 0) self.panels = [] self.rightVBox = gtk.VBox() panel_list = [ ("keygroupPanel", keygrouppanel.KeygroupPanel), ("zonePanel", zonepanel.ZonePanel), ("filterPanel", filterpanel.FilterPanel), ("LFOPanel", lfopanel.LFOPanel), ("keygroupEnvelopes", keygroupenvelope.KeygroupEnvelopes), ("modMatrix", modmatrix.ModMatrix), ] for (n, ui_type) in panel_list: panel = ui_type(self.curr_keygroup, self.update_status) setattr(self, n, panel) self.panels.append(panel) for panel in self.panels: self.rightVBox.pack_start(panel, False, False, 0) self.w_entryProgramName.set_text(p.name) self.w_viewportKeygroups.add(self.keygroupEditor) self.w_viewportSlats.add(self.rightVBox) rbg = None curr_mode = self.curr_keygroup.gettools().get_edit_mode() modes = ["ONE", "ALL", "ADD"] i = 0 for mode in modes: tb = gtk.RadioButton(rbg, mode) if not rbg: rbg = tb self.w_hboxNameEdit.add(tb) tb.connect("toggled", self.on_button_press_event, (i)) if curr_mode == i: tb.set_active(True) i = i + 1 children = self.w_statusbar.get_children()[0].get_children() self.statuslabel = children[0]
def setup(self, p): self.p = p self.no_keygroups = self.p.no_keygroups self.clear_widgets() rbg = None # radio button group self.zone_labels = {} for row in range(0,(len(self.note_order) / self.columns)): for column in range(0,self.columns): index = (row * self.columns) + column if index < len(self.note_order): i = self.note_order[index] kg = keygroup.get_keygroup_cached(p, i) desc = midiutils.midinotes[i] tb = gtk.RadioButton(rbg) tb.connect("toggled", self.on_button_press_event, kg.index + 1) if i in midiutils.gm1drumsmap.keys(): subdesc = midiutils.gm1drumsmap[i] # general midi markup label subdesclabel = gtk.Label("<span size='smaller'>%s %s</span>" % (desc, subdesc)) subdesclabel.set_use_markup(True) else: subdesclabel = gtk.Label("<span size='smaller'>%s</span>" % (desc)) subdesclabel.set_use_markup(True) if not rbg: rbg = tb tb.set_active(True) vboxall = gtk.VBox() kghboxall = gtk.HBox() kghboxall.pack_start(tb, False, False, 1) if subdesclabel: kghboxall.pack_start(subdesclabel, False, False, 0) #Dunno if these are really necessary - removing to save space. #kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), False, False, 2) #kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), False, False, 2) vboxall.pack_start(kghboxall, False, False, 1) eventbox = gtk.EventBox() eventbox.connect("button_press_event", self.on_label_click, tb) eventbox.set_events(gtk.gdk.BUTTON_PRESS_MASK) zone_vbox = gtk.VBox(False, 0) self.zone_labels[i] = [] for zone_index in range(4): zone_label = rangewidget.AkLabel(kg.zones[zone_index], "sample", self.s.samplesmodel, False) zone_label.set_justify(gtk.JUSTIFY_LEFT) self.zone_labels[i].append(zone_label) zone_label.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) zone_label.connect("drag_data_received", self.on_drag_data_received, kg, zone_label, zone_index) zone_vbox.pack_start(zone_label, False, False, 0) vboxall.pack_start(zone_vbox, False, False, 0) eventbox.add(vboxall) self.attach(eventbox,column,column+1,row,row+1)
def change_keygroup(self, keygroup_index): self.curr_keygroup = keygroup.get_keygroup_cached( self.p, keygroup_index) self.curr_keygroup.set_current() for panel in self.panels: panel.setup(self.curr_keygroup) if self.p.type == 1: for i in range(4): self.zonePanel.sample_combos[i].connect( "changed", self.on_zone_sample_changed, self.zonePanel.sample_combos[i], self.keygroupEditor.zone_labels[keygroup_index][i])
def change_keygroup(self, keygroup_index): self.curr_keygroup = keygroup.get_keygroup_cached(self.p, keygroup_index) self.curr_keygroup.set_current() for panel in self.panels: panel.setup(self.curr_keygroup) if self.p.type == 1: for i in range(4): self.zonePanel.sample_combos[i].connect( "changed", self.on_zone_sample_changed, self.zonePanel.sample_combos[i], self.keygroupEditor.zone_labels[keygroup_index][i], )
def setup(self, p): self.p = p self.no_keygroups = self.p.no_keygroups self.clear_widgets() rbg = None # radio button group self.zone_labels = {} for row in range(0, (len(self.note_order) / self.columns)): for column in range(0, self.columns): index = (row * self.columns) + column if index < len(self.note_order): i = self.note_order[index] kg = keygroup.get_keygroup_cached(p, i) desc = midiutils.midinotes[i] tb = gtk.RadioButton(rbg) tb.connect("toggled", self.on_button_press_event, kg.index + 1) if i in midiutils.gm1drumsmap.keys(): subdesc = midiutils.gm1drumsmap[i] # general midi markup label subdesclabel = gtk.Label( "<span size='smaller'>%s %s</span>" % (desc, subdesc)) subdesclabel.set_use_markup(True) else: subdesclabel = gtk.Label( "<span size='smaller'>%s</span>" % (desc)) subdesclabel.set_use_markup(True) if not rbg: rbg = tb tb.set_active(True) vboxall = gtk.VBox() kghboxall = gtk.HBox() kghboxall.pack_start(tb, False, False, 1) if subdesclabel: kghboxall.pack_start(subdesclabel, False, False, 0) #Dunno if these are really necessary - removing to save space. #kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), False, False, 2) #kghboxall.pack_start(rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), False, False, 2) vboxall.pack_start(kghboxall, False, False, 1) eventbox = gtk.EventBox() eventbox.connect("button_press_event", self.on_label_click, tb) eventbox.set_events(gtk.gdk.BUTTON_PRESS_MASK) zone_vbox = gtk.VBox(False, 0) self.zone_labels[i] = [] for zone_index in range(4): zone_label = rangewidget.AkLabel( kg.zones[zone_index], "sample", self.s.samplesmodel, False) zone_label.set_justify(gtk.JUSTIFY_LEFT) self.zone_labels[i].append(zone_label) zone_label.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) zone_label.connect("drag_data_received", self.on_drag_data_received, kg, zone_label, zone_index) zone_vbox.pack_start(zone_label, False, False, 0) vboxall.pack_start(zone_vbox, False, False, 0) eventbox.add(vboxall) self.attach(eventbox, column, column + 1, row, row + 1)