Skip to content

MIDI in/out, Buffer, DataReader, DataWriter, device enumeration - #2930

Merged
jeromelaban merged 103 commits into
unoplatform:masterfrom
MartinZikmund:dev/mazi/midi-in
Jul 27, 2020
Merged

jeromelaban merged 103 commits into
unoplatform:masterfrom
MartinZikmund:dev/mazi/midi-in

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Apr 4, 2020 •

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): closes #2757, closes #3089, closes #3135, closes #3137, related to unoplatform/uno-private#1439

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

MIDI, Buffer, DataReader, DataWriter and device enumeration APIs are not implemented.

What is the new behavior?

This PR implements MIDI and several public APIs, which are all required for it to work fully.

  • Infrastructure for DeviceEnumeration API
  • MIDI input/output on Android, iOS, macOS and WASM
  • Buffer
  • DataReader
  • DataWriter

PR Checklist

Please check if your PR fulfills the following requirements:

@gitpod-io

gitpod-io Bot commented Apr 4, 2020 •

Copy link
Copy Markdown

@MartinZikmund MartinZikmund added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform labels Apr 4, 2020
@MartinZikmund MartinZikmund self-assigned this Apr 5, 2020
@MartinZikmund MartinZikmund changed the title [WIP] MIDI in/out [WIP] MIDI in/out, DataWriter May 10, 2020
@MartinZikmund MartinZikmund changed the title [WIP] MIDI in/out, DataWriter [WIP] MIDI in/out, DataWriter, device enumeration May 10, 2020
@MartinZikmund MartinZikmund changed the title [WIP] MIDI in/out, DataWriter, device enumeration [WIP] MIDI in/out, DataReader, DataWriter, device enumeration May 10, 2020
@MartinZikmund MartinZikmund changed the title [WIP] MIDI in/out, DataReader, DataWriter, device enumeration [WIP] MIDI in/out, Buffer, DataReader, DataWriter, device enumeration May 11, 2020
@MartinZikmund MartinZikmund mentioned this pull request May 14, 2020
2 of 5 tasks
@pkar70

pkar70 commented May 15, 2020

Copy link
Copy Markdown
Contributor

Now ReadString should be added to DataReader :)
Should I correct it within my PR, or somehow here?

@MartinZikmund

MartinZikmund commented May 15, 2020 •

Copy link
Copy Markdown
Member Author

You can add it to your PR and I will merge it in I will do a manual merge of the code in the evening 👍

@pkar70

pkar70 commented May 15, 2020

Copy link
Copy Markdown
Contributor

But is your evening my evening? :)
I know why I didn't implement ReadString - doc says that input parameter is 'codeUnitCount', and I treat it as code unit counter... code unit can have (in UTF-8) anything 1..6 bytes... but I found sample on Microsoft web, where this is treated as byte count (as in your code).
I made some changes. When compilation would be OK, and your PR still would have 'work to-do', maybe my PR can be merged? :)

Comment thread src/Uno.UWP/Devices/Midi/MidiInPort.cs Resolved
@MartinZikmund
MartinZikmund requested a review from a team July 20, 2020 06:38

@davidjohnoliver davidjohnoliver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!

@MartinZikmund MartinZikmund added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 20, 2020
@carldebilly

Copy link
Copy Markdown
Member

/azp run

@unoplatform unoplatform deleted a comment from azure-pipelines Bot Jul 20, 2020
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

# Conflicts:
#	build/PackageDiffIgnore.xml
#	src/Uno.UI/LinkerDefinition.Wasm.xml
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Enumeration/DeviceInformation.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Enumeration/DeviceInformationCollection.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Enumeration/DeviceInformationUpdate.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Enumeration/DeviceWatcher.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Enumeration/DeviceWatcherStatus.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/IMidiMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/IMidiOutPort.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiActiveSensingMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiChannelPressureMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiContinueMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiControlChangeMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiInPort.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiMessageReceivedEventArgs.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiMessageType.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiNoteOffMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiNoteOnMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiOutPort.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiPitchBendChangeMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiPolyphonicKeyPressureMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiProgramChangeMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiSongPositionPointerMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiSongSelectMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiStartMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiStopMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiSystemExclusiveMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiSystemResetMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiTimeCodeMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiTimingClockMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.Midi/MidiTuneRequestMessage.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/Buffer.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/ByteOrder.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/DataReader.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/DataWriter.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/IDataReader.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/IDataWriter.cs
#	src/Uno.UWP/Generated/3.0.0.0/Windows.Storage.Streams/UnicodeEncoding.cs
@MartinZikmund MartinZikmund removed the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 21, 2020
@MartinZikmund MartinZikmund added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 21, 2020
# Conflicts:
#	src/Uno.UI.Wasm/LinkerDefinition.xml
#	src/Uno.UI/ts/Windows/Devices/Enumeration/Internal/Providers/Midi/MidiDeviceClassProvider.ts
#	src/Uno.UI/ts/Windows/Devices/Enumeration/Internal/Providers/Midi/MidiDeviceConnectionWatcher.ts
#	src/Uno.UI/ts/Windows/Devices/Midi/Internal/WasmMidiAccess.ts
#	src/Uno.UI/ts/Windows/Devices/Midi/MidiInPort.ts
#	src/Uno.UI/ts/Windows/Devices/Midi/MidiOutPort.ts
#	src/Uno.UI/ts/types/webmidi/index.d.ts
break;
}

switch (_currentMessageType)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public IBuffer DetachBuffer()
{
var result = new Buffer(_memoryStream.ToArray());
_memoryStream.Dispose();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MartinZikmund MartinZikmund mentioned this pull request Jul 25, 2020
5 of 6 tasks
@jeromelaban
jeromelaban merged commit 0a4a2fe into unoplatform:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for DataReader Support for Windows.Devices.Enumeration.DeviceInformation Support for Windows.Storage.Streams.DataWriter MIDI in/out

8 participants