Files
Work/midiseq/midiout.hpp
2024-08-07 09:16:27 -04:00

62 lines
1.3 KiB
C++

#ifndef _MIDISEQ_MIDIOUTDEVICE_HPP_
#define _MIDISEQ_MIDIOUTDEVICE_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_MMSYSTEM_HPP_
#include <common/mmsystem.hpp>
#endif
#ifndef _MIDISEQ_PUREEVENT_HPP_
#include <midiseq/pureevnt.hpp>
#endif
#ifndef _MIDISEQ_MIDIOUTCAPS_HPP_
#include <midiseq/midicaps.hpp>
#endif
class MIDIOutputDevice
{
public:
MIDIOutputDevice(const String &deviceName=String());
virtual ~MIDIOutputDevice();
bool midiEvent(const PureEvent &somePureEvent);
bool hasDevice(void)const;
void closeDevice(void);
bool openDevice(void);
bool openDevice(const String &deviceName);
bool openDevice(int deviceID);
WORD getRightVolume(void)const;
WORD getLeftVolume(void)const;
bool setRightVolume(WORD volumeLevel);
bool setLeftVolume(WORD volumeLevel);
static bool getDeviceNames(Block<String> &deviceNames);
static UINT getNumDevs(void);
private:
typedef HMIDIOUT MIDIHandle;
void hasDevice(bool hasDevice);
bool getDeviceCapabilities(void);
UINT mMIDIDeviceID;
bool mHasDevice;
MIDIHandle mhMIDIOutput;
MIDIOutCaps mMIDIOutDevCaps;
};
inline
MIDIOutputDevice::~MIDIOutputDevice(void)
{
closeDevice();
}
inline
bool MIDIOutputDevice::hasDevice(void)const
{
return mHasDevice;
}
inline
void MIDIOutputDevice::hasDevice(bool hasDevice)
{
mHasDevice=hasDevice;
}
#endif