Skip to content

Commit f9db764

Browse files
committed
Created CheckDwmApi utility
1 parent d7a1f82 commit f9db764

File tree

16 files changed

+30
-26
lines changed

16 files changed

+30
-26
lines changed

Docs/articles/composing/Pattern.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Each line starts with a note. Think about the line as a piano roll lane in your
160160

161161
Hyphen (`'-'`) means nothing except a step of a cell's length. We will call it as **fill symbol**.
162162

163-
> [!IMPORTANT]
163+
> [!WARNING]
164164
> Spaces will be cut from the piano roll string before processing. So it's required to use a fill symbol to specify an empty space (rest) to get correct results. For example, this pattern:
165165
> ```text
166166
> F2 ||||

Docs/articles/dev/Support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ uid: a_support
66

77
Here you'll find information about how to create good issues on the DryWetMIDI so I (author of the library) can help you with your problem. The main rule – provide as many details as possible. I'm developing the library in my spare time and don't ask money for it. Please respect my time.
88

9-
> [!IMPORTANT]
9+
> [!WARNING]
1010
> If you make no effort to get your issue clear, I will make no effort to help you.
1111
1212
Things to pay attention for are:

Docs/articles/dev/Using-in-Unity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,5 @@ public class DemoScript : MonoBehaviour
155155
}
156156
```
157157

158-
> [!IMPORTANT]
158+
> [!WARNING]
159159
> Pay attention to `OnApplicationQuit` method. You should always take care about disposing of MIDI devices. Without it all resources taken by the device will live until GC collects them. In the case of Unity, it means Unity may need to be reopened to be able to use the same devices again (for example, on Windows).

Docs/articles/dev/Utility-CheckDwmApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Of course, you can see [the source code](https://github.com/melanchall/drywetmid
4646

4747
## Running the utility
4848

49-
> [!IMPORTANT]
49+
> [!WARNING]
5050
> If you're on Windows, you need to have a virtual MIDI device installed to run the utility. For example, you can use [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html):
5151
>
5252
> ![CheckDwmApi loopMIDI Create](images/CheckDwmApi-loopMIDI-Create.png)

Docs/articles/devices/Devices-watcher.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uid: a_dev_watcher
44

55
# Devices watcher
66

7-
> [!IMPORTANT]
7+
> [!WARNING]
88
> Devices watching API is a platform-specific one so please refer to the [Supported OS](xref:a_develop_supported_os) article to learn more.
99
1010
DryWetMIDI allows to track whether a MIDI device is added to or removed from the system. There is the [DevicesWatcher](xref:Melanchall.DryWetMidi.Multimedia.DevicesWatcher) class for that purpose. The class is singleton and you can get the instance with [Instance](xref:Melanchall.DryWetMidi.Multimedia.DevicesWatcher.Instance) property.
@@ -156,5 +156,5 @@ Name is MyDevice
156156

157157
Device instances comparison can be useful in programs with GUI where you need to update the list of available devices. So when a device is added, you just add it to the list. When some device is removed, you find the corresponding item in the current list via `Equals` on device instances and remove that item.
158158

159-
> [!IMPORTANT]
159+
> [!WARNING]
160160
> Checking for devices equality supported for **macOS** only. On Windows call of `Equals` will just compare references.

Docs/articles/devices/Input-device.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ In DryWetMIDI an input MIDI device is represented by the [IInputDevice](xref:Mel
88

99
The library provides built-in implementation of `IInputDevice`: [InputDevice](xref:Melanchall.DryWetMidi.Multimedia.InputDevice) class. To get an instance of `InputDevice` you can use either [GetByName](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.GetByName(System.String)) or [GetByIndex](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.GetByIndex(System.Int32)) static methods. ID of a MIDI device is a number from `0` to _devices count minus one_. To get count of input MIDI devices presented in the system there is the [GetDevicesCount](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.GetDevicesCount) method. You can get all input MIDI devices with the [GetAll](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.GetAll) method.
1010

11-
> [!IMPORTANT]
11+
> [!WARNING]
1212
> You can use `InputDevice` built-in implementation of `IInputDevice` only on the systems listed in the [Supported OS](xref:a_develop_supported_os) article. Of course you can create your own implementation of `IInputDevice` as described in the [Custom input device](#custom-input-device) section below.
1313
1414
After an instance of `InputDevice` is obtained, call [StartEventsListening](xref:Melanchall.DryWetMidi.Multimedia.IInputDevice.StartEventsListening) to start listening to incoming MIDI events going from an input MIDI device. If you don't need to listen for events anymore, call [StopEventsListening](xref:Melanchall.DryWetMidi.Multimedia.IInputDevice.StopEventsListening). Also this method will be called automatically on [Dispose](xref:Melanchall.DryWetMidi.Multimedia.MidiDevice.Dispose). To check whether `InputDevice` is currently listening for events or not use [IsListeningForEvents](xref:Melanchall.DryWetMidi.Multimedia.IInputDevice.IsListeningForEvents) property.
1515

1616
If an input device is listening for events, it will fire the [EventReceived](xref:Melanchall.DryWetMidi.Multimedia.IInputDevice.EventReceived) event for each incoming MIDI event. Received MIDI event will be passed to an event's handler.
1717

18-
> [!IMPORTANT]
18+
> [!WARNING]
1919
> If you use an instance of the `InputDevice` within a `using` block, you need to be very careful. In general it's not a good practice and can cause problems. For example, with this code
2020
> ```csharp
2121
> using (var inputDevice = InputDevice.GetByName("Some MIDI device"))
@@ -66,7 +66,7 @@ namespace InputDeviceExample
6666
}
6767
```
6868
69-
> [!IMPORTANT]
69+
> [!WARNING]
7070
> You must always take care about disposing an `InputDevice`, so use it inside `using` block or call `Dispose` manually. Without it all resources taken by the device will live until GC collects them via the finalizer of the `InputDevice`. It means that sometimes you will not be able to use different instances of the same device across multiple applications or different pieces of a program.
7171
7272
`InputDevice` has the [MidiTimeCodeReceived](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.MidiTimeCodeReceived) event which, by default, will be fired only when **all** MIDI Time Code components (separate [MidiTimeCodeEvent](xref:Melanchall.DryWetMidi.Core.MidiTimeCodeEvent) events) are received forming _hours:minutes:seconds:frames_ timestamp. You can turn this behavior off by setting [RaiseMidiTimeCodeReceived](xref:Melanchall.DryWetMidi.Multimedia.InputDevice.RaiseMidiTimeCodeReceived) to `false`.

Docs/articles/devices/Output-device.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ foreach (var outputDevice in OutputDevice.GetAll())
2020
}
2121
```
2222

23-
> [!IMPORTANT]
23+
> [!WARNING]
2424
> You can use `OutputDevice` built-in implementation of `IOutputDevice` only on the systems listed in the [Supported OS](xref:a_develop_supported_os) article. Of course you can create your own implementation of `IOutputDevice` as described in the [Custom output device](#custom-output-device) section below.
2525
2626
After an instance of `OutputDevice` is obtained, you can send MIDI events to the device via [SendEvent](xref:Melanchall.DryWetMidi.Multimedia.OutputDevice.SendEvent(Melanchall.DryWetMidi.Core.MidiEvent)) method. You cannot send [meta events](xref:Melanchall.DryWetMidi.Core.MetaEvent) since such events can be inside a MIDI file only. If you pass an instance of meta event class, `SendEvent` will do nothing. [EventSent](xref:Melanchall.DryWetMidi.Multimedia.IOutputDevice.EventSent) event will be fired for each event sent with `SendEvent` (except meta events) holding the MIDI event sent. The value of [DeltaTime](xref:Melanchall.DryWetMidi.Core.MidiEvent.DeltaTime) property of MIDI events will be ignored, events will be sent to the device immediately. To take delta-times into account, use [Playback](xref:Melanchall.DryWetMidi.Multimedia.Playback) class.
@@ -59,10 +59,10 @@ private void OnEventSent(object sender, MidiEventSentEventArgs e)
5959
_outputDevice?.Dispose();
6060
```
6161

62-
> [!IMPORTANT]
62+
> [!WARNING]
6363
> You must always take care about disposing an `OutputDevice`, so use it inside `using` block or call `Dispose` manually. Without it all resources taken by the device will live until GC collects them via the finalizer of the `OutputDevice`. It means that sometimes you will not be able to use different instances of the same device across multiple applications or different pieces of a program.
6464
65-
> [!IMPORTANT]
65+
> [!WARNING]
6666
> If you use an instance of the `OutputDevice` within a `using` block, you need to be very careful. In general it's not a good practice and can cause problems. For example, with this code
6767
> ```csharp
6868
> using (var outputDevice = OutputDevice.GetByName("Some MIDI device"))

Docs/articles/devices/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DryWetMIDI provides the ability to send MIDI data to or receive it from MIDI dev
1212

1313
The library provides implementations for both `IInputDevice` and `IOutputDevice`: [InputDevice](xref:Melanchall.DryWetMidi.Multimedia.InputDevice) and [OutputDevice](xref:Melanchall.DryWetMidi.Multimedia.OutputDevice) correspondingly which represent MIDI devices visible by the operating system. Both classes implement [IDisposable](xref:System.IDisposable) interface so you should always dispose of them to free devices for use by other applications.
1414

15-
> [!IMPORTANT]
15+
> [!WARNING]
1616
> You can use `InputDevice` and `OutputDevice` built-in implementations of `IInputDevice` and `IOutputDevice` only on the systems listed in the [Supported OS](xref:a_develop_supported_os) article. Of course you can create your own implementations of `IInputDevice` and `IOutputDevice`.
1717
1818
All classes that interact with devices work with interfaces mentioned above, so you can create custom implementations of your devices (see examples in [Input device](Input-device.md) and [Output device](Output-device.md) articles) and use it for playback or recording, for example.

Docs/articles/devices/Virtual-device.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uid: a_dev_virtual
44

55
# Virtual device
66

7-
> [!IMPORTANT]
7+
> [!WARNING]
88
> Virtual devices API is a platform-specific one so please refer to the [Supported OS](xref:a_develop_supported_os) article to learn more. For Windows you can use products like [virtualMIDI SDK](https://www.tobias-erichsen.de/software/virtualmidi/virtualmidi-sdk.html) or similar to work with virtual MIDI ports programmatically. Be careful with the license of these products.
99
1010
With DryWetMIDI you can programmatically create virtual MIDI devices with the specified name using [VirtualDevice.Create](xref:Melanchall.DryWetMidi.Multimedia.VirtualDevice.Create(System.String)) method. In fact, virtual device is an [input](xref:a_dev_input) and an [output](xref:a_dev_output) devices paired together in a way that any MIDI event sent to the output device will be immediately transferred back from the virtual device and can be received by an application from its input subdevice.
@@ -111,7 +111,7 @@ Event Note On [5] (70, 60) received on device Leaf1.
111111
Event Note On [5] (70, 60) received on device Leaf2.
112112
```
113113

114-
> [!IMPORTANT]
114+
> [!WARNING]
115115
> As with input and output device you must always [dispose](xref:Melanchall.DryWetMidi.Multimedia.MidiDevice.Dispose) virtual device when you're done with it:
116116
>
117117
> ```csharp

Docs/articles/high-level-managing/Processing-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uid: a_processing_objects
44

55
# Processing objects
66

7-
> [!IMPORTANT]
7+
> [!WARNING]
88
> Please read the [Getting objects](xref:a_getting_objects) article before reading this one.
99
1010
This article describes ways to process different objects (like [timed events](xref:Melanchall.DryWetMidi.Interaction.TimedEvent) or [notes](xref:Melanchall.DryWetMidi.Interaction.Note)) within MIDI files and track chunks. Processing means changing properties of the objects, including time or length.

0 commit comments

Comments
 (0)