# 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
# -*- 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.
#





@_unitrepr.store
def Sanitize():
    """
    Sanitize()

    Make sure the event is a valid MIDI message.
    Events with invalid port (output), channel, controller, program or note
    number are discarded. Note velocity and controller values are confined to
    the range 0-127.
    """

# 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

# -*- 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.
#





@_unitrepr.store
def Sanitize():
    """
    Sanitize()

    Make sure the event is a valid MIDI message.
    Events with invalid port (output), channel, controller, program or note
    number are discarded. Note velocity and controller values are confined to
    the range 0-127.
    """

    return _Unit(_mididings.Sanitize())