mirror of
https://github.com/openharmony/midi_framework.git
synced 2026-07-01 22:04:00 -04:00
3627a8005e
Signed-off-by: Robin <chenhongjian3@h-partners.com>
43 lines
1.6 KiB
C++
43 lines
1.6 KiB
C++
/*
|
|
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
#ifndef MIDI_CLIENT_H
|
|
#define MIDI_CLIENT_H
|
|
#include "native_midi_base.h"
|
|
#include "midi_info.h"
|
|
namespace OHOS {
|
|
namespace MIDI {
|
|
|
|
class MidiDevice {
|
|
public:
|
|
virtual ~MidiDevice() = default;
|
|
virtual OH_MIDIStatusCode CloseDevice();
|
|
virtual OH_MIDIStatusCode OpenInputPort(uint32_t portIndex, OH_OnMIDIReceived callback, void *userData);
|
|
virtual OH_MIDIStatusCode ClosePort(uint32_t portIndex);
|
|
};
|
|
|
|
class MidiClient {
|
|
public:
|
|
virtual ~MidiClient() = default;
|
|
static OH_MIDIStatusCode CreateMidiClient(MidiClient **client, OH_MIDICallbacks callbacks, void *userData);
|
|
virtual OH_MIDIStatusCode Init(OH_MIDICallbacks callbacks, void *userData);
|
|
virtual OH_MIDIStatusCode GetDevices(OH_MIDIDeviceInformation *infos, size_t *numDevices);
|
|
virtual OH_MIDIStatusCode OpenDevice(int64_t deviceId, MidiDevice **midiDevice);
|
|
virtual OH_MIDIStatusCode GetDevicePorts(int64_t deviceId, OH_MIDIPortInformation *infos, size_t *numPorts);
|
|
virtual OH_MIDIStatusCode DestroyMidiClient();
|
|
};
|
|
} // namespace MIDI
|
|
} // namespace OHOS
|
|
#endif
|