# Path: mididings/live/widgets.py
# class LiveThemedFactory(object):
#     def __init__(self, color, color_highlight, color_background):
#         self.color = color
#         self.color_highlight = color_highlight
#         self.color_background = color_background
# 
#     def Tk(self, **options):
#         w = Tkinter.Tk()
#         w.config(background=self.color_background)
#         w.config(**options)
#         return w
# 
#     def Frame(self, master, **options):
#         w = Tkinter.Frame(master)
#         w.config(background=self.color)
#         w.config(**options)
#         return w
# 
#     def AutoScrollbar(self, master, **options):
#         w = AutoScrollbar(master)
#         w.config(
#             background=self.color,
#             activebackground=self.color_highlight,
#             troughcolor=self.color_background,
#             borderwidth=1,
#             relief='flat',
#             width=16,
#         )
#         w.config(**options)
#         return w
# 
#     def Listbox(self, master, **options):
#         w = Tkinter.Listbox(master)
#         w.config(
#             background=self.color_background,
#             foreground=self.color,
#             selectbackground=self.color_background,
#             selectforeground=self.color_highlight,
#             selectborderwidth=0,
#             borderwidth=0,
#         )
#         w.config(**options)
#         return w
# 
#     def Button(self, master, **options):
#         w = Tkinter.Button(master)
#         w.config(
#             background=self.color_background,
#             foreground=self.color,
#             activebackground=self.color_background,
#             activeforeground=self.color_highlight,
#             borderwidth=0,
#             highlightthickness=0,
#             relief='flat',
#         )
#         w.config(**options)
#         return w
# 
#     def Canvas(self, master, **options):
#         w = Tkinter.Canvas(master)
#         w.config(background=self.color_background)
#         w.config(**options)
#         return w
# 
# class UnthemedFactory(object):
#     def Tk(self, **options):
#         w = Tkinter.Tk()
#         w.config(**options)
#         return w
# 
#     def Frame(self, master, **options):
#         return Tkinter.Frame(master, **options)
# 
#     def AutoScrollbar(self, master, **options):
#         return AutoScrollbar(master, **options)
# 
#     def Listbox(self, master, **options):
#         return Tkinter.Listbox(master, **options)
# 
#     def Button(self, master, **options):
#         return Tkinter.Button(master, **options)
# 
#     def Canvas(self, master, **options):
#         return Tkinter.Canvas(master, **options)
# 
# Path: mididings/live/osc_control.py
# class LiveOSC(liblo.ServerThread):
#     def __init__(self, dings, control_port, listen_port):
#         liblo.ServerThread.__init__(self, listen_port)
# 
#         self.dings = dings
#         self.control_port = control_port
# 
#         self._scenes = {}
# 
#     def query(self):
#         self.send(self.control_port, '/mididings/query')
# 
#     def switch_scene(self, n):
#         self.send(self.control_port, '/mididings/switch_scene', n)
# 
#     def switch_subscene(self, n):
#         self.send(self.control_port, '/mididings/switch_subscene', n)
# 
#     def prev_scene(self):
#         self.send(self.control_port, '/mididings/prev_scene')
# 
#     def next_scene(self):
#         self.send(self.control_port, '/mididings/next_scene')
# 
#     def prev_subscene(self):
#         self.send(self.control_port, '/mididings/prev_subscene')
# 
#     def next_subscene(self):
#         self.send(self.control_port, '/mididings/next_subscene')
# 
#     def panic(self):
#         self.send(self.control_port, '/mididings/panic')
# 
#     @liblo.make_method('/mididings/data_offset', 'i')
#     def data_offset_cb(self, path, args):
#         self.dings.set_data_offset(args[0])
# 
#     @liblo.make_method('/mididings/begin_scenes', '')
#     def begin_scenes_cb(self, path, args):
#         self._scenes = {}
# 
#     @liblo.make_method('/mididings/add_scene', None)
#     def add_scene_cb(self, path, args):
#         number, name = args[:2]
#         subscenes = args[2:]
#         self._scenes[number] = (name, subscenes)
# 
#     @liblo.make_method('/mididings/end_scenes', '')
#     def end_scenes_cb(self, path, args):
#         self.dings.set_scenes(self._scenes)
# 
#     @liblo.make_method('/mididings/current_scene', 'ii')
#     def current_scene_cb(self, path, args):
#         self.dings.set_current_scene(args[0], args[1])


from mididings.live.widgets import LiveThemedFactory, UnthemedFactory
from mididings.live.osc_control import LiveOSC
import sys
# -*- coding: utf-8 -*-
#
# mididings
#
# Copyright (C) 2008-2014  Dominic Sacré  <dominic.sacre@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#


if sys.version_info >= (3,):
    unichr = chr


class LiveDings(object):
    def __init__(self, options):
        self.options = options

        # start OSC server
        self.osc = LiveOSC(self, self.options.control_port,
                                 self.options.listen_port)
        self.osc.start()

        if self.options.themed:

# Path: mididings/live/widgets.py
# class LiveThemedFactory(object):
#     def __init__(self, color, color_highlight, color_background):
#         self.color = color
#         self.color_highlight = color_highlight
#         self.color_background = color_background
# 
#     def Tk(self, **options):
#         w = Tkinter.Tk()
#         w.config(background=self.color_background)
#         w.config(**options)
#         return w
# 
#     def Frame(self, master, **options):
#         w = Tkinter.Frame(master)
#         w.config(background=self.color)
#         w.config(**options)
#         return w
# 
#     def AutoScrollbar(self, master, **options):
#         w = AutoScrollbar(master)
#         w.config(
#             background=self.color,
#             activebackground=self.color_highlight,
#             troughcolor=self.color_background,
#             borderwidth=1,
#             relief='flat',
#             width=16,
#         )
#         w.config(**options)
#         return w
# 
#     def Listbox(self, master, **options):
#         w = Tkinter.Listbox(master)
#         w.config(
#             background=self.color_background,
#             foreground=self.color,
#             selectbackground=self.color_background,
#             selectforeground=self.color_highlight,
#             selectborderwidth=0,
#             borderwidth=0,
#         )
#         w.config(**options)
#         return w
# 
#     def Button(self, master, **options):
#         w = Tkinter.Button(master)
#         w.config(
#             background=self.color_background,
#             foreground=self.color,
#             activebackground=self.color_background,
#             activeforeground=self.color_highlight,
#             borderwidth=0,
#             highlightthickness=0,
#             relief='flat',
#         )
#         w.config(**options)
#         return w
# 
#     def Canvas(self, master, **options):
#         w = Tkinter.Canvas(master)
#         w.config(background=self.color_background)
#         w.config(**options)
#         return w
# 
# class UnthemedFactory(object):
#     def Tk(self, **options):
#         w = Tkinter.Tk()
#         w.config(**options)
#         return w
# 
#     def Frame(self, master, **options):
#         return Tkinter.Frame(master, **options)
# 
#     def AutoScrollbar(self, master, **options):
#         return AutoScrollbar(master, **options)
# 
#     def Listbox(self, master, **options):
#         return Tkinter.Listbox(master, **options)
# 
#     def Button(self, master, **options):
#         return Tkinter.Button(master, **options)
# 
#     def Canvas(self, master, **options):
#         return Tkinter.Canvas(master, **options)
# 
# Path: mididings/live/osc_control.py
# class LiveOSC(liblo.ServerThread):
#     def __init__(self, dings, control_port, listen_port):
#         liblo.ServerThread.__init__(self, listen_port)
# 
#         self.dings = dings
#         self.control_port = control_port
# 
#         self._scenes = {}
# 
#     def query(self):
#         self.send(self.control_port, '/mididings/query')
# 
#     def switch_scene(self, n):
#         self.send(self.control_port, '/mididings/switch_scene', n)
# 
#     def switch_subscene(self, n):
#         self.send(self.control_port, '/mididings/switch_subscene', n)
# 
#     def prev_scene(self):
#         self.send(self.control_port, '/mididings/prev_scene')
# 
#     def next_scene(self):
#         self.send(self.control_port, '/mididings/next_scene')
# 
#     def prev_subscene(self):
#         self.send(self.control_port, '/mididings/prev_subscene')
# 
#     def next_subscene(self):
#         self.send(self.control_port, '/mididings/next_subscene')
# 
#     def panic(self):
#         self.send(self.control_port, '/mididings/panic')
# 
#     @liblo.make_method('/mididings/data_offset', 'i')
#     def data_offset_cb(self, path, args):
#         self.dings.set_data_offset(args[0])
# 
#     @liblo.make_method('/mididings/begin_scenes', '')
#     def begin_scenes_cb(self, path, args):
#         self._scenes = {}
# 
#     @liblo.make_method('/mididings/add_scene', None)
#     def add_scene_cb(self, path, args):
#         number, name = args[:2]
#         subscenes = args[2:]
#         self._scenes[number] = (name, subscenes)
# 
#     @liblo.make_method('/mididings/end_scenes', '')
#     def end_scenes_cb(self, path, args):
#         self.dings.set_scenes(self._scenes)
# 
#     @liblo.make_method('/mididings/current_scene', 'ii')
#     def current_scene_cb(self, path, args):
#         self.dings.set_current_scene(args[0], args[1])


# Path: mididings/live/livedings.py
from mididings.live.widgets import LiveThemedFactory, UnthemedFactory
from mididings.live.osc_control import LiveOSC
import sys

# -*- coding: utf-8 -*-
#
# mididings
#
# Copyright (C) 2008-2014  Dominic Sacré  <dominic.sacre@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#


if sys.version_info >= (3,):
    unichr = chr


class LiveDings(object):
    def __init__(self, options):
        self.options = options

        # start OSC server
        self.osc = LiveOSC(self, self.options.control_port,
                                 self.options.listen_port)
        self.osc.start()

        if self.options.themed:

            widget_factory = LiveThemedFactory(self.options.color,