# Path: mididings/units/base.py
# _UNIT_TYPES = (_Unit, list, dict, _constants._EventType)
# 
# Path: mididings/scene.py
# _SCENE_TYPES = (Scene, SceneGroup) + _UNIT_TYPES


import _mididings
import mididings.patch as _patch
import mididings.scene as _scene
import mididings.util as _util
import mididings.misc as _misc
import mididings.setup as _setup
import mididings.constants as _constants
import mididings.overload as _overload
import mididings.arguments as _arguments
import time as _time
import weakref as _weakref
import threading as _threading
import gc as _gc
import atexit as _atexit
import os as _os
import sys as _sys
    import smf
from mididings.units.base import _UNIT_TYPES
from mididings.scene import _SCENE_TYPES
    allows switching between multiple scenes.

    :param patch: a single patch.
    :param scenes: a dictionary with program numbers as keys, and
        :class:`Scene` objects, :class:`SceneGroup` objects or plain patches
        as values.
    :param control: an optional "control" patch, which is always active, and
        runs in parallel to the current scene.
    :param pre: an optional patch that allows common processing to take place
        before every scene. Does not affect the control patch.
    :param post: an optional patch that allows common processing to take place
        after every scene. Does not affect the control patch.
    """
)
@_arguments.accept(_UNIT_TYPES)
def run(patch):
    if (isinstance(patch, dict) and
            all(not isinstance(k, _constants._EventType)
                for k in patch.keys())):
        # bypass the overload mechanism (just this once...) if there's no way
        # the given dict could be accepted as a split
        run(scenes=patch)
    else:
        e = Engine()
        e.setup({_util.offset(0): patch}, None, None, None)
        e.run()

@_overload.mark
@_arguments.accept(
    {_util.scene_number: _SCENE_TYPES},

# Path: mididings/units/base.py
# _UNIT_TYPES = (_Unit, list, dict, _constants._EventType)
# 
# Path: mididings/scene.py
# _SCENE_TYPES = (Scene, SceneGroup) + _UNIT_TYPES


# Path: mididings/engine.py
import _mididings
import mididings.patch as _patch
import mididings.scene as _scene
import mididings.util as _util
import mididings.misc as _misc
import mididings.setup as _setup
import mididings.constants as _constants
import mididings.overload as _overload
import mididings.arguments as _arguments
import time as _time
import weakref as _weakref
import threading as _threading
import gc as _gc
import atexit as _atexit
import os as _os
import sys as _sys
    import smf
from mididings.units.base import _UNIT_TYPES
from mididings.scene import _SCENE_TYPES

    allows switching between multiple scenes.

    :param patch: a single patch.
    :param scenes: a dictionary with program numbers as keys, and
        :class:`Scene` objects, :class:`SceneGroup` objects or plain patches
        as values.
    :param control: an optional "control" patch, which is always active, and
        runs in parallel to the current scene.
    :param pre: an optional patch that allows common processing to take place
        before every scene. Does not affect the control patch.
    :param post: an optional patch that allows common processing to take place
        after every scene. Does not affect the control patch.
    """
)
@_arguments.accept(_UNIT_TYPES)
def run(patch):
    if (isinstance(patch, dict) and
            all(not isinstance(k, _constants._EventType)
                for k in patch.keys())):
        # bypass the overload mechanism (just this once...) if there's no way
        # the given dict could be accepted as a split
        run(scenes=patch)
    else:
        e = Engine()
        e.setup({_util.offset(0): patch}, None, None, None)
        e.run()

@_overload.mark
@_arguments.accept(
    {_util.scene_number: _SCENE_TYPES},

    _arguments.nullable(_UNIT_TYPES),