From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- arts/midi/alsamidiport_impl.h | 85 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 arts/midi/alsamidiport_impl.h (limited to 'arts/midi/alsamidiport_impl.h') 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 +#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 +#elif defined(HAVE_SYS_ASOUNDLIB_H) +#include +#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 */ -- cgit v1.2.1