cupertino-sample-code/mididriverkit-creating-a-midi-device-driver/CreatingMIDIDriverSampleAppExtension/CreatingMIDIDriverSampleAppDevice.iig
Mihaela Mihaljevic 37fd4fb24f Initial commit: 606 Apple sample code projects
MIT License - Apple Developer sample code
Downloaded via Cupertino (https://github.com/mihaelamj/cupertino)
2025-12-03 00:19:12 +01:00

49 lines
1.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
See the LICENSE.txt file for this samples licensing information.
Abstract:
The declaration of CreatingMIDIDriverSampleAppDevice, a MIDIDriverKit device that does
a basic MIDI roundtrip, copying data from the input port to the output port.
*/
#ifndef CreatingMIDIDriverSampleAppDevice_h
#define CreatingMIDIDriverSampleAppDevice_h
#include <DriverKit/DriverKit.iig>
#include <MIDIDriverKit/IOUserMIDIDevice.iig>
using namespace MIDIDriverKit;
constexpr uint64_t kAddPortConfigChangeAction = 'remp';
constexpr uint64_t kRemovePortConfigChangeAction = 'addp';
class IOUserMIDIDriver;
class CreatingMIDIDriverSampleAppDevice : public IOUserMIDIDevice
{
public:
virtual bool init(IOUserMIDIDriver* driver,
OSString* name,
OSString* model,
OSString* manufacturer) final LOCALONLY;
virtual void free() override LOCALONLY;
virtual kern_return_t StartIO() override LOCALONLY;
virtual kern_return_t StopIO() override LOCALONLY;
virtual kern_return_t PerformDeviceConfigurationChange(uint64_t changeAction,
OSObject* changeInfo) override LOCALONLY;
virtual kern_return_t AbortDeviceConfigurationChange(uint64_t changeAction,
OSObject* changeInfo) override LOCALONLY;
void SetupEntities() LOCALONLY;
// User client actions.
kern_return_t AddPort() LOCALONLY;
kern_return_t RemovePort() LOCALONLY;
kern_return_t ToggleOffline() LOCALONLY;
};
#endif /* CreatingMIDIDriverSampleAppDevice_h */