def do_lists(s): Main.do_programlist(s) setattr(s, 'samples', Main.get_names(s.sampletools)) setattr(s, 'samplesmodel', modelutils.get_model_from_list(s.samples)) setattr(s, 'multis', Main.get_names(s.multitools)) setattr(s, 'multismodel', modelutils.get_model_from_list(s.multis))
def do_lists(self): s = self.s setattr(s, 'samples', s.sampletools.get_names()) setattr(s, 'programs', s.programtools.get_names()) setattr(s, 'multis', s.multitools.get_names()) setattr(s, 'samplesmodel', modelutils.get_model_from_list(s.samples)) setattr(s, 'programsmodel', modelutils.get_model_from_list(s.programs)) setattr(s, 'multismodel', modelutils.get_model_from_list(s.multis))
def do_lists(self): s = self.s setattr(s, 'samples', s.sampletools.get_names()) setattr(s, 'programs', s.programtools.get_names()) setattr(s, 'multis', s.multitools.get_names()) setattr(s, 'samplesmodel', modelutils.get_model_from_list(s.samples)) setattr(s, 'programsmodel', modelutils.get_model_from_list(s.programs)) setattr(s, 'multismodel', modelutils.get_model_from_list(s.multis))
def __init__(self,s): self.s = s pt = s.programtools self.no_items = pt.get_no_items() self.handles_names = pt.get_handles_names() self.names = pt.get_names() self.curr_handle = pt.get_curr_handle() if self.curr_handle != 268435455: self.curr_name = pt.get_curr_name() self.programdict = { } i = 0 while i < len(self.handles_names): self.programdict[self.handles_names[i]] = self.handles_names[i+1] i += 2 self.programsmodel = modelutils.get_model_from_list(self.programdict) self.programtypesmodel = modelutils.get_model_from_list(Programs.programtypes)
def on_new_multi_activate(self, widget): selected_programs = get_selected_from_treeview(self.main.w_treeview_programs) model = modelutils.get_model_from_list(selected_programs) self.dialogCreateNewMultiFast.w_treeview_selected_programs.set_model(model) self.dialogCreateNewMultiFast.w_entry_name.set_text('Multi %i' % (self.main.s.multitools.get_no_items() + 1)) response = self.dialogCreateNewMultiFast.editor.run() if response == gtk.RESPONSE_OK: name = self.dialogCreateNewMultiFast.w_entry_name.get_text() self.s.multitools.create_new(len(selected_programs), name) self.s.multitools.set_curr_by_name(name) for i, p in enumerate(selected_programs): self.s.multitools.set_multi_part_name(i, p) self.main.init_lists()
def __init__(self, so, soattr, model, use_index = True): if type(model) is list: model = modelutils.get_model_from_list(model) gtk.ComboBox.__init__(self, model) #self.set_size_request(50, 25) cell = gtk.CellRendererText() self.use_index = use_index # use value, versus index self.pack_start(cell, False) self.add_attribute(cell, 'text', 0) self.connect("changed", self.on_changed) self.somodel = model self.init(so, soattr)
value /= 10 elif self.template == " 0.00": value /= 100 if self.string: formatted = self.string else: formatted = self.format % {"value":value, "units":self.units} return formatted def on_value_changed(self, adj, lblFormat = None): s,ci,mi,pi = self.s,self.channel.index,self.module.index,self.index s.multifxtools.set_param_value(ci,mi,pi,int(adj.value)) self.value = adj.value if self.string: self.string = s.multifxtools.get_param_string(ci,mi,pi) lblFormat.set_text(self.format_value()) def dump(self): attrs = ['maximum','minimum','name','type','position_id'] for attr in attrs: print '\t\tParam ',self.index,' :',attr,' = ',getattr(self,attr) inputmapmodel = modelutils.get_model_from_list(MultiFXChannel.inputmap) outputmapmodel = modelutils.get_model_from_list(MultiFXChannel.outputmap) effectmodel = modelutils.get_model_from_list(MultiFX.fxlist)
value /= 100 if self.string: formatted = self.string else: formatted = self.format % {"value": value, "units": self.units} return formatted def on_value_changed(self, adj, lblFormat=None): s, ci, mi, pi = self.s, self.channel.index, self.module.index, self.index s.multifxtools.set_param_value(ci, mi, pi, int(adj.value)) self.value = adj.value if self.string: self.string = s.multifxtools.get_param_string(ci, mi, pi) lblFormat.set_text(self.format_value()) def dump(self): attrs = ['maximum', 'minimum', 'name', 'type', 'position_id'] for attr in attrs: print '\t\tParam ', self.index, ' :', attr, ' = ', getattr( self, attr) inputmapmodel = modelutils.get_model_from_list(MultiFXChannel.inputmap) outputmapmodel = modelutils.get_model_from_list(MultiFXChannel.outputmap) effectmodel = modelutils.get_model_from_list(MultiFX.fxlist)
def do_programlist(s): setattr(s, 'programs', Main.get_names(s.programtools)) setattr(s, 'programsmodel', modelutils.get_model_from_list(s.programs))
def on_new_program_activate(self, widget): selected_samples = get_selected_from_treeview(self.main.w_treeview_samples) model = modelutils.get_model_from_list(selected_samples) tv = self.dialogCreateNewProgramFast.w_treeview_selected_samples.set_model(model) self.dialogCreateNewProgramFast.w_entry_program_name.set_text('Program %i' % (self.main.s.programtools.get_no_items() + 1)) response = self.dialogCreateNewProgramFast.editor.run() if response == gtk.RESPONSE_OK: program_name = self.dialogCreateNewProgramFast.w_entry_program_name.get_text() # create program # figure out note ranges # iterate over notes and set up keygroups # set keygroup low note and high note and zone 1 sample method = self.dialogCreateNewProgramFast.w_combo_allocate_method.get_active() starting_note = self.dialogCreateNewProgramFast.w_combo_starting_note.get_active() type = self.dialogCreateNewProgramFast.w_combo_program_type.get_active() num_samples = len(selected_samples) notes = [] if method == 0: # chromatic for i in range(starting_note, starting_note+num_samples): notes.append([i, i]) keytrack = 1 playback = 0 elif method == 1: # drum for i in range(num_samples): notes.append([midiutils.mpcpads[i], midiutils.mpcpads[i]]) keytrack = 0 # one shot playback = 1 elif method == 2: # span for i in range(num_samples): notes.append([0, 127]) keytrack = 1 playback = 0 self.s.programtools.create_new(len(selected_samples), program_name) self.s.programtools.set_curr_by_name(program_name) if type == 1: # drum program self.main.log("setting drum type") self.s.programtools.set_type(1) for i in range(num_samples): #self.main.log(str("adding", i, notes[i][0], notes[i][1], selected_samples[i])) if type == 0: self.s.keygrouptools.set_curr_keygroup(i) print "set note range" self.s.keygrouptools.set_low_note(notes[i][0]) self.s.keygrouptools.set_high_note(notes[i][1]) else: self.s.keygrouptools.set_curr_keygroup(notes[i][0]) print "set zone stuff" self.s.zonetools.set_keyboard_track(1, keytrack) self.s.zonetools.set_playback(1, playback) print "set sample" self.s.zonetools.set_sample(1, selected_samples[i]) #self.s.programtools.add_keygroup_sample(notes[i][0],notes[i][1],1,keytrack,selected_samples[i]) self.main.init_lists() self.dialogCreateNewProgramFast.editor.hide()