# Path: mididings/units/base.py
# class _Unit(object):
#     """
#     Wrapper class for all units.
#     """
#     def __init__(self, unit):
#         self.unit = unit
# 
#     def __rshift__(self, other):
#         """
#         Connect units in series (operator >>).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Chain, self, other)
# 
#     def __rrshift__(self, other):
#         """
#         Connect units in series (operator >>).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Chain, other, self)
# 
#     def __floordiv__(self, other):
#         """
#         Connect units in parallel (operator //).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Fork, self, other)
# 
#     def __rfloordiv__(self, other):
#         """
#         Connect units in parallel (operator //).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Fork, other, self)
# 
#     def __pos__(self):
#         """
#         Apply to duplicate (unary operator +)
#         """
#         return self.add()
# 
#     def add(self):
#         return Fork([ Pass(), self ])
# 
#     def __repr__(self):
#         return _unitrepr.unit_to_string(self)


import _mididings
import mididings.constants as _constants
import mididings.util as _util
import mididings.overload as _overload
import mididings.unitrepr as _unitrepr
from mididings.units.base import _Unit
@_unitrepr.accept(_util.scene_number_ref)
def SceneSwitch(number=_constants.EVENT_PROGRAM):
    return _Unit(_mididings.SceneSwitch(_util.actual_ref(number), 0))

@_overload.mark
@_unitrepr.accept(int)
def SceneSwitch(offset):
    return _Unit(_mididings.SceneSwitch(0, offset))


@_overload.mark(
    """
    SubSceneSwitch(number=EVENT_PROGRAM)
    SubSceneSwitch(offset=..., wrap=True)

    Switches between subscenes within a scene group.

    *number* can be a fixed subscene number, or one of the
    :ref:`Event Attribute <event-attributes>` constants to use a value from
    the incoming event's data.
    With no arguments, the program number of the incoming event (which should
    be a program change) will be used.

    *offset* can be a positive or negative value that will be added to the
    current subscene number, allowing you to go forward or backward in the
    list of subscenes. If *wrap* is ``True`` you can loop through subscenes.
    """
)
@_unitrepr.accept(_util.subscene_number_ref)
def SubSceneSwitch(number=_constants.EVENT_PROGRAM):

# Path: mididings/units/base.py
# class _Unit(object):
#     """
#     Wrapper class for all units.
#     """
#     def __init__(self, unit):
#         self.unit = unit
# 
#     def __rshift__(self, other):
#         """
#         Connect units in series (operator >>).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Chain, self, other)
# 
#     def __rrshift__(self, other):
#         """
#         Connect units in series (operator >>).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Chain, other, self)
# 
#     def __floordiv__(self, other):
#         """
#         Connect units in parallel (operator //).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Fork, self, other)
# 
#     def __rfloordiv__(self, other):
#         """
#         Connect units in parallel (operator //).
#         """
#         if not isinstance(other, _UNIT_TYPES):
#             return NotImplemented
#         return _join_units(_Fork, other, self)
# 
#     def __pos__(self):
#         """
#         Apply to duplicate (unary operator +)
#         """
#         return self.add()
# 
#     def add(self):
#         return Fork([ Pass(), self ])
# 
#     def __repr__(self):
#         return _unitrepr.unit_to_string(self)


# Path: mididings/units/engine.py
import _mididings
import mididings.constants as _constants
import mididings.util as _util
import mididings.overload as _overload
import mididings.unitrepr as _unitrepr
from mididings.units.base import _Unit

@_unitrepr.accept(_util.scene_number_ref)
def SceneSwitch(number=_constants.EVENT_PROGRAM):
    return _Unit(_mididings.SceneSwitch(_util.actual_ref(number), 0))

@_overload.mark
@_unitrepr.accept(int)
def SceneSwitch(offset):
    return _Unit(_mididings.SceneSwitch(0, offset))


@_overload.mark(
    """
    SubSceneSwitch(number=EVENT_PROGRAM)
    SubSceneSwitch(offset=..., wrap=True)

    Switches between subscenes within a scene group.

    *number* can be a fixed subscene number, or one of the
    :ref:`Event Attribute <event-attributes>` constants to use a value from
    the incoming event's data.
    With no arguments, the program number of the incoming event (which should
    be a program change) will be used.

    *offset* can be a positive or negative value that will be added to the
    current subscene number, allowing you to go forward or backward in the
    list of subscenes. If *wrap* is ``True`` you can loop through subscenes.
    """
)
@_unitrepr.accept(_util.subscene_number_ref)
def SubSceneSwitch(number=_constants.EVENT_PROGRAM):

    return _Unit(_mididings.SubSceneSwitch(_util.actual_ref(number), 0, False))