diff --git a/mdvj/control_md.py b/mdvj/control_md.py index ca8603b..69cca8e 100644 --- a/mdvj/control_md.py +++ b/mdvj/control_md.py @@ -100,8 +100,9 @@ def get_pad_container(self,lr,padno): def select_pad(self,lr,padno): pc = self.get_pad_container(lr,padno) - self.mdc.select_preset(pc.preset) - self.gui.queue.put(['pad',[lr, padno]]) + if pc: + self.mdc.select_preset(pc.preset) + self.gui.queue.put(['pad',[lr, padno]]) def select_pad_gui(self,lr,padno): if self.last_pad and self.last_pad != [lr, padno]: # deselect (in gui) last pad diff --git a/mdvj/error_scrot.bmp b/mdvj/error_scrot.bmp new file mode 100644 index 0000000..9a3a349 Binary files /dev/null and b/mdvj/error_scrot.bmp differ diff --git a/mdvj/mdvj.py b/mdvj/mdvj.py index e54c592..ae24c94 100644 --- a/mdvj/mdvj.py +++ b/mdvj/mdvj.py @@ -37,11 +37,18 @@ def __init__(self,root,mainprogram=None,path="C:/Program Files (x86)/Winamp/plug #self.padgroup_l_n = -1 #self.padgroup_r_n = -1 - #if starting_len > 1: - self.padgroup_l_n = 0 - self.padgroup_r_n = 1 - self.padgroup_l = SuperPadGroup(self,0)#,self.db[0]) - self.padgroup_r = SuperPadGroup(self,1)#,self.db[1]) + if starting_len > 1: + self.padgroup_l_n = 0 + self.padgroup_r_n = 1 + self.padgroup_l = SuperPadGroup(self,0)#,self.db[0]) + self.padgroup_r = SuperPadGroup(self,1)#,self.db[1]) + self.padgroups = [self.padgroup_l,self.padgroup_r] + + else: + self.padgroup_l_n = 0 + self.padgroup_r_n = 0 + self.padgroup_l = SuperPadGroup(self,0)#,self.db[0]) + self.padgroups = [self.padgroup_l,self.padgroup_l] #else: # if starting_len > 0: # self.padgroup_l_n = 0 @@ -49,7 +56,6 @@ def __init__(self,root,mainprogram=None,path="C:/Program Files (x86)/Winamp/plug # else: # self.padgroup_l = SuperPadGroup(self,0) # self.padgroup_r = SuperPadGroup(self,1) - self.padgroups = [self.padgroup_l,self.padgroup_r] self.controlframe = tk.Frame(self.frame) @@ -155,6 +161,7 @@ def __init__(self,parent,lr): self.show_group(self.current_group) def show_group(self,groupno): + #if groupno < len(self.padgroup_cont): self.current_group = groupno cgroup = self.padgroup_cont[groupno] cgroup.frame.tkraise() @@ -201,7 +208,10 @@ def __init__(self,padgroup,preset,lr,padno): self.padgroup = padgroup self.preset = preset self.coords = [lr,padno] - self.img = Image.open(self.preset.img) + try: + self.img = Image.open(self.preset.img) + except: + self.img = Image.open("error_scrot.bmp") self.img = self.img.resize((150, 150), Image.ANTIALIAS) self.img = ImageTk.PhotoImage(self.img) self.label = tk.Label(self.padgroup.frame,image=self.img,text="",compound='top',width=150,bd=5) diff --git a/mdvj/midi_config.py b/mdvj/midi_config.py index 5227c50..1d7ea46 100644 --- a/mdvj/midi_config.py +++ b/mdvj/midi_config.py @@ -248,6 +248,9 @@ def __init__(self,parent): self.output_choice = tk.StringVar() self.output_choice.set('-') + if self.inputs == []: + self.return_vals() + self.input_select = tk.OptionMenu(self.device_select_frame,self.input_choice,*self.inputs) self.output_select = tk.OptionMenu(self.device_select_frame,self.output_choice,*self.outputs) diff --git a/mdvj/saved_state b/mdvj/saved_state index 965d2d6..6aefad2 100644 Binary files a/mdvj/saved_state and b/mdvj/saved_state differ diff --git a/setup.py b/setup.py index b7437c8..c295b96 100644 --- a/setup.py +++ b/setup.py @@ -11,16 +11,14 @@ pywin32_whl = "https://pypi.python.org/packages/cp34/p/pypiwin32/pypiwin32-219-cp34-none-win32.whl" setup( name='mdvj', - version='0.5.0', - - description='Milkdrop DJ Tool', + version='0.5.1', + description='Milkdrop VJ Tool', long_description=""" mdvj - milkdrop vj midi controller -for use with novation twitch controller """, url='https://github.com/pussinboot/mdvj', - keywords='vj midi novation', + keywords='vj midi', packages=['mdvj'], install_requires=[ @@ -33,7 +31,9 @@ pygame_whl, pywin32_whl ], - + package_data={ + 'mdvj' : ['error_scrot.bmp'] + }, entry_points = { 'console_scripts': [ 'mdvj = mdvj.mdvj:main'