# Path: mididings/misc.py
# class NamedFlag(int):
#     """
#     An integer type where each value has a name attached to it.
#     """
#     def __new__(cls, value, name):
#         return int.__new__(cls, value)
#     def __init__(self, value, name):
#         self.name = name
#     def __getnewargs__(self):
#         return (int(self), self.name)
#     def __repr__(self):
#         return self.name
#     def __str__(self):
#         return self.name
# 
# Path: mididings/misc.py
# class NamedBitMask(NamedFlag):
#     """
#     Like NamedFlag, but bit operations | and ~ are also reflected in the
#     resulting value's string representation.
#     """
#     def __or__(self, other):
#         if type(other) is not type(self):
#             return NotImplemented
#         return type(self)(
#             int(self) | int(other),
#             '%s|%s' % (self.name, other.name)
#         )
#     def __invert__(self):
#         return type(self)(
#             ~int(self) & ((1 << 30) - 1),
#             ('~%s' if '|' not in self.name else '~(%s)') % self.name
#         )


import _mididings
from mididings.misc import NamedFlag as _NamedFlag
from mididings.misc import NamedBitMask as _NamedBitMask
# -*- 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.
#




class _EventType(_NamedBitMask):
    pass


class _EventAttribute(_NamedFlag):
    pass


_EVENT_TYPES = {}

# populate this module with midi event type constants
for _name, _value in _mididings.MidiEventType.names.items():

# Path: mididings/misc.py
# class NamedFlag(int):
#     """
#     An integer type where each value has a name attached to it.
#     """
#     def __new__(cls, value, name):
#         return int.__new__(cls, value)
#     def __init__(self, value, name):
#         self.name = name
#     def __getnewargs__(self):
#         return (int(self), self.name)
#     def __repr__(self):
#         return self.name
#     def __str__(self):
#         return self.name
# 
# Path: mididings/misc.py
# class NamedBitMask(NamedFlag):
#     """
#     Like NamedFlag, but bit operations | and ~ are also reflected in the
#     resulting value's string representation.
#     """
#     def __or__(self, other):
#         if type(other) is not type(self):
#             return NotImplemented
#         return type(self)(
#             int(self) | int(other),
#             '%s|%s' % (self.name, other.name)
#         )
#     def __invert__(self):
#         return type(self)(
#             ~int(self) & ((1 << 30) - 1),
#             ('~%s' if '|' not in self.name else '~(%s)') % self.name
#         )


# Path: mididings/constants.py
import _mididings
from mididings.misc import NamedFlag as _NamedFlag
from mididings.misc import NamedBitMask as _NamedBitMask

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




class _EventType(_NamedBitMask):
    pass


class _EventAttribute(_NamedFlag):
    pass


_EVENT_TYPES = {}

# populate this module with midi event type constants
for _name, _value in _mididings.MidiEventType.names.items():

    _type_object = _EventType(int(_value), _name)