Ejemplo n.º 1
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.wm_title = "Control Buses"
     self.app = app
     self.proxy = app.proxy
     self.parser = app.ls_parser
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     lab_title = factory.label(main, "Control Busses", modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list, command=self.select_bus)
     self.listbox.pack(expand=True, fill=BOTH)
     sb = factory.scrollbar(main, yclient=self.listbox)
     lab_name = factory.label(main, "Name", modal=True)
     lab_channels = factory.label(main, "Channels", modal=True)
     self._var_name = StringVar()
     entry_name = factory.entry(main,
                                self._var_name,
                                ttip="Control bus name")
     #self._var_chancount = StringVar()
     #spin_chancount = factory.int_spinbox(main, self._var_chancount, 1, 64)
     self.lab_warning = factory.warning_label(main, modal=True)
     button_bar = factory.frame(main, modal=True)
     #b_remove = factory.delete_button(button_bar,ttip="Delete control bus",command=self.remove_bus)
     b_add = factory.add_button(button_bar,
                                ttip="Add new control bus",
                                command=self.add_bus)
     #b_refresh = factory.refresh_button(button_bar, ttip="Refresh bus list", command=self.refresh)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_help = factory.help_button(button_bar, command=self.display_help)
     lab_title.grid(row=0, column=0, columnspan=6, pady=8)
     frame_list.grid(row=1, column=0, rowspan=5, columnspan=5, pady=8)
     sb.grid(row=1, column=4, rowspan=5, sticky=NS, pady=4, padx=4)
     lab_name.grid(row=6, column=0, sticky=W, padx=4)
     entry_name.grid(row=6, column=1)
     lab_channels.grid(row=7, column=0, sticky=W, pady=8, padx=4)
     #spin_chancount.grid(row=7, column=1)
     self.lab_warning.grid(row=8, column=0, columnspan=6)
     button_bar.grid(row=9, column=0, columnspan=6, padx=8, pady=4)
     #b_remove.grid(row=0, column=0)
     b_add.grid(row=0, column=1)
     #b_refresh.grid(row=0, column=2)
     b_help.grid(row=0, column=3)
     #factory.label(button_bar, "").grid(row=0, column=4, padx=16)
     factory.padding_label(button_bar).grid(row=0, column=4, padx=16)
     b_accept.grid(row=0, column=5)
     self._current_selection = 0
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     entry_name.bind('<Return>', self.add_bus)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.refresh()
     self.grab_set()
     self.mainloop()
Ejemplo n.º 2
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.wm_title = "Control Buses"
     self.app = app
     self.proxy = app.proxy
     self.parser = app.ls_parser
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     lab_title = factory.label(main, "Control Busses", modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list, command=self.select_bus)
     self.listbox.pack(expand=True, fill=BOTH)
     sb = factory.scrollbar(main, yclient=self.listbox)
     lab_name = factory.label(main, "Name", modal=True)
     lab_channels = factory.label(main, "Channels", modal=True)
     self._var_name = StringVar()
     entry_name = factory.entry(main, self._var_name, ttip="Control bus name")
     #self._var_chancount = StringVar()
     #spin_chancount = factory.int_spinbox(main, self._var_chancount, 1, 64)
     self.lab_warning = factory.warning_label(main, modal=True)
     button_bar = factory.frame(main, modal=True)
     #b_remove = factory.delete_button(button_bar,ttip="Delete control bus",command=self.remove_bus)
     b_add = factory.add_button(button_bar, ttip="Add new control bus", command=self.add_bus)
     #b_refresh = factory.refresh_button(button_bar, ttip="Refresh bus list", command=self.refresh)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_help = factory.help_button(button_bar, command=self.display_help)
     lab_title.grid(row=0, column=0, columnspan=6, pady=8)
     frame_list.grid(row=1, column=0, rowspan=5, columnspan=5, pady=8)
     sb.grid(row=1, column=4, rowspan=5, sticky=NS, pady=4, padx=4)
     lab_name.grid(row=6, column=0, sticky=W, padx=4)
     entry_name.grid(row=6, column=1)
     lab_channels.grid(row=7, column=0, sticky=W, pady=8, padx=4)
     #spin_chancount.grid(row=7, column=1)
     self.lab_warning.grid(row=8, column=0, columnspan=6)
     button_bar.grid(row=9, column=0, columnspan=6, padx=8, pady=4)
     #b_remove.grid(row=0, column=0)
     b_add.grid(row=0, column=1)
     #b_refresh.grid(row=0, column=2)
     b_help.grid(row=0, column=3)
     #factory.label(button_bar, "").grid(row=0, column=4, padx=16)
     factory.padding_label(button_bar).grid(row=0, column=4, padx=16)
     b_accept.grid(row=0, column=5)
     self._current_selection = 0
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     entry_name.bind('<Return>', self.add_bus)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.refresh()
     self.grab_set()
     self.mainloop()
Ejemplo n.º 3
0
 def _init_list_frame(self):
     frame = factory.frame(self)
     lbx = factory.listbox(frame)
     sbar = factory.scrollbar(frame, orientation="vertical")
     lbx.pack(side="left", expand=True, fill="both")
     sbar.pack(after=lbx, side="right", expand=True, fill="y")
     lbx.config(yscrollcommand=sbar.set)
     lbx.bind("<<ListboxSelect>>", self._select_slot)
     lbx.bind("<Up>", self._decrement_selection)
     lbx.bind("<Down>", self._increment_selection)
     sbar.config(command = lbx.yview)
     self.listbox = lbx
     return frame
Ejemplo n.º 4
0
 def __init__(self, master, app):
     Frame.__init__(self, master)
     self.config(background=factory.bg())
     self.app = app
     self.proxy = app.proxy
     self.pack_propagate(False)
     self.listbox = factory.listbox(self)
     self.listbox.config(width=75, height=20)
     sbv = factory.scrollbar(self, yclient=self.listbox)
     sbh = factory.scrollbar(self, xclient=self.listbox, orientation=HORIZONTAL)
     self.listbox.grid(row=0, column=0, rowspan=6, columnspan=8)
     sbv.grid(row=0, column=8, rowspan=6, sticky=NS)
     sbh.grid(row=6, column=0, columnspan=8, sticky=EW)
     self.refresh()
Ejemplo n.º 5
0
 def __init__(self, master, app):
     Frame.__init__(self, master)
     self.config(background=factory.bg())
     self.app = app
     self.proxy = app.proxy
     self.pack_propagate(False)
     self.listbox = factory.listbox(self)
     self.listbox.config(width=75, height=20)
     sbv = factory.scrollbar(self, yclient=self.listbox)
     sbh = factory.scrollbar(self,
                             xclient=self.listbox,
                             orientation=HORIZONTAL)
     self.listbox.grid(row=0, column=0, rowspan=6, columnspan=8)
     sbv.grid(row=0, column=8, rowspan=6, sticky=NS)
     sbh.grid(row=6, column=0, columnspan=8, sticky=EW)
     self.refresh()
Ejemplo n.º 6
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.config(background=factory.pallet("DIALOG-BG"))
     self.wm_title = "MIDI Controllers"
     self.app = app
     self.config = app.config()
     self.parser = app.ls_parser
     self._current_controller=0
     self._save_backup()
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     main.pack_propagate(False)
     lab_title = factory.label(main, "MIDI Controller Names", modal=True)
     self.lab_warning = factory.warning_label(main, "", modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list, command=self.select_controller)
     self.listbox.pack(expand=True, fill=BOTH)
     sb = factory.scrollbar(main, yclient=self.listbox)
     self.refresh()
     self.var_name = StringVar()
     entry_name = factory.entry(main, self.var_name)
     button_bar = factory.frame(main, modal=True)
     b_refresh = factory.refresh_button(button_bar, command=self.refresh)
     b_help = factory.help_button(button_bar, command = self.display_help)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_cancel = factory.cancel_button(button_bar, command=self.cancel)
     lab_title.grid(row=0, column=0, columnspan=4, pady=8)
     frame_list.grid(row=1, column=0, rowspan=6, columnspan=4, sticky=N)
     sb.grid(row=1, column=4, rowspan=6, sticky=NS, padx=4)
     factory.label(main, "Name", modal=True).grid(row=7, column=0, padx=4, sticky="w")
     entry_name.grid(row=7, column=1, columnspan=1, sticky=W, padx=4, pady=8)
     self.lab_warning.grid(row=8, column=0, columnspan=5, sticky=W)
     button_bar.grid(row=9, column=0, columnspan=5, sticky=EW, padx=4, pady=4)
     b_refresh.grid(row=0, column=0)
     b_help.grid(row=0, column=1)
     b_accept.grid(row=0, column=2)
     b_cancel.grid(row=0, column=3)
     entry_name.bind('<Return>', self.change_name)
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.protocol("WM_DELETE_WINDOW", None)
     self.grab_set()
     self.mainloop()
Ejemplo n.º 7
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.wm_title = "MIDI Channels"
     self.app = app
     self.config = app.config
     self.parser = app.ls_parser
     self._current_index=0
     self._save_backup()
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     lab_title = factory.dialog_title_label(main, "MIDI Channels", modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list, command=self.select)
     self.listbox.pack(expand=True, fill=BOTH)
     self.lab_warning = factory.warning_label(main)
     self.var_name = StringVar()
     entry_name = factory.entry(main, self.var_name)
     button_bar = factory.frame(main, modal=True)
     b_refresh = factory.refresh_button(button_bar, command=self.refresh)
     b_help = factory.help_button(button_bar, command=self.display_help)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_cancel = factory.cancel_button(button_bar, command=self.cancel)
     b_refresh.grid(row=0, column=0)
     b_help.grid(row=0, column=1)
     b_accept.grid(row=0, column=2)
     b_cancel.grid(row=0, column=3)
     lab_title.grid(row=0, column=0, columnspan=5, pady=8)
     frame_list.grid(row=1, column=0, rowspan=5, columnspan=6, padx=4, pady=8)
     factory.label(main, text="Name", modal=True).grid(row=6, column=0)
     entry_name.grid(row=6, column=1, columnspan=4, sticky=W, padx=4, pady=0)
     self.lab_warning.grid(row=7, column=0, columnspan=5, sticky=W, padx=4, pady=8)
     button_bar.grid(row=8, column=0, columnspan=5, sticky=EW, padx=4, pady=8)
     self.refresh()
     self.protocol("WM_DELETE_WINDOW", None) # ISSUE: Not Working
     entry_name.bind('<Return>', self.change_name)
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.grab_set()
     self.mainloop()
Ejemplo n.º 8
0
 def _init_list_frame(self):
     frame = factory.frame(self)
     lbx = factory.listbox(frame)
     sbar = factory.scrollbar(frame, orientation="vertical")
     # lbx.pack(side="left", expand=True, fill="both")
     # sbar.pack(after=lbx, side="right", expand=True, fill="y")
     lbx.config(yscrollcommand=sbar.set)
     lbx.bind("<<ListboxSelect>>", self._select_slot)
     lbx.bind("<Up>", self._decrement_selection)
     lbx.bind("<Down>", self._increment_selection)
     sbar.config(command = lbx.yview)
     self.listbox = lbx
     self.cbExtend = factory.checkbutton(frame,"Extend",self._var_extend_enable,
                                         command = self._cbextended_callback)
     self.sbExtend = factory.int_spinbox(frame,self._var_extend_count,
                                         from_=0,to=self.synth.voice_count,
                                         command = self._sbextended_callback)
     self.sbExtend.config(width=2)
     lbx.grid(row=0,column=0,rowspan=3,columnspan=2,sticky="ewns")
     sbar.grid(row=0,column=2,rowspan=3,columnspan=1,sticky="ns")
     if self.synth.keymode in constants.SUPPORTS_EXTENDED_PROGRAMS:
         self.cbExtend.grid(row=3,column=0,stick="w",pady=4,padx=4)
         self.sbExtend.grid(row=3,column=1,sticky='w')
     return frame
Ejemplo n.º 9
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.config(background=factory.pallet("DIALOG-BG"))
     self.wm_title = "MIDI Controllers"
     self.app = app
     self.config = app.config
     self.parser = app.ls_parser
     self._current_controller = 0
     self._save_backup()
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     main.pack_propagate(False)
     lab_title = factory.label(main, "MIDI Controller Names", modal=True)
     self.lab_warning = factory.warning_label(main, "", modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list,
                                    command=self.select_controller)
     self.listbox.pack(expand=True, fill=BOTH)
     sb = factory.scrollbar(main, yclient=self.listbox)
     self.refresh()
     self.var_name = StringVar()
     entry_name = factory.entry(main, self.var_name)
     button_bar = factory.frame(main, modal=True)
     b_refresh = factory.refresh_button(button_bar, command=self.refresh)
     b_help = factory.help_button(button_bar, command=self.display_help)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_cancel = factory.cancel_button(button_bar, command=self.cancel)
     lab_title.grid(row=0, column=0, columnspan=4, pady=8)
     frame_list.grid(row=1, column=0, rowspan=6, columnspan=4, sticky=N)
     sb.grid(row=1, column=4, rowspan=6, sticky=NS, padx=4)
     factory.label(main, "Name", modal=True).grid(row=7,
                                                  column=0,
                                                  padx=4,
                                                  sticky="w")
     entry_name.grid(row=7,
                     column=1,
                     columnspan=1,
                     sticky=W,
                     padx=4,
                     pady=8)
     self.lab_warning.grid(row=8, column=0, columnspan=5, sticky=W)
     button_bar.grid(row=9,
                     column=0,
                     columnspan=5,
                     sticky=EW,
                     padx=4,
                     pady=4)
     b_refresh.grid(row=0, column=0)
     b_help.grid(row=0, column=1)
     b_accept.grid(row=0, column=2)
     b_cancel.grid(row=0, column=3)
     entry_name.bind('<Return>', self.change_name)
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.protocol("WM_DELETE_WINDOW", None)
     self.grab_set()
     self.mainloop()
Ejemplo n.º 10
0
 def __init__(self, master, app):
     Toplevel.__init__(self, master)
     self.wm_title = "MIDI Channels"
     self.app = app
     self.config = app.config
     self.parser = app.ls_parser
     self._current_index = 0
     self._save_backup()
     main = factory.frame(self, modal=True)
     main.pack(expand=True)
     lab_title = factory.dialog_title_label(main,
                                            "MIDI Channels",
                                            modal=True)
     frame_list = factory.frame(main, modal=True)
     frame_list.config(width=248, height=320)
     frame_list.pack_propagate(False)
     self.listbox = factory.listbox(frame_list, command=self.select)
     self.listbox.pack(expand=True, fill=BOTH)
     self.lab_warning = factory.warning_label(main)
     self.var_name = StringVar()
     entry_name = factory.entry(main, self.var_name)
     button_bar = factory.frame(main, modal=True)
     b_refresh = factory.refresh_button(button_bar, command=self.refresh)
     b_help = factory.help_button(button_bar, command=self.display_help)
     b_accept = factory.accept_button(button_bar, command=self.accept)
     b_cancel = factory.cancel_button(button_bar, command=self.cancel)
     b_refresh.grid(row=0, column=0)
     b_help.grid(row=0, column=1)
     b_accept.grid(row=0, column=2)
     b_cancel.grid(row=0, column=3)
     lab_title.grid(row=0, column=0, columnspan=5, pady=8)
     frame_list.grid(row=1,
                     column=0,
                     rowspan=5,
                     columnspan=6,
                     padx=4,
                     pady=8)
     factory.label(main, text="Name", modal=True).grid(row=6, column=0)
     entry_name.grid(row=6,
                     column=1,
                     columnspan=4,
                     sticky=W,
                     padx=4,
                     pady=0)
     self.lab_warning.grid(row=7,
                           column=0,
                           columnspan=5,
                           sticky=W,
                           padx=4,
                           pady=8)
     button_bar.grid(row=8,
                     column=0,
                     columnspan=5,
                     sticky=EW,
                     padx=4,
                     pady=8)
     self.refresh()
     self.protocol("WM_DELETE_WINDOW", None)  # ISSUE: Not Working
     entry_name.bind('<Return>', self.change_name)
     entry_name.bind('<Down>', self.increment_selection)
     entry_name.bind('<Up>', self.decrement_selection)
     self.listbox.bind('<Down>', self.increment_selection)
     self.listbox.bind('<Up>', self.decrement_selection)
     self.grab_set()
     self.mainloop()
Ejemplo n.º 11
0
    def _init_map2_tab(self, master):
        img = factory.image("resources/Tabs/map.png")
        HELP_TOPIC = "parameter-maps"
        HEIGHT = 8
        frame = factory.frame(master)
        master.add(frame, text="Map2",image=img,compound="top")
        north = factory.label_frame(frame, "Velocity Maps")
        center = factory.label_frame(frame, "Aftertouch Maps")
        south = factory.label_frame(frame, "Keynumber Maps")
        north.grid(row=0, column=0, sticky="ew", padx=8, pady=8)
        center.grid(row=1, column=0, sticky="ew", padx=8)
        south.grid(row=2, column=0, sticky="ew", padx=8, pady=8)

        def help_callback():
            self.app.main_window().display_help(HELP_TOPIC)

        list_vel_maps = factory.listbox(north, ttip="Active velocity maps")
        list_vel_maps.config(width=80, height=HEIGHT)
        self.list_vel_maps = list_vel_maps
        sb = factory.scrollbar(north, orientation="vertical")
        sb.config(command=list_vel_maps.yview)
        list_vel_maps.config(yscrollcommand=sb.set)
        b_add_vel = factory.add_button(north, ttip="Add velocity map")
        b_delete_vel = factory.delete_button(north, 
                                             ttip="Delete velocity map")
        list_vel_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_vel.grid(row=1, column=0, sticky="ew")
        b_delete_vel.grid(row=1, column=1, sticky="ew")

        list_atouch_maps = factory.listbox(center, 
                                           ttip="Active after touch maps")
        list_atouch_maps.config(width=80, height=HEIGHT)
        self.list_atouch_maps = list_atouch_maps
        sb = factory.scrollbar(center, orientation="vertical")
        sb.config(command=list_atouch_maps.yview)
        list_atouch_maps.config(yscrollcommand=sb.set)
        b_add_atouch = factory.add_button(center, ttip="Add after touch map")
        b_delete_atouch = factory.delete_button(center, 
                                                ttip="Delete after touch map")
        list_atouch_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_atouch.grid(row=1, column=0, sticky="ew")
        b_delete_atouch.grid(row=1, column=1, sticky="ew")

        list_keynum_maps = factory.listbox(south, 
                                           ttip="Active key number maps")
        list_keynum_maps.config(width=80, height=HEIGHT)
        self.list_keynum_maps = list_keynum_maps
        sb = factory.scrollbar(south, orientation="vertical")
        sb.config(command=list_keynum_maps.yview)
        list_keynum_maps.config(yscrollcommand=sb.set)
        b_add_keynum = factory.add_button(south, ttip="Add key number map")
        b_delete_keynum = factory.delete_button(south, 
                                                ttip="Delete key number map")
	b_help = factory.help_button(south, command=help_callback)
        list_keynum_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_keynum.grid(row=1, column=0, sticky="ew")
        b_delete_keynum.grid(row=1, column=1, sticky="ew")
        b_help.grid(row=1, column=7, sticky="ew")

        def add_map_callback(event):
            widget = event.widget
            if widget is b_add_vel:
                dialog = add_map_dialog(self.synth, "velocity", self.app)
            elif widget is b_add_atouch:
                dialog = add_map_dialog(self.synth, "aftertouch", self.app)
            elif widget is b_add_keynum:
                dialog = add_map_dialog(self.synth, "keynumber", self.app)
            else:
                msg = "Invald widget - Should never see this"
                raise ValueError(msg)

        def delete_map_callback(event):
            widget = event.widget
            if widget is b_delete_vel:
                dialog = delete_map_dialog(self, self.synth, "velocity", self.app)
            elif widget is b_delete_atouch:
                dialog = delete_map_dialog(self, self.synth, "aftertouch", self.app)
            elif widget is b_delete_keynum:
                dialog = delete_map_dialog(self, self.synth, "keynumber", self.app)
            else:
                msg = "Invald widget - Should never see this"
                raise ValueError(msg)

        b_add_vel.bind("<Button-1>", add_map_callback)
        b_add_atouch.bind("<Button-1>", add_map_callback)
        b_add_keynum.bind("<Button-1>", add_map_callback)
        b_delete_vel.bind("<Button-1>", delete_map_callback)
        b_delete_atouch.bind("<Button-1>", delete_map_callback)
        b_delete_keynum.bind("<Button-1>", delete_map_callback)
Ejemplo n.º 12
0
    def _init_map1_tab(self, master):
        img = factory.image("resources/Tabs/map.png")
        HELP_TOPIC = "parameter-maps"
        frame = factory.frame(master)
        master.add(frame, text="Map1", image=img, compound="top")
        north = factory.label_frame(frame, "MIDI Controller Maps")
        south = factory.label_frame(frame, "Pitch Wheel Maps")
        north.grid(row=0, column=0, sticky="ew", padx=8, pady=8)
        south.grid(row=1, column=0, sticky="ew", padx=8, pady=8)

        def help_callback():
            self.app.main_window().display_help(HELP_TOPIC)
       
        list_cc_maps = factory.listbox(north, 
                                       ttip="Active MIDI controller maps")
        list_cc_maps.config(width=80, height=16)
        self.list_cc_maps = list_cc_maps
        sb = factory.scrollbar(north, orientation="vertical")
        sb.config(command=list_cc_maps.yview)
        list_cc_maps.config(yscrollcommand=sb.set)
        b_add_cc = factory.add_button(north, ttip="Add new controller map")
        b_delete_cc = factory.delete_button(north, 
                                            ttip="Delete controller map")
        list_cc_maps.grid(row=0, column=0, rowspan=4, 
                          columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, rowspan=4, sticky="ns")
        b_add_cc.grid(row=4, column=0, sticky="ew")
        b_delete_cc.grid(row=4, column=1, sticky="ew")

        list_pwheel_maps = factory.listbox(south, 
                                           ttip="Active pitch wheel maps")
        list_pwheel_maps.config(width=80, height=8)
        self.list_pwheel_maps = list_pwheel_maps
        sb = factory.scrollbar(south, orientation="vertical")

        sb.config(command=list_pwheel_maps.yview)
        list_pwheel_maps.config(yscrollcommand=sb.set)
        b_add_pw = factory.add_button(south, ttip="Add pitchwheel map")
        b_delete_pw = factory.delete_button(south, 
                                            ttip="Delete pitchwheel map")
        b_help = factory.help_button(south, command=help_callback)
        list_pwheel_maps.grid(row=0, column=0, rowspan=4,
                              columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, rowspan=4, sticky="ns")
        b_add_pw.grid(row=4, column=0, sticky="ew")
        b_delete_pw.grid(row=4, column=1, sticky="ew")
        b_help.grid(row=4, column=7, sticky="ew")

        def add_cc_callback():
            dialog = add_map_dialog(self.synth, "cc", self.app)

        def delete_cc_callback():
            dialog = delete_map_dialog(self, self.synth, "cc", self.app)

        def add_pw_callback():
            dialog = add_map_dialog(self.synth, "PitchWheel", self.app)

        def delete_pw_callback():
            dialog = delete_map_dialog(self, self.synth, "PitchWheel", self.app)

        b_add_cc.config(command=add_cc_callback)
        b_delete_cc.config(command=delete_cc_callback)
        b_add_pw.config(command=add_pw_callback)
        b_delete_pw.config(command=delete_pw_callback)
Ejemplo n.º 13
0
    def _init_performance_tab(self, master):
        img = factory.image("resources/Tabs/performance.png")
        frame = factory.frame(master)
        master.add(frame, text = "Performance", image=img, compound="top")
        frame_channel = factory.label_frame(frame, "MIDI Channel")
        frame_keytab = factory.label_frame(frame, "Key Table")
        lab_transpose = factory.label(frame, "Transpose")
        lab_keyrange = factory.label(frame, "Key Range")
        lab_bend = factory.label(frame, "Bend Range")
        self.list_channel = factory.listbox(frame_channel)
        sb_channel = factory.scrollbar(frame_channel)
        sb_channel.config(command=self.list_channel.yview)
        self.list_channel.config(yscrollcommand=sb_channel.set)
        self.list_keytab = factory.listbox(frame_keytab)
        sb_keytab = factory.scrollbar(frame_keytab)
        sb_keytab.config(command=self.list_keytab.yview)
        self.list_keytab.config(yscrollcommand=sb_keytab.set)
        spin_transpose = factory.int_spinbox(frame, 
                                             self.var_transpose, -36, 36)
        spin_keylow = factory.int_spinbox(frame, 
                                          self.var_keyrange_low, 0, 127)
        spin_keyhigh = factory.int_spinbox(frame, 
                                           self.var_keyrange_high, 0, 127)
        spin_bendrange = factory.int_spinbox(frame, 
                                             self.var_bendrange, 0, 2400)
        factory.padding_label(frame).grid(row=0)
        frame_channel.grid(row=1, column=0, rowspan=4, columnspan=2)
        self.list_channel.pack(side="left", expand=True, fill="both")
        sb_channel.pack(after=self.list_channel, side="right", 
                        expand=True, fill="y")
        frame_keytab.grid(row=1, column=2, rowspan=4, columnspan=2)
        self.list_keytab.pack(side="left", expand=True, fill="both")
        sb_keytab.pack(after=self.list_keytab, side="right", 
                       expand=True, fill="y")
        factory.padding_label(frame).grid(row=6)
        lab_transpose.grid(row=7, column=0, sticky="w", padx=4, pady=4)
        spin_transpose.grid(row=7, column=1, padx=4)
        lab_keyrange.grid(row=8, column=0, sticky="w", padx=4, pady=4)
        spin_keylow.grid(row=8, column=1, padx=4)
        spin_keyhigh.grid(row=8, column=2, padx=4)
        lab_bend.grid(row=9, column=0, sticky="w", padx=4, pady=4)
        spin_bendrange.grid(row=9, column=1, padx=4)
   
        def channel_callback(_):
            i = self.list_channel.curselection()[0]
            c = i+1
            self.synth.midi_input_channel(c)
            self.status("MIDI Input Channel = %s" % c)

        def keytab_callback(_):
            i = self.list_keytab.curselection()[0]
            kt = self.list_keytab.get(i)
            self.synth.keytable(kt)
            self.status("Using keytable: %s" % kt)

        def transpose_callback(*_):
            try:
                x = int(self.var_transpose.get())
                self.synth.transpose(x)
                self.status("Transpose = %s" % x)
            except ValueError:
                self.warning("Invalid transpose")
                
        def keyrange_callback(*_):
            try:
                a = int(self.var_keyrange_low.get())
                b = int(self.var_keyrange_high.get())
                a, b = min(a,b), max(a,b)
                self.synth.key_range((a,b))
                self.status("Key range = [%3d, %3d]" % (a, b))
            except ValueError:
                self.warning("Invalid keyrange")
                
        def bend_callback(*_):
            try:
                b = int(self.var_bendrange.get())
                self.synth.bend_range(b)
                self.status("Bend range = %s" % b)
            except ValueError:
                self.warning("Invalid Bendrange")
        
        self.list_channel.bind("<<ListboxSelect>>", channel_callback)
        self.list_keytab.bind("<<ListboxSelect>>", keytab_callback)
        spin_transpose.config(command=transpose_callback)
        spin_transpose.bind("<Return>", transpose_callback)
        spin_keylow.config(command=keyrange_callback)
        spin_keylow.bind("<Return>", keyrange_callback)
        spin_keyhigh.config(command=keyrange_callback)
        spin_keyhigh.bind("<Return>", keyrange_callback)
        spin_bendrange.config(command=bend_callback)
        spin_bendrange.bind("<Return>", bend_callback)
Ejemplo n.º 14
0
    def _init_map2_tab(self, master):
        img = factory.image("resources/Tabs/map.png")
        HELP_TOPIC = "parameter-maps"
        HEIGHT = 8
        frame = factory.frame(master)
        master.add(frame, text="Map2",image=img,compound="top")
        north = factory.label_frame(frame, "Velocity Maps")
        center = factory.label_frame(frame, "Aftertouch Maps")
        south = factory.label_frame(frame, "Keynumber Maps")
        north.grid(row=0, column=0, sticky="ew", padx=8, pady=8)
        center.grid(row=1, column=0, sticky="ew", padx=8)
        south.grid(row=2, column=0, sticky="ew", padx=8, pady=8)

        def help_callback():
            self.app.main_window().display_help(HELP_TOPIC)

        list_vel_maps = factory.listbox(north, ttip="Active velocity maps")
        list_vel_maps.config(width=80, height=HEIGHT)
        self.list_vel_maps = list_vel_maps
        sb = factory.scrollbar(north, orientation="vertical")
        sb.config(command=list_vel_maps.yview)
        list_vel_maps.config(yscrollcommand=sb.set)
        b_add_vel = factory.add_button(north, ttip="Add velocity map")
        b_delete_vel = factory.delete_button(north, 
                                             ttip="Delete velocity map")
        list_vel_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_vel.grid(row=1, column=0, sticky="ew")
        b_delete_vel.grid(row=1, column=1, sticky="ew")

        list_atouch_maps = factory.listbox(center, 
                                           ttip="Active after touch maps")
        list_atouch_maps.config(width=80, height=HEIGHT)
        self.list_atouch_maps = list_atouch_maps
        sb = factory.scrollbar(center, orientation="vertical")
        sb.config(command=list_atouch_maps.yview)
        list_atouch_maps.config(yscrollcommand=sb.set)
        b_add_atouch = factory.add_button(center, ttip="Add after touch map")
        b_delete_atouch = factory.delete_button(center, 
                                                ttip="Delete after touch map")
        list_atouch_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_atouch.grid(row=1, column=0, sticky="ew")
        b_delete_atouch.grid(row=1, column=1, sticky="ew")

        list_keynum_maps = factory.listbox(south, 
                                           ttip="Active key number maps")
        list_keynum_maps.config(width=80, height=HEIGHT)
        self.list_keynum_maps = list_keynum_maps
        sb = factory.scrollbar(south, orientation="vertical")
        sb.config(command=list_keynum_maps.yview)
        list_keynum_maps.config(yscrollcommand=sb.set)
        b_add_keynum = factory.add_button(south, ttip="Add key number map")
        b_delete_keynum = factory.delete_button(south, 
                                                ttip="Delete key number map")
	b_help = factory.help_button(south, command=help_callback)
        list_keynum_maps.grid(row=0, column=0, columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, sticky="ns")
        b_add_keynum.grid(row=1, column=0, sticky="ew")
        b_delete_keynum.grid(row=1, column=1, sticky="ew")
        b_help.grid(row=1, column=7, sticky="ew")

        def add_map_callback(event):
            widget = event.widget
            if widget is b_add_vel:
                dialog = add_map_dialog(self.synth, "velocity", self.app)
            elif widget is b_add_atouch:
                dialog = add_map_dialog(self.synth, "aftertouch", self.app)
            elif widget is b_add_keynum:
                dialog = add_map_dialog(self.synth, "keynumber", self.app)
            else:
                msg = "Invalid widget - Should never see this"
                raise ValueError(msg)

        def delete_map_callback(event):
            widget = event.widget
            if widget is b_delete_vel:
                dialog = delete_map_dialog(self, self.synth, "velocity", self.app)
            elif widget is b_delete_atouch:
                dialog = delete_map_dialog(self, self.synth, "aftertouch", self.app)
            elif widget is b_delete_keynum:
                dialog = delete_map_dialog(self, self.synth, "keynumber", self.app)
            else:
                msg = "Invalid widget - Should never see this"
                raise ValueError(msg)

        b_add_vel.bind("<Button-1>", add_map_callback)
        b_add_atouch.bind("<Button-1>", add_map_callback)
        b_add_keynum.bind("<Button-1>", add_map_callback)
        b_delete_vel.bind("<Button-1>", delete_map_callback)
        b_delete_atouch.bind("<Button-1>", delete_map_callback)
        b_delete_keynum.bind("<Button-1>", delete_map_callback)
Ejemplo n.º 15
0
    def _init_map1_tab(self, master):
        img = factory.image("resources/Tabs/map.png")
        HELP_TOPIC = "parameter-maps"
        frame = factory.frame(master)
        master.add(frame, text="Map1", image=img, compound="top")
        north = factory.label_frame(frame, "MIDI Controller Maps")
        south = factory.label_frame(frame, "Pitch Wheel Maps")
        north.grid(row=0, column=0, sticky="ew", padx=8, pady=8)
        south.grid(row=1, column=0, sticky="ew", padx=8, pady=8)

        def help_callback():
            self.app.main_window().display_help(HELP_TOPIC)
       
        list_cc_maps = factory.listbox(north, 
                                       ttip="Active MIDI controller maps")
        list_cc_maps.config(width=80, height=16)
        self.list_cc_maps = list_cc_maps
        sb = factory.scrollbar(north, orientation="vertical")
        sb.config(command=list_cc_maps.yview)
        list_cc_maps.config(yscrollcommand=sb.set)
        b_add_cc = factory.add_button(north, ttip="Add new controller map")
        b_delete_cc = factory.delete_button(north, 
                                            ttip="Delete controller map")
        list_cc_maps.grid(row=0, column=0, rowspan=4, 
                          columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, rowspan=4, sticky="ns")
        b_add_cc.grid(row=4, column=0, sticky="ew")
        b_delete_cc.grid(row=4, column=1, sticky="ew")

        list_pwheel_maps = factory.listbox(south, 
                                           ttip="Active pitch wheel maps")
        list_pwheel_maps.config(width=80, height=8)
        self.list_pwheel_maps = list_pwheel_maps
        sb = factory.scrollbar(south, orientation="vertical")

        sb.config(command=list_pwheel_maps.yview)
        list_pwheel_maps.config(yscrollcommand=sb.set)
        b_add_pw = factory.add_button(south, ttip="Add pitchwheel map")
        b_delete_pw = factory.delete_button(south, 
                                            ttip="Delete pitchwheel map")
        b_help = factory.help_button(south, command=help_callback)
        list_pwheel_maps.grid(row=0, column=0, rowspan=4,
                              columnspan=8, sticky="ew")
        sb.grid(row=0, column=8, rowspan=4, sticky="ns")
        b_add_pw.grid(row=4, column=0, sticky="ew")
        b_delete_pw.grid(row=4, column=1, sticky="ew")
        b_help.grid(row=4, column=7, sticky="ew")

        def add_cc_callback():
            dialog = add_map_dialog(self.synth, "cc", self.app)

        def delete_cc_callback():
            dialog = delete_map_dialog(self, self.synth, "cc", self.app)

        def add_pw_callback():
            dialog = add_map_dialog(self.synth, "PitchWheel", self.app)

        def delete_pw_callback():
            dialog = delete_map_dialog(self, self.synth, "PitchWheel", self.app)

        b_add_cc.config(command=add_cc_callback)
        b_delete_cc.config(command=delete_cc_callback)
        b_add_pw.config(command=add_pw_callback)
        b_delete_pw.config(command=delete_pw_callback)
Ejemplo n.º 16
0
    def _init_midi_tab(self, master):
        img = factory.image("resources/Tabs/midi.png")
        frame = factory.frame(master)
        master.add(frame, text = "Performance", image=img, compound="top")
        frame_channel = factory.frame(frame)
        frame_keytab = factory.frame(frame)
        lab_transpose = factory.label(frame, "Transpose")
        lab_keyrange = factory.label(frame, "Key Range")
        lab_bend = factory.label(frame, "Bend Range")
        self.list_channel = factory.listbox(frame_channel)
        sb_channel = factory.scrollbar(frame_channel)
        sb_channel.config(command=self.list_channel.yview)
        self.list_channel.config(yscrollcommand=sb_channel.set)
        self.list_keytab = factory.listbox(frame_keytab)
        sb_keytab = factory.scrollbar(frame_keytab)
        sb_keytab.config(command=self.list_keytab.yview)
        self.list_keytab.config(yscrollcommand=sb_keytab.set)
        spin_transpose = factory.int_spinbox(frame,self.var_transpose,-36,36)
        spin_keylow = factory.int_spinbox(frame,self.var_keyrange_low,0,127)
        spin_keyhigh = factory.int_spinbox(frame,self.var_keyrange_high,0,127)
        spin_bendrange = factory.int_spinbox(frame,self.var_bendrange, 0, 2400)
        factory.padding_label(frame).grid(row=0)
        lab_channel = factory.label(frame,"MIDI Input Channel")
        lab_channel.grid(row=0,column=0,columnspan=2, pady=8)
        frame_channel.grid(row=1, column=0, rowspan=4, columnspan=2,padx=8,pady=8)
        self.list_channel.pack(side="left", expand=True, fill="both")
        sb_channel.pack(after=self.list_channel, side="right", expand=True, fill="y")
        lab_ktab = factory.label(frame, "Key Table")
        lab_ktab.grid(row=0,column=2,columnspan=2,pady=8)
        frame_keytab.grid(row=1, column=2, rowspan=4, columnspan=2,padx=8,pady=8)
        self.list_keytab.pack(side="left", expand=True, fill="both")
        sb_keytab.pack(after=self.list_keytab, side="right", 
                       expand=True, fill="y")
        factory.padding_label(frame).grid(row=6)
        lab_transpose.grid(row=7, column=0, sticky="w", padx=4, pady=4)
        lab_keyrange.grid(row=8, column=0, sticky="w", padx=4, pady=4)
        lab_bend.grid(row=9, column=0, sticky="w", padx=4, pady=4)

        spin_transpose.grid(row=7, column=1, padx=4)
        spin_keylow.grid(row=8, column=1, padx=4)
        spin_keyhigh.grid(row=8, column=2, padx=4)
        spin_bendrange.grid(row=9, column=1, padx=4)
   
        def channel_callback(_):
            i = self.list_channel.curselection()[0]
            c = i+1
            self.synth.midi_input_channel(c)
            self.status("MIDI Input Channel = %s" % c)

        def keytab_callback(_):
            i = self.list_keytab.curselection()[0]
            kt = self.list_keytab.get(i)
            self.synth.keytable(kt)
            self.status("Using keytable: %s" % kt)

        def transpose_callback(*_):
            try:
                x = int(self.var_transpose.get())
                self.synth.transpose(x)
                self.status("Transpose = %s" % x)
            except ValueError:
                self.warning("Invalid transpose")
                
        def keyrange_callback(*_):
            try:
                a = int(self.var_keyrange_low.get())
                b = int(self.var_keyrange_high.get())
                a, b = min(a,b), max(a,b)
                self.synth.key_range((a,b))
                self.status("Key range = [%3d, %3d]" % (a, b))
            except ValueError:
                self.warning("Invalid keyrange")
                
        def bend_callback(*_):
            try:
                b = int(self.var_bendrange.get())
                self.synth.bend_range(b)
                self.status("Bend range = %s" % b)
            except ValueError:
                self.warning("Invalid Bendrange")
        
        self.list_channel.bind("<<ListboxSelect>>", channel_callback)
        self.list_keytab.bind("<<ListboxSelect>>", keytab_callback)
        spin_transpose.config(command=transpose_callback)
        spin_transpose.bind("<Return>", transpose_callback)
        spin_keylow.config(command=keyrange_callback)
        spin_keylow.bind("<Return>", keyrange_callback)
        spin_keyhigh.config(command=keyrange_callback)
        spin_keyhigh.bind("<Return>", keyrange_callback)
        spin_bendrange.config(command=bend_callback)
        spin_bendrange.bind("<Return>", bend_callback)