2024-12-15 13:45:46 +01:00
|
|
|
package hardware
|
|
|
|
|
|
|
|
|
|
// MIDIPeripheral contains the data of a MIDI peripheral
|
|
|
|
|
type MIDIPeripheral struct {
|
2024-12-20 17:18:57 +01:00
|
|
|
name string // The name of the peripheral
|
|
|
|
|
location int // The location of the peripheral
|
|
|
|
|
finderName string // The name of the parent finder
|
2024-12-15 13:45:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewMIDIPeripheral creates a new MIDI peripheral
|
2024-12-20 17:18:57 +01:00
|
|
|
func NewMIDIPeripheral(name string, location int, finderName string) *MIDIPeripheral {
|
2024-12-15 13:45:46 +01:00
|
|
|
return &MIDIPeripheral{
|
2024-12-20 17:18:57 +01:00
|
|
|
name: name,
|
|
|
|
|
location: location,
|
|
|
|
|
finderName: finderName,
|
2024-12-15 13:45:46 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Connect connects the MIDI peripheral
|
|
|
|
|
func (p *MIDIPeripheral) Connect() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Disconnect disconnects the MIDI peripheral
|
|
|
|
|
func (p *MIDIPeripheral) Disconnect() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Activate activates the MIDI peripheral
|
|
|
|
|
func (p *MIDIPeripheral) Activate() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Deactivate deactivates the MIDI peripheral
|
|
|
|
|
func (p *MIDIPeripheral) Deactivate() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SetDeviceProperty - not implemented for this kind of peripheral
|
|
|
|
|
func (p *MIDIPeripheral) SetDeviceProperty(uint32, uint32, byte) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetInfo gets the peripheral information
|
|
|
|
|
func (p *MIDIPeripheral) GetInfo() PeripheralInfo {
|
|
|
|
|
return PeripheralInfo{
|
|
|
|
|
Name: p.name,
|
|
|
|
|
ProtocolName: "MIDI",
|
|
|
|
|
}
|
|
|
|
|
}
|