summaryrefslogtreecommitdiffstats
path: root/arts/midi/alsamidiport_impl.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /arts/midi/alsamidiport_impl.h
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'arts/midi/alsamidiport_impl.h')
-rw-r--r--arts/midi/alsamidiport_impl.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/arts/midi/alsamidiport_impl.h b/arts/midi/alsamidiport_impl.h
new file mode 100644
index 00000000..251f9d94
--- /dev/null
+++ b/arts/midi/alsamidiport_impl.h
@@ -0,0 +1,85 @@
+ /*
+
+ Copyright (C) 2001-2002 Stefan Westerfeld
+ stefan@space.twc.de
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ */
+
+#ifndef ARTS_ALSAMIDIPORT_IMPL_H
+#define ARTS_ALSAMIDIPORT_IMPL_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/**
+ * compile real version if we have ALSA support, dummy version otherwise
+ */
+#if defined(HAVE_ARTS_LIBASOUND2) || defined(HAVE_ARTS_LIBASOUND)
+
+#ifdef HAVE_ALSA_ASOUNDLIB_H
+#include <alsa/asoundlib.h>
+#elif defined(HAVE_SYS_ASOUNDLIB_H)
+#include <sys/asoundlib.h>
+#endif
+
+#include "artsmidi.h"
+
+namespace Arts {
+
+class AlsaMidiPort_impl : virtual public AlsaMidiPort_skel {
+protected:
+ long _client, _port;
+ bool opened;
+
+ snd_seq_t *alsaSeq;
+
+ int alsaQueue;
+ int alsaClientId;
+ int alsaPort;
+
+ snd_seq_addr_t alsaSourceAddr;
+ snd_seq_addr_t alsaDestAddr;
+
+ void fillAlsaEvent(snd_seq_event_t *ev, const MidiCommand& command);
+ void sendAlsaEvent(snd_seq_event_t *ev);
+ void flushAlsa();
+
+public:
+ AlsaMidiPort_impl(snd_seq_t *seq, long client, long port);
+ void close();
+
+ /* interface MidiPort */
+ Arts::TimeStamp time();
+ Arts::TimeStamp playTime();
+ void processCommand(const MidiCommand& command);
+ void processEvent(const MidiEvent& event);
+
+ /* interface AlsaMidiPort */
+ void client(long newClient);
+ long client();
+
+ void port(long newPort);
+ long port();
+
+ bool open();
+};
+
+}
+#endif /* HAVE_ARTS_LIBASOUND2 */
+#endif /* ARTS_ALSAMIDIPORT_IMPL_H */