def setup(self, kg): self.clear_children(True) self.kg = kg self.s = kg.s vbox = gtk.VBox() hbox = gtk.HBox() controls = [ rangewidget.AkComboBox(kg, "filter", midiutils.sampler_lists["filter"]), rangewidget.AkComboBox( kg, "filter_attenuation", midiutils.sampler_lists["filter_attenuation"]), ] controls_b = [ rangewidget.AkKnobWidget(kg, "filter_cutoff", 0, 100, 1, ""), rangewidget.AkKnobWidget(kg, "filter_resonance", 0, 100, 1, ""), ] for control in controls: hbox.pack_start(control, False, False, 1) #vbox.pack_start(hbox, False, False, 1) #hbox = gtk.HBox() for control in controls_b: hbox.pack_start(control, False, False, 1) vbox.pack_start(hbox, False, False, 1) self.pack_start(vbox, False, False, 1) self.show_all()
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, kg): self.clear_children(True) self.kg = kg self.s = kg.s zonevbox = gtk.VBox() self.sample_combos = [] for j in range(4): zone = kg.zones[j] zone.set_callback = self.set_callback #zonewidget = MiniZoneWidget(kg.zones[j]) #zonewidget = AkComboBox(zone, "sample", z48.samplesmodel) zonehbox = gtk.HBox() self.sample_combos.append( rangewidget.AkComboBox(zone, "sample", self.s.samplesmodel, False)) zonecombos = [ self.sample_combos[j], # TODO: rangewidget.AkComboBox(zone, "output", utils.sampler_lists["output"]), # TODO: rangewidget.AkComboBox(zone, "keyboard_track", utils.sampler_lists["keyboard_track"]), rangewidget.AkComboBox(zone, "playback", midiutils.sampler_lists["playback_b"]) ] zoneknobs = [ rangewidget.AkKnobWidget(zone, "level", -600, 60, 10, "db"), rangewidget.AkKnobWidget(zone, "pan", 0, 100, 1, ""), rangewidget.AkKnobWidget(zone, "filter", -100, 100, 1, ""), rangewidget.AkKnobWidget(zone, "mod_start", -9999, 9999, 1, ""), rangewidget.AkKnobWidget(zone, "tune", -3600, 3600, 100, ""), ] for zonecombo in zonecombos: zonehbox.pack_start(zonecombo, True, True, 1) zonecombo.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.dnd_list, gtk.gdk.ACTION_COPY) zonecombo.connect("drag_data_received", self.on_drag_data_received, kg, j, zonecombo) #zonevbox.pack_start(zonehbox, False, False, 0) #zonehbox = gtk.HBox() for zoneknob in zoneknobs: zonehbox.pack_start(zoneknob, False, False, 1) zonevbox.pack_start(zonehbox, False, False, 2) self.pack_start(zonevbox) self.show_all()
def setup(self, m): self.m = m self.no_parts = self.m.no_parts self.clear_widgets() for i in range(self.no_parts): p = part.Part(self.s, m, i) kghboxall = gtk.HBox() kghboxall.pack_start( rangewidget.AkComboBox(p, "multi_part_name", self.s.programsmodel, False), True, True, 2) kghboxall.pack_start(rangewidget.PartRangeWidget(p, "part_level"), True, True, 2) kghboxall.pack_start( rangewidget.AkKnobWidget(p, "part_pan", 0, 100, 1, None), False, False, 2) kghboxall.pack_start( rangewidget.AkComboBox(p, "part_output", midiutils.sampler_lists["output"], True), True, True, 2) kghboxall.pack_start( rangewidget.AkComboBox(p, "part_midi_channel", midiutils.sampler_lists["midi_channel"], True), True, True, 2) self.pack_start(kghboxall, False, False, 2)
def setup(self, kg): self.clear_children(True) self.kg = kg self.s = kg.s lfovbox = gtk.VBox() for i in range(2): lfohbox = gtk.HBox() l = lfo.LFO(kg.s, kg, i) # two lfos lfohbox.pack_start( rangewidget.AkKnobWidget(l, "lfo_depth", 0, 100, 1, None), False, False, 0) lfohbox.pack_start( rangewidget.AkKnobWidget(l, "lfo_rate", 0, 100, 1, None), False, False, 0) # what is this in hz? lfohbox.pack_start( rangewidget.AkKnobWidget(l, "lfo_delay", 0, 100, 1, None), False, False, 0) # what is this in ms? lfohbox.pack_start( rangewidget.AkKnobWidget(l, "lfo_phase", 0, 360, 1, None), False, False, 0) lfohbox.pack_start( rangewidget.AkKnobWidget(l, "lfo_shift", -50, 50, 1, None), False, False, 0) lfohbox.pack_start( rangewidget.AkComboBox(l, "lfo_waveform", midiutils.sampler_lists["lfo_waves"]), True, True, 0) lfohbox.pack_start( rangewidget.AkComboBox( l, "lfo_retrigger", midiutils.sampler_lists["lfo_retrigger"]), True, True, 0) lfohbox.pack_start( rangewidget.AkComboBox(l, "lfo_sync", midiutils.sampler_lists["lfo_sync"]), True, True, 0) lfohbox.pack_start( rangewidget.AkComboBox( l, "lfo_midi_sync", midiutils.sampler_lists["lfo_midi_sync"]), True, True, 0) lfovbox.pack_start(lfohbox) self.pack_start(lfovbox, False, False, 1) self.show_all()
def setup(self, kg): self.clear_children(True) print kg.index self.kg = kg self.s = kg.s vbox = gtk.VBox() hbox = gtk.HBox() controls = [ rangewidget.AkKnobWidget(kg, "level", -600, 60, 10, "db"), rangewidget.AkKnobWidget(kg, "tune", -3600, 3600, 100, ""), rangewidget.AkKnobWidget(kg, "polyphony", 1, 64, 1, "voices"), # mute group # fx send # send volume ] for control in controls: hbox.pack_start(control, False, False, 1) vbox.pack_start(hbox, False, False, 1) self.pack_start(vbox, False, False, 1) self.show_all()
def setup(self, kg, index): self.e = envelope.Envelope(kg, index) self.clear_widgets() if index == 0: # amp envelope is simpler knobs = ['rate1', 'rate2', 'level2', 'rate3'] self.e.abbr['envelope_rate1'] = 'A' self.e.abbr['envelope_rate2'] = 'D' self.e.abbr['envelope_level2'] = 'S' self.e.abbr['envelope_rate3'] = 'R' else: knobs = [ 'rate1', 'level1', 'rate2', 'level2', 'rate3', 'level3', 'rate4', 'level4', 'reference' ] for knob_name in knobs: knob = rangewidget.AkKnobWidget(self.e, 'envelope_' + knob_name, 0, 100, 1, None) self.pack_start(knob, False, False, 2)
def setup(self, so): self.clear_children(True) self.s = so.s self.so = so if len(so.mod_matrix) == 0: so.load_matrix() self.table = gtk.Table(len(self.sources) + 1, len(self.destinations) + 1, False) t = self.table for source in self.sources: i = self.sources.index(source) source_label = gtk.Label("<span size='smaller'>%s</span>" % source) source_label.set_property("angle", 90) source_label.set_use_markup(True) t.attach(source_label, i+1, i+2, 0, 1) for dest in self.destinations: i = self.destinations.index(dest) dest_index = modulationmatrix.ModulationMatrix.destinations.index(dest) dest_label = gtk.Label("<span size='smaller'>%s</span>" % dest) dest_label.set_use_markup(True) t.attach(dest_label, 0, 1, i + 1, i + 2) for source in self.sources: j = self.sources.index(source) source_index = modulationmatrix.ModulationMatrix.sources.index(source) mod_name = "MOD_%d_%d" % (source_index, dest_index) mod_knob = rangewidget.AkKnobWidget(self.so, mod_name, -100, 100, 1, units="", mod_destination=dest) # filter env to res t.attach(mod_knob, j + 1, j + 2, i + 1, i + 2, False, False) self.pack_start(t, False, False, 1) self.show_all()