Skip to content

Commit

Permalink
Merge pull request #352 from microsoft/pete-dev
Browse files Browse the repository at this point in the history
Fix some broken docs links
  • Loading branch information
Psychlist1972 authored Jun 21, 2024
2 parents d7802db + a94370f commit 7f5f2e6
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 41 deletions.
6 changes: 3 additions & 3 deletions docs/developer-how-to/how-to-create-virtual-ump-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ If you develop an application which should appear as a new MIDI device to other

A virtual device enables an application to appear as a UMP Endpoint to other applications.

[More information on how Virtual Devices work may be found here](../endpoints/virtual-device-app.md).
[More information on how Virtual Devices work may be found here](../endpoints/virtual-device-app.html).

## Steps to Create a Virtual Device

1. [Check for and bootstrap Windows MIDI Services](./how-to-check-for-windows-midi-services.md)
1. [Check for and bootstrap Windows MIDI Services](./how-to-check-for-windows-midi-services.html)
2. Create a MIDI session
3. Define the Virtual MIDI Device, its function blocks, and other properties
4. Create the Device and get the `EndpointDeviceId` for the device-side application endpoint
Expand All @@ -31,7 +31,7 @@ On the service-side, the Virtual Device works like any other native UMP MIDI 2.0

## Code

We'll assume you've already performed the [Windows MIDI Services bootstrapping steps](./how-to-check-for-windows-midi-services.md).
We'll assume you've already performed the [Windows MIDI Services bootstrapping steps](./how-to-check-for-windows-midi-services.html).

The first step is to define the virtual device by creating the different metadata declarations and then assemble them together using the `MidiVirtualDeviceCreationConfig` type.

Expand Down
4 changes: 2 additions & 2 deletions docs/developer-how-to/how-to-enumerate-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ has_children: false

Sometimes, an application wants to get a snapshot of active endpoints. For example, the MIDI console application does this when it presents a list of devices to pick from. This process is called enumeration.

> Enumerating endpoints one time is good only for a brief snapshot listing. If you want to have a list of devices that is always up to date when devices are plugged/unplugged, come into range, have property updates, etc., see the [how to watch endpoints](./how-to-watch-endpoints.md) topic.
> Enumerating endpoints one time is good only for a brief snapshot listing. If you want to have a list of devices that is always up to date when devices are plugged/unplugged, come into range, have property updates, etc., see the [how to watch endpoints](./how-to-watch-endpoints.html) topic.
```cpp
auto endpointList = MidiEndpointDeviceInformation::FindAll();
Expand All @@ -30,7 +30,7 @@ The application may then iterate through the list, reading the properties as nee

Windows MIDI Services has a very rich set of properties available for a UMP Endpoint. This information includes hardware and other transport information, parent device information, user-supplied information, and in the case of a MIDI 2.0 UMP Endpoint, declared information from endpoint discovery and protocol negotiation carried out within the Windows service.

For more details, see the [`MidiEndpointDeviceInformation`](../sdk-winrt-core/enumeration/MidiEndpointDeviceInformation.md) class documentation. You may also use the [MIDI Console application](../console/midi-console.md) to see all of the properties (including the raw property data if you choose to) for an endpoint.
For more details, see the [`MidiEndpointDeviceInformation`](../sdk-winrt-core/enumeration/MidiEndpointDeviceInformation.html) class documentation. You may also use the [MIDI Console application](../console/midi-console.html) to see all of the properties (including the raw property data if you choose to) for an endpoint.

## Sample Code

Expand Down
2 changes: 1 addition & 1 deletion docs/developer-how-to/how-to-watch-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In Windows MIDI Services, we've provided a specialized version of the device wat
## Events

To use the [`MidiEndpointDeviceWatcher`](../sdk-winrt-core/enumeration/MidiEndpointDeviceWatcher.md), first wire up handlers for the `Added`, `Removed`, and `Updated` events. Optionally, you may wire up handlers for the `EnumerationCompleted` event to be notified when initial enumeration has finished, and the `Stopped` event to know when the watcher has been stopped by a call to the `Stop` method.
To use the [`MidiEndpointDeviceWatcher`](../sdk-winrt-core/enumeration/MidiEndpointDeviceWatcher.html), first wire up handlers for the `Added`, `Removed`, and `Updated` events. Optionally, you may wire up handlers for the `EnumerationCompleted` event to be notified when initial enumeration has finished, and the `Stopped` event to know when the watcher has been stopped by a call to the `Stop` method.

Once the event handlers have been wired up, create the watcher using the static `Create` function.

Expand Down
10 changes: 5 additions & 5 deletions docs/endpoints/diagnostic-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Windows MIDI Services comes with three diagnostic endpoints, two of which are th

Windows MIDI Services comes with two loopback endpoints which are always present if the Windows service is running. These cannot be turned off by applications or configuration, and so may be relied upon by customer support, unit tests, and more.

The Endpoint Device Ids are available as static members of the `MidiEndpointDeviceInformation` class
The Endpoint Device Ids are available as static members of the `MidiDiagnostics` class

```cpp
winrt::hstring MidiEndpointDeviceInformation::DiagnosticsLoopbackAEndpointId();
winrt::hstring MidiEndpointDeviceInformation::DiagnosticsLoopbackBEndpointId();
winrt::hstring MidiDiagnostics::DiagnosticsLoopbackAEndpointDeviceId();
winrt::hstring MidiDiagnostics::DiagnosticsLoopbackBEndpointDeviceId();
```

By default, these endpoints are not returned by enumeration calls, because most applications would not want to present them to the user. However, you can include them in the `MidiEndpointDeviceInformation::FindAll` and `MidiEndpointDeviceWatcher::CreateWatcher` device filters by using the `MidiEndpointDeviceInformationFilter` enum value `IncludeDiagnosticLoopback` if your application has a diagnostic need for them.
By default, these endpoints are not returned by enumeration calls, because most applications would not want to present them to the user. However, you can include them in the `MidiEndpointDeviceInformation::FindAll` and `MidiEndpointDeviceWatcher::CreateWatcher` device filters by using the `MidiEndpointDeviceInformationFilters` enum value `DiagnosticLoopback` if your application has a diagnostic need for them.

```cpp
MidiEndpointDeviceInformationFilter::IncludeDiagnosticLoopback
MidiEndpointDeviceInformationFilters::DiagnosticLoopback
```

Diagnostic Loopback Endpoints A and B are cross-wired so that any message sent out on loopback A will come in on loopback B, and any message sent out on B will come in on A. In this way, the loopbacks function as a global app-to-app MIDI implementation for testing.
Expand Down
3 changes: 0 additions & 3 deletions docs/endpoints/kernel-streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,3 @@ Endpoints for this transport are not created through the configuration file, but
}
```


## Implementation

2 changes: 1 addition & 1 deletion docs/endpoints/virtual-device-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ The best experience for Windows MIDI Services will be with applications using th

Virtual Devices cannot be specified in the configuration file. Instead, applications must create them through code.

For developer information on how to set up a Virtual Device, see the [developer how-to](../developer-how-to/how-to-create-virtual-ump-device.md).
For developer information on how to set up a Virtual Device, see the [developer how-to](../developer-how-to/how-to-create-virtual-ump-device.html).
2 changes: 1 addition & 1 deletion docs/other-developer-docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MIDI devices come and go based on connecting/disconnecting USB cables, or new ne

There's no API or service reason to require a customer to reboot or reload/restart a MIDI DAW or other application to see newly added endpoints when using Windows MIDI Services.

For more information, see the How to Watch Endpoints page.
For more information, see the [How to Watch Endpoints](../developer-how-to/how-to-watch-endpoints.html) page.

### Don't include diagnostics endpoints for most apps

Expand Down
28 changes: 10 additions & 18 deletions docs/other-developer-docs/consuming-midi-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You will follow a similar approach to C++ using windows-rs instead of C++/WinRT.

## Consuming from C++ without Visual Studio (using cmake or other tools)

The C++/WinRT tool `cppwinrt.exe` will generate a set of standard C++ header files including `Windows.Devices.Midi2.h` which you can pull in and include in your project. The header file projections for WinRT types outside of `Windows::Devices::Midi2` are generated from the Windows SDK and included in a subfolder. When we ship Windows MIDI Services in-box in Windows, this new MIDI API will be projected in the same way as all the others in the Windows SDK.
The C++/WinRT tool `cppwinrt.exe` will generate a set of standard C++ header files including `Microsoft.Windows.Devices.Midi2.h` which you can pull in and include in your project. The header file projections for WinRT types outside of `Microsoft::Windows::Devices::Midi2` are generated from the Windows SDK and included in a subfolder. When we ship Windows MIDI Services in-box in Windows, this new MIDI API will be projected in the same way as all the others in the Windows SDK.

First, install the latest Windows SDK. You can get the SDK from the [Windows Dev Center](https://developer.microsoft.com/windows/downloads/windows-sdk/)

Expand Down Expand Up @@ -165,8 +165,8 @@ Once you have the header file referenced, you can use the same sample code used
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.220110.5

#pragma once
#ifndef WINRT_Windows_Devices_Midi2_H
#define WINRT_Windows_Devices_Midi2_H
#ifndef WINRT_Microsoft_Windows_Devices_Midi2_H
#define WINRT_Microsoft_Windows_Devices_Midi2_H
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.220110.5"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.220110.5"
Expand All @@ -176,7 +176,7 @@ static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.220110.5"), "Mismatche
#include "winrt/impl/Windows.Devices.Midi.2.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.Foundation.Collections.2.h"
#include "winrt/impl/Windows.Devices.Midi2.2.h"
#include "winrt/impl/Microsoft.Windows.Devices.Midi2.2.h"
...
```
Expand All @@ -203,9 +203,9 @@ function createWindow () {
// Enumerate endpoints
const endpoints = midi2.MidiEndpointDeviceInformation.findAll(
midi2.MidiEndpointDeviceInformationSortOrder.name,
midi2.MidiEndpointDeviceInformationFilters.includeDiagnosticLoopback +
midi2.MidiEndpointDeviceInformationFilters.includeClientUmpNative +
midi2.MidiEndpointDeviceInformationFilters.includeClientByteStreamNative);
midi2.MidiEndpointDeviceInformationFilters.diagnosticLoopback +
midi2.MidiEndpointDeviceInformationFilters.standardNativeUniversalMidiPacketFormat +
midi2.MidiEndpointDeviceInformationFilters.standardNativeMidi1ByteFormat);
console.log(endpoints);
Expand All @@ -217,18 +217,16 @@ function createWindow () {
console.log(endpoint.id);
console.log(endpoint.deviceInstanceId);
console.log(endpoint.name);
console.log(endpoint.description);
console.log(endpoint.transportMnemonic);
console.log("------------------------------------------------");
console.log("");
}
const loopbackAId = midi2.MidiEndpointDeviceInformation.diagnosticsLoopbackAEndpointId;
const loopbackBId = midi2.MidiEndpointDeviceInformation.diagnosticsLoopbackBEndpointId;
const loopbackAId = midi2.MidiDiagnostics.diagnosticsLoopbackAEndpointDeviceId;
const loopbackBId = midi2.MidiDiagnostics.diagnosticsLoopbackBEndpointDeviceId;
// create a new session
var session = midi2.MidiSession.createSession("Electron Test Session");
var session = midi2.MidiSession.create("Electron Test Session");
// connect to loopback A
var sendConnection = session.createEndpointConnection(loopbackAId);
Expand Down Expand Up @@ -263,22 +261,16 @@ Windows::Foundation::Collections:IVectorView {
\\?\SWD#MIDISRV#MIDIU_DIAG_LOOPBACK_A#{e7cce071-3c03-423f-88d3-f1045d02552b}
SWD\MIDISRV\MIDIU_DIAG_LOOPBACK_A
Diagnostics Loopback A
Diagnostics loopback endpoint. For testing purposes.
DIAG
------------------------------------------------
\\?\SWD#MIDISRV#MIDIU_DIAG_LOOPBACK_B#{e7cce071-3c03-423f-88d3-f1045d02552b}
SWD\MIDISRV\MIDIU_DIAG_LOOPBACK_B
Diagnostics Loopback B
Diagnostics loopback endpoint. For testing purposes.
DIAG
------------------------------------------------
\\?\SWD#MIDISRV#MIDIU_KS_BIDI_14488056966904779946_OUTPIN.0_INPIN.1#{e7cce071-3c03-423f-88d3-f1045d02552b}
SWD\MIDISRV\MIDIU_KS_BIDI_14488056966904779946_OUTPIN.0_INPIN.1
UM-ONE
KS
------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/other-developer-docs/data-translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Windows MIDI Services supports MIDI 1.0 and MIDI 2.0 devices.

## Translation between Message type 2 (MIDI 1.0 Channel Voice) and Message type 4 (MIDI 2.0 Channel Voice)

Currently, Windows MIDI Services does not translate messages based on negotiated protocol or Function Block declared protocol. Instead, for native UMP endpoints, applications should send the correct protocol messages (message type 2 for MIDI 1.0-compatible and message type 4 for MIDI 2.0-compatible messages) based upon the information provided by the `EndpointDeviceInformation` [and related enumeration types](developer-docs\Windows.Devices.Midi2\enumeration\README.md). In addition, for native bytestream endpoints, applications should send the appropriate MIDI 1.0 messages in UMP.
Currently, Windows MIDI Services does not translate messages based on negotiated protocol or Function Block declared protocol. Instead, for native UMP endpoints, applications should send the correct protocol messages (message type 2 for MIDI 1.0-compatible and message type 4 for MIDI 2.0-compatible messages) based upon the information provided by the `EndpointDeviceInformation` class. In addition, for native byte format endpoints, applications should send the appropriate MIDI 1.0 messages in UMP.

If a MIDI 1.0 device is connected to the new MIDI 2.0 Class Driver, Windows MIDI Services *will* downscale Message Type 4 to Message Type 2 before sending to the driver. This is because the driver, when working with a MIDI 1.0 device, only handles UMP messages which can be directly translated to MIDI 1.0 data format.

Expand Down
6 changes: 3 additions & 3 deletions docs/troubleshooting/midi-diag.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ title: MIDI Diagnostics Utility
parent: Troubleshooting
---

# Windows Dump Utility
# MIDI Diagnostics Utility

Windows MIDI Services comes with a simple command-line utility `mididmp.exe`. This has been designed for use by DAWs and support applications which need to shell out to a known executable to capture health information about the system.
The Windows MIDI Services SDK installer comes with a simple command-line utility `mididiag.exe`. This has been designed for use by DAWs and support applications which need to shell out to a known executable to capture health information about the system.

The utility returns information only about MIDI. Here is example output:

```
C:\Users\peteb>mididmp
C:\Users\peteb>mididiag
Microsoft Windows MIDI Services
===============================================================================
Expand Down
4 changes: 1 addition & 3 deletions docs/troubleshooting/type-initialization-error.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ parent: Troubleshooting

# Type Initializer Error

If you receive the error "The type initializer for `Windows.Devices.Midi2.<some class>` threw an exception" at runtime, in the console app in particular, it usually means that the Windows MIDI Services API is not properly registered on the system, or you are running on an unsupported version of Windows. This can happen during development if you don't run the installer which puts the appropriate activation entries into the registry.

This should never appear in production when Windows MIDI Services is in Windows, unless you are using a development build for which the newer types have not been properly registered, or you are running on an unsupported version or SKU of Windows.
If you receive the error "The type initializer for `Microsoft.Windows.Devices.Midi2.<some class>` threw an exception" at runtime, in the console app in particular, it usually means that the Windows MIDI Services SDK is not properly registered on the system, or you are running on an unsupported version of Windows.

0 comments on commit 7f5f2e6

Please sign in to comment.