2 * MidiWinMM.h - WinMM MIDI client
4 * Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
28 #include "lmmsconfig.h"
30 #ifdef LMMS_BUILD_WIN32
35 #include "MidiClient.h"
42 class MidiWinMM
: public QObject
, public MidiClient
49 static QString
probeDevice();
52 inline static QString
name()
54 return QT_TRANSLATE_NOOP( "setupWidget", "WinMM MIDI" );
59 virtual void processOutEvent( const midiEvent
& _me
,
60 const midiTime
& _time
,
61 const MidiPort
* _port
);
63 virtual void applyPortMode( MidiPort
* _port
);
64 virtual void removePort( MidiPort
* _port
);
67 #ifdef LMMS_BUILD_WIN32
68 // list devices as ports
69 virtual QStringList
readablePorts() const
71 return m_inputDevices
.values();
74 virtual QStringList
writablePorts() const
76 return m_outputDevices
.values();
80 // return name of port which specified MIDI event came from
81 virtual QString
sourcePortName( const midiEvent
& ) const;
83 // (un)subscribe given MidiPort to/from destination-port
84 virtual void subscribeReadablePort( MidiPort
* _port
,
85 const QString
& _dest
,
86 bool _subscribe
= true );
87 virtual void subscribeWritablePort( MidiPort
* _port
,
88 const QString
& _dest
,
89 bool _subscribe
= true );
90 virtual void connectRPChanged( QObject
* _receiver
,
91 const char * _member
)
93 connect( this, SIGNAL( readablePortsChanged() ),
97 virtual void connectWPChanged( QObject
* _receiver
,
98 const char * _member
)
100 connect( this, SIGNAL( writablePortsChanged() ),
101 _receiver
, _member
);
104 virtual bool isRaw() const
110 class setupWidget
: public MidiClient::setupWidget
113 setupWidget( QWidget
* _parent
);
114 virtual ~setupWidget();
116 virtual void saveSettings()
124 void updateDeviceList();
131 #ifdef LMMS_BUILD_WIN32
132 static void WINAPI CALLBACK
inputCallback( HMIDIIN _hm
, UINT _msg
,
136 void handleInputEvent( HMIDIIN _hm
, DWORD _ev
);
138 QMap
<HMIDIIN
, QString
> m_inputDevices
;
139 QMap
<HMIDIOUT
, QString
> m_outputDevices
;
143 typedef QMap
<QString
, MidiPortList
> SubMap
;
149 void readablePortsChanged();
150 void writablePortsChanged();