# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

import enum
import sys
import types
import typing
import uuid

import winsdk._winrt as _winrt

try:
    import winsdk.windows.devices.enumeration
except Exception:
    pass

try:
    import winsdk.windows.foundation
except Exception:
    pass

try:
    import winsdk.windows.storage.streams
except Exception:
    pass

class MidiMessageType(enum.IntEnum):
    NONE = 0
    NOTE_OFF = 128
    NOTE_ON = 144
    POLYPHONIC_KEY_PRESSURE = 160
    CONTROL_CHANGE = 176
    PROGRAM_CHANGE = 192
    CHANNEL_PRESSURE = 208
    PITCH_BEND_CHANGE = 224
    SYSTEM_EXCLUSIVE = 240
    MIDI_TIME_CODE = 241
    SONG_POSITION_POINTER = 242
    SONG_SELECT = 243
    TUNE_REQUEST = 246
    END_SYSTEM_EXCLUSIVE = 247
    TIMING_CLOCK = 248
    START = 250
    CONTINUE = 251
    STOP = 252
    ACTIVE_SENSING = 254
    SYSTEM_RESET = 255

class MidiActiveSensingMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiActiveSensingMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiChannelPressureMessage(IMidiMessage, _winrt.Object):
    channel: _winrt.UInt8
    pressure: _winrt.UInt8
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiChannelPressureMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, pressure: _winrt.UInt8) -> None: ...

class MidiContinueMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiContinueMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiControlChangeMessage(IMidiMessage, _winrt.Object):
    channel: _winrt.UInt8
    control_value: _winrt.UInt8
    controller: _winrt.UInt8
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiControlChangeMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, controller: _winrt.UInt8, control_value: _winrt.UInt8) -> None: ...

class MidiInPort(winsdk.windows.foundation.IClosable, _winrt.Object):
    device_id: str
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiInPort: ...
    @typing.overload
    def close(self) -> None: ...
    @typing.overload
    @staticmethod
    def from_id_async(device_id: str) -> winsdk.windows.foundation.IAsyncOperation[MidiInPort]: ...
    @typing.overload
    @staticmethod
    def get_device_selector() -> str: ...
    @typing.overload
    def add_message_received(self, handler: winsdk.windows.foundation.TypedEventHandler[MidiInPort, MidiMessageReceivedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    @typing.overload
    def remove_message_received(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class MidiMessageReceivedEventArgs(_winrt.Object):
    message: IMidiMessage
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiMessageReceivedEventArgs: ...

class MidiNoteOffMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    channel: _winrt.UInt8
    note: _winrt.UInt8
    velocity: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiNoteOffMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, note: _winrt.UInt8, velocity: _winrt.UInt8) -> None: ...

class MidiNoteOnMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    channel: _winrt.UInt8
    note: _winrt.UInt8
    velocity: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiNoteOnMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, note: _winrt.UInt8, velocity: _winrt.UInt8) -> None: ...

class MidiOutPort(IMidiOutPort, winsdk.windows.foundation.IClosable, _winrt.Object):
    device_id: str
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiOutPort: ...
    @typing.overload
    def close(self) -> None: ...
    @typing.overload
    @staticmethod
    def from_id_async(device_id: str) -> winsdk.windows.foundation.IAsyncOperation[IMidiOutPort]: ...
    @typing.overload
    @staticmethod
    def get_device_selector() -> str: ...
    @typing.overload
    def send_buffer(self, midi_data: winsdk.windows.storage.streams.IBuffer) -> None: ...
    @typing.overload
    def send_message(self, midi_message: IMidiMessage) -> None: ...

class MidiPitchBendChangeMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    bend: _winrt.UInt16
    channel: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiPitchBendChangeMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, bend: _winrt.UInt16) -> None: ...

class MidiPolyphonicKeyPressureMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    channel: _winrt.UInt8
    note: _winrt.UInt8
    pressure: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiPolyphonicKeyPressureMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, note: _winrt.UInt8, pressure: _winrt.UInt8) -> None: ...

class MidiProgramChangeMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    channel: _winrt.UInt8
    program: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiProgramChangeMessage: ...
    @typing.overload
    def __init__(self, channel: _winrt.UInt8, program: _winrt.UInt8) -> None: ...

class MidiSongPositionPointerMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    beats: _winrt.UInt16
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiSongPositionPointerMessage: ...
    @typing.overload
    def __init__(self, beats: _winrt.UInt16) -> None: ...

class MidiSongSelectMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    song: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiSongSelectMessage: ...
    @typing.overload
    def __init__(self, song: _winrt.UInt8) -> None: ...

class MidiStartMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiStartMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiStopMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiStopMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiSynthesizer(IMidiOutPort, winsdk.windows.foundation.IClosable, _winrt.Object):
    device_id: str
    volume: _winrt.Double
    audio_device: winsdk.windows.devices.enumeration.DeviceInformation
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiSynthesizer: ...
    @typing.overload
    def close(self) -> None: ...
    @typing.overload
    @staticmethod
    def create_async() -> winsdk.windows.foundation.IAsyncOperation[MidiSynthesizer]: ...
    @typing.overload
    @staticmethod
    def create_async(audio_device: winsdk.windows.devices.enumeration.DeviceInformation) -> winsdk.windows.foundation.IAsyncOperation[MidiSynthesizer]: ...
    @typing.overload
    @staticmethod
    def is_synthesizer(midi_device: winsdk.windows.devices.enumeration.DeviceInformation) -> _winrt.Boolean: ...
    @typing.overload
    def send_buffer(self, midi_data: winsdk.windows.storage.streams.IBuffer) -> None: ...
    @typing.overload
    def send_message(self, midi_message: IMidiMessage) -> None: ...

class MidiSystemExclusiveMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiSystemExclusiveMessage: ...
    @typing.overload
    def __init__(self, raw_data: winsdk.windows.storage.streams.IBuffer) -> None: ...

class MidiSystemResetMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiSystemResetMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiTimeCodeMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    frame_type: _winrt.UInt8
    values: _winrt.UInt8
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiTimeCodeMessage: ...
    @typing.overload
    def __init__(self, frame_type: _winrt.UInt8, values: _winrt.UInt8) -> None: ...

class MidiTimingClockMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiTimingClockMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class MidiTuneRequestMessage(IMidiMessage, _winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> MidiTuneRequestMessage: ...
    @typing.overload
    def __init__(self) -> None: ...

class IMidiMessage(_winrt.Object):
    raw_data: winsdk.windows.storage.streams.IBuffer
    timestamp: winsdk.windows.foundation.TimeSpan
    type: MidiMessageType
    @staticmethod
    def _from(obj: _winrt.Object) -> IMidiMessage: ...

class IMidiOutPort(winsdk.windows.foundation.IClosable, _winrt.Object):
    device_id: str
    @staticmethod
    def _from(obj: _winrt.Object) -> IMidiOutPort: ...
    @typing.overload
    def send_buffer(self, midi_data: winsdk.windows.storage.streams.IBuffer) -> None: ...
    @typing.overload
    def send_message(self, midi_message: IMidiMessage) -> None: ...
    @typing.overload
    def close(self) -> None: ...

