diff -Nru kmetronome-0.10.0/AUTHORS kmetronome-0.10.1/AUTHORS --- kmetronome-0.10.0/AUTHORS 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/AUTHORS 2012-05-28 20:55:39.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +Copyright (C) 2005-2012 Pedro Lopez-Cabanillas Translations @@ -14,9 +14,11 @@ French: Julien Richard-Foy file: po/fr.po + Turkish: Server Acim + file: po/tr.po Instrument definitions (.INS files) support: - Copyright (C) 2005-2009, rncbc aka Rui Nuno Capela + Copyright (C) 2005-2012, rncbc aka Rui Nuno Capela Files: src/Instrument.h src/Instrument.cpp diff -Nru kmetronome-0.10.0/ChangeLog kmetronome-0.10.1/ChangeLog --- kmetronome-0.10.0/ChangeLog 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/ChangeLog 2012-05-28 20:55:39.000000000 +0000 @@ -1,3 +1,21 @@ +2012-05-28 00:00 plcl + + * assigned shortcuts for keyboard media keys + * Release 0.10.1 + +2011-02-05 00:00 plcl + + * Turkish translation added, by Server Acim + +2010-09-16 00:00 plcl + + * docbook version update + +2010-09-10 00:00 plcl + + * drumstick: sync release 0.5 + * request realtime priority for the MIDI input thread + 2010-06-06 00:00 plcl * Release 0.10.0 @@ -7,9 +25,9 @@ * German translation updated, by Rene Landert * Custom pattern samples * release candidate - + 2010-05-23 00:00 plcl - + * Enable the standard toolbar * Optionally hide the fake toolbar * Import/export patterns @@ -30,7 +48,7 @@ * Release 0.9.3 2010-02-20 00:00 plcl - + * aseqmm renamed to drumstick 2009-12-23 00:00 plcl @@ -104,7 +122,7 @@ 2005-06-20 21:17 plcl - * Implemented double click event handler, changing tempo as + * Implemented double click event handler, changing tempo as suggested by Chris. 2005-06-12 23:51 plcl @@ -199,4 +217,3 @@ 2005-03-29 20:34 plcl * Initial revision - diff -Nru kmetronome-0.10.0/cmake_admin/FindMSGFMT.cmake kmetronome-0.10.1/cmake_admin/FindMSGFMT.cmake --- kmetronome-0.10.0/cmake_admin/FindMSGFMT.cmake 2010-06-06 08:09:16.000000000 +0000 +++ kmetronome-0.10.1/cmake_admin/FindMSGFMT.cmake 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ # KMetronome - ALSA Sequencer based MIDI metronome -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/cmake_admin/FindPCHSupport.cmake kmetronome-0.10.1/cmake_admin/FindPCHSupport.cmake --- kmetronome-0.10.0/cmake_admin/FindPCHSupport.cmake 2010-06-06 08:09:16.000000000 +0000 +++ kmetronome-0.10.1/cmake_admin/FindPCHSupport.cmake 2012-05-28 20:55:39.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff -Nru kmetronome-0.10.0/CMakeLists.txt kmetronome-0.10.1/CMakeLists.txt --- kmetronome-0.10.0/CMakeLists.txt 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/CMakeLists.txt 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ # KMetronome - ALSA Sequencer based MIDI metronome -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ SET (VERSION_MAJOR "0") SET (VERSION_MINOR "10") -SET (VERSION_PATCH "0") +SET (VERSION_PATCH "1") SET (VERSION_SUFFIX "") SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}) ADD_DEFINITIONS(-D'VERSION="${VERSION}"') @@ -84,7 +84,7 @@ ADD_SUBDIRECTORY(drumstick) ELSE(STATIC_DRUMSTICK) SET(BUILD_SHARED_LIBS ON) - PKG_CHECK_MODULES(DRUMSTICK REQUIRED drumstick-alsa>=0.3) + PKG_CHECK_MODULES(DRUMSTICK REQUIRED drumstick-alsa>=0.5) IF(DRUMSTICK_FOUND) SET(DRUMSTICK_LIBS ${DRUMSTICK_LIBRARIES}) #MESSAGE(STATUS "DRUMSTICK_LIBS: ${DRUMSTICK_LIBS}") @@ -137,7 +137,7 @@ COMMAND cp -r icons kmetronome-${VERSION} COMMAND cp -r po kmetronome-${VERSION} COMMAND cp -r src kmetronome-${VERSION} - COMMAND cp -rHL drumstick kmetronome-${VERSION} + #COMMAND cp -rHL drumstick kmetronome-${VERSION} COMMAND cp AUTHORS ChangeLog CMakeLists.txt configure.* COPYING INSTALL kmetronome.* net.sourceforge.kmetronome.* NEWS README TODO kmetronome-${VERSION} COMMAND tar -cj --exclude .svn --exclude *.old --exclude *~ -f kmetronome-${VERSION}.tar.bz2 kmetronome-${VERSION} COMMAND tar -cz --exclude .svn --exclude *.old --exclude *~ -f kmetronome-${VERSION}.tar.gz kmetronome-${VERSION} diff -Nru kmetronome-0.10.0/debian/changelog kmetronome-0.10.1/debian/changelog --- kmetronome-0.10.0/debian/changelog 2011-05-29 08:19:41.000000000 +0000 +++ kmetronome-0.10.1/debian/changelog 2012-06-10 10:27:44.000000000 +0000 @@ -1,3 +1,12 @@ +kmetronome (0.10.1-1) unstable; urgency=low + + * New upstream release. + * Remove kubuntu_01_docbook_fix.diff, applied upstream. + * Remove quilt series, no patches remaining. + * Bump Standards. + + -- Alessio Treglia Sun, 10 Jun 2012 12:27:33 +0200 + kmetronome (0.10.0-3) unstable; urgency=low * Apply kubuntu_01_docbook_fix.diff on Debian too (Closes: #628315). diff -Nru kmetronome-0.10.0/debian/control kmetronome-0.10.1/debian/control --- kmetronome-0.10.0/debian/control 2011-05-29 08:19:22.000000000 +0000 +++ kmetronome-0.10.1/debian/control 2012-06-10 10:25:33.000000000 +0000 @@ -2,29 +2,32 @@ Section: sound Priority: extra Maintainer: Debian Multimedia Maintainers -Uploaders: Alessio Treglia , +Uploaders: + Alessio Treglia , Arnout Engelen -Build-Depends: chrpath, +Build-Depends: + chrpath, cmake, debhelper (>= 7.0.50~), kdelibs5-dev, libasound2-dev, libdrumstick-dev, pkg-config -Standards-Version: 3.9.2 +Standards-Version: 3.9.3 Homepage: http://kmetronome.sourceforge.net/kmetronome.shtml Vcs-Git: git://git.debian.org/pkg-multimedia/kmetronome.git Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/kmetronome.git Package: kmetronome Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends} Description: ALSA MIDI Metronome KMetronome is a MIDI based metronome using the ALSA sequencer. . - The intended audience are musicians and music students. Like the solid, real + The intended audience are musicians and music students. Like the solid, real metronomes it is a tool to keep the rhythm while playing musical instruments. . - It uses MIDI for sound generation instead of digital audio, allowing low CPU + It uses MIDI for sound generation instead of digital audio, allowing low CPU usage and very accurate timing thanks to the ALSA sequencer diff -Nru kmetronome-0.10.0/debian/patches/kubuntu_01_docbook_fix.diff kmetronome-0.10.1/debian/patches/kubuntu_01_docbook_fix.diff --- kmetronome-0.10.0/debian/patches/kubuntu_01_docbook_fix.diff 2010-11-25 20:23:00.000000000 +0000 +++ kmetronome-0.10.1/debian/patches/kubuntu_01_docbook_fix.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Add kubuntu_01_docbook_fix.diff to fix docbook FTBFS on Ubuntu. - This patch is Ubuntu-specific. -Origin: Ubuntu -Forwarded: http://sourceforge.net/support/tracker.php?aid=3118766 ---- - doc/index.docbook | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- kmetronome.orig/doc/index.docbook -+++ kmetronome/doc/index.docbook -@@ -1,5 +1,6 @@ - --KMetronome"> - - diff -Nru kmetronome-0.10.0/debian/patches/series kmetronome-0.10.1/debian/patches/series --- kmetronome-0.10.0/debian/patches/series 2011-05-29 08:19:22.000000000 +0000 +++ kmetronome-0.10.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -kubuntu_01_docbook_fix.diff diff -Nru kmetronome-0.10.0/doc/CMakeLists.txt kmetronome-0.10.1/doc/CMakeLists.txt --- kmetronome-0.10.0/doc/CMakeLists.txt 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/doc/CMakeLists.txt 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ # KMetronome - ALSA Sequencer based MIDI metronome -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/doc/index.docbook kmetronome-0.10.1/doc/index.docbook --- kmetronome-0.10.0/doc/index.docbook 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/doc/index.docbook 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ -KMetronome"> @@ -23,7 +23,7 @@ -2005-2010 +2005-2012 Pedro Lopez-Cabanillas @@ -40,8 +40,8 @@ (V.MM.LL), it could be used by automation scripts. Do NOT change these in the translation. --> -2010-06-06 -0.10.0 +2012-05-28 +0.10.1 @@ -429,11 +429,11 @@ &kmetronome; -Program copyright 2005-2010 Pedro Lopez-Cabanillas plcl@users.sourceforge.net +Program copyright 2005-2012 Pedro Lopez-Cabanillas plcl@users.sourceforge.net -Documentation copyright 2005-2010 Pedro Lopez-Cabanillas plcl@users.sourceforge.net +Documentation copyright 2005-2012 Pedro Lopez-Cabanillas plcl@users.sourceforge.net diff -Nru kmetronome-0.10.0/drumstick/CMakeLists.txt kmetronome-0.10.1/drumstick/CMakeLists.txt --- kmetronome-0.10.0/drumstick/CMakeLists.txt 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -) - -# drumstick-alsa library - -SET(drumstick-alsa_QTOBJ_SRCS - include/alsaclient.h - include/alsaevent.h - include/alsaport.h - include/alsaqueue.h - include/alsatimer.h - include/playthread.h -) - -SET(drumstick-alsa_HEADERS - include/alsaclient.h - include/alsaevent.h - include/alsaport.h - include/alsaqueue.h - include/alsatimer.h - include/drumstickcommon.h - include/playthread.h - include/subscription.h -) - -SET(drumstick-alsa_SRCS - src/alsaclient.cpp - src/alsaevent.cpp - src/alsaport.cpp - src/alsaqueue.cpp - src/alsatimer.cpp - src/playthread.cpp - src/subscription.cpp -) - -QT4_WRAP_CPP(drumstick-alsa_MOC_SRCS ${drumstick-alsa_QTOBJ_SRCS}) - -ADD_LIBRARY(drumstick-alsa - ${drumstick-alsa_MOC_SRCS} - ${drumstick-alsa_SRCS} - ${drumstick-alsa_HEADERS} -) - -SET_TARGET_PROPERTIES(drumstick-alsa PROPERTIES COMPILE_FLAGS -fPIC) - -TARGET_LINK_LIBRARIES(drumstick-alsa - ${QT_LIBRARIES} - ${ALSA_LIBS} -) diff -Nru kmetronome-0.10.0/drumstick/include/alsaclient.h kmetronome-0.10.1/drumstick/include/alsaclient.h --- kmetronome-0.10.0/drumstick/include/alsaclient.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/alsaclient.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_ALSACLIENT_H -#define DRUMSTICK_ALSACLIENT_H - -#include "alsaport.h" -#include -#include -#include - -/** - * @file alsaclient.h - * Classes managing ALSA Sequencer clients - * - * @defgroup ALSAClient ALSA Sequencer Clients - * @{ - */ - -namespace drumstick { - -class MidiQueue; -class MidiClient; -class SequencerEvent; -class SequencerInputThread; -class RemoveEvents; - -/** - * Client information - * - * This class is used to retrieve, hold and set some data from - * sequencer clients, like the name or id. - */ -class ClientInfo -{ - friend class MidiClient; - -public: - ClientInfo(); - ClientInfo(const ClientInfo& other); - ClientInfo(snd_seq_client_info_t* other); - ClientInfo(MidiClient* seq, int id); - virtual ~ClientInfo(); - ClientInfo* clone(); - ClientInfo& operator=(const ClientInfo& other); - int getSizeOfInfo() const; - - int getClientId(); - snd_seq_client_type_t getClientType(); - QString getName(); - bool getBroadcastFilter(); - bool getErrorBounce(); - int getNumPorts(); - int getEventLost(); - void setClient(int client); - void setName(QString name); - void setBroadcastFilter(bool val); - void setErrorBounce(bool val); - PortInfoList getPorts() const; - -#if SND_LIB_VERSION > 0x010010 - void addFilter(int eventType); - bool isFiltered(int eventType); - void clearFilter(); - void removeFilter(int eventType); -#endif - -protected: - void readPorts(MidiClient* seq); - void freePorts(); - - const unsigned char* getEventFilter() __attribute__((deprecated)); - void setEventFilter(unsigned char* filter) __attribute__((deprecated)); - -private: - snd_seq_client_info_t* m_Info; - PortInfoList m_Ports; -}; - -/** - * List of sequencer client information - */ -typedef QList ClientInfoList; - -/** - * System information - * - * This class is used to retrieve and hold some data about the - * whole sequencer subsystem. - */ -class SystemInfo -{ - friend class MidiClient; - -public: - SystemInfo(); - SystemInfo(const SystemInfo& other); - SystemInfo(snd_seq_system_info_t* other); - SystemInfo(MidiClient* seq); - virtual ~SystemInfo(); - SystemInfo* clone(); - SystemInfo& operator=(const SystemInfo& other); - int getSizeOfInfo() const; - - int getMaxClients(); - int getMaxPorts(); - int getMaxQueues(); - int getMaxChannels(); - int getCurrentQueues(); - int getCurrentClients(); - -private: - snd_seq_system_info_t* m_Info; -}; - -/** - * Sequencer Pool information - * - * This class is used to get and set the size of the input and output pool - * buffers for a sequencer client. - */ -class PoolInfo -{ - friend class MidiClient; - -public: - PoolInfo(); - PoolInfo(const PoolInfo& other); - PoolInfo(snd_seq_client_pool_t* other); - PoolInfo(MidiClient* seq); - virtual ~PoolInfo(); - PoolInfo* clone(); - PoolInfo& operator=(const PoolInfo& other); - int getSizeOfInfo() const; - - int getClientId(); - int getInputFree(); - int getInputPool(); - int getOutputFree(); - int getOutputPool(); - int getOutputRoom(); - void setInputPool(int size); - void setOutputPool(int size); - void setOutputRoom(int size); - -private: - snd_seq_client_pool_t* m_Info; -}; - -/** - * Sequencer events handler - * - * This abstract class is used to define an interface that other class can - * implement to receive sequencer events. It is one of the three methods of - * delivering events offered by this library. - * - * @see ALSAClient - */ -class SequencerEventHandler -{ -public: - /** Destructor */ - virtual ~SequencerEventHandler() {} - - /** - * Callback function to be implemented by the derived class. - * It will be invoked by the client to deliver received events to the - * registered listener. - * - * @param ev A pointer to the received SequencerEvent - * @see MidiClient::setHandler(), MidiClient::startSequencerInput(), - * MidiClient::stopSequencerInput(), MidiClient::doEvents() - */ - virtual void handleSequencerEvent(SequencerEvent* ev) = 0; -}; - -/** - * Client management. - * - * This class represents an ALSA sequencer client - */ -class MidiClient : public QObject -{ - Q_OBJECT - -private: - /** - * This class manages event input from the ALSA sequencer. - */ - class SequencerInputThread: public QThread - { - public: - SequencerInputThread(MidiClient *seq, int timeout) - : QThread(), - m_MidiClient(seq), - m_Wait(timeout), - m_Stopped(false) {} - virtual ~SequencerInputThread() {} - virtual void run(); - bool stopped(); - void stop(); - void start( Priority priority = InheritPriority ); - private: - MidiClient *m_MidiClient; - int m_Wait; - bool m_Stopped; - QReadWriteLock m_mutex; - }; - -public: - MidiClient( QObject* parent = 0 ); - virtual ~MidiClient(); - - void open( const QString deviceName = "default", - const int openMode = SND_SEQ_OPEN_DUPLEX, - const bool blockMode = false ); - void open( snd_config_t* conf, - const QString deviceName = "default", - const int openMode = SND_SEQ_OPEN_DUPLEX, - const bool blockMode = false ); - void close(); - void startSequencerInput(); - void stopSequencerInput(); - MidiPort* createPort(); - MidiQueue* createQueue(); - MidiQueue* createQueue(QString const& name); - MidiQueue* getQueue(); - MidiQueue* useQueue(int queue_id); - MidiQueue* useQueue(const QString& name); - MidiQueue* useQueue(MidiQueue* queue); - void portAttach(MidiPort* port); - void portDetach(MidiPort* port); - void detachAllPorts(); - void addEventFilter(int evtype); - void output(SequencerEvent* ev, bool async = false, int timeout = -1); - void outputDirect(SequencerEvent* ev, bool async = false, int timeout = -1); - void outputBuffer(SequencerEvent* ev); - void drainOutput(bool async = false, int timeout = -1); - void synchronizeOutput(); - - int getClientId(); - snd_seq_type_t getSequencerType(); - /** Returns the sequencer handler managed by ALSA */ - snd_seq_t* getHandle() { return m_SeqHandle; } - /** Returns true if the sequencer is opened */ - bool isOpened() { return (m_SeqHandle != NULL); } - - size_t getOutputBufferSize(); - void setOutputBufferSize(size_t newSize); - size_t getInputBufferSize(); - void setInputBufferSize(size_t newSize); - /** Returns the name of the sequencer device */ - QString getDeviceName() { return m_DeviceName; } - /** Returns the last open mode used in open() */ - int getOpenMode() { return m_OpenMode; } - /** Returns the last block mode used in open() */ - bool getBlockMode() { return m_BlockMode; } - void setBlockMode(bool newValue); - QString getClientName(); - QString getClientName(const int clientId); - void setClientName(QString const& newName); - bool getBroadcastFilter(); - void setBroadcastFilter(bool newValue); - bool getErrorBounce(); - void setErrorBounce(bool newValue); - - ClientInfo& getThisClientInfo(); - void setThisClientInfo(const ClientInfo& val); - MidiPortList getMidiPorts() const; - ClientInfoList getAvailableClients(); - PortInfoList getAvailableInputs(); - PortInfoList getAvailableOutputs(); - SystemInfo& getSystemInfo(); - QList getAvailableQueues(); - - PoolInfo& getPoolInfo(); - void setPoolInfo(const PoolInfo& info); - void setPoolInput(int size); - void setPoolOutput(int size); - void setPoolOutputRoom(int size); - void resetPoolInput(); - void resetPoolOutput(); - void dropInput(); - void dropInputBuffer(); - void dropOutput(); - void dropOutputBuffer(); - void removeEvents(const RemoveEvents* spec); - SequencerEvent* extractOutput(); - int outputPending(); - int inputPending(bool fetch); - int getQueueId(const QString& name); - - void addListener(QObject* listener); - void removeListener(QObject* listener); - void setEventsEnabled(const bool bEnabled); - /** Returns true if the events mode of delivery has been enabled */ - bool getEventsEnabled() const { return m_eventsEnabled; } - /** Sets a sequencer event handler enabling the callback delivery mode */ - void setHandler(SequencerEventHandler* handler) { m_handler = handler; } - bool parseAddress( const QString& straddr, snd_seq_addr& result ); - -signals: - /** Signal emitted when an event is received */ - void eventReceived(SequencerEvent* ev); - -protected: - void doEvents(); - void applyClientInfo(); - void readClients(); - void freeClients(); - void updateAvailablePorts(); - PortInfoList filterPorts(unsigned int filter); - - /* low level public functions */ - const char * _getDeviceName(); - int getPollDescriptorsCount(short events); - int pollDescriptors(struct pollfd *pfds, unsigned int space, short events); - unsigned short pollDescriptorsRevents(struct pollfd *pfds, unsigned int nfds); - - /* mid level functions */ - void _setClientName( const char *name ); - int createSimplePort( const char *name, - unsigned int caps, - unsigned int type ); - void deleteSimplePort( int port ); - void connectFrom(int myport, int client, int port); - void connectTo(int myport, int client, int port); - void disconnectFrom(int myport, int client, int port); - void disconnectTo(int myport, int client, int port); - -private: - bool m_eventsEnabled; - bool m_BlockMode; - bool m_NeedRefreshClientList; - int m_OpenMode; - QString m_DeviceName; - snd_seq_t* m_SeqHandle; - QPointer m_Thread; - QPointer m_Queue; - SequencerEventHandler* m_handler; - - ClientInfo m_Info; - ClientInfoList m_ClientList; - MidiPortList m_Ports; - PortInfoList m_OutputsAvail; - PortInfoList m_InputsAvail; - QObjectList m_listeners; - SystemInfo m_sysInfo; - PoolInfo m_poolInfo; -}; - -#if SND_LIB_VERSION > 0x010004 -QString getRuntimeALSALibraryVersion(); -int getRuntimeALSALibraryNumber(); -#endif -QString getRuntimeALSADriverVersion(); -int getRuntimeALSADriverNumber(); - -} /* namespace drumstick */ - -/** @} */ - -#endif // DRUMSTICK_ALSACLIENT_H diff -Nru kmetronome-0.10.0/drumstick/include/alsaevent.h kmetronome-0.10.1/drumstick/include/alsaevent.h --- kmetronome-0.10.0/drumstick/include/alsaevent.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/alsaevent.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,651 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_ALSAEVENT_H -#define DRUMSTICK_ALSAEVENT_H - -#include "drumstickcommon.h" -#include - -/** - * @file alsaevent.h - * Classes managing ALSA Sequencer events. - * - * @defgroup ALSAEvent ALSA Sequencer Events - * @{ - */ - -namespace drumstick { - -/** - * Constant SequencerEventType is the QEvent::type() of any SequencerEvent - * object to be used to check the argument in QObject::customEvent(). - */ -const QEvent::Type SequencerEventType = QEvent::Type(QEvent::User + 4154); // :-) - -/** - * Macro to declare a virtual clone() method for SequencerEvent and derived classes. - */ -#define CLONE_EVENT_DECLARATION(T) virtual T* clone() { return new T(&m_event); } - -/** - * Base class for the event's hierarchy - * - * All event classes share this base class. It provides several common - * properties and methods. - */ -class SequencerEvent : public QEvent -{ -public: - SequencerEvent(); - SequencerEvent(const SequencerEvent& other); - SequencerEvent(snd_seq_event_t* event); - /** Destructor */ - virtual ~SequencerEvent() {} - - SequencerEvent& operator=(const SequencerEvent& other); - void setSequencerType(const snd_seq_event_type_t eventType); - /** - * Gets the sequencer event type. - * @return The sequencer event type. - * @see setSequencerType() - */ - snd_seq_event_type_t getSequencerType() const { return m_event.type; } - void setDestination(const unsigned char client, const unsigned char port); - void setSource(const unsigned char port); - /** - * Gets the source client id. - * @return The source client id. - * @see setSource() - */ - unsigned char getSourceClient() const { return m_event.source.client; } - /** - * Gets the source port id. - * @return The source port id. - * @see setSource() - */ - unsigned char getSourcePort() const { return m_event.source.port; } - /** - * Gets the tick time of the event. - * @return The tick time. - * @see scheduleTick() - */ - snd_seq_tick_time_t getTick() const { return m_event.time.tick; } - /** - * Gets the seconds of the event's real time. - * @return The seconds of the time. - * @see scheduleReal(), getRealTimeNanos() - */ - unsigned int getRealTimeSecs() const { return m_event.time.time.tv_sec; } - /** - * Gets the nanoseconds of the event's real time. - * @return The nanoseconds of the time. - * @see scheduleReal(), getRealTimeSecs() - */ - unsigned int getRealTimeNanos() const { return m_event.time.time.tv_nsec; } - void setSubscribers(); - void setBroadcast(); - void setDirect(); - void scheduleTick(const int queue, const int tick, const bool relative); - void scheduleReal(const int queue, const ulong secs, const ulong nanos, const bool relative); - void setPriority(const bool high); - /** - * Gets the tag of the event - * @return The event's tag - * @see setTag() - */ - unsigned char getTag() const { return m_event.tag; } - void setTag(const unsigned char aTag); - unsigned int getRaw32(const unsigned int n) const; - void setRaw32(const unsigned int n, const unsigned int value); - unsigned char getRaw8(const unsigned int n) const; - void setRaw8(const unsigned int n, const unsigned char value); - /** - * Gets the handle of the event - * @return The event's handle - */ - snd_seq_event_t* getHandle() { return &m_event; } - int getEncodedLength(); - - static bool isSubscription(const SequencerEvent* event); - static bool isPort(const SequencerEvent* event); - static bool isClient(const SequencerEvent* event); - static bool isConnectionChange(const SequencerEvent* event); - static bool isChannel(const SequencerEvent* event); - - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(SequencerEvent); - -protected: - void free() __attribute__((deprecated)); - - /** - * ALSA sequencer event record. - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/structsnd__seq__event.html - */ - snd_seq_event_t m_event; -}; - -/** - * Base class for the events having a Channel property - */ -class ChannelEvent : public SequencerEvent -{ -public: - /** Default constructor */ - ChannelEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - ChannelEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - /** - * Sets the channel of the event - * @param c A channel, between 0 and 15. - * @see getChannel() - */ - void setChannel(const MidiByte c) { m_event.data.note.channel = (c & 0xf); } - /** - * Gets the event's channel - * @return The event's channel - * @see setChannel() - */ - int getChannel() const { return m_event.data.note.channel; } -}; - -/** - * Base class for the events having Key and Velocity properties. - */ -class KeyEvent : public ChannelEvent -{ -public: - /** Default constructor */ - KeyEvent() : ChannelEvent() {} - /** Constructor from an ALSA event record */ - KeyEvent(snd_seq_event_t* event) : ChannelEvent(event) {} - /** - * Gets the MIDI note of this event. - * @return The event's MIDI note. - * @see setKey() - */ - int getKey() const { return m_event.data.note.note; } - /** - * Sets the MIDI note of this event. - * @param b A MIDI note, between 0 and 127. - * @see getKey() - */ - void setKey(const MidiByte b) { m_event.data.note.note = b; } - /** - * Gets the note velocity of this event. - * @return The event's note velocity. - * @see setVelocity() - */ - int getVelocity() const { return m_event.data.note.velocity; } - /** - * Sets the note velocity of this event. - * @param b A velocity value, between 0 and 127. - * @see getVelocity() - */ - void setVelocity(const MidiByte b) { m_event.data.note.velocity = b; } -}; - -/** - * Class representing a note event with duration - * - * Note events are converted into two MIDI events, a note-on and a note-off - * over the wire. - */ -class NoteEvent : public KeyEvent -{ -public: - /** Default constructor */ - NoteEvent() : KeyEvent() { m_event.type = SND_SEQ_EVENT_NOTE; } - /** Constructor from an ALSA event record */ - NoteEvent(snd_seq_event_t* event) : KeyEvent(event) {} - NoteEvent(const int ch, const int key, const int vel, const int dur); - /** - * Gets the note's duration - * @return The duration of the event - * @see setDuration() - */ - ulong getDuration() const { return m_event.data.note.duration; } - /** - * Sets the note's duration - * @param d The duration of the event - * @see getDuration() - */ - void setDuration(const ulong d) { m_event.data.note.duration = d; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(NoteEvent) -}; - -/** - * Event representing a note-on MIDI event - */ -class NoteOnEvent : public KeyEvent -{ -public: - /** Default constructor */ - NoteOnEvent() : KeyEvent() { m_event.type = SND_SEQ_EVENT_NOTEON; } - /** Constructor from an ALSA event record */ - NoteOnEvent(snd_seq_event_t* event) : KeyEvent(event) {} - NoteOnEvent(const int ch, const int key, const int vel); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(NoteOnEvent) -}; - -/** - * Event representing a note-off MIDI event - */ -class NoteOffEvent : public KeyEvent -{ -public: - /** Default constructor */ - NoteOffEvent() : KeyEvent() { m_event.type = SND_SEQ_EVENT_NOTEOFF; } - /** Constructor from an ALSA event record */ - NoteOffEvent(snd_seq_event_t* event) : KeyEvent(event) {} - NoteOffEvent(const int ch, const int key, const int vel); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(NoteOffEvent) -}; - -/** - * Event representing a MIDI key pressure, or polyphonic after-touch event - */ -class KeyPressEvent : public KeyEvent -{ -public: - /** Default constructor */ - KeyPressEvent() : KeyEvent() { m_event.type = SND_SEQ_EVENT_KEYPRESS; } - /** Constructor from an ALSA event record */ - KeyPressEvent(snd_seq_event_t* event) : KeyEvent(event) {} - KeyPressEvent(const int ch, const int key, const int vel); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(KeyPressEvent) -}; - -/** - * Event representing a MIDI control change event - */ -class ControllerEvent : public ChannelEvent -{ -public: - /** Default constructor */ - ControllerEvent() : ChannelEvent() {} - /** Constructor from an ALSA event record */ - ControllerEvent(snd_seq_event_t* event) : ChannelEvent(event) {} - ControllerEvent(const int ch, const int cc, const int val); - /** - * Gets the controller event's parameter. - * @return The controller event's parameter. - * @see setParam() - */ - uint getParam() const { return m_event.data.control.param; } - /** - * Sets the controller event's parameter. - * @param p The controller event's parameter. - * @see getParam() - */ - void setParam( const uint p ) { m_event.data.control.param = p; } - /** - * Gets the controller event's value. - * @return The controller event's value. - * @see setValue() - */ - int getValue() const { return m_event.data.control.value; } - /** - * Sets the controller event's value. - * @param v The controller event's value. - * @see getValue() - */ - void setValue( const int v ) { m_event.data.control.value = v; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(ControllerEvent) -}; - -/** - * Event representing a MIDI program change event - */ -class ProgramChangeEvent : public ChannelEvent -{ -public: - /** Default constructor */ - ProgramChangeEvent() : ChannelEvent() { m_event.type = SND_SEQ_EVENT_PGMCHANGE; } - /** Constructor from an ALSA event record */ - ProgramChangeEvent(snd_seq_event_t* event) : ChannelEvent(event) {} - ProgramChangeEvent(const int ch, const int val); - /** Gets the MIDI program number */ - int getValue() const { return m_event.data.control.value; } - /** Sets the MIDI program number */ - void setValue( const int v ) { m_event.data.control.value = v; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(ProgramChangeEvent) -}; - -/** - * Event representing a MIDI bender, or pitch wheel event - */ -class PitchBendEvent : public ChannelEvent -{ -public: - /** Default constructor */ - PitchBendEvent() : ChannelEvent() { m_event.type = SND_SEQ_EVENT_PITCHBEND; } - /** Constructor from an ALSA event record */ - PitchBendEvent(snd_seq_event_t* event) : ChannelEvent(event) {} - PitchBendEvent(const int ch, const int val); - /** Gets the MIDI pitch bend value, zero centered from -8192 to 8191 */ - int getValue() const { return m_event.data.control.value; } - /** Sets the MIDI pitch bend value, zero centered from -8192 to 8191 */ - void setValue( const int v ) { m_event.data.control.value = v; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(PitchBendEvent) -}; - -/** - * Event representing a MIDI channel pressure or after-touch event - */ -class ChanPressEvent : public ChannelEvent -{ -public: - /** Default constructor */ - ChanPressEvent() : ChannelEvent() { m_event.type = SND_SEQ_EVENT_CHANPRESS; } - /** Constructor from an ALSA event record */ - ChanPressEvent(snd_seq_event_t* event) : ChannelEvent(event) {} - ChanPressEvent( const int ch, const int val); - /** Gets the channel aftertouch value */ - int getValue() const { return m_event.data.control.value; } - /** Sets the channel aftertouch value */ - void setValue( const int v ) { m_event.data.control.value = v; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(ChanPressEvent) -}; - -/** - * Base class for variable length events - */ -class VariableEvent : public SequencerEvent -{ -public: - VariableEvent(); - VariableEvent(snd_seq_event_t* event); - VariableEvent(const QByteArray& data); - VariableEvent(const VariableEvent& other); - VariableEvent(const unsigned int datalen, char* dataptr); - VariableEvent& operator=(const VariableEvent& other); - /** Gets the data length */ - unsigned int getLength() const { return m_event.data.ext.len; } - /** Gets the data pointer */ - const char* getData() const { return static_cast(m_event.data.ext.ptr); } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(VariableEvent) -protected: - QByteArray m_data; -}; - -/** - * Event representing a MIDI system exclusive event - */ -class SysExEvent : public VariableEvent -{ -public: - SysExEvent(); - SysExEvent(snd_seq_event_t* event); - SysExEvent(const QByteArray& data); - SysExEvent(const SysExEvent& other); - SysExEvent(const unsigned int datalen, char* dataptr); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(SysExEvent) -}; - -/** - * Event representing a SMF text event - * - * This event type is not intended to be transmitted over the wire to an - * external device, but it is useful for sequencer programs or MIDI applications - */ -class TextEvent : public VariableEvent -{ -public: - TextEvent(); - TextEvent(snd_seq_event_t* event); - explicit TextEvent(const QString& text, const int textType = 1); - TextEvent(const TextEvent& other); - TextEvent(const unsigned int datalen, char* dataptr); - QString getText() const; - int getTextType() const; - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(TextEvent) -protected: - int m_textType; -}; - -/** - * Generic event - */ -class SystemEvent : public SequencerEvent -{ -public: - /** Default constructor */ - SystemEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - SystemEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - SystemEvent(const snd_seq_event_type_t type); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(SystemEvent) -}; - -/** - * ALSA Event representing a queue control command - * - * This event is used to schedule changes to the ALSA queues - */ -class QueueControlEvent : public SequencerEvent -{ -public: - /** Default constructor */ - QueueControlEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - QueueControlEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - QueueControlEvent(const snd_seq_event_type_t type, const int queue, const int value); - /** Gets the queue number */ - int getQueue() const { return m_event.data.queue.queue; } - /** Sets the queue number */ - void setQueue(const uchar q) { m_event.data.queue.queue = q; } - /** Gets the event's value */ - int getValue() const { return m_event.data.queue.param.value; } - /** Sets the event's value */ - void setValue(const int val) { m_event.data.queue.param.value = val; } - /** Gets the queue position */ - uint getPosition() const { return m_event.data.queue.param.position; } - /** Sets the queue position */ - void setPosition(const uint pos) { m_event.data.queue.param.position = pos; } - /** Gets the musical time in ticks */ - snd_seq_tick_time_t getTickTime() const { return m_event.data.queue.param.time.tick; } - /** Sets the musical time in ticks */ - void setTickTime(const snd_seq_tick_time_t t) { m_event.data.queue.param.time.tick = t; } - /** Gets the skew base */ - uint getSkewBase() const { return m_event.data.queue.param.skew.base; } - /** Sets the skew base, should be 65536 */ - void setSkewBase(const uint base) { m_event.data.queue.param.skew.base = base; } - /** Gets the skew value */ - uint getSkewValue() const { return m_event.data.queue.param.skew.value; } - /** Sets the skew value */ - void setSkewValue(const uint val) {m_event.data.queue.param.skew.value = val; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(QueueControlEvent) -}; - -/** - * Generic event having a value property - */ -class ValueEvent : public SequencerEvent -{ -public: - /** Default constructor */ - ValueEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - ValueEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - ValueEvent(const snd_seq_event_type_t type, const int val); - /** Gets the event's value */ - int getValue() const { return m_event.data.control.value; } - /** Sets the event's value */ - void setValue( const int v ) { m_event.data.control.value = v; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(ValueEvent) -}; - -/** - * ALSA Event representing a tempo change for an ALSA queue - */ -class TempoEvent : public QueueControlEvent -{ -public: - /** Default constructor */ - TempoEvent() : QueueControlEvent() {} - /** Constructor from an ALSA event record */ - TempoEvent(snd_seq_event_t* event) : QueueControlEvent(event) {} - TempoEvent(const int queue, const int tempo); - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(TempoEvent) -}; - -/** - * ALSA Event representing a subscription between two ALSA clients and ports - */ -class SubscriptionEvent : public SequencerEvent -{ -public: - /** Default constructor */ - SubscriptionEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - SubscriptionEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - /** Returns true if the event was a subscribed port */ - bool subscribed() const { return (m_event.type == SND_SEQ_EVENT_PORT_SUBSCRIBED); } - /** Returns true if the event was an unsubscribed port */ - bool unsubscribed() const { return (m_event.type == SND_SEQ_EVENT_PORT_UNSUBSCRIBED); } - /** Gets the sender client number */ - int getSenderClient() const { return m_event.data.connect.sender.client; } - /** Gets the sender port number */ - int getSenderPort() const { return m_event.data.connect.sender.port; } - /** Gets the destination client number */ - int getDestClient() const { return m_event.data.connect.dest.client; } - /** Gets the destination port number */ - int getDestPort() const { return m_event.data.connect.dest.port; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(SubscriptionEvent) -}; - -/** - * ALSA Event representing a change on some ALSA sequencer client on the system - */ -class ClientEvent : public SequencerEvent -{ -public: - /** Default constructor */ - ClientEvent() : SequencerEvent() {} - /** Constructor from an ALSA event record */ - ClientEvent(snd_seq_event_t* event) : SequencerEvent(event) {} - int getClient() const { return m_event.data.addr.client; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(ClientEvent) -}; - -/** - * ALSA Event representing a change on some ALSA sequencer port on the system - */ -class PortEvent : public ClientEvent -{ -public: - /** Default constructor */ - PortEvent() : ClientEvent() {} - /** Constructor from an ALSA event record */ - PortEvent(snd_seq_event_t* event) : ClientEvent(event) {} - /** Gets the port number */ - int getPort() const { return m_event.data.addr.port; } - /** Clone this object returning a pointer to the new object */ - CLONE_EVENT_DECLARATION(PortEvent) -}; - -/** - * Auxiliary class to remove events from an ALSA queue - * @see MidiClient::removeEvents() - */ -class RemoveEvents -{ -public: - friend class MidiClient; - -public: - /** Default constructor */ - RemoveEvents(); - RemoveEvents(const RemoveEvents& other); - RemoveEvents(snd_seq_remove_events_t* other); - virtual ~RemoveEvents(); - RemoveEvents* clone(); - RemoveEvents& operator=(const RemoveEvents& other); - int getSizeOfInfo() const; - - int getChannel(); - unsigned int getCondition(); - const snd_seq_addr_t* getDest(); - int getEventType(); - int getQueue(); - int getTag(); - const snd_seq_timestamp_t* getTime(); - void setChannel(int chan); - void setCondition(unsigned int cond); - void setDest(const snd_seq_addr_t* dest); - void setEventType(int type); - void setQueue(int queue); - void setTag(int tag); - void setTime(const snd_seq_timestamp_t* time); - -private: - snd_seq_remove_events_t* m_Info; -}; - -/** - * Auxiliary class to translate between raw MIDI streams and ALSA events - */ -class MidiCodec : public QObject -{ - Q_OBJECT -public: - explicit MidiCodec(int bufsize, QObject* parent = 0); - ~MidiCodec(); - - void init(); - long decode(unsigned char *buf, - long count, - const snd_seq_event_t *ev); - long encode(const unsigned char *buf, - long count, - snd_seq_event_t *ev); - long encode(int c, - snd_seq_event_t *ev); - void enableRunningStatus(bool enable); - void resetEncoder(); - void resetDecoder(); - void resizeBuffer(int bufsize); -private: - snd_midi_event_t* m_Info; -}; - -} /* namespace drumstick */ - -/** @} */ - -#endif //DRUMSTICK_ALSAEVENT_H diff -Nru kmetronome-0.10.0/drumstick/include/alsaport.h kmetronome-0.10.1/drumstick/include/alsaport.h --- kmetronome-0.10.0/drumstick/include/alsaport.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/alsaport.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_ALSAPORT_H -#define DRUMSTICK_ALSAPORT_H - -#include "subscription.h" -#include - -/** - * @file alsaport.h - * Classes managing ALSA Sequencer ports. - * @defgroup ALSAPort ALSA Sequencer Ports - * @{ - */ - -namespace drumstick { - -class MidiClient; - -/** - * Port information container - */ -class PortInfo -{ - friend class MidiPort; - friend class ClientInfo; - friend class MidiClient; - -public: - PortInfo(); - PortInfo(const PortInfo& other); - PortInfo(snd_seq_port_info_t* other); - PortInfo(MidiClient* seq, const int client, const int port); - PortInfo(MidiClient* seq, const int port); - virtual ~PortInfo(); - PortInfo* clone(); - PortInfo& operator=(const PortInfo& other); - int getSizeOfInfo() const; - - int getClient(); - int getPort(); - /** Gets the client name. @see setClientName() */ - QString getClientName() const { return m_ClientName; } - const snd_seq_addr_t* getAddr(); - QString getName(); - unsigned int getCapability(); - unsigned int getType(); - int getMidiChannels(); - int getMidiVoices(); - int getSynthVoices(); - int getReadUse(); - int getWriteUse(); - int getPortSpecified(); - void setClient(int client); - void setPort(int port); - void setAddr(const snd_seq_addr_t* addr); - void setName( QString const& name ); - void setCapability(unsigned int capability); - void setType(unsigned int type); - void setMidiChannels(int channels); - void setMidiVoices(int voices); - void setSynthVoices(int voices); - void setPortSpecified(int val); - SubscribersList getReadSubscribers() const; - SubscribersList getWriteSubscribers() const; - - bool getTimestamping(); - bool getTimestampReal(); - int getTimestampQueue(); - void setTimestamping(bool value); - void setTimestampReal(bool value); - void setTimestampQueue(int queueId); - -protected: - void readSubscribers(MidiClient* seq); - void freeSubscribers(); - /** Sets the client name. @see getClientName() */ - void setClientName(QString name) { m_ClientName = name; } - -private: - snd_seq_port_info_t* m_Info; - QString m_ClientName; - SubscribersList m_ReadSubscribers; - SubscribersList m_WriteSubscribers; -}; - - -/** - * List of port information objects - */ -typedef QList PortInfoList; - -/** - * Port management. - * - * This class represents an ALSA sequencer port. - */ -class MidiPort : public QObject -{ - Q_OBJECT - friend class MidiClient; - -public: - MidiPort( QObject* parent = 0 ); - virtual ~MidiPort(); - - void attach( MidiClient* seq ); - void detach(); - void subscribe( Subscription* subs ); - void unsubscribe( Subscription* subs ); - void unsubscribeAll(); - void unsubscribeTo( QString const& name ); - void unsubscribeTo( PortInfo* port ); - void unsubscribeTo( const snd_seq_addr_t* addr ); - void unsubscribeFrom( QString const& name ); - void unsubscribeFrom( PortInfo* port ); - void unsubscribeFrom( const snd_seq_addr_t* addr ); - void subscribeTo( PortInfo* port); - void subscribeTo( int client, int port ); - void subscribeTo( QString const& name ); - void subscribeFrom( PortInfo* port ); - void subscribeFrom( int client, int port ); - void subscribeFrom( QString const& name ); - void subscribeFromAnnounce(); - void updateSubscribers(); - SubscriptionsList getSubscriptions() const; - PortInfoList getReadSubscribers(); - PortInfoList getWriteSubscribers(); - void updateConnectionsTo(const PortInfoList& desired); - void updateConnectionsFrom(const PortInfoList& desired); - - static bool containsAddress(const snd_seq_addr_t* addr, const PortInfoList& lst); - - void applyPortInfo(); - QString getPortName(); - void setPortName( QString const& newName); - int getPortId(); - unsigned int getCapability(); - void setCapability( unsigned int newValue); - unsigned int getPortType(); - void setPortType( unsigned int newValue); - int getMidiChannels(); - void setMidiChannels(int newValue); - int getMidiVoices(); - void setMidiVoices(int newValue); - int getSynthVoices(); - void setSynthVoices(int newValue); - bool getTimestamping(); - bool getTimestampReal(); - int getTimestampQueue(); - void setTimestamping(bool value); - void setTimestampReal(bool value); - void setTimestampQueue(int queueId); - -signals: - /** - * Signal emitted when an internal subscription is done. - * @param port MIDI port object pointer - * @param subs Subscription object pointer - */ - void subscribed(MidiPort* port, Subscription* subs); - /** - * Signal emitted when the MidiClient has changed - * @param port MIDI port object pinter - * @param seq MidiClient object pointer - */ - void midiClientChanged(MidiPort* port, MidiClient* seq); - /** - * Signal emitted when the port is attached to a MidiClient - * @param port MIDI port object pointer - */ - void attached(MidiPort* port); - /** - * Signal emitted when the port is detached from a MidiClient - * @param port MIDI port object pointer - */ - void detached(MidiPort* port); - -protected: - PortInfo* getPortInfo(); - void freeSubscriptions(); - void setMidiClient( MidiClient* seq ); - -private: - MidiClient* m_MidiClient; - PortInfo m_Info; - bool m_Attached; - SubscriptionsList m_Subscriptions; -}; - -/** - * List of Ports instances. - */ -typedef QList MidiPortList; - -} - -/** @} */ - -#endif //DRUMSTICK_ALSAPORT_H diff -Nru kmetronome-0.10.0/drumstick/include/alsaqueue.h kmetronome-0.10.1/drumstick/include/alsaqueue.h --- kmetronome-0.10.0/drumstick/include/alsaqueue.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/alsaqueue.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,229 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_ALSAQUEUE_H -#define DRUMSTICK_ALSAQUEUE_H - -#include "drumstickcommon.h" -/** - * @file alsaqueue.h - * Classes managing ALSA Sequencer queues - * @defgroup ALSAQueue ALSA Sequencer Queues - * @{ - */ - -namespace drumstick { - -/** - * This is the value for the base skew used in ALSA. It is not possible - * to assign an arbitrary value (ALSA version <= 1.0.20). - */ -#define SKEW_BASE 0x10000 - -class MidiClient; -class TimerId; - -/** - * Queue information container. - * - * This class is used to hold some properties about an ALSA queue object. - */ -class QueueInfo -{ - friend class MidiQueue; - -public: - QueueInfo(); - QueueInfo(const QueueInfo& other); - QueueInfo(snd_seq_queue_info_t* other); - virtual ~QueueInfo(); - QueueInfo* clone(); - QueueInfo& operator=(const QueueInfo& other); - int getInfoSize() const; - - int getId(); - QString getName(); - int getOwner(); - bool isLocked(); - unsigned int getFlags(); - - void setName(QString value); - void setOwner(int value); - void setLocked(bool locked); - void setFlags(unsigned int value); - -private: - snd_seq_queue_info_t* m_Info; -}; - -/** - * Queue status container. - * - * This class is used to retrieve some status information from an ALSA queue. - */ -class QueueStatus -{ - friend class MidiQueue; - -public: - QueueStatus(); - QueueStatus(const QueueStatus& other); - QueueStatus(snd_seq_queue_status_t* other); - virtual ~QueueStatus(); - QueueStatus* clone(); - QueueStatus& operator=(const QueueStatus& other); - int getInfoSize() const; - - int getId(); - int getEvents(); - const snd_seq_real_time_t* getRealtime(); - unsigned int getStatusBits(); - bool isRunning(); - double getClockTime(); - snd_seq_tick_time_t getTickTime(); - -private: - snd_seq_queue_status_t* m_Info; -}; - -/** - * Queue tempo container. - * - * This class is used to hold some tempo properties of an ALSA queue object. - * The queue's resolution defines the meaning of the musical time, in ticks. It - * is expressed in PPQ (parts per quarter), or ticks in a quarter note (crotchet). - * The nominal tempo is usually expressed in BPM (beats per minute), or Maelzel - * metronome units. It can be also given in microseconds per beat. The tempo skew - * factor is given as two integer numbers: skew value and skew base, being the - * factor the quotient of both quantities = value / base. Currently (ALSA <= 1.0.20) - * you can only use the base constant 0x10000 (decimal 65536). - */ -class QueueTempo -{ - friend class MidiQueue; - -public: - QueueTempo(); - QueueTempo(const QueueTempo& other); - QueueTempo(snd_seq_queue_tempo_t* other); - virtual ~QueueTempo(); - QueueTempo* clone(); - QueueTempo& operator=(const QueueTempo& other); - int getInfoSize() const; - - int getId(); - int getPPQ(); - unsigned int getSkewValue(); - unsigned int getSkewBase(); - unsigned int getTempo(); - void setPPQ(int value); - void setSkewValue(unsigned int value); - void setTempo(unsigned int value); - - float getNominalBPM(); - float getRealBPM(); - void setTempoFactor(float value); - void setNominalBPM(float value); - -protected: - void setSkewBase(unsigned int value); - -private: - snd_seq_queue_tempo_t* m_Info; -}; - -/** - * Queue timer container. - * - * This class is used to hold some properties about the Timer used with an ALSA - * queue object. - */ -class QueueTimer -{ - friend class MidiQueue; - -public: - QueueTimer(); - QueueTimer(const QueueTimer& other); - QueueTimer(snd_seq_queue_timer_t* other); - virtual ~QueueTimer(); - QueueTimer* clone(); - QueueTimer& operator=(const QueueTimer& other); - int getInfoSize() const; - - int getQueueId(); - snd_seq_queue_timer_type_t getType(); - const snd_timer_id_t* getId(); - unsigned int getResolution(); - void setType(snd_seq_queue_timer_type_t value); - void setId(snd_timer_id_t* value); - void setId(const TimerId& id); - void setResolution(unsigned int value); - -private: - snd_seq_queue_timer_t* m_Info; -}; - -/** - * Queue management. - * - * This class represents an ALSA sequencer queue object. - */ -class MidiQueue : public QObject -{ - Q_OBJECT -public: - explicit MidiQueue(MidiClient* seq, QObject* parent = 0); - MidiQueue(MidiClient* seq, const QueueInfo& info, QObject* parent = 0); - MidiQueue(MidiClient* seq, const QString name, QObject* parent = 0); - MidiQueue(MidiClient* seq, const int queue_id, QObject* parent = 0); - virtual ~MidiQueue(); - - int getId() const { return m_Id; } - void start(); - void stop(); - void continueRunning(); - void clear(); - void setTickPosition(snd_seq_tick_time_t pos); - void setRealTimePosition(snd_seq_real_time_t* pos); - QueueInfo& getInfo(); - QueueStatus& getStatus(); - QueueTempo& getTempo(); - QueueTimer& getTimer(); - int getUsage(); - void setInfo(const QueueInfo& value); - void setTempo(const QueueTempo& value); - void setTimer(const QueueTimer& value); - void setUsage(int used); - -private: - bool m_allocated; - int m_Id; - MidiClient* m_MidiClient; - QueueInfo m_Info; - QueueTempo m_Tempo; - QueueTimer m_Timer; - QueueStatus m_Status; -}; - -} /* namespace drumstick */ - -/** @} */ - -#endif //DRUMSTICK_ALSAQUEUE_H diff -Nru kmetronome-0.10.0/drumstick/include/alsatimer.h kmetronome-0.10.1/drumstick/include/alsatimer.h --- kmetronome-0.10.0/drumstick/include/alsatimer.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/alsatimer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,360 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_ALSATIMER_H -#define DRUMSTICK_ALSATIMER_H - -#include "drumstickcommon.h" -#include -#include -#include -#include - -/** - * @file alsatimer.h - * Classes managing ALSA Timers - * @defgroup ALSATimer ALSA Timers - * @{ - */ - -namespace drumstick { - -class TimerQuery; -class TimerId; -class TimerGlobalInfo; - -/** - * ALSA Timer information container. - * - * This class is used to hold properties about ALSA Timers. - */ -class TimerInfo -{ - friend class Timer; - -public: - TimerInfo(); - TimerInfo(const TimerInfo& other); - TimerInfo(const snd_timer_info_t* other); - virtual ~TimerInfo(); - TimerInfo* clone(); - TimerInfo& operator=(const TimerInfo& other); - int getSizeOfInfo() const; - - bool isSlave(); - int getCard(); - QString getId(); - QString getName(); - long getResolution(); - long getFrequency(); - -protected: - long getTicks() __attribute__((deprecated)); - -private: - snd_timer_info_t *m_Info; -}; - -/** - * ALSA Timer identifier container. - * - * This class provides an unique identifier for a Timer. - */ -class TimerId -{ - friend class TimerQuery; - friend class TimerGlobalInfo; - friend class QueueTimer; - -public: - TimerId(); - TimerId(const TimerId& other); - TimerId(const snd_timer_id_t *other); - TimerId(int cls, int scls, int card, int dev, int sdev); - virtual ~TimerId(); - TimerId* clone(); - TimerId& operator=(const TimerId& other); - int getSizeOfInfo() const; - - void setClass(int devclass); - int getClass(); - void setSlaveClass(int devsclass); - int getSlaveClass(); - void setCard(int card); - int getCard(); - void setDevice(int device); - int getDevice(); - void setSubdevice(int subdevice); - int getSubdevice(); - -private: - snd_timer_id_t *m_Info; -}; - -/** - * List of timer identifiers - */ -typedef QList TimerIdList; - -/** - * Global timer information container. - * - * This class provides global timer parameters. - */ -class TimerGlobalInfo -{ - friend class TimerQuery; - -public: - TimerGlobalInfo(); - TimerGlobalInfo(const TimerGlobalInfo& other); - TimerGlobalInfo(const snd_timer_ginfo_t* other); - virtual ~TimerGlobalInfo(); - TimerGlobalInfo* clone(); - TimerGlobalInfo& operator=(const TimerGlobalInfo& other); - int getSizeOfInfo() const; - - void setTimerId(const TimerId& tid); - TimerId& getTimerId(); - unsigned int getFlags(); - int getCard(); - QString getId(); - QString getName(); - unsigned long getResolution(); - unsigned long getMinResolution(); - unsigned long getMaxResolution(); - unsigned int getClients(); - -private: - snd_timer_ginfo_t* m_Info; - TimerId m_Id; -}; - -/** - * ALSA Timer inquiry helper. - * - * This class provides a mechanism to enumerate the available system timers. - */ -class TimerQuery -{ -public: - TimerQuery(const QString& deviceName, int openMode); - TimerQuery(const QString& deviceName, int openMode, snd_config_t* conf); - virtual ~TimerQuery(); - /** - * Gets the list of available timers - * @return List of TimerId objects - */ - TimerIdList getTimers() const { return m_timers; } - TimerGlobalInfo& getGlobalInfo(); - void setGlobalParams(snd_timer_gparams_t* params); - void getGlobalParams(snd_timer_gparams_t* params); - void getGlobalStatus(snd_timer_gstatus_t* status); - -protected: - void readTimers(); - void freeTimers(); - -private: - snd_timer_query_t *m_Info; - TimerIdList m_timers; - TimerGlobalInfo m_GlobalInfo; -}; - -/** - * ALSA Timer parameters container. - * - * This class provides several parameters about a Timer. - */ -class TimerParams -{ - friend class Timer; - -public: - TimerParams(); - TimerParams(const TimerParams& other); - TimerParams(const snd_timer_params_t* other); - virtual ~TimerParams(); - TimerParams* clone(); - TimerParams& operator=(const TimerParams& other); - int getSizeOfInfo() const; - - void setAutoStart(bool auto_start); - bool getAutoStart(); - void setExclusive(bool exclusive); - bool getExclusive(); - void setEarlyEvent(bool early_event); - bool getEarlyEvent(); - void setTicks(long ticks); - long getTicks(); - void setQueueSize(long queue_size); - long getQueueSize(); - void setFilter(unsigned int filter); - unsigned int getFilter(); - -private: - snd_timer_params_t* m_Info; -}; - -/** - * ALSA Timer status container. - * - * This class provides some status information about a Timer. - */ -class TimerStatus -{ - friend class Timer; - -public: - TimerStatus(); - TimerStatus(const TimerStatus& other); - TimerStatus(const snd_timer_status_t* other); - virtual ~TimerStatus(); - TimerStatus* clone(); - TimerStatus& operator=(const TimerStatus& other); - int getSizeOfInfo() const; - - snd_htimestamp_t getTimestamp(); - long getResolution(); - long getLost(); - long getOverrun(); - long getQueue(); - -private: - snd_timer_status_t* m_Info; -}; - -/** - * ALSA Timer events handler. - * - * This abstract class is used to define an interface that other class can - * implement to receive timer events. - */ -class TimerEventHandler -{ -public: - /** Destructor */ - virtual ~TimerEventHandler() {} - /** - * Timer event handler. This method is called when the timer expires. - * @param ticks The time in ticks. - * @param msecs The time in milliseconds. - */ - virtual void handleTimerEvent(int ticks, int msecs) = 0; -}; - -/** - * ALSA Timer management. - * - * This class represents an ALSA timer object. - */ -class Timer : public QObject -{ - Q_OBJECT - -private: - /** - * This class manages timer events input from ALSA - */ - class TimerInputThread : public QThread - { - public: - /** Constructor */ - TimerInputThread(Timer* t, int timeout) - : QThread(), - m_timer(t), - m_Wait(timeout), - m_Stopped(false) {} - /** Destructor */ - virtual ~TimerInputThread() {} - virtual void run(); - bool stopped(); - void stop(); - private: - Timer* m_timer; - int m_Wait; - bool m_Stopped; - QReadWriteLock m_mutex; - }; - -public: - Timer(int cls, int scls, int card, int dev, int sdev, int openMode, QObject* parent = 0); - Timer(const QString& deviceName, int openMode, QObject* parent = 0); - Timer(const QString& deviceName, int openMode, snd_config_t* config, QObject* parent = 0); - Timer(TimerId& id, int openMode, QObject* parent = 0); - virtual ~Timer(); - - static TimerId bestGlobalTimerId(); - static Timer* bestGlobalTimer(int openMode, QObject* parent = 0); - /** - * Gets the ALSA timer object. - * @return ALSA timer object pointer. - */ - snd_timer_t* getHandle() { return m_Info; } - TimerInfo& getTimerInfo(); - TimerStatus& getTimerStatus(); - void setTimerParams(const TimerParams& params); - - void start(); - void stop(); - void continueRunning(); - - void addAsyncTimerHandler(snd_async_callback_t callback, void *private_data); - int getPollDescriptorsCount(); - void pollDescriptors(struct pollfd *pfds, unsigned int space); - void pollDescriptorsRevents(struct pollfd *pfds, unsigned int nfds, unsigned short *revents); - ssize_t read(void *buffer, size_t size); - snd_timer_t* getTimerHandle(); - /** - * Sets an event handler providing a method to be called when a timer expires. - * @param h A TimerEventHandler instance. - */ - void setHandler(TimerEventHandler* h) { m_handler = h; } - void startEvents(); - void stopEvents(); - -protected: - void doEvents(); - -signals: - /** - * This signal is emitted when the timer has expired, if there is not an - * event hander installed. - * - * @param ticks The time in ticks. - * @param msecs The time in milliseconds. - */ - void timerExpired(int ticks, int msecs); - -private: - snd_timer_t *m_Info; - snd_async_handler_t *m_asyncHandler; - TimerEventHandler* m_handler; - QPointer m_thread; - TimerInfo m_TimerInfo; - TimerStatus m_TimerStatus; - QString m_deviceName; - snd_htimestamp_t m_last_time; -}; - -} /* namespace drumstick */ - -/** @} */ - -#endif /* DRUMSTICK_ALSATIMER_H */ diff -Nru kmetronome-0.10.0/drumstick/include/drumstickcommon.h kmetronome-0.10.1/drumstick/include/drumstickcommon.h --- kmetronome-0.10.0/drumstick/include/drumstickcommon.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/drumstickcommon.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_DRUMSTICKCOMMON_H -#define DRUMSTICK_DRUMSTICKCOMMON_H - -#include -#include -#include -#include - -extern "C" { -#include -} - -/** - * @file drumstickcommon.h - * Common functionality - * @defgroup Common Common Functionality - * @{ - * drumstick::SequencerError is a common exception object, encapsulating ALSA error codes. - */ - -namespace drumstick { - -/** - * 8-bit unsigned number to be used as a MIDI message parameter - */ -typedef quint8 MidiByte; - -/** - * Class used to report errors from the ALSA sequencer. - * - * The class SequencerError represents an exception object reported when the - * ALSA library returns an error code. It is only used for severe errors. - */ -class SequencerError -{ -public: - /** - * Constructor - * @param s Error location - * @param rc Numeric error code - */ - SequencerError(QString const& s, int rc) : - m_location(s), m_errCode(rc) {} - - /** - * Destructor - */ - virtual ~SequencerError() {} - - /** - * Gets the human readable error message from the error code - * @return Error message - */ - const QString qstrError() const - { - return QString(snd_strerror(m_errCode)); - } - - /** - * Gets the numeric error code - * @return Error code - */ - int code() const - { - return m_errCode; - } - - /** - * Gets the location of the error code as provided in the constructor - * @return Error location - */ - const QString& location() const - { - return m_location; - } - -private: - QString m_location; - int m_errCode; -}; - -/** - * Checks the error code for severe errors. - * If the provided error code is less than zero an exception is thrown, - * containing both the error code and the location. - * @param rc Error code - * @param where Location - * @return Error code - */ -inline int checkErrorAndThrow(int rc, const char *where) -{ - if (rc < 0) { - qDebug() << "Error code:" << rc << "(" << snd_strerror(rc) << ")"; - qDebug() << "Location:" << where; - throw SequencerError(QString(where), rc); - } - return rc; -} - -/** - * Check the error code for warning errors. - * This method doesn't throw an exception. - * @param rc Error code - * @param where Location - * @return Error code - */ -inline int checkWarning(int rc, const char *where) -{ - if (rc < 0) { - qWarning() << "Exception code:" << rc << "(" << snd_strerror(rc) << ")"; - qWarning() << "Location:" << where; - } - return rc; -} - -/** - * This macro calls the check error function. - * @param x Error code - */ -#define CHECK_ERROR(x) (checkErrorAndThrow((x),__PRETTY_FUNCTION__)) - -/** - * This macro calls the check warning function. - * @param x Error code - */ -#define CHECK_WARNING(x) (checkWarning((x),__PRETTY_FUNCTION__)) - -/** - * ALSA library version as a constant string. - * - * This string corresponds to the compilation library, which may be - * different to the runtime library. - * @see getRuntimeALSALibraryVersion - */ -const QString LIBRARY_VERSION(SND_LIB_VERSION_STR); - -} /* namespace drumstick */ - -/** @} */ - -#endif /*DRUMSTICK_DRUMSTICKCOMMON_H*/ diff -Nru kmetronome-0.10.0/drumstick/include/drumstick.h kmetronome-0.10.1/drumstick/include/drumstick.h --- kmetronome-0.10.0/drumstick/include/drumstick.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/drumstick.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_H -#define DRUMSTICK_H - -/** - * @file drumstick.h - * The main header that a program can include to use all the drumstick features. - */ - -// ALSA library interface -#include -#include -#include -#include -#include -#include -#include -#include - -// File formats -#include -#include - -#endif /*DRUMSTICK_H*/ diff -Nru kmetronome-0.10.0/drumstick/include/playthread.h kmetronome-0.10.1/drumstick/include/playthread.h --- kmetronome-0.10.0/drumstick/include/playthread.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/playthread.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_PLAYTHREAD_H -#define DRUMSTICK_PLAYTHREAD_H - -#include "alsaevent.h" -#include -#include - -/** - * @file playthread.h - * Sequencer output thread - * @defgroup PlayThread Sequencer Output - * @{ - */ - -namespace drumstick { - -class MidiClient; -class MidiQueue; - -/** - * Sequence player auxiliary class - * - * This class is used to implement an asynchronous sequence player using - * ALSA sequencer scheduling - * - * Examples: smfplayer.cpp and playsmf.cpp - */ -class SequencerOutputThread : public QThread -{ - Q_OBJECT - -public: - SequencerOutputThread(MidiClient *seq, int portId); - virtual void run(); - /** - * Gets the initial position in ticks of the sequence - * @return Initial position (ticks) - */ - virtual unsigned int getInitialPosition() { return 0; } - /** - * Gets the echo event resolution in ticks. This is the time - * between echo events interleaved with the MIDI sequence. The default - * value zero means that not echo events are sent at all. - * @return Echo resolution (ticks) - */ - virtual unsigned int getEchoResolution() { return 0; } - /** - * Check if there is one more event in the sequence. - * This is a pure virtual method that must be overridden in the derived - * class. - * @return True if the sequence has another event. - */ - virtual bool hasNext() = 0; - /** - * Gets the next event in the sequence. - * This is a pure virtual function that must be overridden in the derived - * class. - * @return Pointer to the next SequencerEvent to be played. - */ - virtual SequencerEvent* nextEvent() = 0; - - /** - * Stops playing the current sequence. - */ - virtual void stop(); - -signals: - /** - * Signal emitted when the sequence play-back has finished. - */ - void finished(); - - /** - * Signal emitted when the play-back has stopped. - * @since 0.2.0 - */ - void stopped(); - -public slots: - void start( Priority priority = InheritPriority ); - -protected: - virtual void sendEchoEvent(int tick); - virtual void sendSongEvent(SequencerEvent* ev); - virtual void drainOutput(); - virtual void syncOutput(); - virtual bool stopRequested(); - - MidiClient *m_MidiClient; /**< MidiClient instance pointer */ - MidiQueue *m_Queue; /**< MidiQueue instance pointer */ - int m_PortId; /**< MidiPort numeric identifier */ - bool m_Stopped; /**< Stopped status */ - int m_QueueId; /**< MidiQueue numeric identifier */ - int m_npfds; /**< Number of pollfd pointers */ - pollfd* m_pfds; /**< Array of pollfd pointers */ - QReadWriteLock m_mutex; /**< Mutex object used for synchronization */ -}; - -} /* namespace drumstick */ - -/** @} */ - -#endif /*DRUMSTICK_PLAYTHREAD_H*/ diff -Nru kmetronome-0.10.0/drumstick/include/qsmf.h kmetronome-0.10.1/drumstick/include/qsmf.h --- kmetronome-0.10.0/drumstick/include/qsmf.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/qsmf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,327 +0,0 @@ -/* - Standard MIDI File component - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - Based on midifile.c by Tim Thompson, M.Czeiszperger and Greg Lee - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_QSMF_H -#define DRUMSTICK_QSMF_H - -#include - -class QDataStream; - -/** - * @file qsmf.h - * Standard MIDI Files Input/Output - * @defgroup SMF Standard MIDI Files management (I/O) - * @{ - */ - -namespace drumstick { - -#define MThd 0x4d546864 /**< SMF Header prefix */ -#define MTrk 0x4d54726b /**< SMF Track prefix */ - -/* Standard MIDI Files meta event definitions */ -#define meta_event 0xff /**< SMF Meta Event prefix */ -#define sequence_number 0x00 /**< SMF Sequence number */ -#define text_event 0x01 /**< SMF Text event */ -#define copyright_notice 0x02 /**< SMF Copyright notice */ -#define sequence_name 0x03 /**< SMF Sequence name */ -#define instrument_name 0x04 /**< SMF Instrument name */ -#define lyric 0x05 /**< SMF Lyric */ -#define marker 0x06 /**< SMF Marker */ -#define cue_point 0x07 /**< SMF Cue point */ -#define forced_channel 0x20 /**< SMF Forced MIDI channel */ -#define forced_port 0x21 /**< SMF Forced MIDI port */ -#define end_of_track 0x2f /**< SMF End of track */ -#define set_tempo 0x51 /**< SMF Tempo change */ -#define smpte_offset 0x54 /**< SMF SMPTE offset */ -#define time_signature 0x58 /**< SMF Time signature */ -#define key_signature 0x59 /**< SMF Key signature */ -#define sequencer_specific 0x7f /**< SMF Sequencer specific */ - -/* MIDI status commands most significant bit is 1 */ -#define note_off 0x80 /**< MIDI event Note Off */ -#define note_on 0x90 /**< MIDI event Note On */ -#define poly_aftertouch 0xa0 /**< MIDI event Polyphonic pressure */ -#define control_change 0xb0 /**< MIDI event Control change */ -#define program_chng 0xc0 /**< MIDI event Program change */ -#define channel_aftertouch 0xd0 /**< MIDI event Channel after-touch */ -#define pitch_wheel 0xe0 /**< MIDI event Bender */ -#define system_exclusive 0xf0 /**< MIDI event System Exclusive begin */ -#define end_of_sysex 0xf7 /**< MIDI event System Exclusive end */ - -#define midi_command_mask 0xf0 /**< Mask to extract the command from the status byte */ -#define midi_channel_mask 0x0f /**< Mask to extract the channel from the status byte */ - -#define major_mode 0 /**< Major mode scale */ -#define minor_mode 1 /**< Minor mode scale */ - -/** - * Standard MIDI Files input/output - * - * This class is used to parse and encode Standard MIDI Files (SMF) - */ -class QSmf : public QObject -{ - Q_OBJECT - -public: - QSmf(QObject * parent = 0); - virtual ~QSmf(); - - void readFromStream(QDataStream *stream); - void readFromFile(const QString& fileName); - void writeToStream(QDataStream *stream); - void writeToFile(const QString& fileName); - - void writeMetaEvent(long deltaTime, int type, const QByteArray& data); - void writeMetaEvent(long deltaTime, int type, const QString& data); - void writeMetaEvent(long deltaTime, int type, int data); - void writeMetaEvent(long deltaTime, int type); - - void writeMidiEvent(long deltaTime, int type, int chan, int b1); - void writeMidiEvent(long deltaTime, int type, int chan, int b1, int b2); - void writeMidiEvent(long deltaTime, int type, int chan, const QByteArray& data); - void writeMidiEvent(long deltaTime, int type, long len, char* data); - - void writeTempo(long deltaTime, long tempo); - void writeBpmTempo(long deltaTime, int tempo); - void writeTimeSignature(long deltaTime, int num, int den, int cc, int bb); - void writeKeySignature(long deltaTime, int tone, int mode); - void writeSequenceNumber(long deltaTime, int seqnum); - - long getCurrentTime(); - long getCurrentTempo(); - long getRealTime(); - long getFilePos(); - int getDivision(); - void setDivision(int division); - int getTracks(); - void setTracks(int tracks); - int getFileFormat(); - void setFileFormat(int fileFormat); - QTextCodec* getTextCodec(); - void setTextCodec(QTextCodec *codec); - -signals: - /** - * Emitted for a SMF read or write error - * @param errorStr Error string - */ - void signalSMFError(const QString& errorStr); - /** - * Emitted after reading a SMF header - * @param format SMF format (0/1) - * @param ntrks Number pof tracks - * @param division Division (resolution in ticks per quarter note) - */ - void signalSMFHeader(int format, int ntrks, int division); - /** - * Emitted after reading a Note On message - * @param chan MIDI Channel - * @param pitch MIDI Note - * @param vol Velocity - */ - void signalSMFNoteOn(int chan, int pitch, int vol); - /** - * Emitted after reading a Note Off message - * @param chan MIDI Channel - * @param pitch MIDI Note - * @param vol Velocity - */ - void signalSMFNoteOff(int chan, int pitch, int vol); - /** - * Emitted after reading a Polyphonic Aftertouch message - * @param chan MIDI Channel - * @param pitch MIDI Note - * @param press Pressure amount - */ - void signalSMFKeyPress(int chan, int pitch, int press); - /** - * Emitted after reading a Control Change message - * @param chan MIDI Channel - * @param ctl MIDI Controller - * @param value Control value - */ - void signalSMFCtlChange(int chan, int ctl, int value); - /** - * Emitted after reading a Bender message - * @param chan MIDI Channel - * @param value Bender value - */ - void signalSMFPitchBend(int chan, int value); - /** - * Emitted after reading a Program change message - * @param chan MIDI Channel - * @param patch Program number - */ - void signalSMFProgram(int chan, int patch); - /** - * Emitted after reading a Channel Aftertouch message - * @param chan MIDI Channel - * @param press Pressure amount - */ - void signalSMFChanPress(int chan, int press); - /** - * Emitted after reading a System Exclusive message - * @param data Sysex bytes - */ - void signalSMFSysex(const QByteArray& data); - /** - * Emitted after reading a Sequencer specific message - * @param data Message data - */ - void signalSMFSeqSpecific(const QByteArray& data); - /** - * Emitted after reading an unregistered SMF Meta message - * @param typ Message type - * @param data Message data - * @since 0.2.0 - */ - void signalSMFMetaUnregistered(int typ, const QByteArray& data); - /** - * Emitted after reading any SMF Meta message - * @param typ Message type - * @param data Message data - */ - void signalSMFMetaMisc(int typ, const QByteArray& data); - /** - * Emitted after reading a Sequence number message - * @param seq Sequence number - */ - void signalSMFSequenceNum(int seq); - /** - * Emitted after reading a Forced channel message - * @param channel MIDI Channel - */ - void signalSMFforcedChannel(int channel); - /** - * Emitted after reading a Forced port message - * @param port Port number - */ - void signalSMFforcedPort(int port); - /** - * Emitted after reading a SMF text message - * @param typ Text type - * @param data Text data - */ - void signalSMFText(int typ, const QString& data); - /** - * Emitted after reading a SMPT offset message - * @param b0 Hours - * @param b1 Minutes - * @param b2 Seconds - * @param b3 Frames - * @param b4 Fractional frames - */ - void signalSMFSmpte(int b0, int b1, int b2, int b3, int b4); - /** - * Emitted after reading a SMF Time signature message - * @param b0 Numerator - * @param b1 Denominator (exponent in a power of two) - * @param b2 Number of MIDI clocks per metronome click - * @param b3 Number of notated 32nd notes per 24 MIDI clocks - */ - void signalSMFTimeSig(int b0, int b1, int b2, int b3); - /** - * Emitted after reading a SMF Key Signature smessage - * @param b0 Number of alterations (negative=flats, positive=sharps) - * @param b1 Scale Mode (0=major, 1=minor) - */ - void signalSMFKeySig(int b0, int b1); - /** - * Emitted after reading a Tempo Change message - * @param tempo Microseconds per quarter note - */ - void signalSMFTempo(int tempo); - /** - * Emitted after reading a End-Of-Track message - */ - void signalSMFendOfTrack(); - /** - * Emitted after reading a track prefix - */ - void signalSMFTrackStart(); - /** - * Emitted after a track has finished - */ - void signalSMFTrackEnd(); - /** - * Emitted to request the user to write the tempo track. - * This is the first track in a format 1 SMF. - */ - void signalSMFWriteTempoTrack(); - /** - * Emitted to request the user to write a track. - * @param track Track number - */ - void signalSMFWriteTrack(int track); - -private: - /** - * Tempo change within a SMF or sequence - */ - struct QSmfRecTempo - { - quint64 tempo; - quint64 time; - }; - - class QSmfPrivate; - QSmfPrivate *d; - - void SMFRead(); - void SMFWrite(); - quint8 getByte(); - void putByte(quint8 value); - void readHeader(); - void readTrack(); - quint16 to16bit(quint8 c1, quint8 c2); - quint32 to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4); - quint16 read16bit(); - quint32 read32bit(); - void write16bit(quint16 data); - void write32bit(quint32 data); - void writeVarLen(quint64 value); - double ticksToSecs(quint64 ticks, quint16 division, quint64 tempo); - long readVarLen(); - void readExpected(const QString& s); - void addTempo(quint64 tempo, quint64 time); - quint64 findTempo(); - void SMFError(const QString& s); - void channelMessage(quint8 status, quint8 c1, quint8 c2); - void msgInit(); - void msgAdd(quint8 b); - void metaEvent(quint8 b); - void sysEx(); - void badByte(quint8 b, int p); - quint8 lowerByte(quint16 x); - quint8 upperByte(quint16 x); - bool endOfSmf(); - void writeHeaderChunk(int format, int ntracks, int division); - void writeTrackChunk(int track); -}; - -} /* namespace drumstick */ - -/** @} */ - -#endif /* DRUMSTICK_QSMF_H */ diff -Nru kmetronome-0.10.0/drumstick/include/qwrk.h kmetronome-0.10.1/drumstick/include/qwrk.h --- kmetronome-0.10.0/drumstick/include/qwrk.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/qwrk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,540 +0,0 @@ -/* - WRK File component - Copyright (C) 2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef DRUMSTICK_QWRK_H -#define DRUMSTICK_QWRK_H - -#include - -class QDataStream; - -/** - * @file qwrk.h - * Cakewalk WRK Files Input - * @defgroup WRK Cakewalk WRK File Parser (Input) - * @{ - */ - -namespace drumstick { - -/** - * Record types within a WRK file - */ -enum WrkChunkType { - TRACK_CHUNK = 1, ///< Track prefix - STREAM_CHUNK = 2, ///< Events stream - VARS_CHUNK = 3, ///< Global variables - TEMPO_CHUNK = 4, ///< Tempo map - METER_CHUNK = 5, ///< Meter map - SYSEX_CHUNK = 6, ///< System exclusive bank - MEMRGN_CHUNK = 7, ///< Memory region - COMMENTS_CHUNK = 8, ///< Comments - TRKOFFS_CHUNK = 9, ///< Track offset - TIMEBASE_CHUNK = 10, ///< Timebase. If present is the first chunk in the file. - TIMEFMT_CHUNK = 11, ///< SMPTE time format - TRKREPS_CHUNK = 12, ///< Track repetitions - TRKPATCH_CHUNK = 14, ///< Track patch - NTEMPO_CHUNK = 15, ///< New Tempo map - THRU_CHUNK = 16, ///< Extended thru parameters - LYRICS_CHUNK = 18, ///< Events stream with lyrics - TRKVOL_CHUNK = 19, ///< Track volume - SYSEX2_CHUNK = 20, ///< System exclusive bank - STRTAB_CHUNK = 22, ///< Table of text event types - METERKEY_CHUNK = 23, ///< Meter/Key map - TRKNAME_CHUNK = 24, ///< Track name - VARIABLE_CHUNK = 26, ///< Variable record chunk - NTRKOFS_CHUNK = 27, ///< Track offset - TRKBANK_CHUNK = 30, ///< Track bank - NTRACK_CHUNK = 36, ///< Track prefix - NSYSEX_CHUNK = 44, ///< System exclusive bank - NSTREAM_CHUNK = 45, ///< Events stream - SGMNT_CHUNK = 49, ///< Segment prefix - SOFTVER_CHUNK = 74, ///< Software version which saved the file - END_CHUNK = 255 ///< Last chunk, end of file -}; - -const QByteArray HEADER("CAKEWALK"); ///< Cakewalk WRK File header id - -/** - * Cakewalk WRK file format (input only) - * - * This class is used to parse Cakewalk WRK Files - */ -class QWrk : public QObject -{ - Q_OBJECT - -public: - QWrk(QObject * parent = 0); - virtual ~QWrk(); - - void readFromStream(QDataStream *stream); - void readFromFile(const QString& fileName); - QTextCodec* getTextCodec(); - void setTextCodec(QTextCodec *codec); - long getFilePos(); - - int getNow() const; - int getFrom() const; - int getThru() const; - int getKeySig() const; - int getClock() const; - int getAutoSave() const; - int getPlayDelay() const; - bool getZeroCtrls() const; - bool getSendSPP() const; - bool getSendCont() const; - bool getPatchSearch() const; - bool getAutoStop() const; - unsigned int getStopTime() const; - bool getAutoRewind() const; - int getRewindTime() const; - bool getMetroPlay() const; - bool getMetroRecord() const; - bool getMetroAccent() const; - int getCountIn() const; - bool getThruOn() const; - bool getAutoRestart() const; - int getCurTempoOfs() const; - int getTempoOfs1() const; - int getTempoOfs2() const; - int getTempoOfs3() const; - bool getPunchEnabled() const; - int getPunchInTime() const; - int getPunchOutTime() const; - int getEndAllTime() const; - - QByteArray getLastChunkRawData() const; - double getRealTime(long ticks) const; - -Q_SIGNALS: - - /** - * Emitted for a WRK file read error - * - * @param errorStr Error string - */ - void signalWRKError(const QString& errorStr); - - /** - * Emitted after reading an unknown chunk - * - * @param type chunk type - * @param data chunk data (not decoded) - */ - void signalWRKUnknownChunk(int type, const QByteArray& data); - - /** - * Emitted after reading a WRK header - * - * @param verh WRK file format version major - * @param verl WRK file format version minor - */ - void signalWRKHeader(int verh, int verl); - - /** - * Emitted after reading the last chunk of a WRK file - */ - void signalWRKEnd(); - - /** - * Emitted after reading the last event of a event stream - */ - void signalWRKStreamEnd(long time); - - /** - * Emitted after reading a Note message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param pitch MIDI Note - * @param vol Velocity - * @param dur Duration - */ - void signalWRKNote(int track, long time, int chan, int pitch, int vol, int dur); - - /** - * Emitted after reading a Polyphonic Aftertouch message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param pitch MIDI Note - * @param press Pressure amount - */ - void signalWRKKeyPress(int track, long time, int chan, int pitch, int press); - - /** - * Emitted after reading a Control Change message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param ctl MIDI Controller - * @param value Control value - */ - void signalWRKCtlChange(int track, long time, int chan, int ctl, int value); - - /** - * Emitted after reading a Bender message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param value Bender value - */ - void signalWRKPitchBend(int track, long time, int chan, int value); - - /** - * Emitted after reading a Program change message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param patch Program number - */ - void signalWRKProgram(int track, long time, int chan, int patch); - - /** - * Emitted after reading a Channel Aftertouch message - * - * @param track track number - * @param time musical time - * @param chan MIDI Channel - * @param press Pressure amount - */ - void signalWRKChanPress(int track, long time, int chan, int press); - - /** - * Emitted after reading a System Exclusive event - * - * @param track track number - * @param time musical time - * @param bank Sysex Bank number - */ - void signalWRKSysexEvent(int track, long time, int bank); - - /** - * Emitted after reading a System Exclusive Bank - * - * @param bank Sysex Bank number - * @param name Sysex Bank name - * @param autosend Send automatically after loading the song - * @param port MIDI output port - * @param data Sysex bytes - */ - void signalWRKSysex(int bank, const QString& name, bool autosend, int port, const QByteArray& data); - - /** - * Emitted after reading a text message - * - * @param track track number - * @param time musical time - * @param type Text type - * @param data Text data - */ - void signalWRKText(int track, long time, int type, const QString& data); - - /** - * Emitted after reading a WRK Time signature - * - * @param bar Measure number - * @param num Numerator - * @param den Denominator (exponent in a power of two) - */ - void signalWRKTimeSig(int bar, int num, int den); - - /** - * Emitted after reading a WRK Key Signature - * - * @param bar Measure number - * @param alt Number of alterations (negative=flats, positive=sharps) - */ - void signalWRKKeySig(int bar, int alt); - - /** - * Emitted after reading a Tempo Change message. - * - * Tempo units are given in beats * 100 per minute, so to obtain BPM - * it is necessary to divide by 100 the tempo. - * - * @param time musical time - * @param tempo beats per minute multiplied by 100 - */ - void signalWRKTempo(long time, int tempo); - - /** - * Emitted after reading a track prefix chunk - * - * @param name1 track 1st name - * @param name2 track 2nd name - * @param trackno track number - * @param channel track forced channel (-1=no forced) - * @param pitch track pitch transpose in semitones (-127..127) - * @param velocity track velocity increment (-127..127) - * @param port track forced port - * @param selected true if track is selected - * @param muted true if track is muted - * @param loop true if loop is enabled - */ - void signalWRKTrack(const QString& name1, - const QString& name2, - int trackno, int channel, int pitch, - int velocity, int port, - bool selected, bool muted, bool loop ); - - /** - * Emitted after reading the timebase chunk - * - * @param timebase ticks per quarter note - */ - void signalWRKTimeBase(int timebase); - - /** - * Emitted after reading the global variables chunk. - * - * This record contains miscellaneous Cakewalk global variables that can - * be retrieved using individual getters. - * - * @see getNow(), getFrom(), getThru() - */ - void signalWRKGlobalVars(); - - /** - * Emitted after reading an Extended Thru parameters chunk. - * - * It was introduced in Cakewalk version 4.0. These parameters are - * intended to override the global vars Thruon value, so this record should - * come after the VARS_CHUNK record. It is optional. - * - * @param mode (auto, off, on) - * @param port MIDI port - * @param channel MIDI channel - * @param keyPlus Note transpose - * @param velPlus Velocity transpose - * @param localPort MIDI local port - */ - void signalWRKThru(int mode, int port, int channel, int keyPlus, int velPlus, int localPort); - - /** - * Emitted after reading a track offset chunk - * - * @param track track number - * @param offset time offset - */ - void signalWRKTrackOffset(int track, int offset); - - /** - * Emitted after reading a track offset chunk - * - * @param track track number - * @param reps number of repetitions - */ - void signalWRKTrackReps(int track, int reps); - - /** - * Emitted after reading a track patch chunk - * - * @param track track number - * @param patch - */ - void signalWRKTrackPatch(int track, int patch); - - /** - * Emitted after reading a track bank chunk - * - * @param track track number - * @param bank - */ - void signalWRKTrackBank(int track, int bank); - - /** - * Emitted after reading a SMPTE time format chunk - * - * @param frames frames/sec (24, 25, 29=30-drop, 30) - * @param offset frames of offset - */ - void signalWRKTimeFormat(int frames, int offset); - - /** - * Emitted after reading a comments chunk - * - * @param data file text comments - */ - void signalWRKComments(const QString& data); - - /** - * Emitted after reading a variable chunk. - * This record may contain data in text or binary format. - * - * @param name record identifier - * @param data record variable data - */ - void signalWRKVariableRecord(const QString& name, const QByteArray& data); - - /** - * Emitted after reading a track volume chunk. - * - * @param track track number - * @param vol initial volume - */ - void signalWRKTrackVol(int track, int vol); - - /** - * Emitted after reading a new track prefix - * - * @param name track name - * @param trackno track number - * @param channel forced MIDI channel - * @param pitch Note transposition - * @param velocity Velocity increment - * @param port MIDI port number - * @param selected track is selected - * @param muted track is muted - * @param loop track loop enabled - */ - void signalWRKNewTrack( const QString& name, - int trackno, int channel, int pitch, - int velocity, int port, - bool selected, bool muted, bool loop ); - - /** - * Emitted after reading a software version chunk. - * - * @param version software version string - */ - void signalWRKSoftVer(const QString& version); - - /** - * Emitted after reading a track name chunk. - * - * @param track track number - * @param name track name - */ - void signalWRKTrackName(int track, const QString& name); - - /** - * Emitted after reading a string event types chunk. - * - * @param strs list of declared string event types - */ - void signalWRKStringTable(const QStringList& strs); - - /** - * Emitted after reading a segment prefix chunk. - * - * @param track track number - * @param time segment time offset - * @param name segment name - */ - void signalWRKSegment(int track, long time, const QString& name); - - /** - * Emitted after reading a chord diagram chunk. - * - * @param track track number - * @param time event time in ticks - * @param name chord name - * @param data chord data definition (not decoded) - */ - void signalWRKChord(int track, long time, const QString& name, const QByteArray& data); - - /** - * Emitted after reading an expression indication (notation) chunk. - * - * @param track track number - * @param time event time in ticks - * @param code expression event code - * @param text expression text - */ - void signalWRKExpression(int track, long time, int code, const QString& text); - - /** - * Emitted after reading a hairpin symbol (notation) chunk. - * - * @param track track number - * @param time event time in ticks - * @param code hairpin code - * @param dur duration - */ - void signalWRKHairpin(int track, long time, int code, int dur); - -private: - quint8 readByte(); - quint16 to16bit(quint8 c1, quint8 c2); - quint32 to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4); - quint16 read16bit(); - quint32 read24bit(); - quint32 read32bit(); - QString readString(int len); - QString readVarString(); - void readRawData(int size); - void readGap(int size); - bool atEnd(); - void seek(qint64 pos); - - int readChunk(); - void processTrackChunk(); - void processVarsChunk(); - void processTimebaseChunk(); - void processNoteArray(int track, int events); - void processStreamChunk(); - void processMeterChunk(); - void processTempoChunk(int factor = 1); - void processSysexChunk(); - void processSysex2Chunk(); - void processNewSysexChunk(); - void processThruChunk(); - void processTrackOffset(); - void processTrackReps(); - void processTrackPatch(); - void processTrackBank(); - void processTimeFormat(); - void processComments(); - void processVariableRecord(int max); - void processNewTrack(); - void processSoftVer(); - void processTrackName(); - void processStringTable(); - void processLyricsStream(); - void processTrackVol(); - void processNewTrackOffset(); - void processMeterKeyChunk(); - void processSegmentChunk(); - void processNewStream(); - void processUnknown(int id); - void processEndChunk(); - void wrkRead(); - - struct RecTempo { - long time; - double tempo; - double seconds; - }; - - class QWrkPrivate; - QWrkPrivate *d; -}; - -} // namespace drumstick; - -/** @} */ - -#endif // DRUMSTICK_QWRK_H diff -Nru kmetronome-0.10.0/drumstick/include/subscription.h kmetronome-0.10.1/drumstick/include/subscription.h --- kmetronome-0.10.0/drumstick/include/subscription.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/include/subscription.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -#ifndef DRUMSTICK_SUBSCRIPTION_H -#define DRUMSTICK_SUBSCRIPTION_H - -#include "drumstickcommon.h" -#include - -/** - * @file subscription.h - * Classes managing ALSA sequencer subscriptions - * @defgroup ALSASubscription ALSA Sequencer Subscriptions - * @{ - */ - -namespace drumstick { - -class MidiClient; - -/** - * Subscriber container class. - * - * This class is used to enumerate the subscribers of a given (root) port. - */ -class Subscriber -{ - friend class PortInfo; -public: - Subscriber(); - Subscriber(const Subscriber& other); - Subscriber(snd_seq_query_subscribe_t* other); - virtual ~Subscriber(); - Subscriber* clone(); - int getSizeOfInfo() const; - - int getClient(); - int getPort(); - const snd_seq_addr_t* getRoot(); - snd_seq_query_subs_type_t getType(); - int getIndex(); - int getNumSubs(); - const snd_seq_addr_t* getAddr(); - int getQueue(); - bool getExclusive(); - bool getTimeUpdate(); - bool getTimeReal(); - void setClient(int client); - void setPort(int port); - void setRoot(snd_seq_addr_t* addr); - void setType(snd_seq_query_subs_type_t type); - void setIndex(int index); - Subscriber& operator=(const Subscriber& other); - -private: - snd_seq_query_subscribe_t* m_Info; - -}; - -/** - * Subscription management. - * - * This class represents a connection between two ports. - */ -class Subscription -{ -public: - Subscription(); - Subscription(const Subscription& other); - Subscription(snd_seq_port_subscribe_t* other); - Subscription(MidiClient* seq); - virtual ~Subscription(); - Subscription* clone(); - int getSizeOfInfo() const; - - void setSender(unsigned char client, unsigned char port); - void setDest(unsigned char client, unsigned char port); - void subscribe(MidiClient* seq); - void unsubscribe(MidiClient* seq); - - const snd_seq_addr_t* getSender(); - const snd_seq_addr_t* getDest(); - int getQueue(); - bool getExclusive(); - bool getTimeUpdate(); - bool getTimeReal(); - void setSender(const snd_seq_addr_t* addr); - void setDest(const snd_seq_addr_t* addr); - void setQueue(int queue); - void setExclusive(bool val); - void setTimeUpdate(bool val); - void setTimeReal(bool val); - Subscription& operator=(const Subscription& other); - -private: - snd_seq_port_subscribe_t* m_Info; -}; - -/** - * List of subscriptions - */ -typedef QList SubscriptionsList; - -/** - * List of subscribers - */ -typedef QList SubscribersList; - -} - -/** @} */ - -#endif //DRUMSTICK_SUBSCRIPTION_H diff -Nru kmetronome-0.10.0/drumstick/src/alsaclient.cpp kmetronome-0.10.1/drumstick/src/alsaclient.cpp --- kmetronome-0.10.0/drumstick/src/alsaclient.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/alsaclient.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2417 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsaclient.h" -#include "alsaqueue.h" -#include "alsaevent.h" -#include -#include -#include -#include - -/** - * @file alsaclient.cpp - * Implementation of classes managing ALSA Sequencer clients - */ - -/** - * @class QObject - * The QObject class is the base class of all Qt objects. - * @see http://doc.trolltech.com/qobject.html - */ - -/** - * @class QThread - * The QThread class provides platform-independent threads. - * @see http://doc.trolltech.com/qthread.html - */ - -namespace drumstick { - -/** -@mainpage drumstick Documentation -@author Copyright © 2009-2010 Pedro López-Cabanillas <plcl AT users.sf.net> -@date 2010-04-18 -@version 0.3.1 - -This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. -To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ - -@section Abstract - -This is the reference documentation for drumstick. This library is a C++ wrapper -around the ALSA library sequencer interface, using Qt4 objects, idioms and style. -ALSA sequencer provides software support for MIDI technology on Linux. - -@see http://doc.trolltech.com/index.html -@see http://www.alsa-project.org/alsa-doc/alsa-lib/seq.html -@see http://cartan.cas.suffolk.edu/oopdocbook/opensource/index.html -@see http://www.midi.org/aboutmidi/tutorials.php - -@section Disclaimer - -This document is a work in progress, in a very early state. It will be always in -development. Please visit the drumstick web site to read the latest version. - -@see http://drumstick.sourceforge.net - -@section Introduction - -For an introduction to design and programming with C++ and Qt4, see the book -"An Introduction to Design Patterns in C++ with Qt 4" by by Alan Ezust and Paul -Ezust. It is available published on dead trees, and also - -online. - -Here is how a simple program playing a note-on MIDI message using drumstick -looks like: - -@code -#include -#include - -int main(int argc, char **argv) { - QApplication app(argc, argv, false); - - // create a client object on the heap - drumstick::MidiClient *client = new drumstick::MidiClient; - client->open(); - client->setClientName( "MyClient" ); - - // create the port - drumstick::MidiPort *port = client->createPort(); - port->setPortName( "MyPort" ); - port->setCapability( SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ ); - port->setPortType( SND_SEQ_PORT_TYPE_MIDI_GENERIC ); - // subscribe the port to some other client:port - port->subscribeTo( "20:0" ); // or "name:port", like in "KMidimon:0" - - // create an event object on the stack, to send a note on message - drumstick::NoteOnEvent ev( 0, 66, 100 ); // (channel, note number, velocity) - ev.setSource( port->getPortId() ); - ev.setSubscribers(); // deliver to all the connected ports - ev.setDirect(); // not scheduled, deliver immediately - client->output( &ev ); // or outputDirect() if you prefer not buffered - client->drainOutput(); // flush the buffer - - // close and clean - client->close(); - delete client; - return 0; -} -@endcode - -There are more examples in the source tree, under the tests/ directory, and -you can also see applications using this library, as kmetronome and kmidimon. - -@see http://kmetronome.sourceforge.net -@see http://kmidimon.sourceforge.net -@see http://kmid2.sourceforge.net - -@section Acknowledgments -Parts of this documentation are copied from the ALSA library documentation, -whose authors are: -
    -
  • Jaroslav Kysela <perex AT perex.cz>
  • -
  • Abramo Bagnara <abramo AT alsa-project.org>
  • -
  • Takashi Iwai <tiwai AT suse.de>
  • -
  • Frank van de Pol <fvdpol AT coil.demon.nl>
  • -
- -@example dumpmid.cpp -Print received sequencer events -@include dumpmid.h - -@example playsmf.cpp -SMF playback, command line interface program -@include playsmf.h - -@example smfplayer.cpp -SMF playback, graphic user interface program -@include smfplayer.h - -@example buildsmf.cpp -SMF output from scratch -@include buildsmf.h - -@example dumpsmf.cpp -SMF read and print -@include dumpsmf.h - -@example dumpwrk.cpp -Cakewalk WRK file parse and print -@include dumpwrk.h - -@example metronome.cpp -Simple command line MIDI metronome -@include metronome.h - -@example sysinfo.cpp -Prints information about the ALSA sequencer subsystem - -@example testevents.cpp -SequencerEvents test -@include testevents.h - -@example timertest.cpp -ALSA Timers test -@include timertest.h - -@example vpiano.cpp -A Virtual Piano Keyboard GUI application. See another one at http://vmpk.sf.net -@include vpiano.h - -*/ - -/** - * @addtogroup ALSAClient - * @{ - * - * ALSA clients are any entities using ALSA sequencer services. A client - * may be an application or a device driver for an external MIDI port, like - * USB MIDI devices or the MIDI/game ports of some sound cards. This library - * allows to easily create applications managing ALSA clients. - * - * ALSA clients are also file descriptors representing a sequencer device, - * that must be opened before reading or writing MIDI events. When the client - * is opened, it is given some handle and a number identifying it to other - * clients in the system. You can also provide a name for it. - * - * Each ALSA sequencer client can have several ports attached. The ports can be - * readable or writable, and can be subscribed in pairs: one readable port to - * one writable port. The subscriptions can be made and queried by external - * applications, like "aconnect" or "qjackctl". - * - * SystemInfo is an auxiliary class to query several system capabilities. - * - * The PoolInfo class represents a container to query and change some values - * for the kernel memory pool assigned to an ALSA client. - * - * The ClientInfo class is another container to query and change properties of - * the MidiClient itself. - * - * The SequencerEventHandler abstract class is used to define an interface - * that other class can implement to receive sequencer events. It is one of the - * three methods of delivering input events offered by the library. - * - * @section EventInput Input - * MidiClient uses a separate thread to receive events from the ALSA sequencer. - * The input thread can be started and stopped using the methods - * MidiClient::startSequencerInput() and MidiClient::stopSequencerInput(). - * It is necessary to have this thread in mind when using this library to read - * events. There are three delivering methods of input events: - *
    - *
  • A Callback method. To use this method, you must derive a class from - * SequencerEventHandler, overriding the method - * SequencerEventHandler::handleSequencerEvent() to provide your own event - * processing code. You must give a handler instance pointer to - * the client using MidiClient::setHandler().
  • - *
  • Using QEvent listeners. To use this method, you must have one or more - * classes derived from QObject overriding the method QObject::customEvent(). - * You must also use the method MidiClient::addListener() to add such objects - * to the client's listeners list, and MidiClient::setEventsEnabled().
  • - *
  • The third method involves signals and slots. Whenever a sequencer event - * is received, a signal MidiClient::eventReceived() is emitted, that can be - * connected to your own supplied slot(s) to process it. - *
- * The selected method depends only on your requirements and your preferences. - *
    - *
  • The Callback method is preferred for real-time usage because the handler - * receives the events without any delay, but at the same time you must - * avoid calling methods of any GUI widgets within the handler. Instead, - * you can create QEvents and call QObject::postEvent() to notify the GUI.
  • - *
  • Inside QObject::eventReceiver() you can collect QEvents and call - * any method you want, but the events are not delivered in real-time. Instead, - * they are enqueued and dispatched by the main application's event loop.
  • - *
  • The signals/slots method can be real-time or queued, depending on the - * last parameter of QObject::connect(). If it is Qt::DirectConnection, the signal - * is delivered in real-time, and the same rule about avoiding calls to any - * GUI widgets methods apply. If it is Qt::QueuedConnection, then the signal is - * enqueued using the application's event loop, and it is safe to call any GUI - * methods in this case.
  • - *
- * Whichever method you select, it excludes the other methods for the same - * program. A callback takes precedence over the others. If it is not set, then - * the events are sent if MidiClient::setEventsEnabled() is called. - * If neither a callback handler is set nor events are enabled, then the signal - * is emitted. In any case, the event pointer must be deleted by the receiver - * method. - * - * @see http://doc.trolltech.com/threads.html#qobject-reentrancy - * - * @section EventOutput Output - * - * The methods to send a single event to the ALSA sequencer are: - *
    - *
  • MidiClient::output() using the library buffer, automatically flushed.
  • - *
  • MidiClient::outputBuffer() using the library buffer. Not flushed.
  • - *
  • MidiClient::outputDirect() not using the library buffer.
  • - *
- * The two first methods usually require a call to MidiClient::drainOutput() to - * flush the ALSA library output buffer. The third one bypasses the buffer, and - * doesn't require the call to MidiClient::drainOutput(). Note that the buffer - * can be automatically drained by the first method when it becomes full. - * - * After being dispatched to the ALSA Sequencer, the events can be scheduled at - * some time in the future, or immediately. This depends on the following - * methods of the SequencerEvent class: - *
    - *
  • SequencerEvent::setDirect() not scheduled
  • - *
  • SequencerEvent::scheduleTick() scheduled in musical time (ticks)
  • - *
  • SequencerEvent::scheduleReal() scheduled in clock time (seconds)
  • - *
- * - * When you need to schedule a lot of events, for instance reproducing - * a Standard MIDI File (SMF) or a MIDI sequence, you may want to use the - * abstract class SequencerOutputThread. - * - * @section Memory - * - * There are two memory issues: the memory pool belongs to the kernel sequencer, - * and can be managed by the class PoolInfo and the methods - * MidiClient::getPoolInfo() and MidiClient::setPoolInfo(). The library buffer - * can be controlled using the methods MidiClient::getOutputBufferSize() and - * MidiClient::setOutputBufferSize() as well as MidiClient::getInputBufferSize() - * and MidiClient::setInputBufferSize(). - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_client.html - * @} - */ - -/** - * Constructor. - * - * This constructor optionally gets a QObject parent. When you create a - * MidiClient with another object as parent, the MidiClient object will - * automatically add itself to the parent's children() list. The parent takes - * ownership of the object i.e. it will automatically delete its children in - * its destructor. - * - * It is necessary to invoke open() later to get the sequencer client handler - * from the ALSA sequencer subsystem. - * - * @param parent The optional parent object - * @return a MidiClient instance - */ -MidiClient::MidiClient( QObject* parent ) : - QObject(parent), - m_eventsEnabled(false), - m_BlockMode(false), - m_NeedRefreshClientList(true), - m_OpenMode(SND_SEQ_OPEN_DUPLEX), - m_DeviceName("default"), - m_SeqHandle(NULL), - m_Thread(NULL), - m_Queue(NULL), - m_handler(NULL) -{ } - -/** - * Destructor. - * - * The ports and queue associated to this client are automatically released. - */ -MidiClient::~MidiClient() -{ - stopSequencerInput(); - detachAllPorts(); - if (m_Queue != NULL) - delete m_Queue; - close(); - freeClients(); - if (m_Thread != NULL) - delete m_Thread; -} - -/** - * Open the sequencer device. - * - * When opening the MidiClient instance, several properties may optionally - * be set as the device name, the open mode and block mode. Default values - * are provided for them. After a successful open, an event with - * SND_SEQ_EVENT_CLIENT_START is broadcast to the announce port. - * - * @param deviceName the sequencer device name, default value = "default". - * This is not a name you make up for your own purposes; it has special - * significance to the ALSA library. Usually you need to pass "default" here. - * @param openMode the open mode, default value = SND_SEQ_OPEN_DUPLEX. - * The read/write mode of the sequencer. Can be one of these three values: - *
    - *
  • SND_SEQ_OPEN_OUTPUT - open the sequencer for output only
  • - *
  • SND_SEQ_OPEN_INPUT - open the sequencer for input only
  • - *
  • SND_SEQ_OPEN_DUPLEX - open the sequencer for output and input
  • - *
- * @param blockMode open in blocking mode, default value = false. - */ -void -MidiClient::open( const QString deviceName, - const int openMode, - const bool blockMode) -{ - CHECK_ERROR( snd_seq_open( &m_SeqHandle, deviceName.toLocal8Bit().data(), - openMode, blockMode ? 0 : SND_SEQ_NONBLOCK ) ); - CHECK_WARNING( snd_seq_get_client_info( m_SeqHandle, m_Info.m_Info ) ); - m_DeviceName = deviceName; - m_OpenMode = openMode; - m_BlockMode = blockMode; -} - -/** - * Open the sequencer device, providing a configuration object pointer. - * - * This method is like open() except that a configuration is explicitly - * provided. After a successful open, an event with SND_SEQ_EVENT_CLIENT_START - * type is broadcasted from the announce port. - * - * @param conf a configuration object pointer. - * @param deviceName the sequencer device name, default value = "default". - * This is not a name you make up for your own purposes; it has special - * significance to the ALSA library. Usually you need to pass "default" here. - * @param openMode the open mode, default value = SND_SEQ_OPEN_DUPLEX. - * The read/write mode of the sequencer. Can be one of these three values: - *
    - *
  • SND_SEQ_OPEN_OUTPUT - open the sequencer for output only
  • - *
  • SND_SEQ_OPEN_INPUT - open the sequencer for input only
  • - *
  • SND_SEQ_OPEN_DUPLEX - open the sequencer for output and input
  • - *
- * @param blockMode open in blocking mode, default value = false. - */ -void -MidiClient::open( snd_config_t* conf, - const QString deviceName, - const int openMode, - const bool blockMode ) -{ - CHECK_ERROR( snd_seq_open_lconf( &m_SeqHandle, - deviceName.toLocal8Bit().data(), - openMode, - blockMode ? 0 : SND_SEQ_NONBLOCK, - conf )); - CHECK_WARNING( snd_seq_get_client_info(m_SeqHandle, m_Info.m_Info)); - m_DeviceName = deviceName; - m_OpenMode = openMode; - m_BlockMode = blockMode; -} - -/** - * Close the sequencer device. - * - * After a client is closed, an event with SND_SEQ_EVENT_CLIENT_EXIT is - * broadcast to the announce port. The connection between other clients are - * disconnected. Call this just before exiting your program. - */ -void -MidiClient::close() -{ - if (m_SeqHandle != NULL) { - stopSequencerInput(); - CHECK_WARNING(snd_seq_close(m_SeqHandle)); - m_SeqHandle = NULL; - } -} - -/** - * Gets the size of the library output buffer for the ALSA client. - * - * This buffer is used to store the decoded byte-stream of output events before - * transferring to the sequencer. - * - * @return the size of the library output buffer - */ -size_t -MidiClient::getOutputBufferSize() -{ - return snd_seq_get_output_buffer_size(m_SeqHandle); -} - -/** - * Sets the size of the library output buffer for the ALSA client. - * - * This buffer is used to store the decoded byte-stream of output events before - * transferring to the sequencer. - * - * @param newSize the size of the library output buffer - */ -void -MidiClient::setOutputBufferSize(size_t newSize) -{ - if (getOutputBufferSize() != newSize) { - CHECK_WARNING(snd_seq_set_output_buffer_size(m_SeqHandle, newSize)); - } -} - -/** - * Gets the size of the library input buffer for the ALSA client. - * - * This buffer is used to read a byte-stream of input events before - * transferring from the sequencer. - * - * @return the size of the library input buffer - */ -size_t -MidiClient::getInputBufferSize() -{ - return snd_seq_get_input_buffer_size(m_SeqHandle); -} - -/** - * Sets the size of the library input buffer for the ALSA client. - * - * This buffer is used to read a byte-stream of input events before - * transferring from the sequencer. - * - * @param newSize the size of the library input buffer - */ -void -MidiClient::setInputBufferSize(size_t newSize) -{ - if (getInputBufferSize() != newSize) { - CHECK_WARNING(snd_seq_set_input_buffer_size(m_SeqHandle, newSize)); - } -} - -/** - * Change the blocking mode of the client. - * - * In block mode, the client falls into sleep when it fills the output memory - * pool with full events. The client will be woken up after a certain amount - * of free space becomes available. - * - * @param newValue the blocking mode - */ -void -MidiClient::setBlockMode(bool newValue) -{ - if (m_BlockMode != newValue) - { - m_BlockMode = newValue; - if (m_SeqHandle != NULL) - { - CHECK_WARNING(snd_seq_nonblock(m_SeqHandle, m_BlockMode ? 0 : 1)); - } - } -} - -/** - * Gets the client ID. - * - * Returns the ID of the client. A client ID is necessary to inquiry or to set - * the client information. A user client ID is assigned from 128 to 191. - * - * @return the client ID. - */ -int -MidiClient::getClientId() -{ - return CHECK_WARNING(snd_seq_client_id(m_SeqHandle)); -} - -/** - * Returns the type snd_seq_type_t of the given sequencer handle. - * @return the type snd_seq_type_t of the given sequencer handle. - */ -snd_seq_type_t -MidiClient::getSequencerType() -{ - return snd_seq_type(m_SeqHandle); -} - -/** - * Dispatch the events received from the Sequencer. - * - * There are three methods of events delivering: - *
    - *
  • A Callback method. To use this method, you must derive a class from - * SequencerEventHandler, overriding the method - * SequencerEventHandler::handleSequencerEvent() to - * provide your own event processing. You must provide the handler instance to - * the client using setHandler().
  • - *
  • Using QEvent listeners. To use this method, you must use one or more - * classes derived from QObject overriding the method QObject::customEvent(). - * You must also use the method addListener() to add such objects to the - * client's listeners list.
  • - *
  • The third method involves signals and slots. Whenever a sequencer event - * is received, a signal eventReceived() is emitted, that can be connected to - * your own supplied slot(s) to process it. - *
- * @see ALSAClient - */ -void -MidiClient::doEvents() -{ - do { - int err = 0; - snd_seq_event_t* evp = NULL; - SequencerEvent* event = NULL; - err = snd_seq_event_input(m_SeqHandle, &evp); - if ((err >= 0) && (evp != NULL)) { - switch (evp->type) { - - case SND_SEQ_EVENT_NOTE: - event = new NoteEvent(evp); - break; - - case SND_SEQ_EVENT_NOTEON: - event = new NoteOnEvent(evp); - break; - - case SND_SEQ_EVENT_NOTEOFF: - event = new NoteOffEvent(evp); - break; - - case SND_SEQ_EVENT_KEYPRESS: - event = new KeyPressEvent(evp); - break; - - case SND_SEQ_EVENT_CONTROLLER: - case SND_SEQ_EVENT_CONTROL14: - case SND_SEQ_EVENT_REGPARAM: - case SND_SEQ_EVENT_NONREGPARAM: - event = new ControllerEvent(evp); - break; - - case SND_SEQ_EVENT_PGMCHANGE: - event = new ProgramChangeEvent(evp); - break; - - case SND_SEQ_EVENT_CHANPRESS: - event = new ChanPressEvent(evp); - break; - - case SND_SEQ_EVENT_PITCHBEND: - event = new PitchBendEvent(evp); - break; - - case SND_SEQ_EVENT_SYSEX: - event = new SysExEvent(evp); - break; - - case SND_SEQ_EVENT_PORT_SUBSCRIBED: - case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: - event = new SubscriptionEvent(evp); - break; - - case SND_SEQ_EVENT_PORT_CHANGE: - case SND_SEQ_EVENT_PORT_EXIT: - case SND_SEQ_EVENT_PORT_START: - event = new PortEvent(evp); - m_NeedRefreshClientList = true; - break; - - case SND_SEQ_EVENT_CLIENT_CHANGE: - case SND_SEQ_EVENT_CLIENT_EXIT: - case SND_SEQ_EVENT_CLIENT_START: - event = new ClientEvent(evp); - m_NeedRefreshClientList = true; - break; - - case SND_SEQ_EVENT_SONGPOS: - case SND_SEQ_EVENT_SONGSEL: - case SND_SEQ_EVENT_QFRAME: - case SND_SEQ_EVENT_TIMESIGN: - case SND_SEQ_EVENT_KEYSIGN: - event = new ValueEvent(evp); - break; - - case SND_SEQ_EVENT_SETPOS_TICK: - case SND_SEQ_EVENT_SETPOS_TIME: - case SND_SEQ_EVENT_QUEUE_SKEW: - event = new QueueControlEvent(evp); - break; - - case SND_SEQ_EVENT_TEMPO: - event = new TempoEvent(evp); - break; - - default: - event = new SequencerEvent(evp); - break; - } - // first, process the callback (if any) - if (m_handler != NULL) { - m_handler->handleSequencerEvent(event->clone()); - } else { - // second, process the event listeners - if (m_eventsEnabled) { - QObjectList::Iterator it; - for(it=m_listeners.begin(); it!=m_listeners.end(); ++it) { - QObject* sub = (*it); - QApplication::postEvent(sub, event->clone()); - } - } else { - // finally, process signals - emit eventReceived(event->clone()); - } - } - delete event; - } - } - while (snd_seq_event_input_pending(m_SeqHandle, 0) > 0); -} - -/** - * Starts reading events from the ALSA sequencer. - */ -void -MidiClient::startSequencerInput() -{ - if (m_Thread == NULL) { - m_Thread = new SequencerInputThread(this, 500); - m_Thread->start(QThread::TimeCriticalPriority); - } -} - -/** - * Stops reading events from the ALSA sequencer. - */ -void -MidiClient::stopSequencerInput() -{ - int counter = 0; - if (m_Thread != NULL) { - m_Thread->stop(); - while (!m_Thread->wait(500) && (counter < 10)) { - counter++; - } - if (!m_Thread->isFinished()) { - m_Thread->terminate(); - } - delete m_Thread; - } -} - -/** - * Reads the ALSA sequencer's clients list. - */ -void -MidiClient::readClients() -{ - ClientInfo cInfo; - freeClients(); - cInfo.setClient(-1); - while (snd_seq_query_next_client(m_SeqHandle, cInfo.m_Info) >= 0) { - cInfo.readPorts(this); - m_ClientList.append(cInfo); - } - m_NeedRefreshClientList = false; -} - -/** - * Releases the list of ALSA sequencer's clients. - */ -void -MidiClient::freeClients() -{ - m_ClientList.clear(); -} - -/** - * Gets the list of clients from the ALSA sequencer. - * @return the list of clients. - */ -ClientInfoList -MidiClient::getAvailableClients() -{ - if (m_NeedRefreshClientList) - readClients(); - ClientInfoList lst = m_ClientList; // copy - return lst; -} - -/** - * Gets the ClientInfo object holding data about this client. - * @return the ClientInfo object representing this client. - */ -ClientInfo& -MidiClient::getThisClientInfo() -{ - snd_seq_get_client_info(m_SeqHandle, m_Info.m_Info); - return m_Info; -} - -/** - * Sets the data supplied by the ClientInfo object into the ALSA sequencer - * client. This allows to change the name, capabilities, type and other data - * in a single step. - * - * @param val a ClientInfo object reference - */ -void -MidiClient::setThisClientInfo(const ClientInfo& val) -{ - m_Info = val; - snd_seq_set_client_info(m_SeqHandle, m_Info.m_Info); -} - -/** - * This internal method applies the ClientInfo data to the ALSA sequencer client - */ -void -MidiClient::applyClientInfo() -{ - if (m_SeqHandle != NULL) { - snd_seq_set_client_info(m_SeqHandle, m_Info.m_Info); - } -} - -/** - * Gets the client's public name - * @return The client's name - */ -QString -MidiClient::getClientName() -{ - return m_Info.getName(); -} - -/** - * Gets the public name corresponding to the given Client ID. - * @param clientId The ID of any existing sequencer client - * @return The client's name - */ -QString -MidiClient::getClientName(const int clientId) -{ - ClientInfoList::Iterator it; - if (m_NeedRefreshClientList) - readClients(); - for (it = m_ClientList.begin(); it != m_ClientList.end(); ++it) { - if ((*it).getClientId() == clientId) { - return (*it).getName(); - } - } - return QString(); -} - -/** - * Changes the public name of the ALSA sequencer client. - * @param newName A new public name - */ -void -MidiClient::setClientName(QString const& newName) -{ - if (newName != m_Info.getName()) { - m_Info.setName(newName); - applyClientInfo(); - } -} - -/** - * Gets the list of MidiPort instances belonging to this client. - * @return The list of MidiPort instances. - */ -MidiPortList -MidiClient::getMidiPorts() const -{ - return m_Ports; -} - -/** - * Create and attach a new MidiPort instance to this client. - * @return The pointer to the new MidiPort instance. - */ -MidiPort* -MidiClient::createPort() -{ - MidiPort* port = new MidiPort(this); - port->attach(this); - return port; -} - -/** - * Attach a MidiPort instance to this client - * @param port The MidiPort to be attached - */ -void -MidiClient::portAttach(MidiPort* port) -{ - if (m_SeqHandle != NULL) { - CHECK_ERROR(snd_seq_create_port(m_SeqHandle, port->m_Info.m_Info)); - m_Ports.push_back(port); - } -} - -/** - * Detach a MidiPort instance from this client - * @param port The MidiPort to be detached - */ -void -MidiClient::portDetach(MidiPort* port) -{ - if (m_SeqHandle != NULL) { - if(port->getPortInfo()->getClient() == getClientId()) - { - return; - } - CHECK_ERROR(snd_seq_delete_port(m_SeqHandle, port->getPortInfo()->getPort())); - port->setMidiClient(NULL); - - MidiPortList::iterator it; - for(it = m_Ports.begin(); it != m_Ports.end(); ++it) - { - if ((*it)->getPortInfo()->getPort() == port->getPortInfo()->getPort()) - { - m_Ports.erase(it); - break; - } - } - } -} - -/** - * Detach all the ports belonging to this client. - */ -void MidiClient::detachAllPorts() -{ - if (m_SeqHandle != NULL) { - MidiPortList::iterator it; - for (it = m_Ports.begin(); it != m_Ports.end(); ++it) { - CHECK_ERROR(snd_seq_delete_port(m_SeqHandle, (*it)->getPortInfo()->getPort())); - (*it)->setMidiClient(NULL); - m_Ports.erase(it); - } - } -} - -/** - * Add an event filter to the client. - * @param evtype An event filter to be added. - */ -void -MidiClient::addEventFilter(int evtype) -{ - snd_seq_set_client_event_filter(m_SeqHandle, evtype); -} - -/** - * Gets the broadcast filter usage of the client. - * - * @return The broadcast filter. - */ -bool -MidiClient::getBroadcastFilter() -{ - return m_Info.getBroadcastFilter(); -} - -/** - * Sets the broadcast filter usage of the client. - * - * @param newValue The broadcast filter. - */ -void -MidiClient::setBroadcastFilter(bool newValue) -{ - m_Info.setBroadcastFilter(newValue); - applyClientInfo(); -} - -/** - * Get the error-bounce usage of the client. - * - * @return The error-bounce usage. - */ -bool -MidiClient::getErrorBounce() -{ - return m_Info.getErrorBounce(); -} - -/** - * Sets the error-bounce usage of the client. - * - * @param newValue The error-bounce usage. - */ -void -MidiClient::setErrorBounce(bool newValue) -{ - m_Info.setErrorBounce(newValue); - applyClientInfo(); -} - -/** - * Output an event using the library output buffer. - * - * An event is once expanded on the output buffer. The output buffer will be - * drained automatically if it becomes full. - * - * @param ev The event to be sent. - * @param async Use asynchronous mode. If false, this call will block until the - * event can be delivered. - * @param timeout The maximum time to wait in synchronous mode. - */ -void -MidiClient::output(SequencerEvent* ev, bool async, int timeout) -{ - int npfds; - pollfd* pfds; - if (async) { - CHECK_WARNING(snd_seq_event_output(m_SeqHandle, ev->getHandle())); - } else { - npfds = snd_seq_poll_descriptors_count(m_SeqHandle, POLLOUT); - pfds = (pollfd*) alloca(npfds * sizeof(pollfd)); - snd_seq_poll_descriptors(m_SeqHandle, pfds, npfds, POLLOUT); - while (snd_seq_event_output(m_SeqHandle, ev->getHandle()) < 0) - { - poll(pfds, npfds, timeout); - } - } -} - -/** - * Output an event directly to the sequencer - * - * This function sends an event to the sequencer directly not using the library - * output buffer. - * - * @param ev The event to be sent. - * @param async Use asynchronous mode. If false, this call will block until the - * event is delivered to the sequencer. - * @param timeout The maximum time to wait in synchronous mode. - */ -void MidiClient::outputDirect(SequencerEvent* ev, bool async, int timeout) -{ - int npfds; - pollfd* pfds; - if (async) { - CHECK_WARNING(snd_seq_event_output_direct(m_SeqHandle, ev->getHandle())); - } else { - npfds = snd_seq_poll_descriptors_count(m_SeqHandle, POLLOUT); - pfds = (pollfd*) alloca(npfds * sizeof(pollfd)); - snd_seq_poll_descriptors(m_SeqHandle, pfds, npfds, POLLOUT); - while (snd_seq_event_output_direct(m_SeqHandle, ev->getHandle()) < 0) - { - poll(pfds, npfds, timeout); - } - } -} - -/** - * Output an event using the library output buffer, without draining the buffer. - * - * An event is once expanded on the output buffer. The output buffer will NOT be - * drained automatically if it becomes full. - * - * @param ev The event to be sent. - */ -void -MidiClient::outputBuffer(SequencerEvent* ev) -{ - CHECK_WARNING(snd_seq_event_output_buffer(m_SeqHandle, ev->getHandle())); -} - -/** - * Drain the library output buffer. - * - * This function drains all pending events on the output buffer. The function - * returns immediately after the events are sent to the queues regardless - * whether the events are processed or not. - * - * @param async Use asynchronous mode. If false, this call will block until the - * buffer can be flushed. - * @param timeout The maximum time to wait in synchronous mode. - */ -void MidiClient::drainOutput(bool async, int timeout) -{ - int npfds; - pollfd* pfds; - if (async) { - CHECK_WARNING(snd_seq_drain_output(m_SeqHandle)); - } else { - npfds = snd_seq_poll_descriptors_count(m_SeqHandle, POLLOUT); - pfds = (pollfd*) alloca(npfds * sizeof(pollfd)); - snd_seq_poll_descriptors(m_SeqHandle, pfds, npfds, POLLOUT); - while (snd_seq_drain_output(m_SeqHandle) < 0) - { - poll(pfds, npfds, timeout); - } - } -} - -/** - * Wait until all sent events are processed. - * - * This function waits until all events of this client are processed. - */ -void -MidiClient::synchronizeOutput() -{ - snd_seq_sync_output_queue(m_SeqHandle); -} - -/** - * Get the MidiQueue instance associated to this client. - * If the client is not associated to a MidiQueue, one is created. - * @return A MidiQueue instance pointer - */ -MidiQueue* -MidiClient::getQueue() -{ - if (m_Queue == NULL) { - createQueue(); - } - return m_Queue; -} - -/** - * Create and return a new MidiQueue associated to this client. - * @return A new MidiQueue instance. - */ -MidiQueue* -MidiClient::createQueue() -{ - if (m_Queue != NULL) { - delete m_Queue; - } - m_Queue = new MidiQueue(this, this); - return m_Queue; -} - -/** - * Create and return a new MidiQueue with the given name, associated to this - * client. - * @param queueName The name for the new queue. - * @return A new MidiQueue instance. - */ -MidiQueue* -MidiClient::createQueue(QString const& queueName ) -{ - if (m_Queue != NULL) { - delete m_Queue; - } - m_Queue = new MidiQueue(this, queueName, this); - return m_Queue; -} - -/** - * Create a new MidiQueue instance using a queue already existing in the - * system, associating it to the client. - * - * @param queue_id An existing queue identifier. - * @return A new MidiQueue instance. - */ -MidiQueue* -MidiClient::useQueue(int queue_id) -{ - if (m_Queue != NULL) { - delete m_Queue; - } - m_Queue = new MidiQueue(this, queue_id, this); - return m_Queue; -} - -/** - * Create a new MidiQueue instance using a queue already existing in the - * system, associating it to the client. - * - * @param name An existing queue name. - * @return A new MidiQueue instance. - */ -MidiQueue* -MidiClient::useQueue(const QString& name) -{ - if (m_Queue != NULL) { - delete m_Queue; - } - int queue_id = getQueueId(name); - if ( queue_id >= 0) { - m_Queue = new MidiQueue(this, queue_id, this); - } - return m_Queue; -} - -/** - * Associate an existing MidiQueue instance to the client. - * - * @param queue An existing MidiQueue. - * @return The provided MidiQueue instance. - */ -MidiQueue* -MidiClient::useQueue(MidiQueue* queue) -{ - if (m_Queue != NULL) { - delete m_Queue; - } - queue->setParent(this); - m_Queue = queue; - return m_Queue; -} - -/** - * Get a list of the existing queues - * @return a list of existing queues - */ -QList -MidiClient::getAvailableQueues() -{ - int q, err, max; - QList queues; - snd_seq_queue_info_t* qinfo; - snd_seq_queue_info_alloca(&qinfo); - max = getSystemInfo().getMaxQueues(); - for ( q = 0; q < max; ++q ) { - err = snd_seq_get_queue_info(m_SeqHandle, q, qinfo); - if (err == 0) { - queues.append(q); - } - } - return queues; -} - -/** - * Gets a list of the available user ports in the system, filtered by the given - * bitmap of desired capabilities. - * - * @param filter A bitmap of capabilities. - * @return A filtered list of the available ports in the system. - */ -PortInfoList -MidiClient::filterPorts(unsigned int filter) -{ - PortInfoList result; - ClientInfoList::ConstIterator itc; - PortInfoList::ConstIterator itp; - - if (m_NeedRefreshClientList) - readClients(); - - for (itc = m_ClientList.constBegin(); itc != m_ClientList.constEnd(); ++itc) { - ClientInfo ci = (*itc); - if ((ci.getClientId() == SND_SEQ_CLIENT_SYSTEM) || - (ci.getClientId() == m_Info.getClientId())) - continue; - PortInfoList lstPorts = ci.getPorts(); - for(itp = lstPorts.constBegin(); itp != lstPorts.constEnd(); ++itp) { - PortInfo pi = (*itp); - unsigned int cap = pi.getCapability(); - if ( ((filter & cap) != 0) && - ((SND_SEQ_PORT_CAP_NO_EXPORT & cap) == 0) ) { - result.append(pi); - } - } - } - return result; -} - -/** - * Update the internal lists of user ports. - */ -void -MidiClient::updateAvailablePorts() -{ - m_InputsAvail.clear(); - m_OutputsAvail.clear(); - m_InputsAvail = filterPorts( SND_SEQ_PORT_CAP_READ | - SND_SEQ_PORT_CAP_SUBS_READ ); - m_OutputsAvail = filterPorts( SND_SEQ_PORT_CAP_WRITE | - SND_SEQ_PORT_CAP_SUBS_WRITE ); -} - -/** - * Gets the available user input ports in the system. - * @return The list of available input ports. - */ -PortInfoList -MidiClient::getAvailableInputs() -{ - m_NeedRefreshClientList = true; - updateAvailablePorts(); - return m_InputsAvail; -} - -/** - * Gets the available user output ports in the system. - * @return The list of available output ports. - */ -PortInfoList -MidiClient::getAvailableOutputs() -{ - m_NeedRefreshClientList = true; - updateAvailablePorts(); - return m_OutputsAvail; -} - -/** - * Adds a QObject to the listeners list. This object should override the method - * QObject::customEvent() to receive SequencerEvent instances. - * @param listener A QObject listener to be notified of received events. - * @see removeListener(), setEventsEnabled() - */ -void -MidiClient::addListener(QObject* listener) -{ - m_listeners.append(listener); -} - -/** - * Removes a QObject listener from the listeners list. - * @param listener listener A QObject listener to be removed of received events. - * @see addListener(), setEventsEnabled() - */ -void -MidiClient::removeListener(QObject* listener) -{ - m_listeners.removeAll(listener); -} - -/** - * Enables the notification of received SequencerEvent instances to the listeners - * registered with addListener() - * @param bEnabled The new state of the events delivering mode. - * @see addListener(), removeListener(), setEventsEnabled() - */ -void -MidiClient::setEventsEnabled(bool bEnabled) -{ - if (bEnabled != m_eventsEnabled) { - m_eventsEnabled = bEnabled; - } -} - -/** - * Gets a SystemInfo instance with the updated state of the system. - * @return The updated system info. - */ -SystemInfo& -MidiClient::getSystemInfo() -{ - snd_seq_system_info(m_SeqHandle, m_sysInfo.m_Info); - return m_sysInfo; -} - -/** - * Gets a PoolInfo instance with an updated state of the client memory pool - * @return The updated memory pool state. - */ -PoolInfo& -MidiClient::getPoolInfo() -{ - snd_seq_get_client_pool(m_SeqHandle, m_poolInfo.m_Info); - return m_poolInfo; -} - -/** - * Applies (updates) the client's PoolInfo data into the system. - * @param info The PoolInfo reference to be applied to the client. - */ -void -MidiClient::setPoolInfo(const PoolInfo& info) -{ - m_poolInfo = info; - CHECK_WARNING(snd_seq_set_client_pool(m_SeqHandle, m_poolInfo.m_Info)); -} - -/** - * Resets the client input pool. - * @see dropInput() - */ -void -MidiClient::resetPoolInput() -{ - CHECK_WARNING(snd_seq_reset_pool_input(m_SeqHandle)); -} - -/** - * Resets the client output pool. - * @see dropOutput() - */ -void -MidiClient::resetPoolOutput() -{ - CHECK_WARNING(snd_seq_reset_pool_output(m_SeqHandle)); -} - -/** - * Sets the size of the client's input pool. - * @param size The new size - */ -void -MidiClient::setPoolInput(int size) -{ - CHECK_WARNING(snd_seq_set_client_pool_input(m_SeqHandle, size)); -} - -/** - * Sets the size of the client's output pool. - * @param size The new size - */ -void -MidiClient::setPoolOutput(int size) -{ - CHECK_WARNING(snd_seq_set_client_pool_output(m_SeqHandle, size)); -} - -/** - * Sets the room size of the client's output pool. - * @param size The new size - */ -void -MidiClient::setPoolOutputRoom(int size) -{ - CHECK_WARNING(snd_seq_set_client_pool_output_room(m_SeqHandle, size)); -} - -/** - * Clears the client's input buffer and and remove events in sequencer queue. - * @see resetPoolInput() - */ -void -MidiClient::dropInput() -{ - CHECK_WARNING(snd_seq_drop_input(m_SeqHandle)); -} - -/** - * Remove all events on user-space input buffer. - * @see dropInput() - */ -void -MidiClient::dropInputBuffer() -{ - CHECK_WARNING(snd_seq_drop_input_buffer(m_SeqHandle)); -} - -/** - * Clears the client's output buffer and and remove events in sequencer queue. - * - * This method removes all events on both user-space output buffer and output - * memory pool on kernel. - * @see resetPoolOutput() - */ -void -MidiClient::dropOutput() -{ - CHECK_WARNING(snd_seq_drop_output(m_SeqHandle)); -} - -/** - * Removes all events on the library output buffer. - * - * Removes all events on the user-space output buffer. Unlike dropOutput(), this - * method doesn't remove events on the client's output memory pool. - * @see dropOutput() - */ -void -MidiClient::dropOutputBuffer() -{ - CHECK_WARNING(snd_seq_drop_output_buffer(m_SeqHandle)); -} - -/** - * Removes events on input/output buffers and pools. - * Removes matching events with the given condition from input/output buffers - * and pools. The removal condition is specified in the spec argument. - * @param spec A RemoveEvents instance specifying the removal condition. - */ -void -MidiClient::removeEvents(const RemoveEvents* spec) -{ - CHECK_WARNING(snd_seq_remove_events(m_SeqHandle, spec->m_Info)); -} - -/** - * Extracts (and removes) the first event in the output buffer. - * @return The extracted event. - */ -SequencerEvent* -MidiClient::extractOutput() -{ - snd_seq_event_t* ev; - if (CHECK_WARNING(snd_seq_extract_output(m_SeqHandle, &ev) == 0)) { - return new SequencerEvent(ev); - } - return NULL; -} - -/** - * Returns the size of pending events on the output buffer. - * - * @return The size of pending events. - */ -int -MidiClient::outputPending() -{ - return snd_seq_event_output_pending(m_SeqHandle); -} - -/** - * Gets the size of the events on the input buffer. - * - * If there are events remaining on the user-space input buffer, this method - * returns the total size of events on it. If the argument is true, this method - * checks the presence of events on the sequencer FIFO, and when events exist - * they are transferred to the input buffer, and the number of received events - * are returned. If the argument is false and no events remain on the input - * buffer, this method simply returns zero. - * - * @param fetch Check and fetch the sequencer input pool. - * @return The size in bytes of the remaining input events on the buffer. - */ -int -MidiClient::inputPending(bool fetch) -{ - return snd_seq_event_input_pending(m_SeqHandle, fetch ? 1 : 0); -} - -/** - * Gets the queue's numeric identifier corresponding to the provided name. - * - * @param name The name string to query. - * @return The number of the matching queue. - */ -int -MidiClient::getQueueId(const QString& name) -{ - return snd_seq_query_named_queue(m_SeqHandle, name.toLocal8Bit().data()); -} - -/** - * Returns the number of poll descriptors. - * @param events Poll events to be checked (POLLIN and POLLOUT). - * @return The number of poll descriptors. - */ -int -MidiClient::getPollDescriptorsCount(short events) -{ - return snd_seq_poll_descriptors_count(m_SeqHandle, events); -} - -/** - * Get poll descriptors. - * - * Get poll descriptors assigned to the sequencer handle. Since a sequencer - * handle can duplex streams, you need to set which direction(s) is/are polled - * in events argument. When POLLIN bit is specified, the incoming events to the - * ports are checked. - * - * @param pfds Array of poll descriptors - * @param space Space in the poll descriptor array - * @param events Polling events to be checked (POLLIN and POLLOUT) - * @return Count of filled descriptors - */ -int -MidiClient::pollDescriptors( struct pollfd *pfds, unsigned int space, - short events ) -{ - return snd_seq_poll_descriptors(m_SeqHandle, pfds, space, events); -} - -/** - * Gets the number of returned events from poll descriptors - * @param pfds Array of poll descriptors. - * @param nfds Count of poll descriptors. - * @return Number of returned events. - */ -unsigned short -MidiClient::pollDescriptorsRevents(struct pollfd *pfds, unsigned int nfds) -{ - unsigned short revents; - CHECK_WARNING( snd_seq_poll_descriptors_revents( m_SeqHandle, - pfds, nfds, - &revents )); - return revents; -} - -/** - * Gets the internal sequencer device name - * @return The device name. - */ -const char * -MidiClient::_getDeviceName() -{ - return snd_seq_name(m_SeqHandle); -} - -/** - * Sets the client name - * @param name The new client name. - */ -void -MidiClient::_setClientName(const char *name) -{ - CHECK_WARNING(snd_seq_set_client_name(m_SeqHandle, name)); -} - -/** - * Create an ALSA sequencer port, without using MidiPort. - * @param name The name of the new port. - * @param caps The new port capabilities. - * @param type The type of the new port. - * @return The port numeric identifier. - */ -int -MidiClient::createSimplePort( const char *name, - unsigned int caps, - unsigned int type ) -{ - return CHECK_WARNING( snd_seq_create_simple_port( m_SeqHandle, - name, caps, type )); -} - -/** - * Remove an ALSA sequencer port. - * @param port The numeric identifier of the port. - */ -void -MidiClient::deleteSimplePort(int port) -{ - CHECK_WARNING( snd_seq_delete_simple_port( m_SeqHandle, port )); -} - -/** - * Subscribe one port from another arbitrary sequencer client:port. - * @param myport The number of the internal port. - * @param client The external client's identifier. - * @param port The external port's identifier. - */ -void -MidiClient::connectFrom(int myport, int client, int port) -{ - CHECK_WARNING( snd_seq_connect_from(m_SeqHandle, myport, client, port )); -} - -/** - * Subscribe one port to another arbitrary sequencer client:port. - * @param myport The number of the internal port. - * @param client The external client's identifier. - * @param port The external port's identifier. - */ -void -MidiClient::connectTo(int myport, int client, int port) -{ - CHECK_WARNING( snd_seq_connect_to(m_SeqHandle, myport, client, port )); -} - -/** - * Unsubscribe one port from another arbitrary sequencer client:port. - * @param myport The number of the internal port. - * @param client The external client's identifier. - * @param port The external port's identifier. - */ -void -MidiClient::disconnectFrom(int myport, int client, int port) -{ - CHECK_WARNING( snd_seq_disconnect_from(m_SeqHandle, myport, client, port )); -} - -/** - * Unsubscribe one port to another arbitrary sequencer client:port. - * @param myport The number of the internal port. - * @param client The external client's identifier. - * @param port The external port's identifier. - */ -void -MidiClient::disconnectTo(int myport, int client, int port) -{ - CHECK_WARNING( snd_seq_disconnect_to(m_SeqHandle, myport, client, port )); -} - -/** - * Parse a text address representation, returning an ALSA address record. - * - * This function can be used as a replacement of the standard ALSA function - * snd_seq_parse_address(). - * - * @param straddr source text address representation - * @param addr returned ALSA address record - * @return true if the text address was successfully parsed - */ -bool -MidiClient::parseAddress( const QString& straddr, snd_seq_addr& addr ) -{ - bool ok(false); - QString testClient, testPort; - ClientInfoList::ConstIterator cit; - int pos = straddr.indexOf(':'); - if (pos > -1) { - testClient = straddr.left(pos); - testPort = straddr.mid(pos+1); - } else { - testClient = straddr; - testPort = '0'; - } - addr.client = testClient.toInt(&ok); - if (ok) - addr.port = testPort.toInt(&ok); - if (!ok) { - if (m_NeedRefreshClientList) - readClients(); - for ( cit = m_ClientList.constBegin(); - cit != m_ClientList.constEnd(); ++cit ) { - ClientInfo ci = *cit; - if (testClient.compare(ci.getName(), Qt::CaseInsensitive) == 0) { - addr.client = ci.getClientId(); - addr.port = testPort.toInt(&ok); - return ok; - } - } - } - return ok; -} - -/** - * Returns true or false depending on the input thread state. - * @return true if the input thread is stopped. - */ -bool -MidiClient::SequencerInputThread::stopped() -{ - m_mutex.lockForRead(); - bool bTmp = m_Stopped; - m_mutex.unlock(); - return bTmp; -} - -/** - * Stops the input thread. - */ -void -MidiClient::SequencerInputThread::stop() -{ - m_mutex.lockForWrite(); - m_Stopped = true; - m_mutex.unlock(); -} - -/** - * Starts the input thread. - * @param priority the thread priority, default is InheritPriority - * @since 0.2.0 - */ -void -MidiClient::SequencerInputThread::start( Priority priority ) -{ - int rc; - struct sched_param p; - - QThread::start(priority); - - if ( priority == TimeCriticalPriority ) { - ::memset(&p, 0, sizeof(p)); - p.sched_priority = 6; - rc = ::pthread_setschedparam(pthread_self(), SCHED_FIFO, &p); - if (rc != 0) { - qWarning() << "pthread_setschedparam to SCHED_FIFO failed, rc=" - << rc << ::strerror(rc); - } - } -} - -/** - * Main input thread process loop. - */ -void -MidiClient::SequencerInputThread::run() -{ - unsigned long npfd; - pollfd* pfd; - int rt; - - if (m_MidiClient != NULL) { - npfd = snd_seq_poll_descriptors_count(m_MidiClient->getHandle(), POLLIN); - pfd = (pollfd *) alloca(npfd * sizeof(pollfd)); - try - { - snd_seq_poll_descriptors(m_MidiClient->getHandle(), pfd, npfd, POLLIN); - while (!stopped() && (m_MidiClient != NULL)) - { - rt = poll(pfd, npfd, m_Wait); - if (rt > 0) { - m_MidiClient->doEvents(); - } - } - } - catch (...) - { - qWarning() << "exception in input thread"; - } - } -} - -/** - * Default constructor - */ -ClientInfo::ClientInfo() -{ - snd_seq_client_info_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Another ClientInfo reference to be copied - */ -ClientInfo::ClientInfo(const ClientInfo& other) -{ - snd_seq_client_info_malloc(&m_Info); - snd_seq_client_info_copy(m_Info, other.m_Info); - m_Ports = other.m_Ports; -} - -/** - * Copy constructor - * @param other An existing ALSA client info object - */ -ClientInfo::ClientInfo(snd_seq_client_info_t* other) -{ - snd_seq_client_info_malloc(&m_Info); - snd_seq_client_info_copy(m_Info, other); -} - -/** - * Constructor - * @param seq A MidiClient object - * @param id A numeric client id - */ -ClientInfo::ClientInfo(MidiClient* seq, int id) -{ - snd_seq_client_info_malloc(&m_Info); - snd_seq_get_any_client_info(seq->getHandle(), id, m_Info); -} - -/** - * Destructor - */ -ClientInfo::~ClientInfo() -{ - freePorts(); - snd_seq_client_info_free(m_Info); -} - -/** - * Clone the client info object. - * @return A pointer to the new object. - */ -ClientInfo* -ClientInfo::clone() -{ - return new ClientInfo(m_Info); -} - -/** - * Assignment operator - * @param other Another ClientInfo object - * @return This object - */ -ClientInfo& -ClientInfo::operator=(const ClientInfo& other) -{ - snd_seq_client_info_copy(m_Info, other.m_Info); - m_Ports = other.m_Ports; - return *this; -} - -/** - * Gets the client's numeric identifier. - * @return The client's numeric identifier. - */ -int -ClientInfo::getClientId() -{ - return snd_seq_client_info_get_client(m_Info); -} - -/** - * Gets the client's type - * @return The client's type. - */ -snd_seq_client_type_t -ClientInfo::getClientType() -{ - return snd_seq_client_info_get_type(m_Info); -} - -/** - * Gets the client's name - * @return The client's name. - */ -QString -ClientInfo::getName() -{ - return QString(snd_seq_client_info_get_name(m_Info)); -} - -/** - * Gets the client's broadcast filter - * @return The client's broadcast filter. - */ -bool -ClientInfo::getBroadcastFilter() -{ - return (snd_seq_client_info_get_broadcast_filter(m_Info) != 0); -} - -/** - * Gets the client's error bounce - * @return The client's error bounce. - */ -bool -ClientInfo::getErrorBounce() -{ - return (snd_seq_client_info_get_error_bounce(m_Info) != 0); -} - -/** - * Gets the client's event filter. - * @return The client's event filter. - * @deprecated - */ -const unsigned char* -ClientInfo::getEventFilter() -{ - return snd_seq_client_info_get_event_filter(m_Info); -} - -/** - * Gets the client's port count. - * @return The client's port count. - */ -int -ClientInfo::getNumPorts() -{ - return snd_seq_client_info_get_num_ports(m_Info); -} - -/** - * Gets the number of lost events. - * @return The number of lost events. - */ -int -ClientInfo::getEventLost() -{ - return snd_seq_client_info_get_event_lost(m_Info); -} - -/** - * Sets the client identifier number. - * @param client The client identifier number. - */ -void -ClientInfo::setClient(int client) -{ - snd_seq_client_info_set_client(m_Info, client); -} - -/** - * Sets the client name. - * @param name The client name. - */ -void -ClientInfo::setName(QString name) -{ - snd_seq_client_info_set_name(m_Info, name.toLocal8Bit().data()); -} - -/** - * Sets the broadcast filter. - * @param val The broadcast filter. - */ -void -ClientInfo::setBroadcastFilter(bool val) -{ - snd_seq_client_info_set_broadcast_filter(m_Info, val ? 1 : 0); -} - -/** - * Sets the error bounce. - * @param val The error bounce. - */ -void -ClientInfo::setErrorBounce(bool val) -{ - snd_seq_client_info_set_error_bounce(m_Info, val ? 1 : 0); -} - -/** - * Sets the event filter. - * @param filter The event filter. - * @deprecated - */ -void -ClientInfo::setEventFilter(unsigned char *filter) -{ - snd_seq_client_info_set_event_filter(m_Info, filter); -} - -/** - * Read the client ports. - * @param seq The client instance. - */ -void -ClientInfo::readPorts(MidiClient* seq) -{ - PortInfo info; - freePorts(); - info.setClient(getClientId()); - info.setClientName(getName()); - info.setPort(-1); - while (snd_seq_query_next_port(seq->getHandle(), info.m_Info) >= 0) { - info.readSubscribers(seq); - m_Ports.append(info); - } -} - -/** - * Release the ports list. - */ -void -ClientInfo::freePorts() -{ - m_Ports.clear(); -} - -/** - * Gets the ports list. - * @return The ports list. - */ -PortInfoList -ClientInfo::getPorts() const -{ - PortInfoList lst = m_Ports; // copy - return lst; -} - -/** - * Gets the size of the internal object. - * @return The size of the internal object. - */ -int -ClientInfo::getSizeOfInfo() const -{ - return snd_seq_client_info_sizeof(); -} - -#if SND_LIB_VERSION > 0x010010 -/** - * Adds an event type to the client's filter. - * - * @param eventType The new event's type. - */ -void -ClientInfo::addFilter(int eventType) -{ - snd_seq_client_info_event_filter_add(m_Info, eventType); -} - -/** - * Checks id the given event's type is filtered. - * @param eventType The event's type. - * @return true if the event type is filtered - */ -bool -ClientInfo::isFiltered(int eventType) -{ - return (snd_seq_client_info_event_filter_check(m_Info, eventType) != 0); -} - -/** - * Clear the client's event filter - */ -void -ClientInfo::clearFilter() -{ - snd_seq_client_info_event_filter_clear(m_Info); -} - -/** - * Removes the event type from the client's filter. - * @param eventType The event's type. - */ -void -ClientInfo::removeFilter(int eventType) -{ - snd_seq_client_info_event_filter_del(m_Info, eventType); -} -#endif - -/** - * Default constructor - */ -SystemInfo::SystemInfo() -{ - snd_seq_system_info_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Another SystemInfo object reference to be copied - */ -SystemInfo::SystemInfo(const SystemInfo& other) -{ - snd_seq_system_info_malloc(&m_Info); - snd_seq_system_info_copy(m_Info, other.m_Info); -} - -/** - * Copy constructor - * @param other Another ALSA system info object to be copied - */ -SystemInfo::SystemInfo(snd_seq_system_info_t* other) -{ - snd_seq_system_info_malloc(&m_Info); - snd_seq_system_info_copy(m_Info, other); -} - -/** - * Constructor - * @param seq A MidiClient object - */ -SystemInfo::SystemInfo(MidiClient* seq) -{ - snd_seq_system_info_malloc(&m_Info); - snd_seq_system_info(seq->getHandle(), m_Info); -} - -/** - * Destructor - */ -SystemInfo::~SystemInfo() -{ - snd_seq_system_info_free(m_Info); -} - -/** - * Clone the system info object - * @return A pointer to the new object - */ -SystemInfo* -SystemInfo::clone() -{ - return new SystemInfo(m_Info); -} - -/** - * Assignment operator - * @param other Another SystemInfo object - * @return This object - */ -SystemInfo& -SystemInfo::operator=(const SystemInfo& other) -{ - snd_seq_system_info_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Get the system's maximum number of clients. - * @return The maximum number of clients. - */ -int SystemInfo::getMaxClients() -{ - return snd_seq_system_info_get_clients(m_Info); -} - -/** - * Get the system's maximum number of ports. - * @return The maximum number of ports. - */ -int SystemInfo::getMaxPorts() -{ - return snd_seq_system_info_get_ports(m_Info); -} - -/** - * Get the system's maximum number of queues. - * @return The system's maximum number of queues. - */ -int SystemInfo::getMaxQueues() -{ - return snd_seq_system_info_get_queues(m_Info); -} - -/** - * Get the system's maximum number of channels. - * @return The system's maximum number of channels. - */ -int SystemInfo::getMaxChannels() -{ - return snd_seq_system_info_get_channels(m_Info); -} - -/** - * Get the system's current number of queues. - * @return The system's current number of queues. - */ -int SystemInfo::getCurrentQueues() -{ - return snd_seq_system_info_get_cur_queues(m_Info); -} - -/** - * Get the system's current number of clients. - * @return The system's current number of clients. - */ -int SystemInfo::getCurrentClients() -{ - return snd_seq_system_info_get_cur_clients(m_Info); -} - -/** - * Get the system's info object size. - * @return The system's info object size. - */ -int SystemInfo::getSizeOfInfo() const -{ - return snd_seq_system_info_sizeof(); -} - -/** - * Default constructor - */ -PoolInfo::PoolInfo() -{ - snd_seq_client_pool_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Another PoolInfo object reference to be copied - */ -PoolInfo::PoolInfo(const PoolInfo& other) -{ - snd_seq_client_pool_malloc(&m_Info); - snd_seq_client_pool_copy(m_Info, other.m_Info); -} - -/** - * Copy constructor - * @param other An ALSA pool info object to be copied - */ -PoolInfo::PoolInfo(snd_seq_client_pool_t* other) -{ - snd_seq_client_pool_malloc(&m_Info); - snd_seq_client_pool_copy(m_Info, other); -} - -/** - * Constructor - * @param seq A MidiClient object - */ -PoolInfo::PoolInfo(MidiClient* seq) -{ - snd_seq_client_pool_malloc(&m_Info); - snd_seq_get_client_pool(seq->getHandle(), m_Info); -} - -/** - * Destructor - */ -PoolInfo::~PoolInfo() -{ - snd_seq_client_pool_free(m_Info); -} - -/** - * Clone the pool info obeject - * @return A pointer to the new object - */ -PoolInfo* -PoolInfo::clone() -{ - return new PoolInfo(m_Info); -} - -/** - * Assignment operator - * @param other Another PoolInfo object reference to be copied - * @return This object - */ -PoolInfo& PoolInfo::operator=(const PoolInfo& other) -{ - snd_seq_client_pool_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the client ID for this object. - * @return The client ID. - */ -int -PoolInfo::getClientId() -{ - return snd_seq_client_pool_get_client(m_Info); -} - -/** - * Gets the available size on input pool. - * @return The available size on input pool. - */ -int -PoolInfo::getInputFree() -{ - return snd_seq_client_pool_get_input_free(m_Info); -} - -/** - * Gets the input pool size. - * @return The input pool size. - */ -int -PoolInfo::getInputPool() -{ - return snd_seq_client_pool_get_input_pool(m_Info); -} - -/** - * Gets the available size on output pool. - * @return The available size on output pool. - */ -int -PoolInfo::getOutputFree() -{ - return snd_seq_client_pool_get_output_free(m_Info); -} - -/** - * Gets the output pool size. - * @return The output pool size. - */ -int -PoolInfo::getOutputPool() -{ - return snd_seq_client_pool_get_output_pool(m_Info); -} - -/** - * Gets the output room size. - * The output room is the minimum pool size for select/blocking mode. - * @return The output room size. - */ -int -PoolInfo::getOutputRoom() -{ - return snd_seq_client_pool_get_output_room(m_Info); -} - -/** - * Set the input pool size. - * @param size The input pool size. - */ -void -PoolInfo::setInputPool(int size) -{ - snd_seq_client_pool_set_input_pool(m_Info, size); -} - -/** - * Sets the output pool size. - * @param size The output pool size. - */ -void -PoolInfo::setOutputPool(int size) -{ - snd_seq_client_pool_set_output_pool(m_Info, size); -} - -/** - * Sets the output room size. - * The output room is the minimum pool size for select/blocking mode. - */ -void -PoolInfo::setOutputRoom(int size) -{ - snd_seq_client_pool_set_output_room(m_Info, size); -} - -/** - * Gets the size of the client pool object. - * @return The size of the client pool object. - */ -int -PoolInfo::getSizeOfInfo() const -{ - return snd_seq_client_pool_sizeof(); -} - -#if SND_LIB_VERSION > 0x010004 -/** - * Gets the runtime ALSA library version string - * @return string representing the runtime ALSA library version - */ -QString -getRuntimeALSALibraryVersion() -{ - return QString(snd_asoundlib_version()); -} - -/** - * Gets the runtime ALSA library version number - * @return integer representing the runtime ALSA library version - */ -int -getRuntimeALSALibraryNumber() -{ - QRegExp rx("(\\d+)"); - QString str = getRuntimeALSALibraryVersion(); - bool ok; - int pos = 0, result = 0, j = 0; - while ((pos = rx.indexIn(str, pos)) != -1 && j < 3) { - int v = rx.cap(1).toInt(&ok); - if (ok) { - result <<= 8; - result += v; - } - pos += rx.matchedLength(); - j++; - } - return result; -} -#endif - -/** - * Gets the runtime ALSA drivers version string - * @return string representing the runtime ALSA drivers version - */ -QString -getRuntimeALSADriverVersion() -{ - QRegExp rx(".*Driver Version ([\\d\\.]+).*"); - QString s; - QFile f("/proc/asound/version"); - if (f.open(QFile::ReadOnly)) { - QTextStream str(&f); - if (rx.exactMatch(str.readLine().trimmed())) - s = rx.cap(1); - } - return s; -} - -/** - * Gets the runtime ALSA drivers version number - * @return integer representing the runtime ALSA drivers version - */ -int -getRuntimeALSADriverNumber() -{ - QRegExp rx("(\\d+)"); - QString str = getRuntimeALSADriverVersion(); - bool ok; - int pos = 0, result = 0, j = 0; - while ((pos = rx.indexIn(str, pos)) != -1 && j < 3) { - int v = rx.cap(1).toInt(&ok); - if (ok) { - result <<= 8; - result += v; - } - pos += rx.matchedLength(); - j++; - } - return result; -} - -} /* namespace drumstick */ diff -Nru kmetronome-0.10.0/drumstick/src/alsaevent.cpp kmetronome-0.10.1/drumstick/src/alsaevent.cpp --- kmetronome-0.10.0/drumstick/src/alsaevent.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/alsaevent.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1048 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsaevent.h" - -/** - * @file alsaevent.cpp - * Implementation of classes managing ALSA Sequencer events. - */ - -/** - * @class QEvent - * The QEvent class is the base class of all event classes. - * @see http://doc.trolltech.com/qevent.html - */ - -namespace drumstick { - -/** - * @addtogroup ALSAEvent - * @{ - * - * MIDI Events are messages transmitted between MIDI devices or applications. - * - * Classes: - * - * SequencerEvent: Base class for the event's hierarchy. - * - * ChannelEvent: Base class for the events having a Channel property. - * - * KeyEvent: Base class for the events having Key and Velocity properties. - * - * NoteEvent: Class representing a note event with duration. - * - * NoteOnEvent: Event representing a note-on MIDI event. - * - * NoteOffEvent: Event representing a note-off MIDI event. - * - * KeyPressEvent: Event representing a MIDI key pressure, or polyphonic after-touch event. - * - * ControllerEvent: Event representing a MIDI control change event. - * - * ProgramChangeEvent: Event representing a MIDI program change event. - * - * PitchBendEvent: Event representing a MIDI bender, or pitch wheel event. - * - * ChanPressEvent: Event representing a MIDI channel pressure or after-touch event. - * - * VariableEvent: Base class for variable length events. - * - * SysExEvent: Event representing a MIDI system exclusive event. - * - * TextEvent: Event representing a SMF text event. - * - * SystemEvent: Generic event. - * - * QueueControlEvent: ALSA Event representing a queue control command. - * - * ValueEvent: Generic event having a value property. - * - * TempoEvent: ALSA Event representing a tempo change for an ALSA queue. - * - * SubscriptionEvent: ALSA Event representing a subscription between two ALSA clients and ports. - * - * ClientEvent: ALSA Event representing a change on some ALSA sequencer client. - * - * PortEvent: ALSA Event representing a change on some ALSA sequencer port. - * - * RemoveEvents: Auxiliary class to remove events from an ALSA queue. - * - * MidiCodec: Auxiliary class to translate between raw MIDI streams and ALSA events. - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_event.html - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_events.html - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_ev_type.html - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___m_i_d_i___event.html - * @} - */ - - -/** - * Default constructor. - */ -SequencerEvent::SequencerEvent() : QEvent(SequencerEventType) -{ - snd_seq_ev_clear( &m_event ); -} - -/** - * Constructor from an ALSA event record - * @param event ALSA event record - */ -SequencerEvent::SequencerEvent(snd_seq_event_t* event) : QEvent(SequencerEventType) -{ - snd_seq_ev_clear( &m_event ); - m_event = *event; -} - -/** - * Copy constructor - * @param other A SequencerEvent object reference - */ -SequencerEvent::SequencerEvent(const SequencerEvent& other) : QEvent(SequencerEventType) -{ - snd_seq_ev_clear( &m_event ); - m_event = other.m_event; -} - -/** - * Assignment operator - * @param other A SequencerEvent object reference - * @return This object - */ -SequencerEvent& -SequencerEvent::operator=(const SequencerEvent& other) -{ - m_event = other.m_event; - return *this; -} - -/** - * Checks if the event's type is a subscription. - * @param event A SequencerEvent object pointer - * @return True if the event has a subscribe/unsubscribe type. - */ -bool -SequencerEvent::isSubscription(const SequencerEvent* event) -{ - snd_seq_event_type_t te = event->getSequencerType(); - return ( te == SND_SEQ_EVENT_PORT_SUBSCRIBED || - te == SND_SEQ_EVENT_PORT_UNSUBSCRIBED ); -} - -/** - * Checks if the event's type is of type port. - * @param event A SequencerEvent object pointer - * @return True if the event has a port start/exit/change type. - */ -bool -SequencerEvent::isPort(const SequencerEvent* event) -{ - snd_seq_event_type_t te = event->getSequencerType(); - return ( te == SND_SEQ_EVENT_PORT_START || - te == SND_SEQ_EVENT_PORT_EXIT || - te == SND_SEQ_EVENT_PORT_CHANGE ); -} - -/** - * Checks if the event's type is of type client. - * @param event A SequencerEvent object pointer - * @return True if the event has a client start/exit/change type. - */ -bool -SequencerEvent::isClient(const SequencerEvent* event) -{ - snd_seq_event_type_t te = event->getSequencerType(); - return ( te == SND_SEQ_EVENT_CLIENT_START || - te == SND_SEQ_EVENT_CLIENT_EXIT || - te == SND_SEQ_EVENT_CLIENT_CHANGE ); -} - -/** - * Checks if the event's type is of type connection change. - * @param event A SequencerEvent object pointer - * @return True if the event has a client/port/subscription type. - */ -bool -SequencerEvent::isConnectionChange(const SequencerEvent* event) -{ - snd_seq_event_type_t te = event->getSequencerType(); - return ( te == SND_SEQ_EVENT_PORT_START || - te == SND_SEQ_EVENT_PORT_EXIT || - te == SND_SEQ_EVENT_PORT_CHANGE || - te == SND_SEQ_EVENT_CLIENT_START || - te == SND_SEQ_EVENT_CLIENT_EXIT || - te == SND_SEQ_EVENT_CLIENT_CHANGE || - te == SND_SEQ_EVENT_PORT_SUBSCRIBED || - te == SND_SEQ_EVENT_PORT_UNSUBSCRIBED ); -} - -/** - * Checks if the event's type is a Channel Voice message. - * @param event A SequencerEvent object pointer - * @return True if the event is a channel voice message. - * @since 0.2.0 - */ -bool -SequencerEvent::isChannel(const SequencerEvent* event) -{ - snd_seq_event_type_t te = event->getSequencerType(); - return ( te == SND_SEQ_EVENT_NOTEOFF || - te == SND_SEQ_EVENT_NOTEON || - te == SND_SEQ_EVENT_NOTE || - te == SND_SEQ_EVENT_KEYPRESS || - te == SND_SEQ_EVENT_CONTROLLER || - te == SND_SEQ_EVENT_CONTROL14 || - te == SND_SEQ_EVENT_PGMCHANGE || - te == SND_SEQ_EVENT_CHANPRESS || - te == SND_SEQ_EVENT_PITCHBEND ); -} - -/** - * Sets the event's ALSA sequencer type - * @param eventType The ALSA sequencer type - */ -void SequencerEvent::setSequencerType(const snd_seq_event_type_t eventType) -{ - m_event.type = eventType; -} - -/** - * Sets the client:port destination of the event. - * @param client The destination's client ID - * @param port The destination port ID - * @see setSubscribers() - */ -void SequencerEvent::setDestination(const unsigned char client, const unsigned char port) -{ - snd_seq_ev_set_dest(&m_event, client, port); -} - -/** - * Sets the event's source port ID - * @param port The source port ID - * @see getSourceClient(), getSourcePort() - */ -void SequencerEvent::setSource(const unsigned char port) -{ - snd_seq_ev_set_source(&m_event, port); -} - -/** - * Sets the event's destination to be all the subscribers of the source port. - */ -void SequencerEvent::setSubscribers() -{ - snd_seq_ev_set_subs(&m_event); -} - -/** - * Sets the event's destination to be all queues/clients/ports/channels. - */ -void SequencerEvent::setBroadcast() -{ - snd_seq_ev_set_broadcast(&m_event); -} - -/** - * Sets the event to be immediately delivered, not queued/scheduled. - * @see scheduleTick(), scheduleReal() - */ -void SequencerEvent::setDirect() -{ - snd_seq_ev_set_direct(&m_event); -} - -/** - * Sets the event to be scheduled in musical time (ticks) units. - * @param queue The queue number to be used. - * @param tick The time in ticks. - * @param relative Use relative (to the current) time instead of absolute time. - */ -void SequencerEvent::scheduleTick(int queue, int tick, bool relative) -{ - snd_seq_ev_schedule_tick(&m_event, queue, relative, tick); -} - -/** - * Sets the event to be scheduled in real (clock) time units. - * @param queue The queue number to be used. - * @param secs The time in whole seconds. - * @param nanos The nanoseconds to be added. - * @param relative Use relative (to the current) time instead of absolute time. - */ -void SequencerEvent::scheduleReal(int queue, ulong secs, ulong nanos, bool relative) -{ - snd_seq_real_time_t rtime; - rtime.tv_sec = secs; - rtime.tv_nsec = nanos; - snd_seq_ev_schedule_real(&m_event, queue, relative, &rtime); -} - -/** - * Sets the priority of the event. This is used in case of several events share - * the same scheduling time. - * - * @param high Mark the event as a high priority one. - */ -void SequencerEvent::setPriority(const bool high) -{ - snd_seq_ev_set_priority(&m_event, high); -} - -/** - * Sets the event's tag. This attribute is any arbitrary number, not used by - * the ALSA library. Range limited to 0 thru 255. - * @param aTag A tag number. - */ -void SequencerEvent::setTag(const unsigned char aTag) -{ -#if SND_LIB_VERSION > 0x010008 - snd_seq_ev_set_tag(&m_event, aTag); -#else - m_event.tag = aTag; -#endif -} - -/** - * Gets an event's raw 32 bits parameter. - * @param n The parameter index, between 0 and 2. - * @return The parameter's value. - * @see setRaw32() - */ -unsigned int SequencerEvent::getRaw32(const unsigned int n) const -{ - if (n < 3) return m_event.data.raw32.d[n]; - return 0; -} - -/** - * Sets an event's raw 32 bits parameter. - * @param n The parameter index, between 0 and 2. - * @param value The parameter's value. - */ -void SequencerEvent::setRaw32(const unsigned int n, const unsigned int value) -{ - if (n < 3) m_event.data.raw32.d[n] = value; -} - -/** - * Gets an event's raw 8 bits parameter. - * @param n The parameter index, between 0 and 11. - * @return The parameter's value. - * @see setRaw8() - */ -unsigned char SequencerEvent::getRaw8(const unsigned int n) const -{ - if (n < 12) return m_event.data.raw8.d[n]; - return 0; -} - -/** - * Sets an event's raw 8 bits parameter. - * @param n The parameter index, between 0 and 11. - * @param value The parameter's value. - */ -void SequencerEvent::setRaw8(const unsigned int n, const unsigned char value) -{ - if (n < 12) m_event.data.raw8.d[n] = value; -} - -/** - * Releases the event record. - * @deprecated - */ -void SequencerEvent::free() -{ - snd_seq_free_event(&m_event); -} - -/** - * Gets the encoded length of the event record. - * @return The encoded length. - */ -int SequencerEvent::getEncodedLength() -{ - return snd_seq_event_length(&m_event); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param key MIDI note. - * @param vel Note velocity. - * @param dur Note duration. - */ -NoteEvent::NoteEvent(int ch, int key, int vel, int dur) : KeyEvent() -{ - snd_seq_ev_set_note(&m_event, ch, key, vel, dur); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param key MIDI note. - * @param vel Note velocity. - */ -NoteOnEvent::NoteOnEvent(int ch, int key, int vel) : KeyEvent() -{ - snd_seq_ev_set_noteon(&m_event, ch, key, vel); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param key MIDI note. - * @param vel Note velocity. - */ -NoteOffEvent::NoteOffEvent(int ch, int key, int vel) : KeyEvent() -{ - snd_seq_ev_set_noteoff(&m_event, ch, key, vel); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param key MIDI note. - * @param vel Note velocity. - */ -KeyPressEvent::KeyPressEvent(int ch, int key, int vel) : KeyEvent() -{ - snd_seq_ev_set_keypress(&m_event, ch, key, vel); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param cc MIDI Controller number. - * @param val Controller value. - */ -ControllerEvent::ControllerEvent(int ch, int cc, int val) : ChannelEvent() -{ - snd_seq_ev_set_controller(&m_event, ch, cc, val); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param val MIDI Program number. - */ -ProgramChangeEvent::ProgramChangeEvent(int ch, int val) : ChannelEvent() -{ - snd_seq_ev_set_pgmchange(&m_event, ch, val); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param val Pitch Bend value. Zero centered from -8192 to 8191. - */ -PitchBendEvent::PitchBendEvent(int ch, int val) : ChannelEvent() -{ - snd_seq_ev_set_pitchbend(&m_event, ch, val); -} - -/** - * Constructor using proper attribute values. - * @param ch MIDI Channel. - * @param val Aftertouch value. - */ -ChanPressEvent::ChanPressEvent(int ch, int val) : ChannelEvent() -{ - snd_seq_ev_set_chanpress(&m_event, ch, val); -} - -/** - * Default constructor. - */ -VariableEvent::VariableEvent() - : SequencerEvent() -{ - m_data.clear(); - snd_seq_ev_set_variable ( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor from an ALSA event record. - * @param event ALSA event record. - */ -VariableEvent::VariableEvent(snd_seq_event_t* event) - : SequencerEvent(event) -{ - m_data = QByteArray((char *) event->data.ext.ptr, - event->data.ext.len); - snd_seq_ev_set_variable ( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor from an arbitrary data array. - * @param data A data byte array. - */ -VariableEvent::VariableEvent(const QByteArray& data) - : SequencerEvent() -{ - m_data = data; - snd_seq_ev_set_variable ( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Copy constructor. - * @param other Another VariableEvent instance. -s */ -VariableEvent::VariableEvent(const VariableEvent& other) - : SequencerEvent() -{ - m_data = other.m_data; - snd_seq_ev_set_variable ( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor from a data pointer. - * @param datalen Length of the data. - * @param dataptr Pointer the data. - */ -VariableEvent::VariableEvent(const unsigned int datalen, char* dataptr) - : SequencerEvent() -{ - m_data = QByteArray(dataptr, datalen); - snd_seq_ev_set_variable( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Assignment operator. - * @param other Another VariableEvent object reference - * @return Pointer to this object - */ -VariableEvent& VariableEvent::operator=(const VariableEvent& other) -{ - m_event = other.m_event; - m_data = other.m_data; - snd_seq_ev_set_variable ( &m_event, m_data.size(), m_data.data() ); - return *this; -} - -/** - * Default constructor. - */ -SysExEvent::SysExEvent() - : VariableEvent() -{ - snd_seq_ev_set_sysex( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor from an ALSA event record. - * @param event ALSA event record. - */ -SysExEvent::SysExEvent(snd_seq_event_t* event) - : VariableEvent(event) -{ - snd_seq_ev_set_sysex( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor from a data array. - * @param data A data byte array. - */ -SysExEvent::SysExEvent(const QByteArray& data) - : VariableEvent(data) -{ - snd_seq_ev_set_sysex( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Copy constructor. - * @param other Another SysExEvent object reference. - */ -SysExEvent::SysExEvent(const SysExEvent& other) - : VariableEvent(other) -{ - snd_seq_ev_set_sysex( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Constructor taking a data pointer and length - * @param datalen Data length - * @param dataptr Data pointer - */ -SysExEvent::SysExEvent(const unsigned int datalen, char* dataptr) - : VariableEvent( datalen, dataptr ) -{ - snd_seq_ev_set_sysex( &m_event, m_data.size(), m_data.data() ); -} - -/** - * Default constructor - */ -TextEvent::TextEvent() - : VariableEvent(), m_textType(1) -{ - setSequencerType(SND_SEQ_EVENT_USR_VAR0); -} - -/** - * Constructor from an ALSA sequencer record. - * @param event ALSA sequencer record. - */ -TextEvent::TextEvent(snd_seq_event_t* event) - : VariableEvent(event), m_textType(1) -{ - setSequencerType(SND_SEQ_EVENT_USR_VAR0); -} - -/** - * Constructor from a given string - * @param text The event's text - * @param textType The SMF text type - */ -TextEvent::TextEvent(const QString& text, const int textType) - : VariableEvent(text.toUtf8()), m_textType(textType) -{ - setSequencerType(SND_SEQ_EVENT_USR_VAR0); -} - -/** - * Copy constructor - * @param other An existing TextEvent object reference - */ -TextEvent::TextEvent(const TextEvent& other) - : VariableEvent(other) -{ - setSequencerType(SND_SEQ_EVENT_USR_VAR0); - m_textType = other.getTextType(); -} - -/** - * Constructor from a data pointer and length - * @param datalen Data length - * @param dataptr Data pointer - */ -TextEvent::TextEvent(const unsigned int datalen, char* dataptr) - : VariableEvent(datalen, dataptr), m_textType(1) -{ - setSequencerType(SND_SEQ_EVENT_USR_VAR0); -} - -/** - * Gets the event's text content. - * @return The text content. - */ -QString TextEvent::getText() const -{ - return QString::fromUtf8(m_data.data(), m_data.size()); -} - -/** - * Gets the event's SMF text type. - * @return The SMF text type. - */ -int TextEvent::getTextType() const -{ - return m_textType; -} - -/** - * Constructor - * @param type The event's type - */ -SystemEvent::SystemEvent(const snd_seq_event_type_t type) : SequencerEvent() -{ - snd_seq_ev_set_fixed(&m_event); - setSequencerType(type); -} - -/** - * Constructor - * @param type Event type - * @param queue Queue number - * @param value Value - */ -QueueControlEvent::QueueControlEvent(snd_seq_event_type_t type, int queue, int value) - : SequencerEvent() -{ - snd_seq_ev_set_queue_control(&m_event, type, queue, value); -} - -/** - * Constructor - * @param type The event's type - * @param val Value - */ -ValueEvent::ValueEvent(const snd_seq_event_type_t type, int val) : SequencerEvent() -{ - snd_seq_ev_set_fixed(&m_event); - setSequencerType(type); - setValue(val); -} - -/** - * Constructor - * @param queue Queue number. - * @param tempo Tempo value in microseconds per quarter note. - */ -TempoEvent::TempoEvent(int queue, int tempo) : QueueControlEvent() -{ - snd_seq_ev_set_queue_tempo(&m_event, queue, tempo); -} - -/** - * Default constructor. - */ -RemoveEvents::RemoveEvents() -{ - snd_seq_remove_events_malloc(&m_Info); -} - -/** - * Copy constructor. - * @param other An existing RemoveEvents object reference. - */ -RemoveEvents::RemoveEvents(const RemoveEvents& other) -{ - snd_seq_remove_events_malloc(&m_Info); - snd_seq_remove_events_copy(m_Info, other.m_Info); -} - -/** - * Constructor from an ALSA remove events object pointer. - * @param other An ALSA remove events object pointer. - */ -RemoveEvents::RemoveEvents(snd_seq_remove_events_t* other) -{ - snd_seq_remove_events_malloc(&m_Info); - snd_seq_remove_events_copy(m_Info, other); -} - -/** - * Destructor. - */ -RemoveEvents::~RemoveEvents() -{ - snd_seq_remove_events_free(m_Info); -} - -/** - * Create a new object copied from this object and return a pointer to the copy. - * @return A pointer to the new object. - */ -RemoveEvents* -RemoveEvents::clone() -{ - return new RemoveEvents(m_Info); -} - -/** - * Assignment operator. - * @param other An existing RemoveEvents object reference. - * @return This object. - */ -RemoveEvents& -RemoveEvents::operator=(const RemoveEvents& other) -{ - snd_seq_remove_events_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the allocated size of the ALSA remove events object. - * @return The size of the ALSA remove events object. - */ -int -RemoveEvents::getSizeOfInfo() const -{ - return snd_seq_remove_events_sizeof(); -} - -/** - * Gets the MIDI channel. - * @return The MIDI channel. - * @see setChannel() - */ -int -RemoveEvents::getChannel() -{ - return snd_seq_remove_events_get_channel(m_Info); -} - -/** - * Gets the condition. - * @return The condition. - * @see setCondition() - */ -unsigned int -RemoveEvents::getCondition() -{ - return snd_seq_remove_events_get_condition(m_Info); -} - -/** - * Gets the destination. - * @return The destination record pointer. - * @see setDest() - */ -const snd_seq_addr_t* -RemoveEvents::getDest() -{ - return snd_seq_remove_events_get_dest(m_Info); -} - -/** - * Gets the event type. - * @return The event type. - * @see setEventType() - */ -int -RemoveEvents::getEventType() -{ - return snd_seq_remove_events_get_event_type(m_Info); -} - -/** - * Gets the queue number. - * @return The queue number. - * @see setQueue() - */ -int -RemoveEvents::getQueue() -{ - return snd_seq_remove_events_get_queue(m_Info); -} - -/** - * Gets the numeric tag. - * @return The numeric tag. - * @see setTag() - */ -int -RemoveEvents::getTag() -{ - return snd_seq_remove_events_get_tag(m_Info); -} - -/** - * Gets the timestamp. - * @return The timestamp. - * @see setTime() - */ -const snd_seq_timestamp_t* -RemoveEvents::getTime() -{ - return snd_seq_remove_events_get_time(m_Info); -} - -/** - * Gets the MIDI channel. - * @param chan The MIDI channel. - * @see getChannel() - */ -void -RemoveEvents::setChannel(int chan) -{ - snd_seq_remove_events_set_channel(m_Info, chan); -} - -/** - * Sets the flags of the conditional event's removal. This condition is a - * bitmap of the combination (OR) the following auto-described flags: - *
    - *
  • SND_SEQ_REMOVE_INPUT
  • - *
  • SND_SEQ_REMOVE_OUTPUT
  • - *
  • SND_SEQ_REMOVE_DEST
  • - *
  • SND_SEQ_REMOVE_DEST_CHANNEL
  • - *
  • SND_SEQ_REMOVE_TIME_BEFORE
  • - *
  • SND_SEQ_REMOVE_TIME_AFTER
  • - *
  • SND_SEQ_REMOVE_TIME_TICK
  • - *
  • SND_SEQ_REMOVE_EVENT_TYPE
  • - *
  • SND_SEQ_REMOVE_IGNORE_OFF
  • - *
  • SND_SEQ_REMOVE_TAG_MATCH
  • - *
- * @param cond The condition bitmap. - * @see getCondition() - */ -void -RemoveEvents::setCondition(unsigned int cond) -{ - snd_seq_remove_events_set_condition(m_Info, cond); -} - -/** - * Set the destination address. - * @param dest A pointer to the destination address record. - * @see getDest() - */ -void -RemoveEvents::setDest(const snd_seq_addr_t* dest) -{ - snd_seq_remove_events_set_dest(m_Info, dest); -} - -/** - * Sets the event type. - * @param type The event type. - * @see getEventType() - */ -void -RemoveEvents::setEventType(int type) -{ - snd_seq_remove_events_set_event_type(m_Info, type); -} - -/** - * Sets the queue number. - * @param queue The queue number. - * @see getQueue() - */ -void -RemoveEvents::setQueue(int queue) -{ - snd_seq_remove_events_set_queue(m_Info, queue); -} - -/** - * Sets the numeric tag. - * @param tag The numeric tag. - * @see getTag() - */ -void -RemoveEvents::setTag(int tag) -{ - snd_seq_remove_events_set_tag(m_Info, tag); -} - -/** - * Sets the timestamp. - * @param time A pointer to the timestamp record. - * @see getTime() - */ -void -RemoveEvents::setTime(const snd_seq_timestamp_t* time) -{ - snd_seq_remove_events_set_time(m_Info, time); -} - -/** - * MidiCodec constructor - * @param bufsize The buffer size of the CODEC - * @param parent The optional parent object - */ -MidiCodec::MidiCodec( int bufsize, QObject* parent ) : QObject(parent) -{ - CHECK_ERROR(snd_midi_event_new(bufsize, &m_Info)); -} - -/** - * Destructor - */ -MidiCodec::~MidiCodec() -{ - snd_midi_event_free(m_Info); -} - -/** - * CODEC initialization. - */ -void -MidiCodec::init() -{ - snd_midi_event_init(m_Info); -} - -/** - * Decode from event to bytes. - * @param buf A buffer to get the results - * @param count Available bytes in MIDI byte stream - * @param ev The input event - * @return The number of written bytes if success. - */ -long -MidiCodec::decode(unsigned char *buf, - long count, - const snd_seq_event_t *ev) -{ - return CHECK_WARNING(snd_midi_event_decode(m_Info, buf, count, ev)); -} - -/** - * Encode from byte stream. - * @param buf MIDI byte stream - * @param count Bytes of MIDI byte stream to encode - * @param ev Result - sequencer event - * @return Number of written bytes if success. - */ -long -MidiCodec::encode(const unsigned char *buf, - long count, - snd_seq_event_t *ev) -{ - return CHECK_WARNING(snd_midi_event_encode(m_Info, buf, count, ev)); -} - -/** - * Read one byte and encode to sequencer event if finished. - * @param c A byte of MIDI stream - * @param ev Result - sequencer event - * @return 1 - sequencer event is completed, 0 - next byte is required for completion, otherwise a negative error code - */ -long -MidiCodec::encode(int c, - snd_seq_event_t *ev) -{ - return CHECK_WARNING(snd_midi_event_encode_byte(m_Info, c, ev)); -} - -/** - * Enable MIDI running status (command merge) - * @param enable True to enable, false to disable. - */ -void -MidiCodec::enableRunningStatus(bool enable) -{ - snd_midi_event_no_status(m_Info, enable ? 0 : 1); -} - -/** - * Reset MIDI decode parser. - */ -void -MidiCodec::resetDecoder() -{ - snd_midi_event_reset_decode(m_Info); -} - -/** - * Reset MIDI encode parser. - */ -void -MidiCodec::resetEncoder() -{ - snd_midi_event_reset_encode(m_Info); -} - -/** - * Resize the CODEC buffer - * @param bufsize New buffer size. - */ -void -MidiCodec::resizeBuffer(int bufsize) -{ - CHECK_WARNING(snd_midi_event_resize_buffer(m_Info, bufsize)); -} - -} /* namespace drumstick */ diff -Nru kmetronome-0.10.0/drumstick/src/alsaport.cpp kmetronome-0.10.1/drumstick/src/alsaport.cpp --- kmetronome-0.10.0/drumstick/src/alsaport.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/alsaport.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1245 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsaqueue.h" -#include "alsaclient.h" - -/** - * @file alsaport.cpp - * Implementation of classes managing ALSA Sequencer ports. - */ - -namespace drumstick { - -/** - * @addtogroup ALSAPort - * @{ - * - * Ports are the endpoints of the MIDI connections. - * - * Ports can be readable, writable, or both. They can be private for the owner - * application, or can be subscribed by a third application. - * - * The ALSA sequencer readable ports are equivalent to the MIDI OUT ports in the - * real world. Similarly, the writable ports are equivalent to the MIDI IN ones. - * - * Classes: - * - * PortInfo is a container to retrieve and change some properties about the ALSA - * MIDI ports. - * - * MidiPort represents an ALSA MIDI port. - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_port.html - * @} - */ - -/** - * Default constructor. - */ -PortInfo::PortInfo() -{ - snd_seq_port_info_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Another PortInfo object reference - */ -PortInfo::PortInfo(const PortInfo& other) -{ - snd_seq_port_info_malloc(&m_Info); - snd_seq_port_info_copy(m_Info, other.m_Info); - m_ReadSubscribers = other.m_ReadSubscribers; - m_WriteSubscribers = other.m_WriteSubscribers; - m_ClientName = other.m_ClientName; -} - -/** - * Constructor - * @param other An ALSA port info object pointer - */ -PortInfo::PortInfo(snd_seq_port_info_t* other) -{ - snd_seq_port_info_malloc(&m_Info); - snd_seq_port_info_copy(m_Info, other); -} - -/** - * Constructor - * @param seq A MidiClient instance - * @param client An existing client number - * @param port An existing port number - */ -PortInfo::PortInfo(MidiClient* seq, const int client, const int port) -{ - snd_seq_port_info_malloc(&m_Info); - CHECK_WARNING(snd_seq_get_any_port_info(seq->getHandle(), client, port, m_Info)); -} - -/** - * Constructor - * @param seq A MidiClient instance - * @param port An existing port number - */ -PortInfo::PortInfo(MidiClient* seq, const int port) -{ - snd_seq_port_info_malloc(&m_Info); - CHECK_WARNING(snd_seq_get_port_info(seq->getHandle(), port, m_Info)); -} - -/** - * Destructor - */ -PortInfo::~PortInfo() -{ - snd_seq_port_info_free(m_Info); - freeSubscribers(); -} - -/** - * Copy the current object - * @return A pointer to the new object - */ -PortInfo* PortInfo::clone() -{ - return new PortInfo(m_Info); -} - -/** - * Assignment operator - * @param other Another PortInfo object reference - * @return This object - */ -PortInfo& PortInfo::operator=(const PortInfo& other) -{ - snd_seq_port_info_copy(m_Info, other.m_Info); - m_ReadSubscribers = other.m_ReadSubscribers; - m_WriteSubscribers = other.m_WriteSubscribers; - m_ClientName = other.m_ClientName; - return *this; -} - -/** - * Gets the client number - * @return The client number - * @see setClient() - */ -int -PortInfo::getClient() -{ - return snd_seq_port_info_get_client(m_Info); -} - -/** - * Gets the port number - * @return The port number - * @see setPort() - */ -int -PortInfo::getPort() -{ - return snd_seq_port_info_get_port(m_Info); -} - -/** - * Gets the address record for this port - * @return A pointer to the address record - * @see setAddr() - */ -const snd_seq_addr_t* -PortInfo::getAddr() -{ - return snd_seq_port_info_get_addr(m_Info); -} - -/** - * Gets the port name - * @return The port name - * @see setName() - */ -QString -PortInfo::getName() -{ - return QString(snd_seq_port_info_get_name(m_Info)); -} - -/** - * Gets the capabilities bitmap - * @return The capabilities bitmap - * @see setCapability() - */ -unsigned int -PortInfo::getCapability() -{ - return snd_seq_port_info_get_capability(m_Info); -} - -/** - * Gets the port type - * @return The port type - * @see setType() - */ -unsigned int -PortInfo::getType() -{ - return snd_seq_port_info_get_type(m_Info); -} - -/** - * Gets the MIDI channels - * @return The MIDI channels - * @see setMidiChannels() - */ -int -PortInfo::getMidiChannels() -{ - return snd_seq_port_info_get_midi_channels(m_Info); -} - -/** - * Gets the MIDI voices - * @return The MIDI voices - * @see setMidiVoices() - */ -int -PortInfo::getMidiVoices() -{ - return snd_seq_port_info_get_midi_voices(m_Info); -} - -/** - * Gets the synth voices - * @return The synth voices - * @see setSynthVoices() - */ -int -PortInfo::getSynthVoices() -{ - return snd_seq_port_info_get_synth_voices(m_Info); -} - -/** - * Get the number of read subscriptions. - * @return The number of read subscriptions. - */ -int -PortInfo::getReadUse() -{ - return snd_seq_port_info_get_read_use(m_Info); -} - -/** - * Gets the number of write subscriptions. - * @return The number of write subscriptions. - */ -int -PortInfo::getWriteUse() -{ - return snd_seq_port_info_get_write_use(m_Info); -} - -/** - * Gets the port-specified mode. - * @return The port-specified mode. - * @see setPortSpecified() - */ -int -PortInfo::getPortSpecified() -{ - return snd_seq_port_info_get_port_specified(m_Info); -} - -/** - * Sets the client number - * @param client The client number - * @see getClient() - */ -void -PortInfo::setClient(int client) -{ - snd_seq_port_info_set_client(m_Info, client); -} - -/** - * Set the port number - * @param port The port number - * @see getPort() - */ -void -PortInfo::setPort(int port) -{ - snd_seq_port_info_set_port(m_Info, port); -} - -/** - * Sets the address record - * @param addr An address record pointer - * @see getAddr() - */ -void -PortInfo::setAddr(const snd_seq_addr_t* addr) -{ - snd_seq_port_info_set_addr(m_Info, addr); -} - -/** - * Sets the port name - * @param name The port name - * @see getName() - */ -void -PortInfo::setName(QString const& name) -{ - snd_seq_port_info_set_name(m_Info, name.toLocal8Bit().data()); -} - -/** - * Sets the capability bitmap. - * - * Each port has the capability bitmaps to specify the access of - * the port from other clients. The capability bit flags are: - *
    - *
  • SND_SEQ_PORT_CAP_READ Readable from this port
  • - *
  • SND_SEQ_PORT_CAP_WRITE Writable to this port
  • - *
  • SND_SEQ_PORT_CAP_DUPLEX Read/write duplex access is supported
  • - *
  • SND_SEQ_PORT_CAP_SUBS_READ Read subscription is allowed
  • - *
  • SND_SEQ_PORT_CAP_SUBS_WRITE Write subscription is allowed
  • - *
  • SND_SEQ_PORT_CAP_NO_EXPORT Subscription management from 3rd clients is disallowed
  • - *
- * @param capability The capability bitmap. - * @see getCapability() - */ -void -PortInfo::setCapability(unsigned int capability) -{ - snd_seq_port_info_set_capability(m_Info, capability); -} - -/** - * Sets the port type. - * - * The port type is defined combining some of the type bit flags: - *
    - *
  • SND_SEQ_PORT_TYPE_SPECIFIC Hardware specific port
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_GENERIC Generic MIDI device
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_GM General MIDI compatible device
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_GM2 General MIDI 2 compatible device
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_GS GS compatible device
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_XG XG compatible device
  • - *
  • SND_SEQ_PORT_TYPE_MIDI_MT32 MT-32 compatible device
  • - *
  • SND_SEQ_PORT_TYPE_HARDWARE Implemented in hardware
  • - *
  • SND_SEQ_PORT_TYPE_SOFTWARE Implemented in software
  • - *
  • SND_SEQ_PORT_TYPE_SYNTHESIZER Generates sound
  • - *
  • SND_SEQ_PORT_TYPE_PORT Connects to other device(s)
  • - *
  • SND_SEQ_PORT_TYPE_APPLICATION Application (sequencer/editor)
  • - *
- * @param type The port type bitmap - * @see getType() - */ -void -PortInfo::setType(unsigned int type) -{ - snd_seq_port_info_set_type(m_Info, type); -} - -/** - * Set the MIDI channels - * @param channels The MIDI channels - * @see getMidiChannels() - */ -void -PortInfo::setMidiChannels(int channels) -{ - snd_seq_port_info_set_midi_channels(m_Info, channels); -} - -/** - * Sets the MIDI voices - * @param voices The MIDI voices - * @see getMidiVoices() - */ -void -PortInfo::setMidiVoices(int voices) -{ - snd_seq_port_info_set_midi_voices(m_Info, voices); -} - -/** - * Sets the synth voices - * @param voices The synth voices - * @see getSynthVoices() - */ -void -PortInfo::setSynthVoices(int voices) -{ - snd_seq_port_info_set_synth_voices(m_Info, voices); -} - -/** - * Sets the port-specified mode - * @param val The port-specified mode. - * @see getPortSpecified() - */ -void -PortInfo::setPortSpecified(int val) -{ - snd_seq_port_info_set_port_specified(m_Info, val); -} - -/** - * Gets the list of read subscribers - * @return The list of read subscribers - */ -SubscribersList -PortInfo::getReadSubscribers() const -{ - return m_ReadSubscribers; // copy -} - -/** - * Gets the list of write subscribers - * @return The list of write subscribers - */ -SubscribersList -PortInfo::getWriteSubscribers() const -{ - return m_WriteSubscribers; // copy -} - -/** - * Obtains the port subscribers lists - * @param seq An opened MidiClient instance - */ -void -PortInfo::readSubscribers(MidiClient* seq) -{ - Subscriber subs; - snd_seq_addr_t tmp; - freeSubscribers(); - tmp.client = getClient(); - tmp.port = getPort(); - // Read subs - subs.setType(SND_SEQ_QUERY_SUBS_READ); - subs.setIndex(0); - subs.setRoot(&tmp); - while (snd_seq_query_port_subscribers(seq->getHandle(), subs.m_Info) >= 0) - { - m_ReadSubscribers.append(subs); - subs.setIndex(subs.getIndex() + 1); - } - // Write subs - subs.setType(SND_SEQ_QUERY_SUBS_WRITE); - subs.setIndex(0); - subs.setRoot(&tmp); - while (snd_seq_query_port_subscribers(seq->getHandle(), subs.m_Info) >= 0) - { - m_WriteSubscribers.append(subs); - subs.setIndex(subs.getIndex() + 1); - } -} - -/** - * Releases the subscribers lists - */ -void -PortInfo::freeSubscribers() -{ - m_ReadSubscribers.clear(); - m_WriteSubscribers.clear(); -} - -/** - * Gets the size of the ALSA info object - * @return The size of the object - */ -int -PortInfo::getSizeOfInfo() const -{ - return snd_seq_port_info_sizeof(); -} - -/** - * Gets the timestamping mode - * @return The timestamping mode - * @see setTimestamping() - */ -bool -PortInfo::getTimestamping() -{ - return (snd_seq_port_info_get_timestamping(m_Info) == 1); -} - -/** - * Gets the timestamping real mode - * @return The timestamping real mode - * @see setTimestampReal() - */ -bool -PortInfo::getTimestampReal() -{ - return (snd_seq_port_info_get_timestamp_real(m_Info) == 1); -} - -/** - * Gets the timestamping queue number - * @return The timestamping queue number - * @see setTimestampQueue() - */ -int -PortInfo::getTimestampQueue() -{ - return snd_seq_port_info_get_timestamp_queue(m_Info); -} - -/** - * Sets the timestamping mode - * @param value The timestamping mode - * @see getTimestamping() - */ -void -PortInfo::setTimestamping(bool value) -{ - snd_seq_port_info_set_timestamping(m_Info, value?1:0); -} - -/** - * Sets the timestamping real mode - * @param value The timestamping real mode - * @see getTimestampReal() - */ -void -PortInfo::setTimestampReal(bool value) -{ - snd_seq_port_info_set_timestamp_real(m_Info, value?1:0); -} - -/** - * Sets the timestamp queue number - * @param queueId The timestamp queue number - * @see getTimestampQueue() - */ -void -PortInfo::setTimestampQueue(int queueId) -{ - snd_seq_port_info_set_timestamp_queue(m_Info, queueId); -} - - -/** - * Constructor - * @param parent An optional parent object - */ -MidiPort::MidiPort( QObject* parent ) : - QObject( parent ), - m_MidiClient( NULL ), - m_Attached( false ) -{} - -/** - * Destructor. - * - * All subscriptions are released. - */ -MidiPort::~MidiPort() -{ - unsubscribeAll(); - detach(); - freeSubscriptions(); -} - -/** - * Gets the PortInfo object pointer - */ -PortInfo* -MidiPort::getPortInfo() -{ - return &m_Info; -} - -/** - * Gets the list of susbcriptions - * @return The list of susbcriptions - */ -SubscriptionsList -MidiPort::getSubscriptions() const -{ - return m_Subscriptions; -} - -/** - * Releases the lists of subscriptions. - */ -void -MidiPort::freeSubscriptions() -{ - m_Subscriptions.clear(); -} - -/** - * Sets the MidiClient - * @param seq A MidiClient object pointer - */ -void -MidiPort::setMidiClient( MidiClient* seq ) -{ - if (m_MidiClient != seq) - { - m_MidiClient = seq; - emit midiClientChanged( this, m_MidiClient ); - applyPortInfo(); - } -} - -/** - * Subscribe a Subscription object - * @param subs A Subscription object pointer - */ -void -MidiPort::subscribe(Subscription* subs) -{ - subs->subscribe(m_MidiClient); - m_Subscriptions.append(*subs); - emit subscribed(this, subs); -} - -/** - * Unsubscribe a Subscription object - * @param subs A Subscription object pointer - */ -void -MidiPort::unsubscribe( Subscription* subs ) -{ - Subscription subs2; - if (m_MidiClient == NULL) - { - return; - } - subs->unsubscribe(m_MidiClient); - SubscriptionsList::iterator it; - for(it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it) - { - subs2 = (*it); - if ((subs2.getSender()->client == subs->getSender()->client) && - (subs2.getSender()->port == subs->getSender()->port) && - (subs2.getDest()->client == subs->getDest()->client) && - (subs2.getDest()->port == subs->getDest()->port)) - { - m_Subscriptions.erase(it); - break; - } - } -} - -/** - * Subscribe to another port destination - * @param info A PortInfo object pointer - */ -void -MidiPort::subscribeTo( PortInfo* info ) -{ - Subscription subs; - subs.setSender(m_Info.getAddr()); - subs.setDest(info->getAddr()); - subscribe(&subs); -} - -/** - * Susbcribe to another port destination - * @param client ALSA client number - * @param port ALSA port number - */ -void -MidiPort::subscribeTo( int client, int port ) -{ - Subscription subs; - snd_seq_addr addr; - addr.client = client; - addr.port = port; - subs.setSender(m_Info.getAddr()); - subs.setDest(&addr); - subscribe(&subs); -} - -/** - * Subscribe to another port destination - * @param name A string representing a client:port pair - */ -void -MidiPort::subscribeTo( QString const& name ) -{ - Subscription subs; - snd_seq_addr addr; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(m_Info.getAddr()); - if (m_MidiClient->parseAddress(name, addr)) { - subs.setDest(&addr); - subscribe(&subs); - } - } -} - -/** - * Unsubscribe a destination port - * @param name A string representing a client:port pair - */ -void -MidiPort::unsubscribeTo( QString const& name ) -{ - Subscription subs; - snd_seq_addr addr; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(m_Info.getAddr()); - if (m_MidiClient->parseAddress(name, addr)) { - subs.setDest(&addr); - unsubscribe(&subs); - } - } -} - -/** - * Unsubscribe a destination port - * @param port A PortInfo object pointer - */ -void -MidiPort::unsubscribeTo( PortInfo* port ) -{ - Subscription subs; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(m_Info.getAddr()); - subs.setDest(port->getAddr()); - unsubscribe(&subs); - } -} - -/** - * Unsubscribe a destination port - * @param addr An ALSA address record pointer - */ -void -MidiPort::unsubscribeTo( const snd_seq_addr_t* addr ) -{ - Subscription subs; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(m_Info.getAddr()); - subs.setDest(addr); - unsubscribe(&subs); - } -} - -/** - * Subscribe a source port - * @param port A PortInfo object pointer - */ -void -MidiPort::subscribeFrom( PortInfo* port ) -{ - Subscription subs; - subs.setSender( port->getAddr() ); - subs.setDest( m_Info.getAddr() ); - subscribe(&subs); -} - -/** - * Subscribe a source port - * @param client ALSA client number - * @param port ALSA port number - */ -void -MidiPort::subscribeFrom( int client, int port ) -{ - Subscription subs; - snd_seq_addr addr; - addr.client = client; - addr.port = port; - subs.setSender(&addr); - subs.setDest(m_Info.getAddr()); - subscribe(&subs); -} - -/** - * Subscribe a source port - * @param name A string representing a client:port pair - */ -void -MidiPort::subscribeFrom( QString const& name ) -{ - Subscription subs; - snd_seq_addr addr; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - if (m_MidiClient->parseAddress(name, addr)) { - subs.setSender(&addr); - subs.setDest(m_Info.getAddr()); - subscribe(&subs); - } - } -} - -/** - * Unsubscribe a source port - * @param name A string representing a client:port pair - */ -void -MidiPort::unsubscribeFrom( QString const& name ) -{ - Subscription subs; - snd_seq_addr addr; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - if (m_MidiClient->parseAddress(name, addr)) { - subs.setSender(&addr); - subs.setDest(m_Info.getAddr()); - unsubscribe(&subs); - } - } -} - -/** - * Unsubscribe a source port - * @param port A PortInfo object pointer - */ -void -MidiPort::unsubscribeFrom( PortInfo* port ) -{ - Subscription subs; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(port->getAddr()); - subs.setDest(m_Info.getAddr()); - unsubscribe(&subs); - } -} - -/** - * Unsubscribe a source port - * @param addr An ALSA address record pointer - */ -void -MidiPort::unsubscribeFrom( const snd_seq_addr_t* addr ) -{ - Subscription subs; - if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL)) - { - subs.setSender(addr); - subs.setDest(m_Info.getAddr()); - unsubscribe(&subs); - } -} - -/** - * Subscribe from the System:announce port - */ -void -MidiPort::subscribeFromAnnounce() -{ - subscribeFrom(SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); -} - -/** - * Unsubscribe all subscriptions - */ -void -MidiPort::unsubscribeAll() -{ - if (m_MidiClient == NULL) { - return; - } - SubscriptionsList::Iterator it; - for( it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it) { - Subscription s = (*it); - s.unsubscribe(m_MidiClient); - } - m_Subscriptions.clear(); -} - -/** - * Applies all the the delayed PortInfo changes to the MIDI port object - */ -void -MidiPort::applyPortInfo() -{ - if (m_Attached && (m_MidiClient != NULL) && (m_MidiClient->isOpened())) - { - CHECK_WARNING(snd_seq_set_port_info( m_MidiClient->getHandle(), - m_Info.getPort(), m_Info.m_Info )); - } -} - -/** - * Gets the port name - * @return The port name - */ -QString -MidiPort::getPortName() -{ - return m_Info.getName(); -} - -/** - * Sets the port name - * @param newName The new port name - */ -void -MidiPort::setPortName( QString const& newName ) -{ - m_Info.setName(newName); - applyPortInfo(); -} - -/** - * Gets the port number - * @return The port number - */ -int -MidiPort::getPortId() -{ - return m_Info.getPort(); -} - -/** - * Gets the port capabilities - * @return The capabilities bitmap - * @see PortInfo::getCapability() - */ -unsigned int -MidiPort::getCapability() -{ - return m_Info.getCapability(); -} - -/** - * Sets the port capabilities - * @param newValue The capabilities bitmap - * @see PortInfo::setCapability() - */ -void -MidiPort::setCapability(unsigned int newValue) -{ - m_Info.setCapability(newValue); - applyPortInfo(); -} - -/** - * Gets the port type - * @return The port type bitmap - * @see PortInfo::getType() - */ -unsigned int -MidiPort::getPortType() -{ - return m_Info.getType(); -} - -/** - * Sets the port type bitmap - * @param newValue The port type flags bitmap - * @see PortInfo::setType() - */ -void -MidiPort::setPortType( unsigned int newValue) -{ - m_Info.setType( newValue ); - applyPortInfo(); -} - -/** - * Gets the MIDI channels - * @return The MIDI channels - */ -int -MidiPort::getMidiChannels() -{ - return m_Info.getMidiChannels(); -} - -/** - * Sets the MIDI channels - * @param newValue The MIDI channels - */ -void -MidiPort::setMidiChannels(int newValue) -{ - m_Info.setMidiChannels( newValue ); - applyPortInfo(); -} - -/** - * Gets the MIDI voices - * @return The MIDI voices - */ -int -MidiPort::getMidiVoices() -{ - return m_Info.getMidiVoices(); -} - -/** - * Sets the MIDI voices - * @param newValue The MIDI voices - */ -void -MidiPort::setMidiVoices(int newValue) -{ - m_Info.setMidiVoices( newValue ); - applyPortInfo(); -} - -/** - * Gets the synth voices - * @return The synth voices - */ -int -MidiPort::getSynthVoices() -{ - return m_Info.getSynthVoices(); -} - -/** - * Sets the synth voices - * @param newValue The synth voices - */ -void -MidiPort::setSynthVoices(int newValue) -{ - m_Info.setSynthVoices( newValue ); - applyPortInfo(); -} - -/** - * Gets the timestamping mode - * @return The timestamping mode - */ -bool -MidiPort::getTimestamping() -{ - return m_Info.getTimestamping(); -} - -/** - * Gets the timestamp real mode - * @return The timestamp real mode - */ -bool -MidiPort::getTimestampReal() -{ - return m_Info.getTimestampReal(); -} - -/** - * Gets the timestamp queue number - * @return The timestamp queue number - */ -int -MidiPort::getTimestampQueue() -{ - return m_Info.getTimestampQueue(); -} - -/** - * Sets the timestamping mode - * @param value The timestamping mode - */ -void -MidiPort::setTimestamping(bool value) -{ - m_Info.setTimestamping(value); - applyPortInfo(); -} - -/** - * Sets the timestamp real mode - * @param value The timestamp real mode - */ -void -MidiPort::setTimestampReal(bool value) -{ - m_Info.setTimestampReal(value); - applyPortInfo(); -} - -/** - * Sets the timestamp queue number - * @param queueId The queue number - */ -void -MidiPort::setTimestampQueue(int queueId) -{ - m_Info.setTimestampQueue(queueId); - applyPortInfo(); -} - -/** - * Attach the port to a MidiClient instance - * @param seq A MidiClient object pointer - */ -void -MidiPort::attach( MidiClient* seq ) -{ - if (!m_Attached && (seq != NULL)) { - m_MidiClient = seq; - m_MidiClient->portAttach(this); - m_Attached = true; - emit attached(this); - } -} - -/** - * Detach the port from any MidiClient instance previously attached - */ -void -MidiPort::detach() -{ - if (m_Attached && (m_MidiClient != NULL)) { - m_MidiClient->portDetach(this); - m_Attached = false; - emit detached(this); - } -} - -/** - * Update the subscribers list in the PortInfo member - */ -void -MidiPort::updateSubscribers() -{ - m_Info.readSubscribers(m_MidiClient); -} - -/** - * Gets the list of read subscribers - * @return The list of read subscribers - */ -PortInfoList -MidiPort::getReadSubscribers() -{ - const SubscribersList subs(m_Info.getReadSubscribers()); - PortInfoList lst; - SubscribersList::ConstIterator it; - for(it = subs.constBegin(); it != subs.constEnd(); ++it) { - Subscriber s = *it; - int client = s.getAddr()->client; - if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.getClient())) { - int port = s.getAddr()->port; - PortInfo p(m_MidiClient, client, port); - if ((p.getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) { - p.setClientName(m_MidiClient->getClientName(client)); - lst << p; - } - } - } - return lst; -} - -/** - * Gets the list of write subscribers - * @return The list of write subscribers - */ -PortInfoList -MidiPort::getWriteSubscribers() -{ - const SubscribersList subs(m_Info.getWriteSubscribers()); - PortInfoList lst; - SubscribersList::ConstIterator it; - for(it = subs.constBegin(); it != subs.constEnd(); ++it) { - Subscriber s = *it; - int client = s.getAddr()->client; - if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.getClient())) { - int port = s.getAddr()->port; - PortInfo p(m_MidiClient, client, port); - if ((p.getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) { - p.setClientName(m_MidiClient->getClientName(client)); - lst << p; - } - } - } - return lst; -} - -/** - * Checks if the provided address is included in the port list - * @param addr ALSA address record pointer - * @param lst List of port information containers - * @return True if the address is found - */ -bool -MidiPort::containsAddress(const snd_seq_addr_t* addr, const PortInfoList& lst) -{ - PortInfoList::ConstIterator i; - for( i = lst.begin(); i != lst.end(); ++i) { - PortInfo p = *i; - if ((p.getAddr()->client == addr->client) && - (p.getAddr()->port == addr->port)) { - return true; - } - } - return false; -} - -/** - * Update the write subscriptions - * @param ports List of writable ports to be subscribed - */ -void -MidiPort::updateConnectionsTo(const PortInfoList& ports) -{ - PortInfoList subs(getReadSubscribers()); - PortInfoList::ConstIterator i; - for (i = subs.constBegin(); i != subs.constEnd(); ++i) { - PortInfo s = *i; - if (!containsAddress(s.getAddr(), ports)) { - unsubscribeTo(s.getAddr()); - } - } - for (i = ports.constBegin(); i != ports.constEnd(); ++i) { - PortInfo p = *i; - if (!containsAddress(p.getAddr(), subs)) { - subscribeTo(&p); - } - } -} - -/** - * Update the read susbcriptions - * @param ports List of readable ports to be subscribed - */ -void -MidiPort::updateConnectionsFrom(const PortInfoList& ports) -{ - PortInfoList subs(getWriteSubscribers()); - PortInfoList::ConstIterator i; - for (i = subs.constBegin(); i != subs.constEnd(); ++i) { - PortInfo s = *i; - if (!containsAddress(s.getAddr(), ports)) { - unsubscribeFrom(s.getAddr()); - } - } - for (i = ports.constBegin(); i != ports.constEnd(); ++i) { - PortInfo p = *i; - if (!containsAddress(p.getAddr(), subs)) { - subscribeFrom(&p); - } - } -} - -} /* namespace drumstick; */ diff -Nru kmetronome-0.10.0/drumstick/src/alsaqueue.cpp kmetronome-0.10.1/drumstick/src/alsaqueue.cpp --- kmetronome-0.10.0/drumstick/src/alsaqueue.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/alsaqueue.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,909 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsaqueue.h" -#include "alsaclient.h" -#include "alsaevent.h" -#include "alsatimer.h" -#include - -/** - * @file alsaqueue.cpp - * Implementation of classes managing ALSA Sequencer queues - */ - -namespace drumstick { - -/** - * @addtogroup ALSAQueue - * @{ - * - * ALSA events can be delivered to the output ports at scheduled times using the - * queues. There is a small amount of available queues in the system, so this is - * a limited resource. Queues are also used to time-stamp incoming events. - * - * Classes: - * - * QueueInfo holds several properties about the queue object. - * - * QueueStatus is used to retrieve the status of the queue object. - * - * QueueTempo holds properties to get and set the tempo in the queue object. - * - * QueueTimer holds properties about the Timer used in the queue object. - * - * MidiQueue represents the queue object. - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_queue.html - * @} - */ - -/** - * Default constructor - */ -QueueInfo::QueueInfo() -{ - snd_seq_queue_info_malloc(&m_Info); -} - -/** - * Constructor. - * @param other ALSA queue info object pointer - */ -QueueInfo::QueueInfo(snd_seq_queue_info_t* other) -{ - snd_seq_queue_info_malloc(&m_Info); - snd_seq_queue_info_copy(m_Info, other); -} - -/** - * Copy constructor. - * @param other An existing QueueInfo object reference. - */ -QueueInfo::QueueInfo(const QueueInfo& other) -{ - snd_seq_queue_info_malloc(&m_Info); - snd_seq_queue_info_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -QueueInfo::~QueueInfo() -{ - snd_seq_queue_info_free(m_Info); -} - -/** - * Copy the current object and return the copy. - * @return The pointer to the new object. - */ -QueueInfo* QueueInfo::clone() -{ - return new QueueInfo(m_Info); -} - -/** - * Assignment operator. - * @param other An existing QueueInfo object reference. - * @return This object. - */ -QueueInfo& QueueInfo::operator=(const QueueInfo& other) -{ - snd_seq_queue_info_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the queue's numeric identifier. - * @return The numeric identifier. - */ -int QueueInfo::getId() -{ - return snd_seq_queue_info_get_queue(m_Info); -} - -/** - * Gets the queue name - * @return The queue name. - */ -QString QueueInfo::getName() -{ - return QString(snd_seq_queue_info_get_name(m_Info)); -} - -/** - * Gets the owner's client id of the queue. - * @return the owner's client id. - */ -int QueueInfo::getOwner() -{ - return snd_seq_queue_info_get_owner(m_Info); -} - -/** - * Returns the locking status of the queue - * @return The locking status. - */ -bool QueueInfo::isLocked() -{ - return (snd_seq_queue_info_get_locked(m_Info) != 0); -} - -/** - * Gets the flags of the queue. - * @return The flags of the queue. - */ -unsigned int QueueInfo::getFlags() -{ - return snd_seq_queue_info_get_flags(m_Info); -} - -/** - * Sets the queue name - * @param value The queue name - */ -void QueueInfo::setName(QString value) -{ - snd_seq_queue_info_set_name(m_Info, value.toLocal8Bit().data()); -} - -/** - * Sets the client ID of the owner - * @param value The client ID of the owner - */ -void QueueInfo::setOwner(int value) -{ - snd_seq_queue_info_set_owner(m_Info, value); -} - -/** - * Sets the bit flags of the queue - * @param value The bit flags - */ -void QueueInfo::setFlags(unsigned int value) -{ - snd_seq_queue_info_set_flags(m_Info, value); -} - -/** - * Sets the locked status of the queue - * @param locked The locked status - */ -void QueueInfo::setLocked(bool locked) -{ - snd_seq_queue_info_set_locked(m_Info, locked ? 1 : 0); -} - -/** - * Gets the size of the ALSA queue info object. - * @return The size of the ALSA object. - */ -int QueueInfo::getInfoSize() const -{ - return snd_seq_queue_info_sizeof(); -} - - -/** - * Default constructor - */ -QueueStatus::QueueStatus() -{ - snd_seq_queue_status_malloc(&m_Info); -} - -/** - * Constructor - * @param other ALSA queue status object pointer - */ -QueueStatus::QueueStatus(snd_seq_queue_status_t* other) -{ - snd_seq_queue_status_malloc(&m_Info); - snd_seq_queue_status_copy(m_Info, other); -} - -/** - * Copy constructor - * @param other An existing QueueStatus object reference - */ -QueueStatus::QueueStatus(const QueueStatus& other) -{ - snd_seq_queue_status_malloc(&m_Info); - snd_seq_queue_status_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -QueueStatus::~QueueStatus() -{ - snd_seq_queue_status_free(m_Info); -} - -/** - * Copy the current object and return the copy - * @return The pointer to the new object - */ -QueueStatus* QueueStatus::clone() -{ - return new QueueStatus(m_Info); -} - -/** - * Assignment operator - * @param other An existing QueueStatus object reference - * @return This object - */ -QueueStatus& QueueStatus::operator=(const QueueStatus& other) -{ - snd_seq_queue_status_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the queue's numeric identifier - * @return The queue's numeric identifier. - */ -int QueueStatus::getId() -{ - return snd_seq_queue_status_get_queue(m_Info); -} - -/** - * Gets the number of queued events - * @return The number of queued events - */ -int QueueStatus::getEvents() -{ - return snd_seq_queue_status_get_events(m_Info); -} - -/** - * Gets the real time (secods and nanoseconds) of the queue - * @return The queue's real time. - */ -const snd_seq_real_time_t* QueueStatus::getRealtime() -{ - return snd_seq_queue_status_get_real_time(m_Info); -} - -/** - * Gets the running status bits - * @return The running status bits - */ -unsigned int QueueStatus::getStatusBits() -{ - return snd_seq_queue_status_get_status(m_Info); -} - -/** - * Gets the musical time (ticks) of the queue - * @return The musical time - */ -snd_seq_tick_time_t QueueStatus::getTickTime() -{ - return snd_seq_queue_status_get_tick_time(m_Info); -} - -/** - * Gets the size of the ALSA status object - * @return The size of the ALSA object - */ -int QueueStatus::getInfoSize() const -{ - return snd_seq_queue_status_sizeof(); -} - -/** - * Gets the queue's running state - * @return True if the queue is running - */ -bool QueueStatus::isRunning() -{ - return (snd_seq_queue_status_get_status(m_Info) != 0); -} - -/** - * Gets the clock time in seconds of the queue - * @return The queue time in seconds - */ -double QueueStatus::getClockTime() -{ - const snd_seq_real_time_t* time = snd_seq_queue_status_get_real_time(m_Info); - return (time->tv_sec * 1.0) + (time->tv_nsec * 1.0e-9); -} - -/** - * Default constructor - */ -QueueTempo::QueueTempo() -{ - snd_seq_queue_tempo_malloc(&m_Info); -} - -/** - * Constructor - * @param other An ALSA queue tempo object pointer - */ -QueueTempo::QueueTempo(snd_seq_queue_tempo_t* other) -{ - snd_seq_queue_tempo_malloc(&m_Info); - snd_seq_queue_tempo_copy(m_Info, other); -} - -/** - * Copy constructor - * @param other An existing QueueTempo object reference - */ -QueueTempo::QueueTempo(const QueueTempo& other) -{ - snd_seq_queue_tempo_malloc(&m_Info); - snd_seq_queue_tempo_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -QueueTempo::~QueueTempo() -{ - snd_seq_queue_tempo_free(m_Info); -} - -/** - * Copy the current object returning the copied object - * @return The pointer to the new object - */ -QueueTempo* QueueTempo::clone() -{ - return new QueueTempo(m_Info); -} - -/** - * Assignment operator - * @param other An existing QueueTempo object reference - * @return This object - */ -QueueTempo& QueueTempo::operator=(const QueueTempo& other) -{ - snd_seq_queue_tempo_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the queue's numeric identifier - * @return The queue's numeric identifier - */ -int QueueTempo::getId() -{ - return snd_seq_queue_tempo_get_queue(m_Info); -} - -/** - * Gets the PPQ (parts per quarter note) resolution of the queue - * @return The PPQ (parts per quarter note) resolution - */ -int QueueTempo::getPPQ() -{ - return snd_seq_queue_tempo_get_ppq(m_Info); -} - -/** - * Gets the tempo skew numerator. The real skew factor is the quotient of this - * value divided by the skew base. - * @return The tempo skew numerator. - * @see getSkewBase(), setSkewValue(), setTempoFactor() - */ -unsigned int QueueTempo::getSkewValue() -{ - return snd_seq_queue_tempo_get_skew(m_Info); -} - -/** - * Gets the tempo skew base. The real skew factor is the quotient of the skew - * value divided by the skew base. - * @return The tempo skew base. - * @see getSkewValue(), setSkewValue(), setTempoFactor() - */ -unsigned int QueueTempo::getSkewBase() -{ - return snd_seq_queue_tempo_get_skew_base(m_Info); -} - -/** - * Gets the queue's tempo in microseconds per beat. - * @return The queue's tempo in microseconds per beat. - */ -unsigned int QueueTempo::getTempo() -{ - return snd_seq_queue_tempo_get_tempo(m_Info); -} - -/** - * Sets the queue resolution in parts per quarter note. - * @param value The queue resolution in PPQ. - */ -void QueueTempo::setPPQ(int value) -{ - snd_seq_queue_tempo_set_ppq(m_Info, value); -} - -/** - * Sets the tempo skew numerator. The real skew factor is the quotient of this - * value divided by the skew base. - * @param value The tempo skew numerator. - * @see getSkewBase(), getSkewValue(), setTempoFactor() - */ -void QueueTempo::setSkewValue(unsigned int value) -{ - snd_seq_queue_tempo_set_skew(m_Info, value); -} - -/** - * Sets the tempo skew base. The real skew factor is the quotient of the skew - * value divided by the skew base. - * @bug Protected because ALSA only accepts as argument a constant SKEW_BASE - * @param value The tempo skew base. - * @see getSkewBase(), getSkewValue(), setTempoFactor() - */ -void QueueTempo::setSkewBase(unsigned int value) -{ - snd_seq_queue_tempo_set_skew_base(m_Info, value); -} - -/** - * Sets the queue tempo in microseconds per beat - * @param value The tempo in microseconds per beat - */ -void QueueTempo::setTempo(unsigned int value) -{ - snd_seq_queue_tempo_set_tempo(m_Info, value); -} - -/** - * Gets the queue's nominal BPM tempo (in beats per minute) - * @return The queue's nominal BPM tempo (in beats per minute) - */ -float QueueTempo::getNominalBPM() -{ - int itempo = getTempo(); - if (itempo != 0) - return 6.0e7f / itempo; - return 0.0f; -} - -/** - * Gets the queue's real BPM tempo in beats per minute. The result is equal to - * the nominal BPM tempo multiplied by the skew factor. - * @return - */ -float QueueTempo::getRealBPM() -{ - float tempo = getNominalBPM(); - return tempo * getSkewValue() / SKEW_BASE; -} - -/** - * Sets the queue's tempo skew factor - * @param value The tempo skew factor. - */ -void QueueTempo::setTempoFactor(float value) -{ - setSkewValue(floor(SKEW_BASE * value)); - setSkewBase(SKEW_BASE); -} - -/** - * Sets the queue's nominal tempo in BPM (beats per minute). - * @param value The nominal tempo in BPM (beats per minute). - */ -void QueueTempo::setNominalBPM(float value) -{ - setTempo(floor(6.0e7f / value)); -} - -/** - * Gets the size of the ALSA queue tempo object - * @return The size of the ALSA object - */ -int QueueTempo::getInfoSize() const -{ - return snd_seq_queue_tempo_sizeof(); -} - -/** - * Default constructor - */ -QueueTimer::QueueTimer() -{ - snd_seq_queue_timer_malloc(&m_Info); -} - -/** - * Constructor - * @param other An ALSA queue timer object pointer - */ -QueueTimer::QueueTimer(snd_seq_queue_timer_t* other) -{ - snd_seq_queue_timer_malloc(&m_Info); - snd_seq_queue_timer_copy(m_Info, other); -} - -/** - * Copy constructor - * @param other An existing QueueTimer object reference - */ -QueueTimer::QueueTimer(const QueueTimer& other) -{ - snd_seq_queue_timer_malloc(&m_Info); - snd_seq_queue_timer_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -QueueTimer::~QueueTimer() -{ - snd_seq_queue_timer_free(m_Info); -} - -/** - * Copy the current object and return the copy - * @return The pointer to the new object - */ -QueueTimer* QueueTimer::clone() -{ - return new QueueTimer(m_Info); -} - -/** - * Assignment operator - * @param other An existing QueueTimer object reference - * @return This object - */ -QueueTimer& QueueTimer::operator=(const QueueTimer& other) -{ - snd_seq_queue_timer_copy(m_Info, other.m_Info); - return *this; -} - -/** - * The queue's numeric identifier - * @return The queue's numeric identifier - */ -int QueueTimer::getQueueId() -{ - return snd_seq_queue_timer_get_queue(m_Info); -} - -/** - * Gets the timer type. - * - * The timer type can be one of the following constants: - *
    - *
  • SND_SEQ_TIMER_ALSA: ALSA timer
  • - *
  • SND_SEQ_TIMER_MIDI_CLOCK: MIDI Clock (CLOCK event)
  • - *
  • SND_SEQ_TIMER_MIDI_TICK: MIDI Timer Tick (TICK event)
  • - *
- * @return the timer type. - * @see setType() - */ -snd_seq_queue_timer_type_t QueueTimer::getType() -{ - return snd_seq_queue_timer_get_type(m_Info); -} - -/** - * Gets the timer identifier record - * @return The timer identifier record pointer - */ -const snd_timer_id_t* QueueTimer::getId() -{ - return snd_seq_queue_timer_get_id(m_Info); -} - -/** - * Gets the timer resolution - * @return The timer resolution - */ -unsigned int QueueTimer::getResolution() -{ - return snd_seq_queue_timer_get_resolution(m_Info); -} - -/** - * Sets the timer type. - * The timer type can be one of the following constants: - *
    - *
  • SND_SEQ_TIMER_ALSA: ALSA timer
  • - *
  • SND_SEQ_TIMER_MIDI_CLOCK: MIDI Clock (CLOCK event)
  • - *
  • SND_SEQ_TIMER_MIDI_TICK: MIDI Timer Tick (TICK event)
  • - *
- * @param value The timer type - * @see getType() - */ -void QueueTimer::setType(snd_seq_queue_timer_type_t value) -{ - snd_seq_queue_timer_set_type(m_Info, value); -} - -/** - * Sets the timer identifier record - * @param value The timer identifier record pointer - */ -void QueueTimer::setId(snd_timer_id_t* value) -{ - snd_seq_queue_timer_set_id(m_Info, value); -} - -/** - * Sets the timer identifier record - * @param id Timer identifier object - */ -void QueueTimer::setId(const TimerId& id) -{ - setId(id.m_Info); -} - -/** - * Sets the timer resolution - * @param value The timer resolution - */ -void QueueTimer::setResolution(unsigned int value) -{ - snd_seq_queue_timer_set_resolution(m_Info, value); -} - -/** - * Gets the size of the ALSA queue timer object - * @return The size of the ALSA object - */ -int QueueTimer::getInfoSize() const -{ - return snd_seq_queue_timer_sizeof(); -} - -/** - * Constructor - * @param seq An existing MidiClient instance - * @param parent An optional parent object - */ -MidiQueue::MidiQueue(MidiClient* seq, QObject* parent) - : QObject(parent) -{ - m_MidiClient = seq; - m_Id = CHECK_ERROR(snd_seq_alloc_queue(m_MidiClient->getHandle())); - m_allocated = !(m_Id < 0); -} - -/** - * Constructor - * @param seq An existing MidiClient instance - * @param info A QueueInfo object reference - * @param parent An optional parent object - */ -MidiQueue::MidiQueue(MidiClient* seq, const QueueInfo& info, QObject* parent) - : QObject(parent) -{ - m_MidiClient = seq; - m_Info = info; - m_Id = CHECK_ERROR(snd_seq_create_queue(m_MidiClient->getHandle(), m_Info.m_Info)); - m_allocated = !(m_Id < 0); -} - -/** - * Constructor - * @param seq An existing MidiClient instance - * @param name The name for the new queue - * @param parent An optional parent object - */ -MidiQueue::MidiQueue(MidiClient* seq, const QString name, QObject* parent) - : QObject(parent) -{ - m_MidiClient = seq; - m_Id = CHECK_ERROR(snd_seq_alloc_named_queue(m_MidiClient->getHandle(), name.toLocal8Bit().data())); - m_allocated = !(m_Id < 0); -} - -/** - * Constructor. - * - * Note: this constructor doesn't allocate a new queue, it uses an existing one. - * @param seq An existing MidiClient instance - * @param queue_id An existing queue numeric identifier - * @param parent An optional parent object - */ -MidiQueue::MidiQueue(MidiClient* seq, const int queue_id, QObject* parent) - : QObject(parent) -{ - m_MidiClient = seq; - m_Id = queue_id; - m_allocated = false; -} - -/** - * Destructor - */ -MidiQueue::~MidiQueue() -{ - if ( m_allocated && (m_MidiClient->getHandle() != NULL) ) - { - CHECK_ERROR(snd_seq_free_queue(m_MidiClient->getHandle(), m_Id)); - } -} - -/** - * Gets a QueueInfo object reference - * @return A QueueInfo object reference - */ -QueueInfo& MidiQueue::getInfo() -{ - CHECK_WARNING(snd_seq_get_queue_info(m_MidiClient->getHandle(), m_Id, m_Info.m_Info)); - return m_Info; -} - -/** - * Gets a QueueStatus object reference - * @return A QueueStatus object reference - */ -QueueStatus& MidiQueue::getStatus() -{ - CHECK_WARNING(snd_seq_get_queue_status(m_MidiClient->getHandle(), m_Id, m_Status.m_Info)); - return m_Status; -} - -/** - * Gets a QueueTempo object reference - * @return A QueueTempo object reference - */ -QueueTempo& MidiQueue::getTempo() -{ - CHECK_WARNING(snd_seq_get_queue_tempo(m_MidiClient->getHandle(), m_Id, m_Tempo.m_Info)); - return m_Tempo; -} - -/** - * Gets a QueueTimer object reference - * @return A QueueTimer object reference - */ -QueueTimer& MidiQueue::getTimer() -{ - CHECK_WARNING(snd_seq_get_queue_timer(m_MidiClient->getHandle(), m_Id, m_Timer.m_Info)); - return m_Timer; -} - -/** - * Applies a QueueInfo object to the queue - * @param value A QueueInfo object reference - */ -void MidiQueue::setInfo(const QueueInfo& value) -{ - m_Info = value; - CHECK_WARNING(snd_seq_set_queue_info(m_MidiClient->getHandle(), m_Id, m_Info.m_Info)); -} - -/** - * Applies a QueueTempo object to the queue - * @param value A QueueTempo object reference - */ -void MidiQueue::setTempo(const QueueTempo& value) -{ - m_Tempo = value; - CHECK_WARNING(snd_seq_set_queue_tempo(m_MidiClient->getHandle(), m_Id, m_Tempo.m_Info)); -} - -/** - * Applies q QueueTimer object to the queue - * @param value A QueueTimer object reference - */ -void MidiQueue::setTimer(const QueueTimer& value) -{ - m_Timer = value; - CHECK_WARNING(snd_seq_set_queue_timer(m_MidiClient->getHandle(), m_Id, m_Timer.m_Info)); -} - -/** - * Gets the queue usage flag. - * - * @return 1 = client is allowed to access the queue, 0 = not allowed. - */ -int MidiQueue::getUsage() -{ - return CHECK_WARNING(snd_seq_get_queue_usage(m_MidiClient->getHandle(), m_Id)); -} - -/** - * Sets the queue usage flag. - * - * @param used 1 = client is allowed to access the queue, 0 = not allowed. - */ -void MidiQueue::setUsage(int used) -{ - CHECK_WARNING(snd_seq_set_queue_usage(m_MidiClient->getHandle(), m_Id, used)); -} - -/** - * Start the queue. - * - * This method should start running the queue from the initial position. - */ -void MidiQueue::start() -{ - CHECK_WARNING(snd_seq_start_queue(m_MidiClient->getHandle(), m_Id, NULL)); - CHECK_WARNING(snd_seq_drain_output(m_MidiClient->getHandle())); -} - -/** - * Stop the queue. - * - * This method should stop running the queue. - */ -void MidiQueue::stop() -{ - if (m_MidiClient != NULL && m_MidiClient->getHandle() != NULL) { - CHECK_WARNING(snd_seq_stop_queue(m_MidiClient->getHandle(), m_Id, NULL)); - CHECK_WARNING(snd_seq_drain_output(m_MidiClient->getHandle())); - } -} - -/** - * Start the queue without resetting the last position. - * - * This method should start running the queue from the last position set. - */ -void MidiQueue::continueRunning() -{ - CHECK_WARNING(snd_seq_continue_queue(m_MidiClient->getHandle(), m_Id, NULL)); - CHECK_WARNING(snd_seq_drain_output(m_MidiClient->getHandle())); -} - -/** - * Clear the queue, dropping any scheduled events. - */ -void MidiQueue::clear() -{ - if (m_MidiClient != NULL && m_MidiClient->getHandle() != NULL) - snd_seq_drop_output(m_MidiClient->getHandle()); -} - -/** - * Sets the queue position in musical time (ticks). - * @param pos Musical time in ticks. - */ -void MidiQueue::setTickPosition(snd_seq_tick_time_t pos) -{ - SystemEvent event(SND_SEQ_EVENT_SETPOS_TICK); - snd_seq_ev_set_queue_pos_tick(event.getHandle(), m_Id, pos); - event.setDirect(); - m_MidiClient->outputDirect(&event); -} - -/** - * Sets the queue position in real time (clock) units: seconds and nanoseconds. - * @param pos Real time (clock) position in seconds/nanoseconds. - */ -void MidiQueue::setRealTimePosition(snd_seq_real_time_t* pos) -{ - SystemEvent event(SND_SEQ_EVENT_SETPOS_TIME); - snd_seq_ev_set_queue_pos_real(event.getHandle(), m_Id, pos); - event.setDirect(); - m_MidiClient->outputDirect(&event); -} - -} /* namespace drumstick */ diff -Nru kmetronome-0.10.0/drumstick/src/alsatimer.cpp kmetronome-0.10.1/drumstick/src/alsatimer.cpp --- kmetronome-0.10.0/drumstick/src/alsatimer.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/alsatimer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1453 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsatimer.h" -#include -#include - -/** - * @file alsatimer.cpp - * Implementation of classes managing ALSA Timers - */ - -namespace drumstick { - -/** - * @addtogroup ALSATimer - * @{ - * - * Timers provide periodic time events to applications, and also to the ALSA - * sequencer. - * - * There are two mechanisms to deliver the timer events. To use the callback - * mechanism, a class must be derived from TimerEventHandler, and a instance - * of the derived class must be assigned to the Timer instance using - * Timer::setHandler(). If the handler is not assigned, then the Timer instance - * will generate the signal Timer::timerExpired(). - * - * Classes: - * - * TimerInfo: ALSA Timer information container. - * - * This class is used to hold properties about ALSA Timers. - * - * TimerId: ALSA Timer identifier container. - * - * This class provides an unique identifier for a Timer. - * - * TimerGlobalInfo: Global timer information container. - * - * This class provides global timer parameters. - * - * TimerQuery: ALSA Timer inquiry helper. - * - * This class provides a mechanism to enumerate the available system timers. - * - * TimerParams: ALSA Timer parameters container. - * - * This class provides several parameters about a Timer. - * - * TimerStatus: ALSA Timer status container. - * - * This class provides some status information about a Timer. - * - * TimerEventHandler: ALSA Timer events handler. - * - * This abstract class is used to define an interface that other class can - * implement to receive timer events. - * - * Timer: ALSA Timer management. - * - * This class represents an ALSA timer object. - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___timer.html - * @} - */ - -/** - * Constructor - */ -TimerInfo::TimerInfo() -{ - snd_timer_info_malloc(&m_Info); -} - -/** - * Cosntructor - * @param other ALSA timer info object pointer - */ -TimerInfo::TimerInfo(const snd_timer_info_t *other) -{ - snd_timer_info_malloc(&m_Info); - snd_timer_info_copy(m_Info, other); -} - -/** - * Copy constructor - * @param other Existing TimerInfo object reference - */ -TimerInfo::TimerInfo(const TimerInfo& other) -{ - snd_timer_info_malloc(&m_Info); - snd_timer_info_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -TimerInfo::~TimerInfo() -{ - snd_timer_info_free(m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -TimerInfo* -TimerInfo::clone() -{ - return new TimerInfo(m_Info); -} - -/** - * Assignment operator - * @param other Existing TimerInfo object reference - */ -TimerInfo& -TimerInfo::operator=(const TimerInfo& other) -{ - snd_timer_info_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Check if the timer is slave (depends on another device) - * @return True if the timer is slave - */ -bool -TimerInfo::isSlave() -{ - return (snd_timer_info_is_slave(m_Info) != 0); -} - -/** - * Gets the card number - * @return Card number - */ -int -TimerInfo::getCard() -{ - return snd_timer_info_get_card(m_Info); -} - -/** - * Gets the string identifier - * @return String identifier - */ -QString -TimerInfo::getId() -{ - return QString(snd_timer_info_get_id(m_Info)); -} - -/** - * Gets the timer name - * @return Timer name - */ -QString -TimerInfo::getName() -{ - return QString(snd_timer_info_get_name(m_Info)); -} - -/** - * Gets the timer resolution (timer period in nanoseconds) - * @return Timer resolution in nanos - */ -long -TimerInfo::getResolution() -{ - return snd_timer_info_get_resolution(m_Info); -} - -/** - * Gets the timer frequency in Hz - * @return Timer frequency in Hz - */ -long -TimerInfo::getFrequency() -{ - long res = getResolution(); - if (res > 0) - { - return 1000000000L / res; - } - return 0; -} - -/** - * Gets the size of the ALSA timer info object - * @return Size of the ALSA object - */ -int -TimerInfo::getSizeOfInfo() const -{ - return snd_timer_info_sizeof(); -} - -/** - * Gets the maximum timer ticks - * @deprecated - * @return Maximum timer ticks - */ -long -TimerInfo::getTicks() -{ - return snd_timer_info_get_ticks(m_Info); -} - -/** - * Constructor - */ -TimerId::TimerId() -{ - snd_timer_id_malloc(&m_Info); -} - -/** - * Constructor - * @param other ALSA timer ID object pointer - */ -TimerId::TimerId(const snd_timer_id_t *other) -{ - snd_timer_id_malloc(&m_Info); - snd_timer_id_copy(m_Info, other); - if (getCard() < 0) - setCard(0); - if (getDevice() < 0) - setDevice(0); - if (getSubdevice() < 0) - setSubdevice(0); -} - -/** - * Copy constructor - * @param other Existing TimerId object reference - */ -TimerId::TimerId(const TimerId& other) -{ - snd_timer_id_malloc(&m_Info); - snd_timer_id_copy(m_Info, other.m_Info); - if (getCard() < 0) - setCard(0); - if (getDevice() < 0) - setDevice(0); - if (getSubdevice() < 0) - setSubdevice(0); -} - -/** - * Constructor - * @param cls Class - * @param scls Subclass - * @param card Card - * @param dev Device - * @param sdev Subdevice - */ -TimerId::TimerId(int cls, int scls, int card, int dev, int sdev) -{ - snd_timer_id_malloc(&m_Info); - setClass(cls); - setSlaveClass(scls); - setCard(card); - setDevice(dev); - setSubdevice(sdev); -} - -/** - * Destructor - */ -TimerId::~TimerId() -{ - snd_timer_id_free(m_Info); -} - -/** - * Copy the object - * @return Pointer to the new object - */ -TimerId* -TimerId::clone() -{ - return new TimerId(m_Info); -} - -/** - * Assignment operator - * @param other Existing TimerId object reference - * @return This object - */ -TimerId& -TimerId::operator=(const TimerId& other) -{ - snd_timer_id_copy(m_Info, other.m_Info); - if (getCard() < 0) - setCard(0); - if (getDevice() < 0) - setDevice(0); - if (getSubdevice() < 0) - setSubdevice(0); - return *this; -} - -/** - * Set the class identifier. Existing classes: - *
    - *
  • SND_TIMER_CLASS_SLAVE: slave timer
  • - *
  • SND_TIMER_CLASS_GLOBAL: global timer
  • - *
  • SND_TIMER_CLASS_CARD: card timer
  • - *
  • SND_TIMER_CLASS_PCM: PCM timer
  • - *
- * @param devclass Class identifier. - */ -void -TimerId::setClass(int devclass) -{ - snd_timer_id_set_class(m_Info, devclass); -} - -/** - * Gets the class identifier. - * @return Class identifier - * @see setClass() - */ -int -TimerId::getClass() -{ - return snd_timer_id_get_class(m_Info); -} - -/** - * Sets the Slave class - * @param devsclass Slave class - */ -void -TimerId::setSlaveClass(int devsclass) -{ - snd_timer_id_set_sclass(m_Info, devsclass); -} - -/** - * Gets the slave class - * @return Slave class - */ -int -TimerId::getSlaveClass() -{ - return snd_timer_id_get_sclass(m_Info); -} - -/** - * Sets the card number - * @param card Card number - */ -void -TimerId::setCard(int card) -{ - snd_timer_id_set_card(m_Info, card); -} - -/** - * Gets the card number - * @return Card number - */ -int -TimerId::getCard() -{ - return snd_timer_id_get_card(m_Info); -} - -/** - * Sets the device number - * @param device Device number - */ -void -TimerId::setDevice(int device) -{ - snd_timer_id_set_device(m_Info, device); -} - -/** - * Gets the device number - * @return Device number - */ -int -TimerId::getDevice() -{ - return snd_timer_id_get_device(m_Info); -} - -/** - * Sets the subdevice number - * @param subdevice Subdevice number - */ -void -TimerId::setSubdevice(int subdevice) -{ - snd_timer_id_set_subdevice (m_Info, subdevice); -} - -/** - * Gets the subdevice number - * @return Subdevice number - */ -int -TimerId::getSubdevice() -{ - return snd_timer_id_get_subdevice(m_Info); -} - -/** - * Gets the size of the ALSA timer ID object - * @return Size of the ALSA object - */ -int -TimerId::getSizeOfInfo() const -{ - return snd_timer_id_sizeof(); -} - -/** - * Constructor - * @param deviceName Device name, usually "hw" - * @param openMode Open mode (unknown values) - */ -TimerQuery::TimerQuery(const QString& deviceName, int openMode) -{ - CHECK_WARNING( snd_timer_query_open( &m_Info, - deviceName.toLocal8Bit().data(), - openMode )); - readTimers(); -} - -/** - * Constructor - * @param deviceName Device name, usually "hw" - * @param openMode Open mode (unknown values) - * @param conf ALSA configuration object pointer - */ -TimerQuery::TimerQuery( const QString& deviceName, int openMode, - snd_config_t* conf ) -{ - CHECK_WARNING( snd_timer_query_open_lconf( &m_Info, - deviceName.toLocal8Bit().data(), - openMode, conf )); - readTimers(); -} - -/** - * Destructor - */ -TimerQuery::~TimerQuery() -{ - freeTimers(); - snd_timer_query_close(m_Info); -} - -/** - * Enumerate the available timers storing the results into an internal list - */ -void -TimerQuery::readTimers() -{ - TimerId tid; - snd_timer_id_set_class(tid.m_Info, SND_TIMER_CLASS_NONE); - for(;;) - { - int rc = snd_timer_query_next_device(m_Info, tid.m_Info); - if ((rc < 0) || (tid.getClass() < 0)) { - break; - } - m_timers.append(tid); - } -} - -/** - * Release the internal list of timers - */ -void -TimerQuery::freeTimers() -{ - m_timers.clear(); -} - -/** - * Get a TimerGlobalInfo object - * @return TimerGlobalInfo object reference - */ -TimerGlobalInfo& -TimerQuery::getGlobalInfo() -{ - snd_timer_query_info(m_Info, m_GlobalInfo.m_Info); - return m_GlobalInfo; -} - -/** - * Sets the global parameters - * @param params Pointer to an ALSA timer global parameters object - */ -void -TimerQuery::setGlobalParams(snd_timer_gparams_t* params) -{ - snd_timer_query_params(m_Info, params); -} - -/** - * Gets the global timer parameters - * @param params Pointer to an ALSA timer global parameters object - */ -void -TimerQuery::getGlobalParams(snd_timer_gparams_t* params) -{ - snd_timer_query_params(m_Info, params); -} - -/** - * Gets the global timer status - * @param status Pointer to an ALSA timer global status object - */ -void -TimerQuery::getGlobalStatus(snd_timer_gstatus_t *status) -{ - snd_timer_query_status(m_Info, status); -} - -/** - * Default constructor - */ -TimerGlobalInfo::TimerGlobalInfo() -{ - snd_timer_ginfo_malloc(&m_Info); -} - -/** - * Constructor - * @param other ALSA global info object pointer - */ -TimerGlobalInfo::TimerGlobalInfo(const snd_timer_ginfo_t* other) -{ - snd_timer_ginfo_malloc(&m_Info); - snd_timer_ginfo_copy(m_Info, other); -} - -/** - * Copy constructor - * @param other Existing TimerGlobalInfo object reference - */ -TimerGlobalInfo::TimerGlobalInfo(const TimerGlobalInfo& other) -{ - snd_timer_ginfo_malloc(&m_Info); - snd_timer_ginfo_copy(m_Info, other.m_Info); -} - -/** - * Destructor - */ -TimerGlobalInfo::~TimerGlobalInfo() -{ - snd_timer_ginfo_free(m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -TimerGlobalInfo* -TimerGlobalInfo::clone() -{ - return new TimerGlobalInfo(m_Info); -} - -/** - * Assignment operator - * @param other Existing TimerGlobalInfo object reference - * @return This object - */ -TimerGlobalInfo& -TimerGlobalInfo::operator=(const TimerGlobalInfo& other) -{ - snd_timer_ginfo_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Sets the timer identifier - * @param tid TimerId object reference - */ -void -TimerGlobalInfo::setTimerId(const TimerId& tid) -{ - m_Id = tid; - snd_timer_ginfo_set_tid (m_Info, m_Id.m_Info); -} - -/** - * Gets the timer identifier - * @return TimerId object reference - */ -TimerId& -TimerGlobalInfo::getTimerId() -{ - m_Id = TimerId(snd_timer_ginfo_get_tid (m_Info)); - return m_Id; -} - -/** - * Gets the flags - * @return Undocumented flags - */ -unsigned int -TimerGlobalInfo::getFlags() -{ - return snd_timer_ginfo_get_flags (m_Info); -} - -/** - * Gets the card number - * @return Card number - */ -int -TimerGlobalInfo::getCard() -{ - return snd_timer_ginfo_get_card (m_Info); -} - -/** - * Gets the timer ID string - * @return Timer ID string - */ -QString -TimerGlobalInfo::getId() -{ - return QString(snd_timer_ginfo_get_id (m_Info)); -} - -/** - * Gets the timer name - * @return Timer name - */ -QString -TimerGlobalInfo::getName() -{ - return QString(snd_timer_ginfo_get_name (m_Info)); -} - -/** - * Gets the timer resolution in ns - * @return Timer resolution in ns - */ -unsigned long -TimerGlobalInfo::getResolution() -{ - return snd_timer_ginfo_get_resolution (m_Info); -} - -/** - * Gets timer minimal resolution in ns - * @return Minimal resolution in ns - */ -unsigned long -TimerGlobalInfo::getMinResolution() -{ - return snd_timer_ginfo_get_resolution_min (m_Info); -} - -/** - * Gets timer maximal resolution in ns - * @return Maximal resolution in ns - */ -unsigned long -TimerGlobalInfo::getMaxResolution() -{ - return snd_timer_ginfo_get_resolution_max(m_Info); -} - -/** - * Gets current timer clients - * @return Current clients - */ -unsigned int -TimerGlobalInfo::getClients() -{ - return snd_timer_ginfo_get_clients(m_Info); -} - -/** - * Gets the size of the ALSA timer global info object - * @return Size of the ALSA object - */ -int -TimerGlobalInfo::getSizeOfInfo() const -{ - return snd_timer_ginfo_sizeof(); -} - -/** - * Default constructor - */ -TimerParams::TimerParams() -{ - snd_timer_params_malloc (&m_Info); -} - -/** - * Constructor - * @param other Pointer to an ALSA timer parameters object - */ -TimerParams::TimerParams(const snd_timer_params_t *other) -{ - snd_timer_params_malloc (&m_Info); - snd_timer_params_copy (m_Info, other); -} - -/** - * Copy constructor - * @param other Existing TimerParams object reference - */ -TimerParams::TimerParams(const TimerParams& other) -{ - snd_timer_params_malloc (&m_Info); - snd_timer_params_copy (m_Info, other.m_Info); -} - -/** - * Destructor - * @return - */ -TimerParams::~TimerParams() -{ - snd_timer_params_free (m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -TimerParams* -TimerParams::clone() -{ - return new TimerParams(m_Info); -} - -/** - * Assignment operator - * @param other Existing TimerParams object reference - * @return This object - */ -TimerParams& -TimerParams::operator=(const TimerParams& other) -{ - snd_timer_params_copy (m_Info, other.m_Info); - return *this; -} - -/** - * Sets the automatic start flag - * @param auto_start Value for the automatic start flag - */ -void -TimerParams::setAutoStart(bool auto_start) -{ - snd_timer_params_set_auto_start (m_Info, auto_start ? 1 : 0); -} - -/** - * Gets the automatic start flag - * @return True if the timer starts automatically - */ -bool -TimerParams::getAutoStart() -{ - return (snd_timer_params_get_auto_start (m_Info) != 0); -} - -/** - * Sets the exclusive flag - * @param exclusive True if the timer has the exclusive flag - */ -void -TimerParams::setExclusive(bool exclusive) -{ - snd_timer_params_set_exclusive (m_Info, exclusive ? 1 : 0); -} - -/** - * Gets the timer's exclusive flag - * @return True if the timer has the exclusive flag - */ -bool -TimerParams::getExclusive() -{ - return (snd_timer_params_get_exclusive (m_Info) != 0); -} - -/** - * Sets the timer early event - * @param early_event Timer early event - */ -void -TimerParams::setEarlyEvent(bool early_event) -{ - snd_timer_params_set_early_event (m_Info, early_event ? 1 : 0); -} - -/** - * Gets the timer early event - * @return Timer early event - */ -bool -TimerParams::getEarlyEvent() -{ - return (snd_timer_params_get_early_event (m_Info) != 0); -} - -/** - * Sets the timer ticks - * @param ticks Timer ticks - */ -void -TimerParams::setTicks(long ticks) -{ - snd_timer_params_set_ticks (m_Info, ticks); -} - -/** - * Gets the timer ticks - * @return Timer ticks - */ -long -TimerParams::getTicks() -{ - return snd_timer_params_get_ticks (m_Info); -} - -/** - * Sets the queue size (32-1024) - * @param queue_size Queue size - */ -void -TimerParams::setQueueSize(long queue_size) -{ - snd_timer_params_set_queue_size (m_Info, queue_size); -} - -/** - * Gets the queue size - * @return Queue size - */ -long -TimerParams::getQueueSize() -{ - return snd_timer_params_get_queue_size (m_Info); -} - -/** - * Sets the event filter - * @param filter Event filter - */ -void -TimerParams::setFilter(unsigned int filter) -{ - snd_timer_params_set_filter (m_Info, filter); -} - -/** - * Gets the event filter - * @return Event filter - */ -unsigned int -TimerParams::getFilter() -{ - return snd_timer_params_get_filter (m_Info); -} - -/** - * Gets the size of the ALSA timer parameters object - * @return Size of the ALSA object - */ -int -TimerParams::getSizeOfInfo() const -{ - return snd_timer_params_sizeof(); -} - -/** - * Default constructor - */ -TimerStatus::TimerStatus() -{ - snd_timer_status_malloc (&m_Info); -} - -/** - * Constructor - * @param other Pointer to an existing ALSA timer status object - */ -TimerStatus::TimerStatus(const snd_timer_status_t *other) -{ - snd_timer_status_malloc (&m_Info); - snd_timer_status_copy (m_Info, other); -} - -/** - * Copy constructor - * @param other Existing TimerStatus object reference - */ -TimerStatus::TimerStatus(const TimerStatus& other) -{ - snd_timer_status_malloc (&m_Info); - snd_timer_status_copy (m_Info, other.m_Info); -} - -/** - * Destructor - */ -TimerStatus::~TimerStatus() -{ - snd_timer_status_free (m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -TimerStatus* -TimerStatus::clone() -{ - return new TimerStatus(m_Info); -} - -/** - * Assignment operator - * @param other Existing TimerStatus object reference - * @return This object - */ -TimerStatus& -TimerStatus::operator=(const TimerStatus& other) -{ - snd_timer_status_copy (m_Info, other.m_Info); - return *this; -} - -/** - * Gets the high resolution time-stamp - * @return High resolution time-stamp - */ -snd_htimestamp_t -TimerStatus::getTimestamp() -{ - return snd_timer_status_get_timestamp (m_Info); -} - -/** - * Gets the resolution in us - * @return Resolution in us - */ -long -TimerStatus::getResolution() -{ - return snd_timer_status_get_resolution (m_Info); -} - -/** - * Gets the master tick lost count - * @return Master tick lost count - */ -long -TimerStatus::getLost() -{ - return snd_timer_status_get_lost (m_Info); -} - -/** - * Gets the overrun count - * @return Overrun count - */ -long -TimerStatus::getOverrun() -{ - return snd_timer_status_get_overrun (m_Info); -} - -/** - * Gets the count of used queue elements - * @return Count of used queue elements - */ -long -TimerStatus::getQueue() -{ - return snd_timer_status_get_queue (m_Info); -} - -/** - * Gets the size of the ALSA timer status object - * @return Size of the ALSA object - */ -int -TimerStatus::getSizeOfInfo() const -{ - return snd_timer_status_sizeof(); -} - -/** - * Constructor. - * Open flags can be a combination of the following constants: - *
    - *
  • SND_TIMER_OPEN_NONBLOCK: non-blocking behavior
  • - *
  • SND_TIMER_OPEN_TREAD: enhanced read, use time-stamps and event notification
  • - *
- * @param deviceName Name of the device - * @param openMode Open mode flags bitmap - * @param parent Optional parent object - */ -Timer::Timer( const QString& deviceName, int openMode, QObject* parent ) - : QObject(parent), - m_asyncHandler(NULL), - m_handler(NULL), - m_thread(NULL), - m_deviceName(deviceName) -{ - CHECK_ERROR( snd_timer_open( &m_Info, m_deviceName.toLocal8Bit().data(), - openMode )); -} - -/** - * Constructor. - * Open flags can be a combination of the following constants: - *
    - *
  • SND_TIMER_OPEN_NONBLOCK: non-blocking behavior
  • - *
  • SND_TIMER_OPEN_TREAD: enhanced read, use time-stamps and event notification
  • - *
- * @param deviceName Name of the device - * @param openMode Open mode flags bitmap - * @param conf ALSA configuration object pointer - * @param parent Optional parent object - */ -Timer::Timer( const QString& deviceName, int openMode, snd_config_t* conf, - QObject* parent ) - : QObject(parent), - m_asyncHandler(NULL), - m_handler(NULL), - m_thread(NULL), - m_deviceName(deviceName) -{ - CHECK_ERROR( snd_timer_open_lconf( &m_Info, - m_deviceName.toLocal8Bit().data(), - openMode, conf )); -} - -/** - * Constructor - * Open flags can be a combination of the following constants: - *
    - *
  • SND_TIMER_OPEN_NONBLOCK: non-blocking behavior
  • - *
  • SND_TIMER_OPEN_TREAD: enhanced read, use time-stamps and event notification
  • - *
- * @param id TimerId object reference - * @param openMode Open mode flags bitmap - * @param parent Optional parent object - */ -Timer::Timer( TimerId& id, int openMode, QObject* parent ) - : QObject(parent), - m_asyncHandler(NULL), - m_handler(NULL), - m_thread(NULL) -{ - m_deviceName = QString("hw:CLASS=%1,SCLASS=%2,CARD=%3,DEV=%4,SUBDEV=%5") - .arg(id.getClass()) - .arg(id.getSlaveClass()) - .arg(id.getCard()) - .arg(id.getDevice()) - .arg(id.getSubdevice()); - CHECK_ERROR( snd_timer_open( &m_Info, - m_deviceName.toLocal8Bit().data(), - openMode )); -} - -/** - * Constructor. - * Open flags can be a combination of the following constants: - *
    - *
  • SND_TIMER_OPEN_NONBLOCK: non-blocking behavior
  • - *
  • SND_TIMER_OPEN_TREAD: enhanced read, use time-stamps and event notification
  • - *
- * @param cls Class - * @param scls Subclass - * @param card Card - * @param dev Device - * @param sdev Subdevice - * @param openMode Open mode flags bitmap - * @param parent Optional parent object - */ -Timer::Timer( int cls, int scls, int card, int dev, int sdev, - int openMode, QObject* parent ) - : QObject(parent), - m_asyncHandler(NULL), - m_handler(NULL), - m_thread(NULL) -{ - m_deviceName = QString("hw:CLASS=%1,SCLASS=%2,CARD=%3,DEV=%4,SUBDEV=%5") - .arg(cls) - .arg(scls) - .arg(card) - .arg(dev) - .arg(sdev); - CHECK_ERROR( snd_timer_open( &m_Info, - m_deviceName.toLocal8Bit().data(), - openMode )); -} - -/** - * Destructor. - */ -Timer::~Timer() -{ - stopEvents(); - if (m_thread != NULL) - delete m_thread; - CHECK_WARNING(snd_timer_close(m_Info)); -} - -/** - * Adds an asynchronous timer handler function. - * @param callback Function handler - * @param private_data Any data that will be passed to the callback - */ -void -Timer::addAsyncTimerHandler(snd_async_callback_t callback, void *private_data) -{ - CHECK_WARNING(snd_async_add_timer_handler(&m_asyncHandler, m_Info, callback, private_data)); -} - -/** - * Gets the ALSA timer handle - * @return ALSA timer handle - */ -snd_timer_t* -Timer::getTimerHandle() -{ - return snd_async_handler_get_timer(m_asyncHandler); -} - -/** - * Gets the count of poll descriptors - * @return Count of poll descriptors - */ -int -Timer::getPollDescriptorsCount() -{ - return snd_timer_poll_descriptors_count(m_Info); -} - -/** - * Gets poll descriptors - * @param pfds Pointer to a pollfd array - * @param space Number of pollfd elements available - */ -void -Timer::pollDescriptors(struct pollfd *pfds, unsigned int space) -{ - CHECK_WARNING(snd_timer_poll_descriptors(m_Info, pfds, space)); -} - -/** - * Gets returned events from poll descriptors - * @param pfds Pointer to a pollfd array - * @param nfds Number of pollfd elements available - * @param revents Returned events - */ -void -Timer::pollDescriptorsRevents(struct pollfd *pfds, unsigned int nfds, unsigned short *revents) -{ - CHECK_WARNING(snd_timer_poll_descriptors_revents(m_Info, pfds, nfds, revents)); -} - -/** - * Gets the timer info object - * @return TimerInfo object reference - */ -TimerInfo& -Timer::getTimerInfo() -{ - snd_timer_info (m_Info, m_TimerInfo.m_Info); - return m_TimerInfo; -} - -/** - * Sets the timer parameters - * @param params TimerParams object reference - */ -void -Timer::setTimerParams(const TimerParams& params) -{ - CHECK_WARNING( snd_timer_params(m_Info, params.m_Info) ); -} - -/** - * Gets the timer status - * @return TimerStatus object reference - */ -TimerStatus& -Timer::getTimerStatus() -{ - CHECK_WARNING( snd_timer_status(m_Info, m_TimerStatus.m_Info) ); - return m_TimerStatus; -} - -/** - * Start rolling the timer - */ -void -Timer::start() -{ - CHECK_WARNING(snd_timer_start(m_Info)); -} - -/** - * Stop rolling the timer - */ -void -Timer::stop() -{ - CHECK_WARNING(snd_timer_stop(m_Info)); -} - -/** - * Continue rolling the timer - */ -void -Timer::continueRunning() -{ - CHECK_WARNING(snd_timer_continue(m_Info)); -} - -/** - * Read bytes from the timer handle - * @param buffer Buffer to store the input bytes - * @param size Input buffer size in bytes - * @return Bytes read from the timer - */ -ssize_t -Timer::read(void *buffer, size_t size) -{ - return snd_timer_read(m_Info, buffer, size); -} - -/** - * Internal function to deliver the timer events using one of the two available - * methods: - *
    - *
  • TimerEventHandler instance pointer provided in Timer::setHandler()
  • - *
  • A signal Timer::timerExpired() is emitted, otherwise
  • - *
- */ -void -Timer::doEvents() -{ - snd_timer_tread_t tr; - while ( read(&tr, sizeof(tr)) == sizeof(tr) ) { - int msecs = ((tr.tstamp.tv_sec - m_last_time.tv_sec) * 1000) + - round((tr.tstamp.tv_nsec - m_last_time.tv_nsec) / 1000000.0); - m_last_time = tr.tstamp; - if ( m_handler != NULL ) - m_handler->handleTimerEvent(tr.val, msecs); - else - emit timerExpired(tr.val, msecs); - } -} - -/** - * Starts the events dispatching thread - */ -void Timer::startEvents() -{ - m_last_time = getTimerStatus().getTimestamp(); - if (m_thread == NULL) { - m_thread = new TimerInputThread(this, 500); - m_thread->start(); - } -} - -/** - * Stops the events dispatching thread - */ -void Timer::stopEvents() -{ - int counter = 0; - if (m_thread != NULL) { - m_thread->stop(); - while (!m_thread->wait(500) && (counter < 10)) { - counter++; - } - if (!m_thread->isFinished()) { - m_thread->terminate(); - } - delete m_thread; - } -} - -/** - * Check and return the best available global TimerId in the system, meaning - * the timer with higher frequency (or lesser period, resolution). - * @return A TimerId object - */ -TimerId -Timer::bestGlobalTimerId() -{ - TimerId id; - snd_timer_t* timer; - snd_timer_info_t* info; - long res, best_res = LONG_MAX; - char timername[64]; - int test_devs[] = { - SND_TIMER_GLOBAL_SYSTEM - , SND_TIMER_GLOBAL_RTC -#ifdef SND_TIMER_GLOBAL_HPET - , SND_TIMER_GLOBAL_HPET -#endif -#ifdef SND_TIMER_GLOBAL_HRTIMER - , SND_TIMER_GLOBAL_HRTIMER -#endif - }; - int max_global_timers = sizeof(test_devs)/sizeof(int); - int clas = SND_TIMER_CLASS_GLOBAL; - int scls = SND_TIMER_SCLASS_NONE; - int card = 0; - int dev = SND_TIMER_GLOBAL_SYSTEM; - int sdev = 0; - int err = 0; - int is_slave = 0; - int i; - snd_timer_info_alloca(&info); - // default system timer - id.setClass(clas); - id.setSlaveClass(scls); - id.setCard(card); - id.setDevice(dev); - id.setSubdevice(sdev); - // select a non slave timer with the lowest resolution value - for( i = 0; i < max_global_timers; ++i ) - { - dev = test_devs[i]; - sprintf( timername, "hw:CLASS=%i,SCLASS=%i,CARD=%i,DEV=%i,SUBDEV=%i", - clas, scls, card, dev, sdev ); - err = snd_timer_open(&timer, timername, SND_TIMER_OPEN_NONBLOCK); - if (err < 0) continue; - err = snd_timer_info(timer, info); - if (err == 0) { - is_slave = snd_timer_info_is_slave(info); - res = snd_timer_info_get_resolution(info); - if ((is_slave == 0) && (best_res > res)) { - best_res = res; - id.setDevice(dev); - } - } - snd_timer_close(timer); - } - return id; -} - -/** - * Check and return the best available global Timer in the system, meaning - * the timer with higher frequency (or lesser period, resolution). - * @param openMode Open mode flags - * @param parent Optional parent object - * @return A new Timer instance pointer - */ -Timer* -Timer::bestGlobalTimer(int openMode, QObject* parent) -{ - TimerId id = bestGlobalTimerId(); - return new Timer(id, openMode, parent); -} - -/** - * Loop reading and dispatching timer events. - */ -void -Timer::TimerInputThread::run() -{ - int err, count; - struct pollfd *fds; - if (m_timer == NULL) return; - - count = m_timer->getPollDescriptorsCount(); - fds = (pollfd *) calloc(count, sizeof(struct pollfd)); - if (fds == NULL) { - qWarning() << "allocation error!"; - return; - } - fds->events = POLLIN; - fds->revents = 0; - - try { - while (!stopped() && (m_timer != NULL)) { - m_timer->pollDescriptors(fds, count); - if ((err = poll(fds, count, m_Wait)) < 0) { - qWarning() << "poll error " << err << "(" << strerror(err) << ")"; - return; - } - if (err == 0) { - qWarning() << "timer time out"; - return; - } - m_timer->doEvents(); - } - } catch (...) { - qWarning() << "exception in input thread"; - } - free(fds); -} - -/** - * Returns the rolling state of the timer thread - * @return The stopped state - */ -bool -Timer::TimerInputThread::stopped() -{ - m_mutex.lockForRead(); - bool bTmp = m_Stopped; - m_mutex.unlock(); - return bTmp; -} - -/** - * Stop the thread - */ -void -Timer::TimerInputThread::stop() -{ - m_mutex.lockForWrite(); - m_Stopped = true; - m_mutex.unlock(); -} - -} /* namespace drumstick */ diff -Nru kmetronome-0.10.0/drumstick/src/playthread.cpp kmetronome-0.10.1/drumstick/src/playthread.cpp --- kmetronome-0.10.0/drumstick/src/playthread.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/playthread.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "playthread.h" -#include "alsaclient.h" -#include "alsaqueue.h" - -/** - * @file playthread.cpp - * Implementation of a sequencer output thread - */ - -namespace drumstick { - -/** - * @addtogroup PlayThread - * @{ - * - * SequencerOutputThread provides MIDI sequence playback. - * - * This is an abstract class that must be extended providing - * an implementation for the pure virtual methods: - * SequencerOutputThread::hasNext() and SequencerOutputThread::nextEvent() - * before using it for MIDI sequence playback. You can use any structure or - * class you prefer to store the SequencerEvent objects, but they must be - * provided ordered by time. A simplistic Song definition may be: - * - * @code - * typedef QList Song; - * @endcode - * - * Using this class is optional. You may prefer another mechanism to - * manage playback actions. This class uses a thread to manage the - * sequence playback as a background task. - * @} - */ - -const int TIMEOUT = 100; - -/** - * Constructor - * @param seq Existing MidiClient object pointer - * @param portId Numeric input/output port identifier - */ -SequencerOutputThread::SequencerOutputThread(MidiClient *seq, int portId) - : QThread(), - m_MidiClient(seq), - m_Queue(0), - m_PortId(portId), - m_Stopped(false), - m_QueueId(0), - m_npfds(0), - m_pfds(0) -{ - if (m_MidiClient != NULL) { - m_Queue = m_MidiClient->getQueue(); - m_QueueId = m_Queue->getId(); - } -} - -/** - * Checks if stop has been requested - * @return True if stop has been requested - * @since 0.2.0 - */ -bool -SequencerOutputThread::stopRequested() -{ - m_mutex.lockForRead(); - bool bTmp = m_Stopped; - m_mutex.unlock(); - return bTmp; -} - -/** - * Stops the playback task - */ -void -SequencerOutputThread::stop() -{ - m_mutex.lockForWrite(); - m_Stopped = true; - m_mutex.unlock(); - while (isRunning()) - wait(TIMEOUT); -} - -/** - * Sends an echo event, with the same PortId as sender and destination. - * @param tick Event schedule time in ticks. - */ -void -SequencerOutputThread::sendEchoEvent(int tick) -{ - if (!stopRequested() && m_MidiClient != NULL) { - SystemEvent ev(SND_SEQ_EVENT_ECHO); - ev.setSource(m_PortId); - ev.setDestination(m_MidiClient->getClientId(), m_PortId); - ev.scheduleTick(m_QueueId, tick, false); - sendSongEvent(&ev); - } -} - -/** - * Sends a SequencerEvent - * @param ev SequencerEvent object pointer - */ -void -SequencerOutputThread::sendSongEvent(SequencerEvent* ev) -{ - if (m_MidiClient != NULL) { - while (!stopRequested() && - (snd_seq_event_output_direct(m_MidiClient->getHandle(), ev->getHandle()) < 0)) - poll(m_pfds, m_npfds, TIMEOUT); - } -} - -/** - * Flush the ALSA output buffer. - */ -void -SequencerOutputThread::drainOutput() -{ - if (m_MidiClient != NULL) { - while (!stopRequested() && - (snd_seq_drain_output(m_MidiClient->getHandle()) < 0)) - poll(m_pfds, m_npfds, TIMEOUT); - } -} - -/** - * Waits until the ALSA output queue is empty (all the events have been played.) - */ -void -SequencerOutputThread::syncOutput() -{ - if (!stopRequested() && m_MidiClient != NULL) { - QueueStatus status = m_Queue->getStatus(); - while (!stopRequested() && (status.getEvents() > 0)) { - usleep(TIMEOUT); - status = m_Queue->getStatus(); - } - } -} - -/** - * Thread process loop - */ -void SequencerOutputThread::run() -{ - unsigned int last_tick; - if (m_MidiClient != NULL) { - try { - m_npfds = snd_seq_poll_descriptors_count(m_MidiClient->getHandle(), POLLOUT); - m_pfds = (pollfd*) alloca(m_npfds * sizeof(pollfd)); - snd_seq_poll_descriptors(m_MidiClient->getHandle(), m_pfds, m_npfds, POLLOUT); - last_tick = getInitialPosition(); - if (last_tick == 0) { - m_Queue->start(); - } else { - m_Queue->setTickPosition(last_tick); - m_Queue->continueRunning(); - } - while (!stopRequested() && hasNext()) { - SequencerEvent* ev = nextEvent(); - if (getEchoResolution() > 0) { - while (!stopRequested() && (last_tick < ev->getTick())) { - last_tick += getEchoResolution(); - sendEchoEvent(last_tick); - } - } - if (!stopRequested() && !SequencerEvent::isConnectionChange(ev)) - sendSongEvent(ev); - } - if (stopRequested()) { - m_Queue->clear(); - emit stopped(); - } else { - drainOutput(); - syncOutput(); - if (stopRequested()) - emit stopped(); - else - emit finished(); - } - m_Queue->stop(); - } catch (...) { - qWarning("exception in output thread"); - } - m_npfds = 0; - m_pfds = 0; - } -} - -/** - * Starts the playback thread - * @param priority Thread priority, default is InheritPriority - */ -void SequencerOutputThread::start( Priority priority ) -{ - m_mutex.lockForWrite(); - m_Stopped = false; - QThread::start( priority ); - m_mutex.unlock(); -} - -} /* namespace drumstick */ - diff -Nru kmetronome-0.10.0/drumstick/src/qsmf.cpp kmetronome-0.10.1/drumstick/src/qsmf.cpp --- kmetronome-0.10.0/drumstick/src/qsmf.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/qsmf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1222 +0,0 @@ -/* - Standard MIDI File component - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - Based on midifile.c by Tim Thompson, M.Czeiszperger and Greg Lee - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "qsmf.h" -#include -#include -#include -#include -#include - -/** - * @file qsmf.cpp - * Implementation of a class managing Standard MIDI Files input/output - */ - -namespace drumstick { - -/** - * @addtogroup SMF - * @{ - * - * QSmf provides a mechanism to parse and encode Standard MIDI Files, without - * the burden of a policy forcing to use some internal sequence representation. - * - * This class is not related or based on the ALSA library. - * - * @} - */ - -class QSmf::QSmfPrivate { -public: - QSmfPrivate(): - m_Interactive(false), - m_CurrTime(0), - m_RealTime(0), - m_DblRealTime(0), - m_DblOldRealtime(0), - m_Division(96), - m_CurrTempo(500000), - m_OldCurrTempo(500000), - m_OldRealTime(0), - m_OldCurrTime(0), - m_RevisedTime(0), - m_TempoChangeTime(0), - m_ToBeRead(0), - m_NumBytesWritten(0), - m_Tracks(0), - m_fileFormat(0), - m_LastStatus(0), - m_codec(0), - m_IOStream(0) - { } - - bool m_Interactive; /**< file and track headers are not required */ - quint64 m_CurrTime; /**< current time in delta-time units */ - quint64 m_RealTime; /**< current time in 1/16 centisecond-time units */ - double m_DblRealTime; /**< as above, floating */ - double m_DblOldRealtime; - int m_Division; /**< ticks per beat. Default = 96 */ - quint64 m_CurrTempo; /**< microseconds per quarter note */ - quint64 m_OldCurrTempo; - quint64 m_OldRealTime; - quint64 m_OldCurrTime; - quint64 m_RevisedTime; - quint64 m_TempoChangeTime; - quint64 m_ToBeRead; - quint64 m_NumBytesWritten; - int m_Tracks; - int m_fileFormat; - int m_LastStatus; - QTextCodec *m_codec; - QDataStream *m_IOStream; - QByteArray m_MsgBuff; - QList m_TempoList; -}; - -/** - * Constructor - * @param parent Optional parent object - */ -QSmf::QSmf(QObject * parent) : - QObject(parent), - d(new QSmfPrivate) -{ } - -/** - * Destructor - */ -QSmf::~QSmf() -{ - d->m_TempoList.clear(); - delete d; -} - -/** - * Check if the SMF stream is positioned at the end. - * @return True if the SMF stream is at the end - */ -bool QSmf::endOfSmf() -{ - return d->m_IOStream->atEnd(); -} - -/** - * Gets a single byte from the SMF stream - * @return A Single byte - */ -quint8 QSmf::getByte() -{ - quint8 b = 0; - if (!d->m_IOStream->atEnd()) - { - *d->m_IOStream >> b; - d->m_ToBeRead--; - } - return b; -} - -/** - * Puts a single byte to the SMF stream - * @param value A Single byte - */ -void QSmf::putByte(quint8 value) -{ - *d->m_IOStream << value; - d->m_NumBytesWritten++; -} - -/** - * Adds a tempo change to the internal tempo list - * @param tempo Tempo in microseconds per quarter - * @param time Location in ticks - */ -void QSmf::addTempo(quint64 tempo, quint64 time) -{ - QSmfRecTempo tempoRec; - tempoRec.tempo = tempo; - tempoRec.time = time; - d->m_TempoList.append(tempoRec); -} - -/** - * Reads a SMF header - */ -void QSmf::readHeader() -{ - d->m_CurrTime = 0; - d->m_RealTime = 0; - d->m_Division = 96; - d->m_CurrTempo = 500000; - d->m_OldCurrTempo = 500000; - addTempo(d->m_CurrTempo, 0); - if (d->m_Interactive) - { - d->m_fileFormat= 0; - d->m_Tracks = 1; - d->m_Division = 96; - } - else - { - readExpected("MThd"); - d->m_ToBeRead = read32bit(); - d->m_fileFormat = read16bit(); - d->m_Tracks = read16bit(); - d->m_Division = read16bit(); - } - emit signalSMFHeader(d->m_fileFormat, d->m_Tracks, d->m_Division); - - /* flush any extra stuff, in case the length of header is not */ - while ((d->m_ToBeRead > 0) && !endOfSmf()) - { - getByte(); - } -} - -/** - * Reads a track chunk - */ -void QSmf::readTrack() -{ - /* This array is indexed by the high half of a status byte. It's - value is either the number of bytes needed (1 or 2) for a channel - message, or 0 (meaning it's not a channel message). */ - static const quint8 chantype[16] = - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 2, 0 }; - - quint64 lookfor; - quint8 c, c1, type; - bool sysexcontinue; // 1 if last message was an unfinished SysEx - bool running; // 1 when running status used - quint8 status; // status value (e.g. 0x90==note-on) - int needed; - double delta_secs; - quint64 delta_ticks, save_time, save_tempo; - - sysexcontinue = false; - status = 0; - if (d->m_Interactive) - { - d->m_ToBeRead = std::numeric_limits::max(); - } - else - { - readExpected("MTrk"); - d->m_ToBeRead = read32bit(); - } - d->m_CurrTime = 0; - d->m_RealTime = 0; - d->m_DblRealTime = 0; - d->m_DblOldRealtime = 0; - d->m_OldCurrTime = 0; - d->m_OldRealTime = 0; - d->m_CurrTempo = findTempo(); - - emit signalSMFTrackStart(); - - while (!endOfSmf() && (d->m_Interactive || d->m_ToBeRead > 0)) - { - if (d->m_Interactive) - { - d->m_CurrTime++; - } - else - { - delta_ticks = readVarLen(); - d->m_RevisedTime = d->m_CurrTime; - d->m_CurrTime += delta_ticks; - while (d->m_RevisedTime < d->m_CurrTime) - { - save_time = d->m_RevisedTime; - save_tempo = d->m_CurrTempo; - d->m_CurrTempo = findTempo(); - if (d->m_CurrTempo != d->m_OldCurrTempo) - { - d->m_OldCurrTempo = d->m_CurrTempo; - d->m_OldRealTime = d->m_RealTime; - if (d->m_RevisedTime != d->m_TempoChangeTime) - { - d->m_DblOldRealtime = d->m_DblRealTime; - d->m_OldCurrTime = save_time; - } - delta_secs = ticksToSecs(d->m_RevisedTime - d->m_OldCurrTime, - d->m_Division, save_tempo); - d->m_DblRealTime = d->m_DblOldRealtime + delta_secs * 1600.0; - d->m_RealTime = static_cast(0.5 + d->m_DblRealTime); - if (d->m_RevisedTime == d->m_TempoChangeTime) - { - d->m_OldCurrTime = d->m_RevisedTime; - d->m_DblOldRealtime = d->m_DblRealTime; - } - } - else - { - delta_secs = ticksToSecs(d->m_RevisedTime - d->m_OldCurrTime, - d->m_Division, d->m_CurrTempo); - d->m_DblRealTime = d->m_DblOldRealtime + delta_secs * 1600.0; - d->m_RealTime = static_cast(0.5 + d->m_DblRealTime); - } - } - } - - c = getByte(); - if (sysexcontinue && (c != end_of_sysex)) - { - SMFError("didn't find expected continuation of a SysEx"); - } - if (c < 0xf8) - { - if ((c & 0x80) == 0) - { - if (status == 0) - { - SMFError("unexpected running status"); - } - running = true; - } - else - { - status = c; - running = false; - } - needed = chantype[status >> 4 & 0x0f]; - if (needed != 0) - { - if (running) - { - c1 = c; - } - else - { - c1 = getByte(); - } - if (needed > 1) - { - channelMessage(status, c1, getByte()); - } - else - { - channelMessage(status, c1, 0); - } - continue; - } - } - - switch (c) - { - case meta_event: - type = getByte(); - lookfor = readVarLen(); - lookfor = d->m_ToBeRead - lookfor; - msgInit(); - while (d->m_ToBeRead > lookfor) - { - msgAdd(getByte()); - } - metaEvent(type); - break; - case system_exclusive: - lookfor = readVarLen(); - lookfor = d->m_ToBeRead - lookfor; - msgInit(); - msgAdd(system_exclusive); - while (d->m_ToBeRead > lookfor) - { - c = getByte(); - msgAdd(c); - } - if (c == end_of_sysex) - { - sysEx(); - } - else - { - sysexcontinue = true; - } - break; - case end_of_sysex: - lookfor = readVarLen(); - lookfor = d->m_ToBeRead - lookfor; - if (!sysexcontinue) - { - msgInit(); - } - while (d->m_ToBeRead > lookfor) - { - c = getByte(); - msgAdd(c); - } - if (sysexcontinue) - { - if (c == end_of_sysex) - { - sysEx(); - sysexcontinue = false; - } - } - break; - default: - badByte(c, d->m_IOStream->device()->pos() - 1); - break; - } - } - emit signalSMFTrackEnd(); -} - -/** - * Reads a SMF stream. - */ -void QSmf::SMFRead() -{ - int i; - readHeader(); - for ( i = d->m_Tracks; (i > 0) && !endOfSmf(); i--) - { - readTrack(); - } -} - -/** - * Writes a SMF stream. - * - * Every MIDI file starts with a header. - * In format 1 files, the first track is a tempo map. - * The rest of the file is a series of tracks - */ -void QSmf::SMFWrite() -{ - int i; - d->m_LastStatus = 0; - writeHeaderChunk(d->m_fileFormat, d->m_Tracks, d->m_Division); - d->m_LastStatus = 0; - if (d->m_fileFormat == 1) - { - emit signalSMFWriteTempoTrack(); - } - for (i = 0; i < d->m_Tracks; ++i) - { - writeTrackChunk(i); - } -} - -/** - * Reads a SMF stream. - * @param stream Pointer to an existing and opened stream - */ -void QSmf::readFromStream(QDataStream *stream) -{ - d->m_IOStream = stream; - SMFRead(); -} - -/** - * Reads a SMF stream from a disk file. - * @param fileName Name of an existing file. - */ -void QSmf::readFromFile(const QString& fileName) -{ - QFile file(fileName); - file.open(QIODevice::ReadOnly); - QDataStream ds(&file); - readFromStream(&ds); - file.close(); -} - -/** - * Writes a SMF stream - * @param stream Pointer to an existing and opened stream - */ -void QSmf::writeToStream(QDataStream *stream) -{ - d->m_IOStream = stream; - SMFWrite(); -} - -/** - * Writes a SMF stream to a disk file - * @param fileName File name - */ -void QSmf::writeToFile(const QString& fileName) -{ - QFile file(fileName); - file.open(QIODevice::WriteOnly); - QDataStream ds(&file); - writeToStream(&ds); - file.close(); -} - -/** - * Writes a SMF header chuck - * @param format SMF Format (0/1/2) - * @param ntracks Number of tracks - * @param division Resolution in ticks per quarter note - */ -void QSmf::writeHeaderChunk(int format, int ntracks, int division) -{ - write32bit(MThd); - write32bit(6); - write16bit(format); - write16bit(ntracks); - write16bit(division); -} - -/** - * Writes a track chuck - * @param track Number of the track - */ -void QSmf::writeTrackChunk(int track) -{ - quint32 trkhdr; - quint32 trklength; - qint64 offset; - qint64 place_marker; - - d->m_LastStatus = 0; - trkhdr = MTrk; - trklength = 0; - offset = d->m_IOStream->device()->pos(); - write32bit(trkhdr); - write32bit(trklength); - d->m_NumBytesWritten = 0; - - emit signalSMFWriteTrack(track); - - place_marker = d->m_IOStream->device()->pos(); - d->m_IOStream->device()->seek(offset); - trklength = d->m_NumBytesWritten; - write32bit(trkhdr); - write32bit(trklength); - d->m_IOStream->device()->seek(place_marker); -} - -/** - * Writes a variable length Meta Event - * @param deltaTime Time offset in ticks - * @param type Meta event type - * @param data Message data - */ -void QSmf::writeMetaEvent(long deltaTime, int type, const QByteArray& data) -{ - writeVarLen(deltaTime); - d->m_LastStatus = meta_event; - putByte(d->m_LastStatus); - putByte(type); - writeVarLen(data.size()); - foreach(char byte, data) - putByte(byte); -} - -/** - * Writes a Text Meta Event - * @param deltaTime Time offset in ticks - * @param type Meta event type - * @param data Message text - */ -void QSmf::writeMetaEvent(long deltaTime, int type, const QString& data) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(type); - QByteArray lcldata; - if (d->m_codec == NULL) - lcldata = data.toLatin1(); - else - lcldata = d->m_codec->fromUnicode(data); - writeVarLen(lcldata.length()); - foreach(char byte, lcldata) - putByte(byte); -} - -/** - * Writes a simple Meta event - * @param deltaTime Time offset in ticks - * @param type Meta event type - * @param data Meta event data - * @since 0.2.0 - */ -void QSmf::writeMetaEvent(long deltaTime, int type, int data) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(type); - putByte(1); - putByte(data); -} - -/** - * Writes a simple Meta event - * @param deltaTime Time offset in ticks - * @param type Meta event type - */ -void QSmf::writeMetaEvent(long deltaTime, int type) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(type); - putByte(0); -} - -/** - * Writes a variable length MIDI message - * @param deltaTime Time offset in ticks - * @param type MIDI event type - * @param chan MIDI Channel - * @param data Message data - */ -void QSmf::writeMidiEvent(long deltaTime, int type, int chan, - const QByteArray& data) -{ - int i, j, size; - quint8 c; - writeVarLen(deltaTime); - if ((type == system_exclusive) || (type == end_of_sysex)) - { - c = type; - d->m_LastStatus = 0; - } - else - { - if (chan > 15) - { - SMFError("error: MIDI channel greater than 16"); - } - c = type | chan; - } - if (d->m_LastStatus != c) - { - d->m_LastStatus = c; - putByte(c); - } - if (type == system_exclusive || type == end_of_sysex) - { - size = data.size(); - if (data[0] == type) - --size; - writeVarLen(size); - } - j = (data[0] == type ? 1 : 0); - for (i = j; i < data.size(); ++i) - { - putByte(data[i]); - } -} - -/** - * Writes a MIDI message with a single parameter - * @param deltaTime Time offset in ticks - * @param type MIDI event type - * @param chan MIDI Channel - * @param b1 Message parameter - */ -void QSmf::writeMidiEvent(long deltaTime, int type, int chan, int b1) -{ - quint8 c; - writeVarLen(deltaTime); - if ((type == system_exclusive) || (type == end_of_sysex)) - { - SMFError("error: Wrong method for a system exclusive event"); - } - if (chan > 15) - { - SMFError("error: MIDI channel greater than 16"); - } - c = type | chan; - if (d->m_LastStatus != c) - { - d->m_LastStatus = c; - putByte(c); - } - putByte(b1); -} - -/** - * Writes a MIDI message with two parameters - * @param deltaTime Time offset in ticks - * @param type MIDI event type - * @param chan MIDI Channel - * @param b1 Message parameter 1 - * @param b2 Message parameter 2 - */ -void QSmf::writeMidiEvent(long deltaTime, int type, int chan, int b1, int b2) -{ - quint8 c; - writeVarLen(deltaTime); - if ((type == system_exclusive) || (type == end_of_sysex)) - { - SMFError("error: Wrong method for a system exclusive event"); - } - if (chan > 15) - { - SMFError("error: MIDI channel greater than 16"); - } - c = type | chan; - if (d->m_LastStatus != c) - { - d->m_LastStatus = c; - putByte(c); - } - putByte(b1); - putByte(b2); -} - -/** - * Writes a variable length MIDI message - * @param deltaTime Time offset in ticks - * @param type MIDI event type - * @param len Message length - * @param data Message data - */ -void QSmf::writeMidiEvent(long deltaTime, int type, long len, char* data) -{ - unsigned int i, j, size; - quint8 c; - writeVarLen(deltaTime); - if ((type != system_exclusive) && (type != end_of_sysex)) - { - SMFError("error: type should be system exclusive"); - } - d->m_LastStatus = 0; - c = type; - putByte(c); - size = len; - c = (unsigned)data[0]; - if (c == type) - --size; - writeVarLen(size); - j = (c == type ? 1 : 0); - for (i = j; i < (unsigned)len; ++i) - { - putByte(data[i]); - } -} - -/** - * Writes a MIDI Sequence number - * @param deltaTime Time offset in ticks - * @param seqnum Sequence number - */ -void QSmf::writeSequenceNumber(long deltaTime, int seqnum) -{ - writeVarLen(deltaTime); - d->m_LastStatus = meta_event; - putByte(d->m_LastStatus); - putByte(sequence_number); - putByte(2); - putByte((seqnum >> 8) & 0xff); - putByte(seqnum & 0xff); -} - -/** - * Writes a Tempo change message - * @param deltaTime Time offset in ticks - * @param tempo Tempo in microseconds per quarter note - */ -void QSmf::writeTempo(long deltaTime, long tempo) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(set_tempo); - putByte(3); - putByte((tempo >> 16) & 0xff); - putByte((tempo >> 8) & 0xff); - putByte(tempo & 0xff); -} - -/** - * Writes a Tempo change message - * @param deltaTime Time offset in ticks - * @param tempo Tempo expressed in quarter notes per minute - */ -void QSmf::writeBpmTempo(long deltaTime, int tempo) -{ - long us_tempo = 60000000l / tempo; - writeTempo(deltaTime, us_tempo); -} - -/** - * Writes a Time Signature message - * @param deltaTime Time offset in ticks - * @param num Numerator - * @param den Denominator (exponent for a power of two) - * @param cc Number of MIDI clocks in a metronome click - * @param bb Number of notated 32nd notes in 24 MIDI clocks - */ -void QSmf::writeTimeSignature(long deltaTime, int num, int den, int cc, int bb) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(time_signature); - putByte(4); - putByte(num & 0xff); - putByte(den & 0xff); - putByte(cc & 0xff); - putByte(bb & 0xff); -} - -/** - * Writes a key Signature message - * @param deltaTime Time offset in ticks - * @param tone Number of alterations (positive=sharps, negative=flats) - * @param mode Scale mode (0=major, 1=minor) - */ -void QSmf::writeKeySignature(long deltaTime, int tone, int mode) -{ - writeVarLen(deltaTime); - putByte(d->m_LastStatus = meta_event); - putByte(key_signature); - putByte(2); - putByte((char)tone); - putByte(mode & 0x01); -} - -/** - * Writes multi-length bytes - * @param value Integer value - */ -void QSmf::writeVarLen(quint64 value) -{ - quint64 buffer; - - buffer = value & 0x7f; - while ((value >>= 7) > 0) - { - buffer <<= 8; - buffer |= 0x80; - buffer += (value & 0x7f); - } - while (true) - { - putByte(buffer & 0xff); - if (buffer & 0x80) - buffer >>= 8; - else - break; - } -} - -/* These routines are used to make sure that the byte order of - the various data types remains constant between machines. */ -void QSmf::write32bit(quint32 data) -{ - putByte((data >> 24) & 0xff); - putByte((data >> 16) & 0xff); - putByte((data >> 8) & 0xff); - putByte(data & 0xff); -} - -void QSmf::write16bit(quint16 data) -{ - putByte((data >> 8) & 0xff); - putByte(data & 0xff); -} - -quint16 QSmf::to16bit(quint8 c1, quint8 c2) -{ - quint16 value; - value = (c1 << 8); - value += c2; - return value; -} - -quint32 QSmf::to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4) -{ - quint32 value; - value = (c1 << 24); - value += (c2 << 16); - value += (c3 << 8); - value += c4; - return value; -} - -quint16 QSmf::read16bit() -{ - quint8 c1, c2; - c1 = getByte(); - c2 = getByte(); - return to16bit(c1, c2); -} - -quint32 QSmf::read32bit() -{ - quint8 c1, c2, c3, c4; - c1 = getByte(); - c2 = getByte(); - c3 = getByte(); - c4 = getByte(); - return to32bit(c1, c2, c3, c4); -} - -long QSmf::readVarLen() -{ - long value; - quint8 c; - - c = getByte(); - value = c; - if ((c & 0x80) != 0) - { - value &= 0x7f; - do - { - c = getByte(); - value = (value << 7) + (c & 0x7f); - } while ((c & 0x80) != 0); - } - return value; -} - -void QSmf::readExpected(const QString& s) -{ - int j; - quint8 b; - for (j = 0; j < s.length(); ++j) - { - b = getByte(); - if (QChar(b) != s[j]) - { - SMFError(QString("Invalid (%1) SMF format at %2").arg(b, 0, 16).arg(d->m_IOStream->device()->pos())); - break; - } - } -} - -quint64 QSmf::findTempo() -{ - quint64 result, old_tempo, new_tempo; - QSmfRecTempo rec = d->m_TempoList.last(); - old_tempo = d->m_CurrTempo; - new_tempo = d->m_CurrTempo; - QList::Iterator it; - for( it = d->m_TempoList.begin(); it != d->m_TempoList.end(); ++it ) - { - rec = (*it); - if (rec.time <= d->m_CurrTime) - { - old_tempo = rec.tempo; - } - new_tempo = rec.tempo; - if (rec.time > d->m_RevisedTime) - { - break; - } - } - if ((rec.time <= d->m_RevisedTime) || (rec.time > d->m_CurrTime)) - { - d->m_RevisedTime = d->m_CurrTime; - result = old_tempo; - } - else - { - d->m_RevisedTime = rec.time; - d->m_TempoChangeTime = d->m_RevisedTime; - result = new_tempo; - } - return result; -} - -/* This routine converts delta times in ticks into seconds. The - else statement is needed because the formula is different for tracks - based on notes and tracks based on SMPTE times. */ -double QSmf::ticksToSecs(quint64 ticks, quint16 division, quint64 tempo) -{ - double result; - double smpte_format; - double smpte_resolution; - - if (division > 0) - { - result = static_cast(ticks * tempo)/(division * 1000000.0); - } - else - { - smpte_format = upperByte(division); - smpte_resolution = lowerByte(division); - result = static_cast(ticks)/(smpte_format * smpte_resolution - * 1000000.0); - } - return result; -} - -void QSmf::SMFError(const QString& s) -{ - emit signalSMFError(s); -} - -void QSmf::channelMessage(quint8 status, quint8 c1, quint8 c2) -{ - quint8 chan; - int k; - chan = status & midi_channel_mask; - if (c1 > 127) - { - SMFError(QString("ChannelMessage with bad c1 = %1").arg(c1)); - //c1 &= 127; - } - if (c2 > 127) - { - SMFError(QString("ChannelMessage with bad c2 = %1").arg(c2)); - //c2 &= 127; - } - switch (status & midi_command_mask) - { - case note_off: - emit signalSMFNoteOff(chan, c1, c2); - break; - case note_on: - emit signalSMFNoteOn(chan, c1, c2); - break; - case poly_aftertouch: - emit signalSMFKeyPress(chan, c1, c2); - break; - case control_change: - emit signalSMFCtlChange(chan, c1, c2); - break; - case program_chng: - emit signalSMFProgram(chan, c1); - break; - case channel_aftertouch: - emit signalSMFChanPress(chan, c1); - break; - case pitch_wheel: - k = c1 + (c2 << 7) - 8192; - emit signalSMFPitchBend(chan, k); - break; - default: - SMFError(QString("Invalid MIDI status %1. Unhandled event").arg(status)); - break; - } -} - -void QSmf::metaEvent(quint8 b) -{ - QSmfRecTempo rec; - QByteArray m(d->m_MsgBuff); - - switch (b) - { - case sequence_number: - emit signalSMFSequenceNum(to16bit(m[0], m[1])); - break; - case text_event: - case copyright_notice: - case sequence_name: - case instrument_name: - case lyric: - case marker: - case cue_point: { - QString s; - if (d->m_codec == NULL) - s = QString(m); - else - s = d->m_codec->toUnicode(m); - emit signalSMFText(b, s); - } - break; - case forced_channel: - emit signalSMFforcedChannel(m[0]); - break; - case forced_port: - emit signalSMFforcedPort(m[0]); - break; - case end_of_track: - emit signalSMFendOfTrack(); - break; - case set_tempo: - d->m_CurrTempo = to32bit(0, m[0], m[1], m[2]); - emit signalSMFTempo(d->m_CurrTempo); - rec = d->m_TempoList.last(); - if (rec.tempo == d->m_CurrTempo) - { - return; - } - if (rec.time > d->m_CurrTime) - { - return; - } - addTempo(d->m_CurrTempo, d->m_CurrTime); - break; - case smpte_offset: - emit signalSMFSmpte(m[0], m[1], m[2], m[3], m[4]); - break; - case time_signature: - emit signalSMFTimeSig(m[0], m[1], m[2], m[3]); - break; - case key_signature: - emit signalSMFKeySig(m[0], m[1]); - break; - case sequencer_specific: - emit signalSMFSeqSpecific(m); - break; - default: - emit signalSMFMetaUnregistered(b, m); - break; - } - emit signalSMFMetaMisc(b, m); -} - -void QSmf::sysEx() -{ - QByteArray varr(d->m_MsgBuff); - emit signalSMFSysex(varr); -} - -void QSmf::badByte(quint8 b, int p) -{ - SMFError(QString("Unexpected byte (%1) at %2").arg(b, 2, 16).arg(p)); -} - -quint8 QSmf::lowerByte(quint16 x) -{ - return (x & 0xff); -} - -quint8 QSmf::upperByte(quint16 x) -{ - return ((x >> 8) & 0xff); -} - -void QSmf::msgInit() -{ - d->m_MsgBuff.truncate(0); -} - -void QSmf::msgAdd(quint8 b) -{ - int s = d->m_MsgBuff.size(); - d->m_MsgBuff.resize(s + 1); - d->m_MsgBuff[s] = b; -} - -/* public properties (accessors) */ - -/** - * Gets the current time in ticks - * @return Time in ticks - */ -long QSmf::getCurrentTime() -{ - return d->m_CurrTime; -} - -/** - * Gets the current tempo - * @return Tempo in us per quarter - */ -long QSmf::getCurrentTempo() -{ - return d->m_CurrTempo; -} - -/** - * Gets the real time in seconds - * @return Time in seconds - */ -long QSmf::getRealTime() -{ - return d->m_RealTime; -} - -/** - * Gets the resolution - * @return Resolution in ticks per quarter note - */ -int QSmf::getDivision() -{ - return d->m_Division; -} - -/** - * Sets the resolution - * @param division Resolution in ticks per quarter note - */ -void QSmf::setDivision(int division) -{ - d->m_Division = division; -} - -/** - * Gets the number of tracks - * @return Number of tracks - */ -int QSmf::getTracks() -{ - return d->m_Tracks; -} - -/** - * Sets the number of tracks - * @param tracks Number of tracks - */ -void QSmf::setTracks(int tracks) -{ - d->m_Tracks = tracks; -} - -/** - * Gets the SMF file format - * @return File format (0, 1, or 2) - */ -int QSmf::getFileFormat() -{ - return d->m_fileFormat; -} - -/** - * Sets the SMF file format - * @param fileFormat File format (0, 1, or 2) - */ -void QSmf::setFileFormat(int fileFormat) -{ - d->m_fileFormat = fileFormat; -} - -/** - * Gets the position in the SMF stream - * @return Position offset in the stream - */ -long QSmf::getFilePos() -{ - return (long) d->m_IOStream->device()->pos(); -} - -/** - * Gets the text codec used for text meta-events I/O - * @return QTextCodec pointer - * @since 0.2.0 - */ -QTextCodec* QSmf::getTextCodec() -{ - return d->m_codec; -} - -/** - * Sets the text codec for text meta-events. - * The engine doesn't take ownership of the codec instance. - * - * @param codec QTextCodec pointer - * @since 0.2.0 - */ -void QSmf::setTextCodec(QTextCodec *codec) -{ - d->m_codec = codec; -} - -} diff -Nru kmetronome-0.10.0/drumstick/src/qwrk.cpp kmetronome-0.10.1/drumstick/src/qwrk.cpp --- kmetronome-0.10.0/drumstick/src/qwrk.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/qwrk.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1288 +0,0 @@ -/* - WRK File component - Copyright (C) 2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "qwrk.h" -#include -#include -#include -#include -#include -#include -#include - -/** - * @file qwrk.cpp - * Implementation of a class managing Cakewalk WRK Files input - */ - -namespace drumstick { - -/** - * @addtogroup WRK - * @{ - * - * QWrk provides a mechanism to parse Cakewalk WRK Files, without - * the burden of a policy forcing to use some internal sequence representation. - * - * This class is not related or based on the ALSA library. - * - * @} - */ - -class QWrk::QWrkPrivate { -public: - QWrkPrivate(): - m_Now(0), - m_From(0), - m_Thru(11930), - m_KeySig(0), - m_Clock(0), - m_AutoSave(0), - m_PlayDelay(0), - m_ZeroCtrls(false), - m_SendSPP(true), - m_SendCont(true), - m_PatchSearch(false), - m_AutoStop(false), - m_StopTime(4294967295U), - m_AutoRewind(false), - m_RewindTime(0), - m_MetroPlay(false), - m_MetroRecord(true), - m_MetroAccent(false), - m_CountIn(1), - m_ThruOn(true), - m_AutoRestart(false), - m_CurTempoOfs(1), - m_TempoOfs1(32), - m_TempoOfs2(64), - m_TempoOfs3(128), - m_PunchEnabled(false), - m_PunchInTime(0), - m_PunchOutTime(0), - m_EndAllTime(0), - m_division(120), - m_codec(0), - m_IOStream(0) - { } - - quint32 m_Now; ///< Now marker time - quint32 m_From; ///< From marker time - quint32 m_Thru; ///< Thru marker time - quint8 m_KeySig; ///< Key signature (0=C, 1=C#, ... 11=B) - quint8 m_Clock; ///< Clock Source (0=Int, 1=MIDI, 2=FSK, 3=SMPTE) - quint8 m_AutoSave; ///< Auto save (0=disabled, 1..256=minutes) - quint8 m_PlayDelay; ///< Play Delay - bool m_ZeroCtrls; ///< Zero continuous controllers? - bool m_SendSPP; ///< Send Song Position Pointer? - bool m_SendCont; ///< Send MIDI Continue? - bool m_PatchSearch; ///< Patch/controller search-back? - bool m_AutoStop; ///< Auto-stop? - quint32 m_StopTime; ///< Auto-stop time - bool m_AutoRewind; ///< Auto-rewind? - quint32 m_RewindTime; ///< Auto-rewind time - bool m_MetroPlay; ///< Metronome on during playback? - bool m_MetroRecord; ///< Metronome on during recording? - bool m_MetroAccent; ///< Metronome accents primary beats? - quint8 m_CountIn; ///< Measures of count-in (0=no count-in) - bool m_ThruOn; ///< MIDI Thru enabled? (only used if no THRU rec) - bool m_AutoRestart; ///< Auto-restart? - quint8 m_CurTempoOfs; ///< Which of the 3 tempo offsets is used: 0..2 - quint8 m_TempoOfs1; ///< Fixed-point ratio value of offset 1 - quint8 m_TempoOfs2; ///< Fixed-point ratio value of offset 2 - quint8 m_TempoOfs3; ///< Fixed-point ratio value of offset 3 - bool m_PunchEnabled; ///< Auto-Punch enabled? - quint32 m_PunchInTime; ///< Punch-in time - quint32 m_PunchOutTime; ///< Punch-out time - quint32 m_EndAllTime; ///< Time of latest event (incl. all tracks) - - int m_division; - QTextCodec *m_codec; - QDataStream *m_IOStream; - QByteArray m_lastChunkData; - QList m_tempos; -}; - -QWrk::QWrk(QObject * parent) : - QObject(parent), - d(new QWrkPrivate) -{ } - -QWrk::~QWrk() -{ - delete d; -} - -/** - * Gets the text codec used for text meta-events I/O - * @return QTextCodec pointer - */ -QTextCodec* QWrk::getTextCodec() -{ - return d->m_codec; -} - -/** - * Sets the text codec for text meta-events. - * The engine doesn't take ownership of the codec instance. - * - * @param codec QTextCodec pointer - */ -void QWrk::setTextCodec(QTextCodec *codec) -{ - d->m_codec = codec; -} - -/** - * Gets the last chunk raw data (undecoded) - * - * @return last chunk raw data - */ -QByteArray QWrk::getLastChunkRawData() const -{ - return d->m_lastChunkData; -} - -/** - * Read the chunk raw data (undecoded) - */ -void QWrk::readRawData(int size) -{ - d->m_lastChunkData = d->m_IOStream->device()->read(size); -} - -/** - * Now marker time - * @return Now marker time - */ -int QWrk::getNow() const -{ - return d->m_Now; -} - -/** - * From marker time - * @return From marker time - */ -int QWrk::getFrom() const -{ - return d->m_From; -} - -/** - * Thru marker time - * @return Thru marker time - */ -int QWrk::getThru() const -{ - return d->m_Thru; -} - -/** - * Key signature (0=C, 1=C#, ... 11=B) - * @return Key signature - */ -int QWrk::getKeySig() const -{ - return d->m_KeySig; -} - -/** - * Clock Source (0=Int, 1=MIDI, 2=FSK, 3=SMPTE) - * @return Clock Source - */ -int QWrk::getClock() const -{ - return d->m_Clock; -} - -/** - * Auto save (0=disabled, 1..256=minutes) - * @return Auto save - */ -int QWrk::getAutoSave() const -{ - return d->m_AutoSave; -} - -/** - * Play Delay - * @return Play Delay - */ -int QWrk::getPlayDelay() const -{ - return d->m_PlayDelay; -} - -/** - * Zero continuous controllers? - * @return Zero continuous controllers - */ -bool QWrk::getZeroCtrls() const -{ - return d->m_ZeroCtrls; -} - -/** - * Send Song Position Pointer? - * @return Send Song Position Pointer - */ -bool QWrk::getSendSPP() const -{ - return d->m_SendSPP; -} - -/** - * Send MIDI Continue? - * @return Send MIDI Continue - */ -bool QWrk::getSendCont() const -{ - return d->m_SendCont; -} - -/** - * Patch/controller search-back? - * @return Patch/controller search-back - */ -bool QWrk::getPatchSearch() const -{ - return d->m_PatchSearch; -} - -/** - * Auto-stop? - * @return Auto-stop - */ -bool QWrk::getAutoStop() const -{ - return d->m_AutoStop; -} - -/** - * Auto-stop time - * @return Auto-stop time - */ -unsigned int QWrk::getStopTime() const -{ - return d->m_StopTime; -} - -/** - * Auto-rewind? - * @return Auto-rewind - */ -bool QWrk::getAutoRewind() const -{ - return d->m_AutoRewind; -} - -/** - * Auto-rewind time - * @return Auto-rewind time - */ -int QWrk::getRewindTime() const -{ - return d->m_RewindTime; -} - -/** - * Metronome on during playback? - * @return Metronome on during playback - */ -bool QWrk::getMetroPlay() const -{ - return d->m_MetroPlay; -} - -/** - * Metronome on during recording? - * @return Metronome on during recording - */ -bool QWrk::getMetroRecord() const -{ - return d->m_MetroRecord; -} - -/** - * Metronome accents primary beats? - * @return Metronome accents primary beats - */ -bool QWrk::getMetroAccent() const -{ - return d->m_MetroAccent; -} - -/** - * Measures of count-in (0=no count-in) - * @return Measures of count-in - */ -int QWrk::getCountIn() const -{ - return d->m_CountIn; -} - -/** - * MIDI Thru enabled? (only used if no THRU rec) - * @return MIDI Thru enabled - */ -bool QWrk::getThruOn() const -{ - return d->m_ThruOn; -} - -/** - * Auto-restart? - * @return Auto-restart - */ -bool QWrk::getAutoRestart() const -{ - return d->m_AutoRestart; -} - -/** - * Which of the 3 tempo offsets is used: 0..2 - * @return tempo offset index - */ -int QWrk::getCurTempoOfs() const -{ - return d->m_CurTempoOfs; -} - -/** - * Fixed-point ratio value of tempo offset 1 - * - * NOTE: The offset ratios are expressed as a numerator in the expression - * n/64. To get a ratio from this number, divide the number by 64. To get - * this number from a ratio, multiply the ratio by 64. - * Examples: - * 32 ==> 32/64 = 0.5 - * 63 ==> 63/64 = 0.9 - * 64 ==> 64/64 = 1.0 - * 128 ==> 128/64 = 2.0 - * - * @return tempo offset 1 - */ -int QWrk::getTempoOfs1() const -{ - return d->m_TempoOfs1; -} - -/** - * Fixed-point ratio value of tempo offset 2 - * - * NOTE: The offset ratios are expressed as a numerator in the expression - * n/64. To get a ratio from this number, divide the number by 64. To get - * this number from a ratio, multiply the ratio by 64. - * Examples: - * 32 ==> 32/64 = 0.5 - * 63 ==> 63/64 = 0.9 - * 64 ==> 64/64 = 1.0 - * 128 ==> 128/64 = 2.0 - * - * @return tempo offset 2 - */ -int QWrk::getTempoOfs2() const -{ - return d->m_TempoOfs2; -} - -/** - * Fixed-point ratio value of tempo offset 3 - * - * NOTE: The offset ratios are expressed as a numerator in the expression - * n/64. To get a ratio from this number, divide the number by 64. To get - * this number from a ratio, multiply the ratio by 64. - * Examples: - * 32 ==> 32/64 = 0.5 - * 63 ==> 63/64 = 0.9 - * 64 ==> 64/64 = 1.0 - * 128 ==> 128/64 = 2.0 - * - * @return tempo offset 3 - */ -int QWrk::getTempoOfs3() const -{ - return d->m_TempoOfs3; -} - -/** - * Auto-Punch enabled? - * @return Auto-Punch enabled - */ -bool QWrk::getPunchEnabled() const -{ - return d->m_PunchEnabled; -} - -/** - * Punch-in time - * @return punch-in time - */ -int QWrk::getPunchInTime() const -{ - return d->m_PunchInTime; -} - -/** - * Punch-out time - * @return Punch-out time - */ -int QWrk::getPunchOutTime() const -{ - return d->m_PunchOutTime; -} - -/** - * Time of latest event (incl. all tracks) - * @return Time of latest event - */ -int QWrk::getEndAllTime() const -{ - return d->m_EndAllTime; -} - -/** - * Gets a single byte from the stream - * @return A Single byte - */ -quint8 QWrk::readByte() -{ - quint8 b = 0xff; - if (!d->m_IOStream->atEnd()) - *d->m_IOStream >> b; - return b; -} - -/** - * Converts two bytes into a single 16-bit value - * @param c1 first byte - * @param c2 second byte - * @return 16-bit value - */ -quint16 QWrk::to16bit(quint8 c1, quint8 c2) -{ - quint16 value = (c1 << 8); - value += c2; - return value; -} - -/** - * Converts four bytes into a single 32-bit value - * @param c1 1st byte - * @param c2 2nd byte - * @param c3 3rd byte - * @param c4 4th byte - * @return 32-bit value - */ -quint32 QWrk::to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4) -{ - quint32 value = (c1 << 24); - value += (c2 << 16); - value += (c3 << 8); - value += c4; - return value; -} - -/** - * Reads a 16-bit value - * @return 16-bit value - */ -quint16 QWrk::read16bit() -{ - quint8 c1, c2; - c1 = readByte(); - c2 = readByte(); - return to16bit(c2, c1); -} - -/** - * Reads a 24-bit value - * @return 32-bit value - */ -quint32 QWrk::read24bit() -{ - quint8 c1, c2, c3; - c1 = readByte(); - c2 = readByte(); - c3 = readByte(); - return to32bit(0, c3, c2, c1); -} - -/** - * Reads a 32-bit value - * @return 32-bit value - */ -quint32 QWrk::read32bit() -{ - quint8 c1, c2, c3, c4; - c1 = readByte(); - c2 = readByte(); - c3 = readByte(); - c4 = readByte(); - return to32bit(c4, c3, c2, c1); -} - -/** - * Reads a string - * @return a string - */ -QString QWrk::readString(int len) -{ - QString s; - if ( len > 0 ) { - quint8 c = 0xff; - QByteArray data; - for ( int i = 0; i < len && c != 0; ++i ) { - c = readByte(); - if ( c != 0) - data += c; - } - if (d->m_codec == NULL) - s = QString(data); - else - s = d->m_codec->toUnicode(data); - } - return s; -} - -/** - * Reads a variable length string (C-style) - * @return a string - */ -QString QWrk::readVarString() -{ - QString s; - QByteArray data; - quint8 b; - do { - b = readByte(); - if (b != 0) - data += b; - } while (b != 0); - if (d->m_codec == NULL) - s = QString(data); - else - s = d->m_codec->toUnicode(data); - return s; -} - -/** - * Current position in the data stream - * @return current position - */ -long QWrk::getFilePos() -{ - return d->m_IOStream->device()->pos(); -} - -/** - * Seeks to a new position in the data stream - * @param pos new position - */ -void QWrk::seek(qint64 pos) -{ - d->m_IOStream->device()->seek(pos); -} - -/** - * Checks if the data stream pointer has reached the end position - * @return true if the read pointer is at end - */ -bool QWrk::atEnd() -{ - return d->m_IOStream->atEnd(); -} - -/** - * Jumps the given size in the data stream - * @param size the gap size - */ -void QWrk::readGap(int size) -{ - if ( size > 0) - seek( getFilePos() + size ); -} - -/** - * Reads a stream. - * @param stream Pointer to an existing and opened stream - */ -void QWrk::readFromStream(QDataStream *stream) -{ - d->m_IOStream = stream; - wrkRead(); -} - -/** - * Reads a stream from a disk file. - * @param fileName Name of an existing file. - */ -void QWrk::readFromFile(const QString& fileName) -{ - QFile file(fileName); - file.open(QIODevice::ReadOnly); - QDataStream ds(&file); - readFromStream(&ds); - file.close(); -} - -void QWrk::processTrackChunk() -{ - int namelen; - QString name[2]; - int trackno; - int channel; - int pitch; - int velocity; - int port; - bool selected; - bool muted; - bool loop; - - trackno = read16bit(); - for(int i=0; i<2; ++i) { - namelen = readByte(); - name[i] = readString(namelen); - } - channel = (qint8) readByte(); - pitch = readByte(); - velocity = readByte(); - port = readByte(); - quint8 flags = readByte(); - selected = ((flags & 1) != 0); - muted = ((flags & 2) != 0); - loop = ((flags & 4) != 0); - Q_EMIT signalWRKTrack( name[0], name[1], - trackno, channel, pitch, - velocity, port, selected, - muted, loop ); -} - -void QWrk::processVarsChunk() -{ - d->m_Now = read32bit(); - d->m_From = read32bit(); - d->m_Thru = read32bit(); - d->m_KeySig = readByte(); - d->m_Clock = readByte(); - d->m_AutoSave = readByte(); - d->m_PlayDelay = readByte(); - readGap(1); - d->m_ZeroCtrls = (readByte() != 0); - d->m_SendSPP = (readByte() != 0); - d->m_SendCont = (readByte() != 0); - d->m_PatchSearch = (readByte() != 0); - d->m_AutoStop = (readByte() != 0); - d->m_StopTime = read32bit(); - d->m_AutoRewind = (readByte() != 0); - d->m_RewindTime = read32bit(); - d->m_MetroPlay = (readByte() != 0); - d->m_MetroRecord = (readByte() != 0); - d->m_MetroAccent = (readByte() != 0); - d->m_CountIn = readByte(); - readGap(2); - d->m_ThruOn = (readByte() != 0); - readGap(19); - d->m_AutoRestart = (readByte() != 0); - d->m_CurTempoOfs = readByte(); - d->m_TempoOfs1 = readByte(); - d->m_TempoOfs2 = readByte(); - d->m_TempoOfs3 = readByte(); - readGap(2); - d->m_PunchEnabled = (readByte() != 0); - d->m_PunchInTime = read32bit(); - d->m_PunchOutTime = read32bit(); - d->m_EndAllTime = read32bit(); - - Q_EMIT signalWRKGlobalVars(); -} - -void QWrk::processTimebaseChunk() -{ - quint16 timebase = read16bit(); - d->m_division = timebase; - Q_EMIT signalWRKTimeBase(timebase); -} - -void QWrk::processNoteArray(int track, int events) -{ - quint32 time = 0; - quint8 status = 0, data1 = 0, data2 = 0; - quint16 dur = 0; - int value = 0, type = 0, channel = 0, len = 0; - QString text; - QByteArray data; - for ( int i = 0; i < events; ++i ) { - time = read24bit(); - status = readByte(); - dur = 0; - if (status >= 0x90) { - type = status & 0xf0; - channel = status & 0x0f; - data1 = readByte(); - if (type == 0x90 || type == 0xA0 || type == 0xB0 || type == 0xE0) - data2 = readByte(); - if (type == 0x90) - dur = read16bit(); - switch (type) { - case 0x90: - Q_EMIT signalWRKNote(track, time, channel, data1, data2, dur); - break; - case 0xA0: - Q_EMIT signalWRKKeyPress(track, time, channel, data1, data2); - break; - case 0xB0: - Q_EMIT signalWRKCtlChange(track, time, channel, data1, data2); - break; - case 0xC0: - Q_EMIT signalWRKProgram(track, time, channel, data1); - break; - case 0xD0: - Q_EMIT signalWRKChanPress(track, time, channel, data1); - break; - case 0xE0: - value = (data2 << 7) + data1 - 8192; - Q_EMIT signalWRKPitchBend(track, time, channel, value); - break; - case 0xF0: - Q_EMIT signalWRKSysexEvent(track, time, data1); - break; - } - } else if (status == 5) { - int code = read16bit(); - len = read32bit(); - text = readString(len); - Q_EMIT signalWRKExpression(track, time, code, text); - } else if (status == 6) { - int code = read16bit(); - dur = read16bit(); - readGap(4); - Q_EMIT signalWRKHairpin(track, time, code, dur); - } else if (status == 7) { - len = read32bit(); - text = readString(len); - data.clear(); - for(int j=0; j<13; ++j) { - int byte = readByte(); - data += byte; - } - Q_EMIT signalWRKChord(track, time, text, data); - } else if (status == 8) { - len = read16bit(); - data.clear(); - for(int j=0; jm_division; - RecTempo last; - last.time = 0; - last.tempo = 100.0; - last.seconds = 0.0; - if (!d->m_tempos.isEmpty()) { - foreach(const RecTempo& rec, d->m_tempos) { - if (rec.time >= ticks) - break; - last = rec; - } - } - return last.seconds + (((ticks - last.time) / division) * (60.0 / last.tempo)); -} - -void QWrk::processTempoChunk(int factor) -{ - double division = 1.0 * d->m_division; - int count = read16bit(); - RecTempo last, next; - for (int i = 0; i < count; ++i) { - - long time = read32bit(); - readGap(4); - long tempo = read16bit() * factor; - readGap(8); - - next.time = time; - next.tempo = tempo / 100.0; - next.seconds = 0.0; - last.time = 0; - last.tempo = next.tempo; - last.seconds = 0.0; - if (! d->m_tempos.isEmpty()) { - foreach(const RecTempo& rec, d->m_tempos) { - if (rec.time >= time) - break; - last = rec; - } - next.seconds = last.seconds + - (((time - last.time) / division) * (60.0 / last.tempo)); - } - d->m_tempos.append(next); - - Q_EMIT signalWRKTempo(time, tempo); - } -} - -void QWrk::processSysexChunk() -{ - int j; - QString name; - QByteArray data; - int bank = readByte(); - int length = read16bit(); - bool autosend = (readByte() != 0); - int namelen = readByte(); - name = readString(namelen); - for(j=0; j> 4; - bool autosend = ( (b & 0x0f) != 0); - int namelen = readByte(); - name = readString(namelen); - for(j=0; j127 - qint8 channel = readByte(); // -1, 0->15 - qint8 keyPlus = readByte(); // 0->127 - qint8 velPlus = readByte(); // 0->127 - qint8 localPort = readByte(); - qint8 mode = readByte(); - Q_EMIT signalWRKThru(mode, port, channel, keyPlus, velPlus, localPort); -} - -void QWrk::processTrackOffset() -{ - quint16 track = read16bit(); - qint16 offset = read16bit(); - Q_EMIT signalWRKTrackOffset(track, offset); -} - -void QWrk::processTrackReps() -{ - quint16 track = read16bit(); - quint16 reps = read16bit(); - Q_EMIT signalWRKTrackReps(track, reps); -} - -void QWrk::processTrackPatch() -{ - quint16 track = read16bit(); - qint8 patch = readByte(); - Q_EMIT signalWRKTrackPatch(track, patch); -} - -void QWrk::processTimeFormat() -{ - quint16 fmt = read16bit(); - quint16 ofs = read16bit(); - Q_EMIT signalWRKTimeFormat(fmt, ofs); -} - -void QWrk::processComments() -{ - int len = read16bit(); - QString text = readString(len); - Q_EMIT signalWRKComments(text); -} - -void QWrk::processVariableRecord(int max) -{ - int datalen = max - 32; - QByteArray data; - QString name = readVarString(); - readGap(31 - name.length()); - for ( int i = 0; i < datalen; ++i ) - data += readByte(); - Q_EMIT signalWRKVariableRecord(name, data); -} - -void QWrk::processUnknown(int id) -{ - Q_EMIT signalWRKUnknownChunk(id, d->m_lastChunkData); -} - -void QWrk::processNewTrack() -{ - qint16 bank = -1; - qint16 patch = -1; - qint16 vol = -1; - qint16 pan = -1; - qint8 key = -1; - qint8 vel = 0; - quint8 port = 0; - qint8 channel = 0; - bool selected = false; - bool muted = false; - bool loop = false; - quint16 track = read16bit(); - quint8 len = readByte(); - QString name = readString(len); - bank = read16bit(); - patch = read16bit(); - vol = read16bit(); - pan = read16bit(); - key = readByte(); - vel = readByte(); - readGap(7); - port = readByte(); - channel = readByte(); - muted = (readByte() != 0); - Q_EMIT signalWRKNewTrack(name, track, channel, key, vel, port, selected, muted, loop); - if (bank > -1) - Q_EMIT signalWRKTrackBank(track, bank); - if (patch > -1) - if (channel > -1) - Q_EMIT signalWRKProgram(track, 0, channel, patch); - else - Q_EMIT signalWRKTrackPatch(track, patch); -} - -void QWrk::processSoftVer() -{ - int len = readByte(); - QString vers = readString(len); - Q_EMIT signalWRKSoftVer(vers); -} - -void QWrk::processTrackName() -{ - int track = read16bit(); - int len = readByte(); - QString name = readString(len); - Q_EMIT signalWRKTrackName(track, name); -} - -void QWrk::processStringTable() -{ - QStringList table; - int rows = read16bit(); - for (int i = 0; i < rows; ++i) { - int len = readByte(); - QString name = readString(len); - int idx = readByte(); - table.insert(idx, name); - } - Q_EMIT signalWRKStringTable(table); -} - -void QWrk::processLyricsStream() -{ - quint16 track = read16bit(); - int events = read32bit(); - processNoteArray(track, events); -} - -void QWrk::processTrackVol() -{ - quint16 track = read16bit(); - int vol = read16bit(); - Q_EMIT signalWRKTrackVol(track, vol); -} - -void QWrk::processNewTrackOffset() -{ - quint16 track = read16bit(); - int offset = read32bit(); - Q_EMIT signalWRKTrackOffset(track, offset); -} - -void QWrk::processTrackBank() -{ - quint16 track = read16bit(); - int bank = read16bit(); - Q_EMIT signalWRKTrackBank(track, bank); -} - -void QWrk::processSegmentChunk() -{ - QString name; - int track = read16bit(); - int offset = read32bit(); - readGap(8); - int len = readByte(); - name = readString(len); - readGap(20); - Q_EMIT signalWRKSegment(track, offset, name); - int events = read32bit(); - processNoteArray(track, events); -} - -void QWrk::processNewStream() -{ - QString name; - int track = read16bit(); - int len = readByte(); - name = readString(len); - Q_EMIT signalWRKSegment(track, 0, name); - int events = read32bit(); - processNoteArray(track, events); -} - -void QWrk::processEndChunk() -{ - emit signalWRKEnd(); -} - -int QWrk::readChunk() -{ - long start_pos, final_pos; - int ck_len, ck = readByte(); - if (ck != END_CHUNK) { - ck_len = read32bit(); - start_pos = getFilePos(); - final_pos = start_pos + ck_len; - readRawData(ck_len); - seek(start_pos); - switch (ck) { - case TRACK_CHUNK: - processTrackChunk(); - break; - case VARS_CHUNK: - processVarsChunk(); - break; - case TIMEBASE_CHUNK: - processTimebaseChunk(); - break; - case STREAM_CHUNK: - processStreamChunk(); - break; - case METER_CHUNK: - processMeterChunk(); - break; - case TEMPO_CHUNK: - processTempoChunk(100); - break; - case NTEMPO_CHUNK: - processTempoChunk(); - break; - case SYSEX_CHUNK: - processSysexChunk(); - break; - case THRU_CHUNK: - processThruChunk(); - break; - case TRKOFFS_CHUNK: - processTrackOffset(); - break; - case TRKREPS_CHUNK: - processTrackReps(); - break; - case TRKPATCH_CHUNK: - processTrackPatch(); - break; - case TIMEFMT_CHUNK: - processTimeFormat(); - break; - case COMMENTS_CHUNK: - processComments(); - break; - case VARIABLE_CHUNK: - processVariableRecord(ck_len); - break; - case NTRACK_CHUNK: - processNewTrack(); - break; - case SOFTVER_CHUNK: - processSoftVer(); - break; - case TRKNAME_CHUNK: - processTrackName(); - break; - case STRTAB_CHUNK: - processStringTable(); - break; - case LYRICS_CHUNK: - processLyricsStream(); - break; - case TRKVOL_CHUNK: - processTrackVol(); - break; - case NTRKOFS_CHUNK: - processNewTrackOffset(); - break; - case TRKBANK_CHUNK: - processTrackBank(); - break; - case METERKEY_CHUNK: - processMeterKeyChunk(); - break; - case SYSEX2_CHUNK: - processSysex2Chunk(); - break; - case NSYSEX_CHUNK: - processNewSysexChunk(); - break; - case SGMNT_CHUNK: - processSegmentChunk(); - break; - case NSTREAM_CHUNK: - processNewStream(); - break; - default: - processUnknown(ck); - } - seek(final_pos); - } - return ck; -} - -void QWrk::wrkRead() -{ - int vma, vme; - int ck_id; - QByteArray hdr(HEADER.length(), ' '); - d->m_tempos.clear(); - d->m_IOStream->device()->read(hdr.data(), HEADER.length()); - if (hdr == HEADER) { - readGap(1); - vme = readByte(); - vma = readByte(); - Q_EMIT signalWRKHeader(vma, vme); - do { - ck_id = readChunk(); - } while (ck_id != END_CHUNK); - if (!atEnd()) - Q_EMIT signalWRKError("Corrupted file"); - else - processEndChunk(); - } else - Q_EMIT signalWRKError("Invalid file format"); -} - -} // namespace drumstick diff -Nru kmetronome-0.10.0/drumstick/src/subscription.cpp kmetronome-0.10.1/drumstick/src/subscription.cpp --- kmetronome-0.10.0/drumstick/src/subscription.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/drumstick/src/subscription.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,544 +0,0 @@ -/* - MIDI Sequencer C++ library - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "alsaclient.h" - -/** - * @file subscription.cpp - * Implementation of classes managing ALSA sequencer subscriptions - */ - -namespace drumstick { - -/** - * @addtogroup ALSASubscription - * @{ - * - * Subscriptions are virtual MIDI cables between readable and writable ports. - * - * The ALSA sequencer readable ports are equivalent to the MIDI OUT ports in the - * real world. Similarly, the writable ports are equivalent to the MIDI IN ones. - * Subscriptions, like real MIDI cables, always involve a readable port (source) - * and a writable port (destination). - * - * Classes: - * - * Subscriber: This class is used to enumerate the subscribers of a given (root) port. - * - * Subscription: This class represents a connection between two ports. - * - * @see http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_subscribe.html - * @} - */ - -/** - * Default constructor - */ -Subscriber::Subscriber() -{ - snd_seq_query_subscribe_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Existing Subscriber object reference - */ -Subscriber::Subscriber(const Subscriber& other) -{ - snd_seq_query_subscribe_malloc(&m_Info); - snd_seq_query_subscribe_copy(m_Info, other.m_Info); -} - -/** - * Constructor - * @param other Pointer to an ALSA query subscribe object - */ -Subscriber::Subscriber(snd_seq_query_subscribe_t* other) -{ - snd_seq_query_subscribe_malloc(&m_Info); - snd_seq_query_subscribe_copy(m_Info, other); -} - -/** - * Destructor - */ -Subscriber::~Subscriber() -{ - snd_seq_query_subscribe_free(m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -Subscriber* Subscriber::clone() -{ - return new Subscriber(m_Info); -} - -/** - * Assignment operator - * @param other Existing Subscriber object reference - * @return This object - */ -Subscriber& Subscriber::operator=(const Subscriber& other) -{ - snd_seq_query_subscribe_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the subscriber's client number - * @return Client number - */ -int -Subscriber::getClient() -{ - return snd_seq_query_subscribe_get_client(m_Info); -} - -/** - * Gets the subscriober's port number - * @return Port number - */ -int -Subscriber::getPort() -{ - return snd_seq_query_subscribe_get_port(m_Info); -} - -/** - * Gets the subscriber's root address - * @return Pointer to the ALSA client/port address - */ -const snd_seq_addr_t* -Subscriber::getRoot() -{ - return snd_seq_query_subscribe_get_root(m_Info); -} - -/** - * Gets the subscription type (read or write). - *
    - *
  • SND_SEQ_QUERY_SUBS_READ: read subscriptions
  • - *
  • SND_SEQ_QUERY_SUBS_WRITE: write subscriptions
  • - *
- * @return Subscription type - */ -snd_seq_query_subs_type_t -Subscriber::getType() -{ - return snd_seq_query_subscribe_get_type(m_Info); -} - -/** - * Gets the index of the subscriber container - * @return Index of the subscriber - */ -int -Subscriber::getIndex() -{ - return snd_seq_query_subscribe_get_index(m_Info); -} - -/** - * Gets the number of subscribers returned by a query operation - * @return Number of subscribers - */ -int -Subscriber::getNumSubs() -{ - return snd_seq_query_subscribe_get_num_subs(m_Info); -} - -/** - * Gets the subscriber's address - * @return Pointer to the ALSA address record - */ -const snd_seq_addr_t* -Subscriber::getAddr() -{ - return snd_seq_query_subscribe_get_addr(m_Info); -} - -/** - * Gets the subscriber's queue number - * @return Queue number - */ -int -Subscriber::getQueue() -{ - return snd_seq_query_subscribe_get_queue(m_Info); -} - -/** - * Gets the subscriber's exclusive flag - * @return Exclusive flag - */ -bool -Subscriber::getExclusive() -{ - return (snd_seq_query_subscribe_get_exclusive(m_Info) != 0); -} - -/** - * Gets the susbcriber's time-update flag - * @return Time update flag - */ -bool -Subscriber::getTimeUpdate() -{ - return (snd_seq_query_subscribe_get_time_update(m_Info) != 0); -} - -/** - * Gets the subscriber's time real time-stamp flag - * @return Time real flag - */ -bool -Subscriber::getTimeReal() -{ - return (snd_seq_query_subscribe_get_time_real(m_Info) != 0); -} - -/** - * Sets the subscriber's client number - * @param client Client number - */ -void -Subscriber::setClient(int client) -{ - snd_seq_query_subscribe_set_client(m_Info, client); -} - -/** - * Sets the subscriber's port number - * @param port Port number - */ -void -Subscriber::setPort(int port) -{ - snd_seq_query_subscribe_set_port(m_Info, port); -} - -/** - * Sets the subscriber's root address - * @param addr Pointer to the root ALSA address record - */ -void -Subscriber::setRoot(snd_seq_addr_t* addr) -{ - snd_seq_query_subscribe_set_root(m_Info, addr); -} - -/** - * Sets the subscription type - *
    - *
  • SND_SEQ_QUERY_SUBS_READ: read subscriptions
  • - *
  • SND_SEQ_QUERY_SUBS_WRITE: write subscriptions
  • - *
- * @param type Subscription type - */ -void -Subscriber::setType(snd_seq_query_subs_type_t type) -{ - snd_seq_query_subscribe_set_type(m_Info, type); -} - -/** - * Sets the index of the subscriber - * @param index Subscriber index - */ -void -Subscriber::setIndex(int index) -{ - snd_seq_query_subscribe_set_index(m_Info, index); -} - -/** - * Gets the size of the ALSA query subscriber object - * @return Size of the ALSA object - */ -int -Subscriber::getSizeOfInfo() const -{ - return snd_seq_query_subscribe_sizeof(); -} - -/** - * Default constructor - */ -Subscription::Subscription() -{ - snd_seq_port_subscribe_malloc(&m_Info); -} - -/** - * Copy constructor - * @param other Existing Subscription object reference - */ -Subscription::Subscription(const Subscription& other) -{ - snd_seq_port_subscribe_malloc(&m_Info); - snd_seq_port_subscribe_copy(m_Info, other.m_Info); -} - -/** - * Constructor - * @param other Pointer to an ALSA subscription object - */ -Subscription::Subscription(snd_seq_port_subscribe_t* other) -{ - snd_seq_port_subscribe_malloc(&m_Info); - snd_seq_port_subscribe_copy(m_Info, other); -} - -/** - * Constructor - * @param seq Pointer to a MIDI Client object - */ -Subscription::Subscription(MidiClient* seq) -{ - snd_seq_port_subscribe_malloc(&m_Info); - CHECK_WARNING(snd_seq_get_port_subscription(seq->getHandle(), m_Info)); -} - -/** - * Destructor - * @return - */ -Subscription::~Subscription() -{ - snd_seq_port_subscribe_free(m_Info); -} - -/** - * Copy the current object - * @return Pointer to the new object - */ -Subscription* -Subscription::clone() -{ - return new Subscription(m_Info); -} - -/** - * Assignment operator - * @param other Existing subscription object reference - * @return This object - */ -Subscription& -Subscription::operator=(const Subscription& other) -{ - snd_seq_port_subscribe_copy(m_Info, other.m_Info); - return *this; -} - -/** - * Gets the sender address of the subscription (MIDI OUT port) - * @return Pointer to the sender ALSA address record - */ -const snd_seq_addr_t* -Subscription::getSender() -{ - return snd_seq_port_subscribe_get_sender(m_Info); -} - -/** - * Gets the destination address of the subscription (MIDI IN port) - * @return Pointer to the destination ALSA address record - */ -const snd_seq_addr_t* -Subscription::getDest() -{ - return snd_seq_port_subscribe_get_dest(m_Info); -} - -/** - * Gets the susbcription's queue number - * @return Queue number - */ -int -Subscription::getQueue() -{ - return snd_seq_port_subscribe_get_queue(m_Info); -} - -/** - * Gets the subscription's exclusive flag - * @return Exclusive flag - */ -bool -Subscription::getExclusive() -{ - return (snd_seq_port_subscribe_get_exclusive(m_Info) != 0); -} - -/** - * Gets the susbcription's time-update flag - * @return Time-update flag - */ -bool -Subscription::getTimeUpdate() -{ - return (snd_seq_port_subscribe_get_time_update(m_Info) != 0); -} - -/** - * Gets the susbcription's time-real (time-stamping) flag - * @return Time real flag - */ -bool -Subscription::getTimeReal() -{ - return (snd_seq_port_subscribe_get_time_real(m_Info) != 0); -} - -/** - * Sets the Subscription's sender (MIDI OUT) port - * @param addr Pointer to the sender ALSA address record - */ -void -Subscription::setSender(const snd_seq_addr_t* addr) -{ - snd_seq_port_subscribe_set_sender(m_Info, addr); -} - -/** - * Sets the Subscription's destination (MIDI IN) port - * @param addr Pointer to the destination ALSA address record - */ -void -Subscription::setDest(const snd_seq_addr_t* addr) -{ - snd_seq_port_subscribe_set_dest(m_Info, addr); -} - -/** - * Sets the Subscription's Queue number - * @param q Queue number - */ -void -Subscription::setQueue(int q) -{ - snd_seq_port_subscribe_set_queue(m_Info, q); -} - -/** - * Sets the subscription's exclusive flag - * @param val Exclusive flag - */ -void -Subscription::setExclusive(bool val) -{ - snd_seq_port_subscribe_set_exclusive(m_Info, val?1:0); -} - -/** - * Sets the susbcription's time-update flag - * @param val Time update flag - */ -void -Subscription::setTimeUpdate(bool val) -{ - snd_seq_port_subscribe_set_time_update(m_Info, val?1:0); -} - -/** - * Sets the subscription's time real (time-stamping) flag - * @param val Time real flag - */ -void -Subscription::setTimeReal(bool val) -{ - snd_seq_port_subscribe_set_time_real(m_Info, val?1:0); -} - -/** - * Sets the Subscription's sender (MIDI OUT) port - * @param client Client number - * @param port Port number - */ -void -Subscription::setSender(unsigned char client, unsigned char port) -{ - snd_seq_addr_t addr; - addr.client = client; - addr.port = port; - setSender(&addr); -} - -/** - * Sets the Subscription's destination (MIDI IN) port - * @param client Client number - * @param port Port number - */ -void -Subscription::setDest(unsigned char client, unsigned char port) -{ - snd_seq_addr_t addr; - addr.client = client; - addr.port = port; - setDest(&addr); -} - -/** - * Performs the subscription in the ALSA sequencer subsystem. - * Neither the sender nor the destination ports need to belong to the - * same MidiClient instance performing the subscription. - * @param seq MidiClient instance pointer - */ -void -Subscription::subscribe(MidiClient* seq) -{ - if ((m_Info == NULL) || (seq == NULL) || !(seq->isOpened())) - { - return; - } - CHECK_WARNING(snd_seq_subscribe_port(seq->getHandle(), m_Info)); -} - -/** - * Breaks the subscription in the ALSA sequencer subsystem. - * Neither the sender nor the destination ports need to belong to the - * same MidiClient instance breaking the subscription. - * @param seq MidiClient instance pointer - */ -void -Subscription::unsubscribe(MidiClient* seq) -{ - if ((m_Info == NULL) || (seq == NULL) || !(seq->isOpened())) - { - return; - } - CHECK_WARNING(snd_seq_unsubscribe_port(seq->getHandle(), m_Info)); -} - -/** - * Gets the size of the ALSA subscription object - * @return Size of the ALSA object - */ -int -Subscription::getSizeOfInfo() const -{ - return snd_seq_port_subscribe_sizeof(); -} - -} /* namespace drumstick */ - diff -Nru kmetronome-0.10.0/kmetronome.spec kmetronome-0.10.1/kmetronome.spec --- kmetronome-0.10.0/kmetronome.spec 2010-06-06 08:09:18.000000000 +0000 +++ kmetronome-0.10.1/kmetronome.spec 2012-05-28 20:55:39.000000000 +0000 @@ -1,10 +1,10 @@ # -# spec file for package kmetronome (Version 0.10.0) +# spec file for package kmetronome (Version 0.10.1) # # norootforbuild Name: kmetronome -Version: 0.10.0 +Version: 0.10.1 Release: 0 License: GPL v2 or later Summary: KDE MIDI Metronome using ALSA Sequencer diff -Nru kmetronome-0.10.0/po/CMakeLists.txt kmetronome-0.10.1/po/CMakeLists.txt --- kmetronome-0.10.0/po/CMakeLists.txt 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/CMakeLists.txt 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ # KMetronome - ALSA Sequencer based MIDI metronome -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/po/cs.po kmetronome-0.10.1/po/cs.po --- kmetronome-0.10.0/po/cs.po 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/cs.po 2012-05-28 20:55:39.000000000 +0000 @@ -9,9 +9,9 @@ msgid "" msgstr "" "Project-Id-Version: es\n" -"Report-Msgid-Bugs-To: http://sourceforge." -"net/tracker/?atid=731542&group_id=134956\n" -"POT-Creation-Date: 2010-05-23 11:30+0200\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"atid=731542&group_id=134956\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" "PO-Revision-Date: 2010-05-23 14:20+0200\n" "Last-Translator: Pavel Fric\n" "Language-Team: Czech \n" @@ -21,44 +21,57 @@ "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#: src/drumgrid.cpp:49 +#: src/drumgrid.cpp:51 msgid "Pattern Editor" msgstr "Editor vzorů" -#: src/drumgrid.cpp:254 +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "" + +#: src/drumgrid.cpp:69 +#, fuzzy +msgid "Paste" +msgstr "Vzory" + +#: src/drumgrid.cpp:278 msgid "Do you want to remove the current pattern?" msgstr "Chcete odstranit současný vzor?" -#: src/drumgrid.cpp:255 +#: src/drumgrid.cpp:279 msgid "Remove Pattern" msgstr "Odstranit vzor" -#: src/drumgrid.cpp:309 +#: src/drumgrid.cpp:333 msgctxt "name of an automatically created pattern" msgid "Sample Pattern" msgstr "Ukázkový vzor" -#: src/drumgrid.cpp:340 +#: src/drumgrid.cpp:364 msgid "Insert Pattern Row" msgstr "Vložit vzor nyní" -#: src/drumgrid.cpp:341 +#: src/drumgrid.cpp:365 msgid "Drum Key:" msgstr "Tónina bubnu:" -#: src/drumgrid.cpp:361 +#: src/drumgrid.cpp:386 msgid "Please select one, and only one row" msgstr "Vyberte, prosím, jednu, a pouze jeden řádek" -#: src/drumgrid.cpp:363 +#: src/drumgrid.cpp:388 msgid "Do you want to remove the selected pattern row?" msgstr "Chcete odstranit vybraný vzor nyní?" -#: src/drumgrid.cpp:364 +#: src/drumgrid.cpp:389 msgid "Remove Row" msgstr "Odstranit řádek" -#: src/kmetronome.cpp:85 +#: src/kmetronome.cpp:87 msgid "" "Fatal error from the ALSA sequencer. This usually happens when the kernel " "doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " @@ -70,45 +83,45 @@ "není nahrán modul jádra (snd_seq). Ověřte, prosím, své nastavení ALSA/MIDI. " "Vrácenou chybou bylo: %1" -#: src/kmetronome.cpp:91 +#: src/kmetronome.cpp:93 msgid "Error" msgstr "Chyba" -#: src/kmetronome.cpp:112 +#: src/kmetronome.cpp:114 msgid "Play/Stop" msgstr "Přehrát/Zastavit" -#: src/kmetronome.cpp:116 +#: src/kmetronome.cpp:118 msgid "Show Action Buttons" msgstr "Ukázat tlačítka činností" #. i18n: file: src/kmetronomeviewbase.ui:126 #. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) -#: src/kmetronome.cpp:123 po/rc.cpp:130 +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 msgid "Patterns" msgstr "Vzory" -#: src/kmetronome.cpp:128 src/kmetronome.cpp:490 +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 msgid "Import Patterns" msgstr "Zavést vzory" -#: src/kmetronome.cpp:133 src/kmetronome.cpp:503 +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 msgid "Export Patterns" msgstr "Vyvést vzory" -#: src/kmetronome.cpp:489 src/kmetronome.cpp:502 +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 msgid "*.pat|Pattern Files (*.pat)" msgstr "*.pat|Soubory se vzory (*.pat)" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Tempo" msgstr "Tempo" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Enter new Tempo:" msgstr "Zadat nové tempo:" -#: src/kmetronomeview.cpp:177 +#: src/kmetronomeview.cpp:179 msgctxt "the pattern is created automatically" msgid "Automatic" msgstr "Automaticky" @@ -121,15 +134,15 @@ msgid "KDE MIDI metronome using ALSA sequencer" msgstr "Metronom MIDI pro prostředí KDE používající sekvencer ALSA" -#: src/main.cpp:40 +#: src/main.cpp:41 msgid "KMetronome" msgstr "KMetronome" -#: src/main.cpp:42 -msgid "(C) 2005-2010 Pedro Lopez-Cabanillas" -msgstr "(C) 2005-2010 Pedro Lopez-Cabanillas" +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" +msgstr "(C) 2005-2012 Pedro Lopez-Cabanillas" -#: src/main.cpp:46 +#: src/main.cpp:45 msgid "Pedro Lopez-Cabanillas" msgstr "Pedro Lopez-Cabanillas" @@ -141,7 +154,7 @@ #. i18n: ectx: property (text), widget (QLabel, patternLabel) #. i18n: file: src/kmetronomeviewbase.ui:191 #. i18n: ectx: property (text), widget (QLabel, lblPattern) -#: po/rc.cpp:3 po/rc.cpp:142 +#: po/rc.cpp:3 po/rc.cpp:140 msgid "Pattern:" msgstr "Vzor:" @@ -153,8 +166,7 @@ "choose an existing pattern from the drop-down list." msgstr "" "Napište nový název a stiskněte tlačítko \"Uložit\" pro vytvoření nového " -"vzoru. " -"nebo vyberte stávající vzor ze seznamu." +"vzoru. nebo vyberte stávající vzor ze seznamu." #. i18n: file: src/drumgrid.ui:72 #. i18n: ectx: property (whatsThis), widget (KPushButton, saveButton) @@ -245,196 +257,190 @@ msgid "This is the current beat number" msgstr "Toto je číslo nynější doby" -#. i18n: file: src/drumgrid.ui:184 +#. i18n: file: src/drumgrid.ui:187 #. i18n: ectx: property (whatsThis), widget (QTableView, tableView) #: po/rc.cpp:49 msgid "This is the pattern table, beats as columns and sounds as rows" msgstr "Toto je tabulka vzoru, doby jako sloupce a zvuky jako řádky" -#. i18n: file: src/drumgrid.ui:200 +#. i18n: file: src/drumgrid.ui:203 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) #: po/rc.cpp:52 msgid "Number of beats per measure (bar)" msgstr "Počet dob na takt" -#. i18n: file: src/drumgrid.ui:216 +#. i18n: file: src/drumgrid.ui:219 #. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) #: po/rc.cpp:55 msgid "This is the beat length for the pattern column." msgstr "Toto je délka doby pro sloupec vzoru." -#. i18n: file: src/drumgrid.ui:226 +#. i18n: file: src/drumgrid.ui:229 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:282 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:58 po/rc.cpp:164 +#: po/rc.cpp:58 po/rc.cpp:162 msgid "Whole" msgstr "Celá" -#. i18n: file: src/drumgrid.ui:235 +#. i18n: file: src/drumgrid.ui:238 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:291 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:61 po/rc.cpp:167 +#: po/rc.cpp:61 po/rc.cpp:165 msgid "Half" msgstr "Půlová" -#. i18n: file: src/drumgrid.ui:244 +#. i18n: file: src/drumgrid.ui:247 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:300 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:64 po/rc.cpp:170 +#: po/rc.cpp:64 po/rc.cpp:168 msgid "Quarter" msgstr "Čtvrtina" -#. i18n: file: src/drumgrid.ui:253 +#. i18n: file: src/drumgrid.ui:256 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:309 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:67 po/rc.cpp:173 +#: po/rc.cpp:67 po/rc.cpp:171 msgid "Eighth" msgstr "Osmina" -#. i18n: file: src/drumgrid.ui:262 +#. i18n: file: src/drumgrid.ui:265 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:318 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:70 po/rc.cpp:176 +#: po/rc.cpp:70 po/rc.cpp:174 msgid "Sixteenth" msgstr "Šestnáctina" -#. i18n: file: src/drumgrid.ui:271 +#. i18n: file: src/drumgrid.ui:274 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:327 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:73 po/rc.cpp:179 +#: po/rc.cpp:73 po/rc.cpp:177 msgid "Thirty-Second" msgstr "Dvaatřicetina" -#. i18n: file: src/drumgrid.ui:280 +#. i18n: file: src/drumgrid.ui:283 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:336 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:76 po/rc.cpp:182 +#: po/rc.cpp:76 po/rc.cpp:180 msgid "Sixty-Fourth" msgstr "Čtyřiašedesátina" -#. i18n: file: src/drumgrid.ui:292 +#. i18n: file: src/drumgrid.ui:295 #. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) #: po/rc.cpp:79 msgid "This button starts playing the current pattern" msgstr "Tímto tlačítkem se spouští přehrávání současného vzoru" -#. i18n: file: src/drumgrid.ui:295 +#. i18n: file: src/drumgrid.ui:298 #. i18n: ectx: property (text), widget (QPushButton, startButton) #. i18n: file: src/kmetronomeviewbase.ui:81 #. i18n: ectx: property (text), widget (KPushButton, m_playbtn) -#: po/rc.cpp:82 po/rc.cpp:112 +#: po/rc.cpp:82 po/rc.cpp:110 msgid "Play" msgstr "Přehrát" -#. i18n: file: src/drumgrid.ui:308 +#. i18n: file: src/drumgrid.ui:311 #. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) #: po/rc.cpp:85 msgid "This button stops the playback" msgstr "Tímto tlačítkem se zastavuje přehrávání" -#. i18n: file: src/drumgrid.ui:311 +#. i18n: file: src/drumgrid.ui:314 #. i18n: ectx: property (text), widget (QPushButton, stopButton) #. i18n: file: src/kmetronomeviewbase.ui:100 #. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:88 po/rc.cpp:118 +#: po/rc.cpp:88 po/rc.cpp:116 msgid "Stop" msgstr "Zastavit" -#. i18n: file: src/drumgrid.ui:327 +#. i18n: file: src/drumgrid.ui:330 #. i18n: ectx: property (whatsThis), widget (QLabel, label_3) #: po/rc.cpp:91 msgid "QPM: quarters per minute" msgstr "ČZM: čtvrtin za minutu" -#. i18n: file: src/drumgrid.ui:330 +#. i18n: file: src/drumgrid.ui:333 #. i18n: ectx: property (text), widget (QLabel, label_3) #: po/rc.cpp:94 msgctxt "Quarters per Minute" msgid "QPM:" msgstr "ČZM:" -#. i18n: file: src/drumgrid.ui:340 +#. i18n: file: src/drumgrid.ui:343 #. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) #: po/rc.cpp:97 msgid "This is the current tempo in quarters per minute" msgstr "Toto je nynější tempo ve čtvrtinách za minutu)" -#. i18n: file: src/drumgrid.ui:343 -#. i18n: ectx: property (text), widget (QLabel, tempoLabel) -#: po/rc.cpp:100 -msgid "100" -msgstr "100" - -#. i18n: file: src/drumgrid.ui:350 +#. i18n: file: src/drumgrid.ui:353 #. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) -#: po/rc.cpp:103 +#: po/rc.cpp:101 msgid "Drag the slider handle to change the tempo, in quarters per minute" msgstr "Táhněte posuvníkem pro změnu tempa, ve čtvrtinách za minutu" #. i18n: file: src/kmetronomeviewbase.ui:58 #. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) -#: po/rc.cpp:106 +#: po/rc.cpp:104 msgid "MIDI Metronome" msgstr "MIDI metronom" #. i18n: file: src/kmetronomeviewbase.ui:78 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) -#: po/rc.cpp:109 +#: po/rc.cpp:107 msgid "This button starts playing the rhythm pattern" msgstr "Tímto tlačítkem se spouští přehrávání rytmického vzoru" #. i18n: file: src/kmetronomeviewbase.ui:97 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:115 +#: po/rc.cpp:113 msgid "This button stops playing the rhythm pattern" msgstr "Tímto tlačítkem se zastavuje přehrávání rytmického vzoru" #. i18n: file: src/kmetronomeviewbase.ui:113 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) -#: po/rc.cpp:121 +#: po/rc.cpp:119 msgid "This button opens the configuration window" msgstr "Tímto tlačítkem se otevírá okno s nastavením" #. i18n: file: src/kmetronomeviewbase.ui:116 #. i18n: ectx: property (text), widget (KPushButton, m_configbtn) -#: po/rc.cpp:124 +#: po/rc.cpp:122 msgid "Settings" msgstr "Nastavení" #. i18n: file: src/kmetronomeviewbase.ui:123 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) -#: po/rc.cpp:127 +#: po/rc.cpp:125 msgid "This button opens the pattern editor" msgstr "Tímto tlačítkem se otevírá editor vzoru" #. i18n: file: src/kmetronomeviewbase.ui:139 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:133 +#: po/rc.cpp:131 msgid "This button exits the program" msgstr "Tímto tlačítkem se program ukončuje" #. i18n: file: src/kmetronomeviewbase.ui:142 #. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:136 +#: po/rc.cpp:134 msgid "Quit" msgstr "Ukončit" #. i18n: file: src/kmetronomeviewbase.ui:173 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) -#: po/rc.cpp:139 +#: po/rc.cpp:137 msgid "Number of measures (bars) and beats played from beginning" msgstr "Počet taktů a dob přehrávaných od začátku" #. i18n: file: src/kmetronomeviewbase.ui:210 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) -#: po/rc.cpp:145 +#: po/rc.cpp:143 msgid "" "This is the pattern definition to play, either \"Automatic\" or a custom " "defined one." @@ -444,71 +450,71 @@ #. i18n: file: src/kmetronomeviewbase.ui:217 #. i18n: ectx: property (text), widget (QLabel, lblBeats) -#: po/rc.cpp:148 +#: po/rc.cpp:146 msgid "Beats/Bar:" msgstr "Doby/Takt:" #. i18n: file: src/kmetronomeviewbase.ui:238 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) -#: po/rc.cpp:151 +#: po/rc.cpp:149 msgid "" -"This is the number of beats for each measure (bar).
\n" -"Values are from 1 to 32.
\n" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" "It is the numerator of the time signature specification." msgstr "" -"Toto je počet dob pro každý takt
\n" -"Hodnoty jsou od 1 do 32
\n" +"Toto je počet dob pro každý takt\n" +"Hodnoty jsou od 1 do 32\n" "Je to čitatel zadání taktového označení." #. i18n: file: src/kmetronomeviewbase.ui:254 #. i18n: ectx: property (text), widget (QLabel, lblFigure) -#: po/rc.cpp:156 +#: po/rc.cpp:154 msgid "Beat Length:" msgstr "Délka doby:" #. i18n: file: src/kmetronomeviewbase.ui:272 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) -#: po/rc.cpp:159 +#: po/rc.cpp:157 msgid "" -"This is the beat length.
\n" -"Values mean 1, 2, 4, 8, 16, 32 and 64.
\n" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" "It is the denominator in the time signature specification." msgstr "" -"Toto je délka doby.
\n" -"Hodnoty znamenají 1, 2, 4, 8, 16, 32 a 64.
\n" +"Toto je délka doby.\n" +"Hodnoty znamenají 1, 2, 4, 8, 16, 32 a 64.\n" "Je to jmenovatel zadání taktového označení." #. i18n: file: src/kmetronomeviewbase.ui:356 #. i18n: ectx: property (text), widget (QLabel, label_1) -#: po/rc.cpp:185 +#: po/rc.cpp:183 msgctxt "weak notes MIDI velocity" msgid "Weak" msgstr "Slabý" #. i18n: file: src/kmetronomeviewbase.ui:369 #. i18n: ectx: property (text), widget (QLabel, label_2) -#: po/rc.cpp:188 +#: po/rc.cpp:186 msgctxt "strong notes MIDI velocity" msgid "Strong" msgstr "Silný" #. i18n: file: src/kmetronomeviewbase.ui:382 #. i18n: ectx: property (text), widget (QLabel, label_3) -#: po/rc.cpp:191 +#: po/rc.cpp:189 msgctxt "audio volume level" msgid "Volume" msgstr "Hlasitost" #. i18n: file: src/kmetronomeviewbase.ui:395 #. i18n: ectx: property (text), widget (QLabel, label_4) -#: po/rc.cpp:194 +#: po/rc.cpp:192 msgctxt "audio panning" msgid "Pan" msgstr "Vyváženost" #. i18n: file: src/kmetronomeviewbase.ui:414 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) -#: po/rc.cpp:197 +#: po/rc.cpp:195 msgid "" "This is the velocity of the weak notes in the automatic rhythm pattern (all " "of them, except the first one)" @@ -518,7 +524,7 @@ #. i18n: file: src/kmetronomeviewbase.ui:439 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) -#: po/rc.cpp:200 +#: po/rc.cpp:198 msgid "" "This is the velocity of the strong note in the automatic rhythm pattern (the " "first one)" @@ -526,47 +532,47 @@ #. i18n: file: src/kmetronomeviewbase.ui:464 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) -#: po/rc.cpp:203 +#: po/rc.cpp:201 msgid "This is the MIDI volume control (CC7)" msgstr "Toto je ovládání hlasitosti MIDI (CC7)" #. i18n: file: src/kmetronomeviewbase.ui:489 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) -#: po/rc.cpp:206 +#: po/rc.cpp:204 msgid "This is the MIDI pan control (CC10)" msgstr "Toto je ovládání vyrovnání MIDI (CC10)" #. i18n: file: src/kmetronomeviewbase.ui:512 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) -#: po/rc.cpp:209 +#: po/rc.cpp:207 msgid "This is the musical name of the tempo value" msgstr "Toto je hudební název pro hodnotu tempa" #. i18n: file: src/kmetronomeviewbase.ui:531 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) -#: po/rc.cpp:212 +#: po/rc.cpp:210 msgid "The current tempo value" msgstr "Nynější hodnota pro tempo" #. i18n: file: src/kmetronomeviewbase.ui:554 #. i18n: ectx: property (text), widget (QLabel, textLabel1_2) -#: po/rc.cpp:215 +#: po/rc.cpp:213 msgid "Tempo (in quarters per minute)" msgstr "Tempo (ve čtvrtinách za minutu)" #. i18n: file: src/kmetronomeviewbase.ui:580 #. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) -#: po/rc.cpp:218 +#: po/rc.cpp:216 msgid "" -"This slider changes the tempo, or speed of the rhythm.
\n" +"This slider changes the tempo, or speed of the rhythm.\n" "Values are 25 to 250 quarters per minute (Maelzel Metronome units)." msgstr "" -"Posuvníkem se mění tempo, nebo rychlost rytmu.
\n" +"Posuvníkem se mění tempo, nebo rychlost rytmu.\n" "Hodnoty jsou 25 až 250 čtvrtin za minutu. (jednotky metronomu Mälzel)." #. i18n: file: src/kmetropreferencesbase.ui:37 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:222 +#: po/rc.cpp:220 msgid "" "If this checkbox is activated, the the program will remember the connections " "for the input and output ports, and try to reconnect them at program startup." @@ -577,67 +583,67 @@ #. i18n: file: src/kmetropreferencesbase.ui:40 #. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:225 +#: po/rc.cpp:223 msgid "Automatic ports connection on startup" msgstr "Automatické spojení přípojek při spuštění" #. i18n: file: src/kmetropreferencesbase.ui:61 #. i18n: ectx: property (text), widget (QLabel, lblInputPort) -#: po/rc.cpp:228 +#: po/rc.cpp:226 msgid "Optional input port conn:" msgstr "Volitelné spojení vstupní přípojky:" #. i18n: file: src/kmetropreferencesbase.ui:83 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) -#: po/rc.cpp:231 +#: po/rc.cpp:229 msgid "This is the optional connection for the MIDI IN port." msgstr "Toto je volitelné spojení pro vstupní přípojku MIDI." #. i18n: file: src/kmetropreferencesbase.ui:102 #. i18n: ectx: property (text), widget (QLabel, lblOutputPort) -#: po/rc.cpp:234 +#: po/rc.cpp:232 msgid "Output port connection:" msgstr "Spojení výstupní přípojky:" #. i18n: file: src/kmetropreferencesbase.ui:124 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) -#: po/rc.cpp:237 +#: po/rc.cpp:235 msgid "This is the mandatory connection for the MIDI OUT port" msgstr "Toto je povinné spojení pro výstupní přípojku MIDI" #. i18n: file: src/kmetropreferencesbase.ui:131 #. i18n: ectx: property (text), widget (QLabel, lblInstrument) -#: po/rc.cpp:240 +#: po/rc.cpp:238 msgid "Output instrument:" msgstr "Výstupní nástroj:" #. i18n: file: src/kmetropreferencesbase.ui:147 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) -#: po/rc.cpp:243 +#: po/rc.cpp:241 msgid "This is the definition of the instrument connected to the MIDI OUT port" msgstr "Toto je vymezení nástroje spojeného s výstupní přípojkou MIDI" #. i18n: file: src/kmetropreferencesbase.ui:158 #. i18n: ectx: property (text), widget (QLabel, lblBank) -#: po/rc.cpp:246 +#: po/rc.cpp:244 msgid "Bank:" msgstr "Banka:" #. i18n: file: src/kmetropreferencesbase.ui:171 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) -#: po/rc.cpp:249 +#: po/rc.cpp:247 msgid "This is the Bank of the selected MIDI program" msgstr "Toto je banka vybraného programu MIDI" #. i18n: file: src/kmetropreferencesbase.ui:190 #. i18n: ectx: property (text), widget (QLabel, textLabel2) -#: po/rc.cpp:252 +#: po/rc.cpp:250 msgid "Channel:" msgstr "Kanál:" #. i18n: file: src/kmetropreferencesbase.ui:207 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) -#: po/rc.cpp:255 +#: po/rc.cpp:253 msgid "" "This is the MIDI channel, between 1 and 16. \n" "General MIDI uses the channel 10 for percussion sounds." @@ -647,80 +653,80 @@ #. i18n: file: src/kmetropreferencesbase.ui:235 #. i18n: ectx: property (text), widget (QLabel, textLabel3) -#: po/rc.cpp:259 +#: po/rc.cpp:257 msgid "Program:" msgstr "Program:" #. i18n: file: src/kmetropreferencesbase.ui:257 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) -#: po/rc.cpp:262 +#: po/rc.cpp:260 msgid "This is the MIDI program" msgstr "Toto je program MIDI" #. i18n: file: src/kmetropreferencesbase.ui:270 #. i18n: ectx: property (text), widget (QLabel, textLabel7) -#: po/rc.cpp:265 +#: po/rc.cpp:263 msgid "Resolution:" msgstr "Rozlišení:" #. i18n: file: src/kmetropreferencesbase.ui:286 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) -#: po/rc.cpp:268 +#: po/rc.cpp:266 msgid "This is the MIDI time resolution (number of ticks in a quarter note)" msgstr "Toto je rozlišení času MIDI (počet tiknutí ve čtvrťové notě)" #. i18n: file: src/kmetropreferencesbase.ui:305 #. i18n: ectx: property (text), widget (QLabel, textLabel4) -#: po/rc.cpp:271 +#: po/rc.cpp:269 msgid "Weak note:" msgstr "Slabá nota:" #. i18n: file: src/kmetropreferencesbase.ui:327 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) -#: po/rc.cpp:274 +#: po/rc.cpp:272 msgid "This is the sound of the weak notes for the automatic patterns" msgstr "Toto je zvuk slabých not pro automatické vzory" #. i18n: file: src/kmetropreferencesbase.ui:340 #. i18n: ectx: property (text), widget (QLabel, textLabel8) -#: po/rc.cpp:277 +#: po/rc.cpp:275 msgid "Note duration:" msgstr "Doba trvání noty:" #. i18n: file: src/kmetropreferencesbase.ui:356 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) -#: po/rc.cpp:280 +#: po/rc.cpp:278 msgid "This is the note duration in ticks, when using NOTE OFF events" msgstr "" "Toto je doba trvání noty v tiknutích, když se používají události NOTA VYPNUTA" #. i18n: file: src/kmetropreferencesbase.ui:378 #. i18n: ectx: property (text), widget (QLabel, textLabel5) -#: po/rc.cpp:283 +#: po/rc.cpp:281 msgid "Strong note:" msgstr "Silná nota:" #. i18n: file: src/kmetropreferencesbase.ui:400 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) -#: po/rc.cpp:286 +#: po/rc.cpp:284 msgid "This is the sound of the strong notes for the automatic patterns" msgstr "Toto je zvuk silných not pro automatické vzory" #. i18n: file: src/kmetropreferencesbase.ui:411 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:289 +#: po/rc.cpp:287 msgid "Optional setting to send NOTE OFF events" msgstr "Volitelné nastavení pro poslání událostí NOTA VYPNUTA" #. i18n: file: src/kmetropreferencesbase.ui:414 #. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:292 +#: po/rc.cpp:290 msgid "Send NOTE OFF events" msgstr "Poslat události NOTA VYPNUTA" #. i18n: file: src/kmetropreferencesbase.ui:440 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:295 +#: po/rc.cpp:293 msgid "If this option is activated, the knobs are drawn using a custom style" msgstr "" "Pokud je zapnuta tato volba, otočné knoflíky se vykreslují za použití " @@ -728,20 +734,23 @@ #. i18n: file: src/kmetropreferencesbase.ui:443 #. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:298 +#: po/rc.cpp:296 msgid "Styled Knobs" msgstr "Stylizované knoflíky" -#: po/rc.cpp:299 +#: po/rc.cpp:297 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Pavel Fric" -#: po/rc.cpp:300 +#: po/rc.cpp:298 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "fripohled.blogspot.com" +#~ msgid "100" +#~ msgstr "100" + #~ msgid "Config" #~ msgstr "Nastavení" diff -Nru kmetronome-0.10.0/po/de.po kmetronome-0.10.1/po/de.po --- kmetronome-0.10.0/po/de.po 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/de.po 2012-05-28 20:55:39.000000000 +0000 @@ -5,9 +5,9 @@ msgid "" msgstr "" "Project-Id-Version: kmetronome\n" -"Report-Msgid-Bugs-To: http://sourceforge." -"net/tracker/?atid=731542&group_id=134956\n" -"POT-Creation-Date: 2010-05-23 11:30+0200\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"atid=731542&group_id=134956\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" "PO-Revision-Date: 2010-06-03 19:13+0200\n" "Last-Translator: Rene Landert \n" "Language-Team: German \n" @@ -17,44 +17,57 @@ "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: src/drumgrid.cpp:49 +#: src/drumgrid.cpp:51 msgid "Pattern Editor" msgstr "Editor für Rhythmusschema" -#: src/drumgrid.cpp:254 +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "" + +#: src/drumgrid.cpp:69 +#, fuzzy +msgid "Paste" +msgstr "Rhythmusschema" + +#: src/drumgrid.cpp:278 msgid "Do you want to remove the current pattern?" msgstr "Möchten Sie das aktuelle Rhythmusschema entfernen?" -#: src/drumgrid.cpp:255 +#: src/drumgrid.cpp:279 msgid "Remove Pattern" msgstr "Rhythmusschema entfernen" -#: src/drumgrid.cpp:309 +#: src/drumgrid.cpp:333 msgctxt "name of an automatically created pattern" msgid "Sample Pattern" msgstr "Muster für Rhythmusschema" -#: src/drumgrid.cpp:340 +#: src/drumgrid.cpp:364 msgid "Insert Pattern Row" msgstr "Zeile in Rhythmusschema einfügen" -#: src/drumgrid.cpp:341 +#: src/drumgrid.cpp:365 msgid "Drum Key:" msgstr "Schlagzeug Taste:" -#: src/drumgrid.cpp:361 +#: src/drumgrid.cpp:386 msgid "Please select one, and only one row" msgstr "Bitte wählen Sie eine, und nur eine Zeile aus" -#: src/drumgrid.cpp:363 +#: src/drumgrid.cpp:388 msgid "Do you want to remove the selected pattern row?" msgstr "Möchten Sie die ausgewählte Zeile des Rhythmusschemas entfernen?" -#: src/drumgrid.cpp:364 +#: src/drumgrid.cpp:389 msgid "Remove Row" msgstr "Zeile entfernen" -#: src/kmetronome.cpp:85 +#: src/kmetronome.cpp:87 msgid "" "Fatal error from the ALSA sequencer. This usually happens when the kernel " "doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " @@ -66,45 +79,45 @@ "das Kernel-Modul (snd_seq) nicht geladen ist. Bitte überprüfen Sie Ihre ALSA/" "MIDI Konfiguration. Zurückgegebener Fehler war: %1" -#: src/kmetronome.cpp:91 +#: src/kmetronome.cpp:93 msgid "Error" msgstr "Fehler" -#: src/kmetronome.cpp:112 +#: src/kmetronome.cpp:114 msgid "Play/Stop" msgstr "Wiedergabe/Stopp" -#: src/kmetronome.cpp:116 +#: src/kmetronome.cpp:118 msgid "Show Action Buttons" msgstr "Aktionsknopf anzeigen" #. i18n: file: src/kmetronomeviewbase.ui:126 #. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) -#: src/kmetronome.cpp:123 po/rc.cpp:130 +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 msgid "Patterns" msgstr "Rhythmusschema" -#: src/kmetronome.cpp:128 src/kmetronome.cpp:490 +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 msgid "Import Patterns" msgstr "Rhythmusschema importieren" -#: src/kmetronome.cpp:133 src/kmetronome.cpp:503 +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 msgid "Export Patterns" msgstr "Rhythmusschema exportieren" -#: src/kmetronome.cpp:489 src/kmetronome.cpp:502 +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 msgid "*.pat|Pattern Files (*.pat)" msgstr "*.pat|Rhythmusschema Dateien (*.pat)" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Tempo" msgstr "Tempo" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Enter new Tempo:" msgstr "Neues Tempo eingeben:" -#: src/kmetronomeview.cpp:177 +#: src/kmetronomeview.cpp:179 msgctxt "the pattern is created automatically" msgid "Automatic" msgstr "Automatisch" @@ -117,15 +130,15 @@ msgid "KDE MIDI metronome using ALSA sequencer" msgstr "KDE MIDI Metronom mit dem ALSA Sequenzer" -#: src/main.cpp:40 +#: src/main.cpp:41 msgid "KMetronome" msgstr "KMetronome" -#: src/main.cpp:42 -msgid "(C) 2005-2010 Pedro Lopez-Cabanillas" -msgstr "(C) 2005-2010 Pedro Lopez-Cabanillas" +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" +msgstr "(C) 2005-2012 Pedro Lopez-Cabanillas" -#: src/main.cpp:46 +#: src/main.cpp:45 msgid "Pedro Lopez-Cabanillas" msgstr "Pedro Lopez-Cabanillas" @@ -137,7 +150,7 @@ #. i18n: ectx: property (text), widget (QLabel, patternLabel) #. i18n: file: src/kmetronomeviewbase.ui:191 #. i18n: ectx: property (text), widget (QLabel, lblPattern) -#: po/rc.cpp:3 po/rc.cpp:142 +#: po/rc.cpp:3 po/rc.cpp:140 msgid "Pattern:" msgstr "Rhythmusschema:" @@ -243,7 +256,7 @@ msgid "This is the current beat number" msgstr "Dies ist die aktuelle Anzahl Grundschläge" -#. i18n: file: src/drumgrid.ui:184 +#. i18n: file: src/drumgrid.ui:187 #. i18n: ectx: property (whatsThis), widget (QTableView, tableView) #: po/rc.cpp:49 msgid "This is the pattern table, beats as columns and sounds as rows" @@ -251,192 +264,186 @@ "Dies ist die Tabelle des Rhythmusschemas, Grundschläge als Spalten und Töne " "als Zeilen" -#. i18n: file: src/drumgrid.ui:200 +#. i18n: file: src/drumgrid.ui:203 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) #: po/rc.cpp:52 msgid "Number of beats per measure (bar)" msgstr "Anzahl Grundschläge pro Takt" -#. i18n: file: src/drumgrid.ui:216 +#. i18n: file: src/drumgrid.ui:219 #. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) #: po/rc.cpp:55 msgid "This is the beat length for the pattern column." msgstr "" "Dies ist die Dauer des Grundschlags für die Spalte des Rhythmusschemas." -#. i18n: file: src/drumgrid.ui:226 +#. i18n: file: src/drumgrid.ui:229 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:282 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:58 po/rc.cpp:164 +#: po/rc.cpp:58 po/rc.cpp:162 msgid "Whole" msgstr "Ganze" -#. i18n: file: src/drumgrid.ui:235 +#. i18n: file: src/drumgrid.ui:238 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:291 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:61 po/rc.cpp:167 +#: po/rc.cpp:61 po/rc.cpp:165 msgid "Half" msgstr "Halbe" -#. i18n: file: src/drumgrid.ui:244 +#. i18n: file: src/drumgrid.ui:247 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:300 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:64 po/rc.cpp:170 +#: po/rc.cpp:64 po/rc.cpp:168 msgid "Quarter" msgstr "Viertel" -#. i18n: file: src/drumgrid.ui:253 +#. i18n: file: src/drumgrid.ui:256 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:309 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:67 po/rc.cpp:173 +#: po/rc.cpp:67 po/rc.cpp:171 msgid "Eighth" msgstr "Achtel" -#. i18n: file: src/drumgrid.ui:262 +#. i18n: file: src/drumgrid.ui:265 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:318 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:70 po/rc.cpp:176 +#: po/rc.cpp:70 po/rc.cpp:174 msgid "Sixteenth" msgstr "Sechzehntel" -#. i18n: file: src/drumgrid.ui:271 +#. i18n: file: src/drumgrid.ui:274 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:327 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:73 po/rc.cpp:179 +#: po/rc.cpp:73 po/rc.cpp:177 msgid "Thirty-Second" msgstr "Zweiundreissigstel" -#. i18n: file: src/drumgrid.ui:280 +#. i18n: file: src/drumgrid.ui:283 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:336 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:76 po/rc.cpp:182 +#: po/rc.cpp:76 po/rc.cpp:180 msgid "Sixty-Fourth" msgstr "Vierundsechzigstel" -#. i18n: file: src/drumgrid.ui:292 +#. i18n: file: src/drumgrid.ui:295 #. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) #: po/rc.cpp:79 msgid "This button starts playing the current pattern" msgstr "Dieser Knopf startet die Wiedergabe des Rhythmusschemas" -#. i18n: file: src/drumgrid.ui:295 +#. i18n: file: src/drumgrid.ui:298 #. i18n: ectx: property (text), widget (QPushButton, startButton) #. i18n: file: src/kmetronomeviewbase.ui:81 #. i18n: ectx: property (text), widget (KPushButton, m_playbtn) -#: po/rc.cpp:82 po/rc.cpp:112 +#: po/rc.cpp:82 po/rc.cpp:110 msgid "Play" msgstr "Wiedergabe" -#. i18n: file: src/drumgrid.ui:308 +#. i18n: file: src/drumgrid.ui:311 #. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) #: po/rc.cpp:85 msgid "This button stops the playback" msgstr "Dieser Knopf beendet die Wiedergabe" -#. i18n: file: src/drumgrid.ui:311 +#. i18n: file: src/drumgrid.ui:314 #. i18n: ectx: property (text), widget (QPushButton, stopButton) #. i18n: file: src/kmetronomeviewbase.ui:100 #. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:88 po/rc.cpp:118 +#: po/rc.cpp:88 po/rc.cpp:116 msgid "Stop" msgstr "Stopp" -#. i18n: file: src/drumgrid.ui:327 +#. i18n: file: src/drumgrid.ui:330 #. i18n: ectx: property (whatsThis), widget (QLabel, label_3) #: po/rc.cpp:91 msgid "QPM: quarters per minute" msgstr "QPM: Tempo (in Viertel pro Minute)" -#. i18n: file: src/drumgrid.ui:330 +#. i18n: file: src/drumgrid.ui:333 #. i18n: ectx: property (text), widget (QLabel, label_3) #: po/rc.cpp:94 msgctxt "Quarters per Minute" msgid "QPM:" msgstr "QPM:" -#. i18n: file: src/drumgrid.ui:340 +#. i18n: file: src/drumgrid.ui:343 #. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) #: po/rc.cpp:97 msgid "This is the current tempo in quarters per minute" msgstr "Dies ist das aktuelle Tempo in Viertel pro Minute" -#. i18n: file: src/drumgrid.ui:343 -#. i18n: ectx: property (text), widget (QLabel, tempoLabel) -#: po/rc.cpp:100 -msgid "100" -msgstr "100" - -#. i18n: file: src/drumgrid.ui:350 +#. i18n: file: src/drumgrid.ui:353 #. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) -#: po/rc.cpp:103 +#: po/rc.cpp:101 msgid "Drag the slider handle to change the tempo, in quarters per minute" msgstr "" "Ziehen Sie den Schieberegler um das Tempo zu ändern, in Viertel pro Minute" #. i18n: file: src/kmetronomeviewbase.ui:58 #. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) -#: po/rc.cpp:106 +#: po/rc.cpp:104 msgid "MIDI Metronome" msgstr "MIDI Metronom" #. i18n: file: src/kmetronomeviewbase.ui:78 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) -#: po/rc.cpp:109 +#: po/rc.cpp:107 msgid "This button starts playing the rhythm pattern" msgstr "Dieser Knopf startet die Wiedergabe des Rhythmusschemas" #. i18n: file: src/kmetronomeviewbase.ui:97 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:115 +#: po/rc.cpp:113 msgid "This button stops playing the rhythm pattern" msgstr "Dieser Knopf stoppt die Wiedergabe des Rhythmusschemas" #. i18n: file: src/kmetronomeviewbase.ui:113 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) -#: po/rc.cpp:121 +#: po/rc.cpp:119 msgid "This button opens the configuration window" msgstr "Dieser Knopf öffnet den Einrichtungsdialog" #. i18n: file: src/kmetronomeviewbase.ui:116 #. i18n: ectx: property (text), widget (KPushButton, m_configbtn) -#: po/rc.cpp:124 +#: po/rc.cpp:122 msgid "Settings" msgstr "Einstellungen" #. i18n: file: src/kmetronomeviewbase.ui:123 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) -#: po/rc.cpp:127 +#: po/rc.cpp:125 msgid "This button opens the pattern editor" msgstr "Dieser Knopf öffnet den Editor für das Rhythmusschema" #. i18n: file: src/kmetronomeviewbase.ui:139 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:133 +#: po/rc.cpp:131 msgid "This button exits the program" msgstr "Dieser Knopf beendet das Programm" #. i18n: file: src/kmetronomeviewbase.ui:142 #. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:136 +#: po/rc.cpp:134 msgid "Quit" msgstr "Beenden" #. i18n: file: src/kmetronomeviewbase.ui:173 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) -#: po/rc.cpp:139 +#: po/rc.cpp:137 msgid "Number of measures (bars) and beats played from beginning" msgstr "Anzahl Noten (Takte) und Schläge seit Beginn der Wiedergabe" #. i18n: file: src/kmetronomeviewbase.ui:210 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) -#: po/rc.cpp:145 +#: po/rc.cpp:143 msgid "" "This is the pattern definition to play, either \"Automatic\" or a custom " "defined one." @@ -446,71 +453,71 @@ #. i18n: file: src/kmetronomeviewbase.ui:217 #. i18n: ectx: property (text), widget (QLabel, lblBeats) -#: po/rc.cpp:148 +#: po/rc.cpp:146 msgid "Beats/Bar:" msgstr "Taktzahl:" #. i18n: file: src/kmetronomeviewbase.ui:238 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) -#: po/rc.cpp:151 +#: po/rc.cpp:149 msgid "" -"This is the number of beats for each measure (bar).
\n" -"Values are from 1 to 32.
\n" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" "It is the numerator of the time signature specification." msgstr "" -"Dies ist die Anzahl Grundschläge für jeden Takt.
\n" -"Die Werte sind von 1 bis 32.
\n" +"Dies ist die Anzahl Grundschläge für jeden Takt.\n" +"Die Werte sind von 1 bis 32.\n" "Dies ist der Zähler der Taktart-Spezifikation." #. i18n: file: src/kmetronomeviewbase.ui:254 #. i18n: ectx: property (text), widget (QLabel, lblFigure) -#: po/rc.cpp:156 +#: po/rc.cpp:154 msgid "Beat Length:" msgstr "Länge Grundschlag." #. i18n: file: src/kmetronomeviewbase.ui:272 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) -#: po/rc.cpp:159 +#: po/rc.cpp:157 msgid "" -"This is the beat length.
\n" -"Values mean 1, 2, 4, 8, 16, 32 and 64.
\n" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" "It is the denominator in the time signature specification." msgstr "" -"Dies ist die Dauer des Grundschlags.
\n" -"Die Werte sind 1, 2, 4, 8, 16, 32 und 64.
\n" +"Dies ist die Dauer des Grundschlags.\n" +"Die Werte sind 1, 2, 4, 8, 16, 32 und 64.\n" "Es ist der Nenner der Taktart-Spezifikation." #. i18n: file: src/kmetronomeviewbase.ui:356 #. i18n: ectx: property (text), widget (QLabel, label_1) -#: po/rc.cpp:185 +#: po/rc.cpp:183 msgctxt "weak notes MIDI velocity" msgid "Weak" msgstr "Schwach" #. i18n: file: src/kmetronomeviewbase.ui:369 #. i18n: ectx: property (text), widget (QLabel, label_2) -#: po/rc.cpp:188 +#: po/rc.cpp:186 msgctxt "strong notes MIDI velocity" msgid "Strong" msgstr " Stark" #. i18n: file: src/kmetronomeviewbase.ui:382 #. i18n: ectx: property (text), widget (QLabel, label_3) -#: po/rc.cpp:191 +#: po/rc.cpp:189 msgctxt "audio volume level" msgid "Volume" msgstr "Volumen" #. i18n: file: src/kmetronomeviewbase.ui:395 #. i18n: ectx: property (text), widget (QLabel, label_4) -#: po/rc.cpp:194 +#: po/rc.cpp:192 msgctxt "audio panning" msgid "Pan" msgstr "Balance" #. i18n: file: src/kmetronomeviewbase.ui:414 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) -#: po/rc.cpp:197 +#: po/rc.cpp:195 msgid "" "This is the velocity of the weak notes in the automatic rhythm pattern (all " "of them, except the first one)" @@ -520,7 +527,7 @@ #. i18n: file: src/kmetronomeviewbase.ui:439 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) -#: po/rc.cpp:200 +#: po/rc.cpp:198 msgid "" "This is the velocity of the strong note in the automatic rhythm pattern (the " "first one)" @@ -528,49 +535,49 @@ #. i18n: file: src/kmetronomeviewbase.ui:464 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) -#: po/rc.cpp:203 +#: po/rc.cpp:201 msgid "This is the MIDI volume control (CC7)" msgstr "Dies ist die MIDI Lautstärkenregelung (CC7)" #. i18n: file: src/kmetronomeviewbase.ui:489 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) -#: po/rc.cpp:206 +#: po/rc.cpp:204 msgid "This is the MIDI pan control (CC10)" msgstr "Dies ist die MIDI Balance Steuerung (CC10)" #. i18n: file: src/kmetronomeviewbase.ui:512 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) -#: po/rc.cpp:209 +#: po/rc.cpp:207 msgid "This is the musical name of the tempo value" msgstr "Dies ist der musikalische Name des Tempos" #. i18n: file: src/kmetronomeviewbase.ui:531 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) -#: po/rc.cpp:212 +#: po/rc.cpp:210 msgid "The current tempo value" msgstr "Der aktuelle Wert für das Tempo" #. i18n: file: src/kmetronomeviewbase.ui:554 #. i18n: ectx: property (text), widget (QLabel, textLabel1_2) -#: po/rc.cpp:215 +#: po/rc.cpp:213 msgid "Tempo (in quarters per minute)" msgstr "Tempo (in Viertel pro Minute)" #. i18n: file: src/kmetronomeviewbase.ui:580 #. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) -#: po/rc.cpp:218 +#: po/rc.cpp:216 msgid "" -"This slider changes the tempo, or speed of the rhythm.
\n" +"This slider changes the tempo, or speed of the rhythm.\n" "Values are 25 to 250 quarters per minute (Maelzel Metronome units)." msgstr "" "Dieser Schieberegler ändert das Tempo, oder Geschwindigkeit des " -"Rhythmus.
\n" +"Rhythmus.\n" "Die Werte sind von 25 bis 250 Viertel pro Minute (Maelzel Metronom " "Einheiten)." #. i18n: file: src/kmetropreferencesbase.ui:37 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:222 +#: po/rc.cpp:220 msgid "" "If this checkbox is activated, the the program will remember the connections " "for the input and output ports, and try to reconnect them at program startup." @@ -581,43 +588,43 @@ #. i18n: file: src/kmetropreferencesbase.ui:40 #. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:225 +#: po/rc.cpp:223 msgid "Automatic ports connection on startup" msgstr "Automatische Verbindung der Ports beim Start" #. i18n: file: src/kmetropreferencesbase.ui:61 #. i18n: ectx: property (text), widget (QLabel, lblInputPort) -#: po/rc.cpp:228 +#: po/rc.cpp:226 msgid "Optional input port conn:" msgstr "Opt.Verbindung Eingangs-Port:" #. i18n: file: src/kmetropreferencesbase.ui:83 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) -#: po/rc.cpp:231 +#: po/rc.cpp:229 msgid "This is the optional connection for the MIDI IN port." msgstr "Dies ist die optionale Verbindung für den MIDI Eingangs-Port" #. i18n: file: src/kmetropreferencesbase.ui:102 #. i18n: ectx: property (text), widget (QLabel, lblOutputPort) -#: po/rc.cpp:234 +#: po/rc.cpp:232 msgid "Output port connection:" msgstr "Verbindung für Ausgabe-Port:" #. i18n: file: src/kmetropreferencesbase.ui:124 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) -#: po/rc.cpp:237 +#: po/rc.cpp:235 msgid "This is the mandatory connection for the MIDI OUT port" msgstr "Dies ist die notwendige Verbindung für den MIDI Ausgabe-Port" #. i18n: file: src/kmetropreferencesbase.ui:131 #. i18n: ectx: property (text), widget (QLabel, lblInstrument) -#: po/rc.cpp:240 +#: po/rc.cpp:238 msgid "Output instrument:" msgstr "Ausgabe Instrument:" #. i18n: file: src/kmetropreferencesbase.ui:147 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) -#: po/rc.cpp:243 +#: po/rc.cpp:241 msgid "This is the definition of the instrument connected to the MIDI OUT port" msgstr "" "Dies ist die Definition des Instrumentes das mit dem MIDI Ausgabe-Port " @@ -625,25 +632,25 @@ #. i18n: file: src/kmetropreferencesbase.ui:158 #. i18n: ectx: property (text), widget (QLabel, lblBank) -#: po/rc.cpp:246 +#: po/rc.cpp:244 msgid "Bank:" msgstr "Bank:" #. i18n: file: src/kmetropreferencesbase.ui:171 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) -#: po/rc.cpp:249 +#: po/rc.cpp:247 msgid "This is the Bank of the selected MIDI program" msgstr "Dies ist die Bank des ausgewählten MIDI Programms" #. i18n: file: src/kmetropreferencesbase.ui:190 #. i18n: ectx: property (text), widget (QLabel, textLabel2) -#: po/rc.cpp:252 +#: po/rc.cpp:250 msgid "Channel:" msgstr "Kanal:" #. i18n: file: src/kmetropreferencesbase.ui:207 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) -#: po/rc.cpp:255 +#: po/rc.cpp:253 msgid "" "This is the MIDI channel, between 1 and 16. \n" "General MIDI uses the channel 10 for percussion sounds." @@ -653,50 +660,50 @@ #. i18n: file: src/kmetropreferencesbase.ui:235 #. i18n: ectx: property (text), widget (QLabel, textLabel3) -#: po/rc.cpp:259 +#: po/rc.cpp:257 msgid "Program:" msgstr "Programm:" #. i18n: file: src/kmetropreferencesbase.ui:257 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) -#: po/rc.cpp:262 +#: po/rc.cpp:260 msgid "This is the MIDI program" msgstr "Dies ist das MIDI Programm" #. i18n: file: src/kmetropreferencesbase.ui:270 #. i18n: ectx: property (text), widget (QLabel, textLabel7) -#: po/rc.cpp:265 +#: po/rc.cpp:263 msgid "Resolution:" msgstr "Auflösung:" #. i18n: file: src/kmetropreferencesbase.ui:286 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) -#: po/rc.cpp:268 +#: po/rc.cpp:266 msgid "This is the MIDI time resolution (number of ticks in a quarter note)" msgstr "Dies ist die MIDI Zeitauflösung (Anzahl Ticks in einer Viertel Note)" #. i18n: file: src/kmetropreferencesbase.ui:305 #. i18n: ectx: property (text), widget (QLabel, textLabel4) -#: po/rc.cpp:271 +#: po/rc.cpp:269 msgid "Weak note:" msgstr "Schwache Note:" #. i18n: file: src/kmetropreferencesbase.ui:327 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) -#: po/rc.cpp:274 +#: po/rc.cpp:272 msgid "This is the sound of the weak notes for the automatic patterns" msgstr "" "Dies ist die Lautstärke der schwachen Note im automatischen Rhythmusschema" #. i18n: file: src/kmetropreferencesbase.ui:340 #. i18n: ectx: property (text), widget (QLabel, textLabel8) -#: po/rc.cpp:277 +#: po/rc.cpp:275 msgid "Note duration:" msgstr "Dauer der Note:" #. i18n: file: src/kmetropreferencesbase.ui:356 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) -#: po/rc.cpp:280 +#: po/rc.cpp:278 msgid "This is the note duration in ticks, when using NOTE OFF events" msgstr "" "Dies ist die Dauer der Note in Anzahl Ticks, wenn NOTE OFF Ereignisse " @@ -704,32 +711,32 @@ #. i18n: file: src/kmetropreferencesbase.ui:378 #. i18n: ectx: property (text), widget (QLabel, textLabel5) -#: po/rc.cpp:283 +#: po/rc.cpp:281 msgid "Strong note:" msgstr "Starke Note:" #. i18n: file: src/kmetropreferencesbase.ui:400 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) -#: po/rc.cpp:286 +#: po/rc.cpp:284 msgid "This is the sound of the strong notes for the automatic patterns" msgstr "" "Dies ist die Lautstärke der starken Note im automatischen Rhythmusschema" #. i18n: file: src/kmetropreferencesbase.ui:411 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:289 +#: po/rc.cpp:287 msgid "Optional setting to send NOTE OFF events" msgstr "Optionale Einstellung zum Senden von NOTE OFF Ereignissen" #. i18n: file: src/kmetropreferencesbase.ui:414 #. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:292 +#: po/rc.cpp:290 msgid "Send NOTE OFF events" msgstr "Sende NOTE OFF Ereignisse" #. i18n: file: src/kmetropreferencesbase.ui:440 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:295 +#: po/rc.cpp:293 msgid "If this option is activated, the knobs are drawn using a custom style" msgstr "" "Beim Aktivieren dieser Option werden die Knöpfe mit einem " @@ -737,20 +744,23 @@ #. i18n: file: src/kmetropreferencesbase.ui:443 #. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:298 +#: po/rc.cpp:296 msgid "Styled Knobs" msgstr "Stilvolle Knöpfe" -#: po/rc.cpp:299 +#: po/rc.cpp:297 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Rene Landert" -#: po/rc.cpp:300 +#: po/rc.cpp:298 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "rene.landert@bluewin.ch " +#~ msgid "100" +#~ msgstr "100" + #~ msgid "Config" #~ msgstr "Einrichtung" diff -Nru kmetronome-0.10.0/po/es.po kmetronome-0.10.1/po/es.po --- kmetronome-0.10.0/po/es.po 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/es.po 2012-05-28 20:55:39.000000000 +0000 @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: es\n" -"Report-Msgid-Bugs-To: http://sourceforge." -"net/tracker/?atid=731542&group_id=134956\n" -"POT-Creation-Date: 2010-05-23 11:30+0200\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"atid=731542&group_id=134956\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" "PO-Revision-Date: 2010-05-23 11:30+0200\n" "Last-Translator: Pedro López-Cabanillas \n" "Language-Team: Spanish \n" @@ -19,44 +19,56 @@ "X-Generator: Lokalize 0.3\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/drumgrid.cpp:49 +#: src/drumgrid.cpp:51 msgid "Pattern Editor" msgstr "Editor de patrones" -#: src/drumgrid.cpp:254 +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "Cortar" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "Copiar" + +#: src/drumgrid.cpp:69 +msgid "Paste" +msgstr "Pegar" + +#: src/drumgrid.cpp:278 msgid "Do you want to remove the current pattern?" msgstr "¿Desea eliminar el patrón actual?" -#: src/drumgrid.cpp:255 +#: src/drumgrid.cpp:279 msgid "Remove Pattern" msgstr "Eliminar patrón" -#: src/drumgrid.cpp:309 +#: src/drumgrid.cpp:333 msgctxt "name of an automatically created pattern" msgid "Sample Pattern" msgstr "Patrón de ejemplo" -#: src/drumgrid.cpp:340 +#: src/drumgrid.cpp:364 msgid "Insert Pattern Row" msgstr "Insertar fila en el patrón" -#: src/drumgrid.cpp:341 +#: src/drumgrid.cpp:365 msgid "Drum Key:" msgstr "Sonido de percusión:" -#: src/drumgrid.cpp:361 +#: src/drumgrid.cpp:386 msgid "Please select one, and only one row" msgstr "Por favor seleccione una fila, y sólamente una" -#: src/drumgrid.cpp:363 +#: src/drumgrid.cpp:388 msgid "Do you want to remove the selected pattern row?" msgstr "¿Desea eliminar la fila seleccionada del patrón?" -#: src/drumgrid.cpp:364 +#: src/drumgrid.cpp:389 msgid "Remove Row" msgstr "Eliminar fila" -#: src/kmetronome.cpp:85 +#: src/kmetronome.cpp:87 msgid "" "Fatal error from the ALSA sequencer. This usually happens when the kernel " "doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " @@ -68,45 +80,45 @@ "bien el módulo del núcleo (snd_seq) no ha sido cargado. Por favor, compruebe " "la configuración de ALSA y MIDI.El error devuelto ha sido: %1" -#: src/kmetronome.cpp:91 +#: src/kmetronome.cpp:93 msgid "Error" msgstr "Error" -#: src/kmetronome.cpp:112 +#: src/kmetronome.cpp:114 msgid "Play/Stop" msgstr "Comenzar/Parar" -#: src/kmetronome.cpp:116 +#: src/kmetronome.cpp:118 msgid "Show Action Buttons" msgstr "Mostrar botones de acción" #. i18n: file: src/kmetronomeviewbase.ui:126 #. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) -#: src/kmetronome.cpp:123 po/rc.cpp:130 +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 msgid "Patterns" msgstr "Patrones" -#: src/kmetronome.cpp:128 src/kmetronome.cpp:490 +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 msgid "Import Patterns" msgstr "Importar patrones" -#: src/kmetronome.cpp:133 src/kmetronome.cpp:503 +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 msgid "Export Patterns" msgstr "Exportar patrones" -#: src/kmetronome.cpp:489 src/kmetronome.cpp:502 +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 msgid "*.pat|Pattern Files (*.pat)" msgstr "*.pat|Archivos de patrones (*.pat)" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Tempo" msgstr "Tempo" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Enter new Tempo:" msgstr "Introducir nuevo tempo:" -#: src/kmetronomeview.cpp:177 +#: src/kmetronomeview.cpp:179 msgctxt "the pattern is created automatically" msgid "Automatic" msgstr "Automático" @@ -119,15 +131,15 @@ msgid "KDE MIDI metronome using ALSA sequencer" msgstr "Metrónomo MIDI de KDE utilizando el secuenciador de ALSA " -#: src/main.cpp:40 +#: src/main.cpp:41 msgid "KMetronome" msgstr "KMetronome" -#: src/main.cpp:42 -msgid "(C) 2005-2010 Pedro Lopez-Cabanillas" -msgstr "(C) 2005-2010 Pedro Lopez-Cabanillas" +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" +msgstr "(C) 2005-2012 Pedro Lopez-Cabanillas" -#: src/main.cpp:46 +#: src/main.cpp:45 msgid "Pedro Lopez-Cabanillas" msgstr "Pedro Lopez-Cabanillas" @@ -139,7 +151,7 @@ #. i18n: ectx: property (text), widget (QLabel, patternLabel) #. i18n: file: src/kmetronomeviewbase.ui:191 #. i18n: ectx: property (text), widget (QLabel, lblPattern) -#: po/rc.cpp:3 po/rc.cpp:142 +#: po/rc.cpp:3 po/rc.cpp:140 msgid "Pattern:" msgstr "Patrón:" @@ -244,197 +256,191 @@ msgid "This is the current beat number" msgstr "Este es el número de parte actual" -#. i18n: file: src/drumgrid.ui:184 +#. i18n: file: src/drumgrid.ui:187 #. i18n: ectx: property (whatsThis), widget (QTableView, tableView) #: po/rc.cpp:49 msgid "This is the pattern table, beats as columns and sounds as rows" msgstr "" "Esta es la tabla de patrones, partes como columnas y sonidos como filas" -#. i18n: file: src/drumgrid.ui:200 +#. i18n: file: src/drumgrid.ui:203 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) #: po/rc.cpp:52 msgid "Number of beats per measure (bar)" msgstr "Número de partes rítmicas por compás" -#. i18n: file: src/drumgrid.ui:216 +#. i18n: file: src/drumgrid.ui:219 #. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) #: po/rc.cpp:55 msgid "This is the beat length for the pattern column." msgstr "Esta es la duración de cada columna del patrón" -#. i18n: file: src/drumgrid.ui:226 +#. i18n: file: src/drumgrid.ui:229 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:282 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:58 po/rc.cpp:164 +#: po/rc.cpp:58 po/rc.cpp:162 msgid "Whole" msgstr "Redonda " -#. i18n: file: src/drumgrid.ui:235 +#. i18n: file: src/drumgrid.ui:238 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:291 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:61 po/rc.cpp:167 +#: po/rc.cpp:61 po/rc.cpp:165 msgid "Half" msgstr "Blanca" -#. i18n: file: src/drumgrid.ui:244 +#. i18n: file: src/drumgrid.ui:247 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:300 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:64 po/rc.cpp:170 +#: po/rc.cpp:64 po/rc.cpp:168 msgid "Quarter" msgstr "Negra" -#. i18n: file: src/drumgrid.ui:253 +#. i18n: file: src/drumgrid.ui:256 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:309 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:67 po/rc.cpp:173 +#: po/rc.cpp:67 po/rc.cpp:171 msgid "Eighth" msgstr "Corchea" -#. i18n: file: src/drumgrid.ui:262 +#. i18n: file: src/drumgrid.ui:265 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:318 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:70 po/rc.cpp:176 +#: po/rc.cpp:70 po/rc.cpp:174 msgid "Sixteenth" msgstr "Semicorchea" -#. i18n: file: src/drumgrid.ui:271 +#. i18n: file: src/drumgrid.ui:274 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:327 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:73 po/rc.cpp:179 +#: po/rc.cpp:73 po/rc.cpp:177 msgid "Thirty-Second" msgstr "Fusa" -#. i18n: file: src/drumgrid.ui:280 +#. i18n: file: src/drumgrid.ui:283 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:336 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:76 po/rc.cpp:182 +#: po/rc.cpp:76 po/rc.cpp:180 msgid "Sixty-Fourth" msgstr "Semifusa" -#. i18n: file: src/drumgrid.ui:292 +#. i18n: file: src/drumgrid.ui:295 #. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) #: po/rc.cpp:79 msgid "This button starts playing the current pattern" msgstr "Este botón inicia la reproducción del patrón rítmico" -#. i18n: file: src/drumgrid.ui:295 +#. i18n: file: src/drumgrid.ui:298 #. i18n: ectx: property (text), widget (QPushButton, startButton) #. i18n: file: src/kmetronomeviewbase.ui:81 #. i18n: ectx: property (text), widget (KPushButton, m_playbtn) -#: po/rc.cpp:82 po/rc.cpp:112 +#: po/rc.cpp:82 po/rc.cpp:110 msgid "Play" msgstr "Reproducir" -#. i18n: file: src/drumgrid.ui:308 +#. i18n: file: src/drumgrid.ui:311 #. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) #: po/rc.cpp:85 msgid "This button stops the playback" msgstr "Este botón termina la reproducción" -#. i18n: file: src/drumgrid.ui:311 +#. i18n: file: src/drumgrid.ui:314 #. i18n: ectx: property (text), widget (QPushButton, stopButton) #. i18n: file: src/kmetronomeviewbase.ui:100 #. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:88 po/rc.cpp:118 +#: po/rc.cpp:88 po/rc.cpp:116 msgid "Stop" msgstr "Parar" -#. i18n: file: src/drumgrid.ui:327 +#. i18n: file: src/drumgrid.ui:330 #. i18n: ectx: property (whatsThis), widget (QLabel, label_3) #: po/rc.cpp:91 msgid "QPM: quarters per minute" msgstr "NPM: negras por minuto" -#. i18n: file: src/drumgrid.ui:330 +#. i18n: file: src/drumgrid.ui:333 #. i18n: ectx: property (text), widget (QLabel, label_3) #: po/rc.cpp:94 msgctxt "Quarters per Minute" msgid "QPM:" msgstr "NPM:" -#. i18n: file: src/drumgrid.ui:340 +#. i18n: file: src/drumgrid.ui:343 #. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) #: po/rc.cpp:97 msgid "This is the current tempo in quarters per minute" msgstr "Este es el tempo actual (en negras por minuto)" -#. i18n: file: src/drumgrid.ui:343 -#. i18n: ectx: property (text), widget (QLabel, tempoLabel) -#: po/rc.cpp:100 -msgid "100" -msgstr "100" - -#. i18n: file: src/drumgrid.ui:350 +#. i18n: file: src/drumgrid.ui:353 #. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) -#: po/rc.cpp:103 +#: po/rc.cpp:101 msgid "Drag the slider handle to change the tempo, in quarters per minute" msgstr "Arrastre el deslizador para cambiar el tempo, en negras por minuto" #. i18n: file: src/kmetronomeviewbase.ui:58 #. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) -#: po/rc.cpp:106 +#: po/rc.cpp:104 msgid "MIDI Metronome" msgstr "Metrónomo MIDI" #. i18n: file: src/kmetronomeviewbase.ui:78 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) -#: po/rc.cpp:109 +#: po/rc.cpp:107 msgid "This button starts playing the rhythm pattern" msgstr "Este botón inicia la reproducción del patrón rítmico" #. i18n: file: src/kmetronomeviewbase.ui:97 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:115 +#: po/rc.cpp:113 msgid "This button stops playing the rhythm pattern" msgstr "Este botón detiene la reproducción del patrón rítmico" #. i18n: file: src/kmetronomeviewbase.ui:113 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) -#: po/rc.cpp:121 +#: po/rc.cpp:119 msgid "This button opens the configuration window" msgstr "Este botón abre la ventana de configuración" #. i18n: file: src/kmetronomeviewbase.ui:116 #. i18n: ectx: property (text), widget (KPushButton, m_configbtn) -#: po/rc.cpp:124 +#: po/rc.cpp:122 msgid "Settings" msgstr "Preferencias" #. i18n: file: src/kmetronomeviewbase.ui:123 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) -#: po/rc.cpp:127 +#: po/rc.cpp:125 msgid "This button opens the pattern editor" msgstr "Este botón abre el editor de patrones" #. i18n: file: src/kmetronomeviewbase.ui:139 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:133 +#: po/rc.cpp:131 msgid "This button exits the program" msgstr "Este botón termina el programa" #. i18n: file: src/kmetronomeviewbase.ui:142 #. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:136 +#: po/rc.cpp:134 msgid "Quit" msgstr "Salir" #. i18n: file: src/kmetronomeviewbase.ui:173 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) -#: po/rc.cpp:139 +#: po/rc.cpp:137 msgid "Number of measures (bars) and beats played from beginning" msgstr "Número de compases y partes ejecutadas desde el principio" #. i18n: file: src/kmetronomeviewbase.ui:210 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) -#: po/rc.cpp:145 +#: po/rc.cpp:143 msgid "" "This is the pattern definition to play, either \"Automatic\" or a custom " "defined one." @@ -444,71 +450,71 @@ #. i18n: file: src/kmetronomeviewbase.ui:217 #. i18n: ectx: property (text), widget (QLabel, lblBeats) -#: po/rc.cpp:148 +#: po/rc.cpp:146 msgid "Beats/Bar:" msgstr "Partes/Compás:" #. i18n: file: src/kmetronomeviewbase.ui:238 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) -#: po/rc.cpp:151 +#: po/rc.cpp:149 msgid "" -"This is the number of beats for each measure (bar).
\n" -"Values are from 1 to 32.
\n" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" "It is the numerator of the time signature specification." msgstr "" -"Este es el número de partes de cada compás.
\n" -"Valores admisibles entre 1 y 32.
\n" +"Este es el número de partes de cada compás.\n" +"Valores admisibles entre 1 y 32.\n" "Este es el numerador de la especificación de ritmo." #. i18n: file: src/kmetronomeviewbase.ui:254 #. i18n: ectx: property (text), widget (QLabel, lblFigure) -#: po/rc.cpp:156 +#: po/rc.cpp:154 msgid "Beat Length:" msgstr "Figura rítmica:" #. i18n: file: src/kmetronomeviewbase.ui:272 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) -#: po/rc.cpp:159 +#: po/rc.cpp:157 msgid "" -"This is the beat length.
\n" -"Values mean 1, 2, 4, 8, 16, 32 and 64.
\n" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" "It is the denominator in the time signature specification." msgstr "" -"Esta es la duración de una parte rítmica.
\n" -"Los valores significan 1, 2, 4, 8, 16, 32 y 64.
\n" +"Esta es la duración de una parte rítmica.\n" +"Los valores significan 1, 2, 4, 8, 16, 32 y 64.\n" "Es el denominador de la especificación de ritmo." #. i18n: file: src/kmetronomeviewbase.ui:356 #. i18n: ectx: property (text), widget (QLabel, label_1) -#: po/rc.cpp:185 +#: po/rc.cpp:183 msgctxt "weak notes MIDI velocity" msgid "Weak" msgstr "Débil" #. i18n: file: src/kmetronomeviewbase.ui:369 #. i18n: ectx: property (text), widget (QLabel, label_2) -#: po/rc.cpp:188 +#: po/rc.cpp:186 msgctxt "strong notes MIDI velocity" msgid "Strong" msgstr "Fuerte" #. i18n: file: src/kmetronomeviewbase.ui:382 #. i18n: ectx: property (text), widget (QLabel, label_3) -#: po/rc.cpp:191 +#: po/rc.cpp:189 msgctxt "audio volume level" msgid "Volume" msgstr "Volumen" #. i18n: file: src/kmetronomeviewbase.ui:395 #. i18n: ectx: property (text), widget (QLabel, label_4) -#: po/rc.cpp:194 +#: po/rc.cpp:192 msgctxt "audio panning" msgid "Pan" msgstr "Balance" #. i18n: file: src/kmetronomeviewbase.ui:414 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) -#: po/rc.cpp:197 +#: po/rc.cpp:195 msgid "" "This is the velocity of the weak notes in the automatic rhythm pattern (all " "of them, except the first one)" @@ -518,7 +524,7 @@ #. i18n: file: src/kmetronomeviewbase.ui:439 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) -#: po/rc.cpp:200 +#: po/rc.cpp:198 msgid "" "This is the velocity of the strong note in the automatic rhythm pattern (the " "first one)" @@ -528,48 +534,48 @@ #. i18n: file: src/kmetronomeviewbase.ui:464 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) -#: po/rc.cpp:203 +#: po/rc.cpp:201 msgid "This is the MIDI volume control (CC7)" msgstr "Este es el control de volumen (CC7)" #. i18n: file: src/kmetronomeviewbase.ui:489 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) -#: po/rc.cpp:206 +#: po/rc.cpp:204 msgid "This is the MIDI pan control (CC10)" msgstr "Este es el control de balance (CC10)" #. i18n: file: src/kmetronomeviewbase.ui:512 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) -#: po/rc.cpp:209 +#: po/rc.cpp:207 msgid "This is the musical name of the tempo value" msgstr "Esta es la denominación musical del valor del tempo" #. i18n: file: src/kmetronomeviewbase.ui:531 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) -#: po/rc.cpp:212 +#: po/rc.cpp:210 msgid "The current tempo value" msgstr "El valor actual del tempo" #. i18n: file: src/kmetronomeviewbase.ui:554 #. i18n: ectx: property (text), widget (QLabel, textLabel1_2) -#: po/rc.cpp:215 +#: po/rc.cpp:213 msgid "Tempo (in quarters per minute)" msgstr "Tempo (en negras por minuto)" #. i18n: file: src/kmetronomeviewbase.ui:580 #. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) -#: po/rc.cpp:218 +#: po/rc.cpp:216 msgid "" -"This slider changes the tempo, or speed of the rhythm.
\n" +"This slider changes the tempo, or speed of the rhythm.\n" "Values are 25 to 250 quarters per minute (Maelzel Metronome units)." msgstr "" -"Este deslizador cambia el tempo, o velocidad del ritmo.
\n" +"Este deslizador cambia el tempo, o velocidad del ritmo.\n" "Los valores van desde 25 hasta 250 negras por minuto. (unidades del " "Metrónomo de Mälzel)." #. i18n: file: src/kmetropreferencesbase.ui:37 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:222 +#: po/rc.cpp:220 msgid "" "If this checkbox is activated, the the program will remember the connections " "for the input and output ports, and try to reconnect them at program startup." @@ -580,67 +586,67 @@ #. i18n: file: src/kmetropreferencesbase.ui:40 #. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:225 +#: po/rc.cpp:223 msgid "Automatic ports connection on startup" msgstr "Conexión automática de los puertos al iniciar" #. i18n: file: src/kmetropreferencesbase.ui:61 #. i18n: ectx: property (text), widget (QLabel, lblInputPort) -#: po/rc.cpp:228 +#: po/rc.cpp:226 msgid "Optional input port conn:" msgstr "Conexión de la entrada:" #. i18n: file: src/kmetropreferencesbase.ui:83 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) -#: po/rc.cpp:231 +#: po/rc.cpp:229 msgid "This is the optional connection for the MIDI IN port." msgstr "Esta es la conexión opcional del puerto MIDI IN." #. i18n: file: src/kmetropreferencesbase.ui:102 #. i18n: ectx: property (text), widget (QLabel, lblOutputPort) -#: po/rc.cpp:234 +#: po/rc.cpp:232 msgid "Output port connection:" msgstr "Conexión de la salida:" #. i18n: file: src/kmetropreferencesbase.ui:124 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) -#: po/rc.cpp:237 +#: po/rc.cpp:235 msgid "This is the mandatory connection for the MIDI OUT port" msgstr "Esta es la conexión obligatoria del puerto MIDI OUT" #. i18n: file: src/kmetropreferencesbase.ui:131 #. i18n: ectx: property (text), widget (QLabel, lblInstrument) -#: po/rc.cpp:240 +#: po/rc.cpp:238 msgid "Output instrument:" msgstr "Instrumento receptor:" #. i18n: file: src/kmetropreferencesbase.ui:147 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) -#: po/rc.cpp:243 +#: po/rc.cpp:241 msgid "This is the definition of the instrument connected to the MIDI OUT port" msgstr "Esta es la definición del instrumento conectado al puerto MIDI OUT" #. i18n: file: src/kmetropreferencesbase.ui:158 #. i18n: ectx: property (text), widget (QLabel, lblBank) -#: po/rc.cpp:246 +#: po/rc.cpp:244 msgid "Bank:" msgstr "Banco:" #. i18n: file: src/kmetropreferencesbase.ui:171 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) -#: po/rc.cpp:249 +#: po/rc.cpp:247 msgid "This is the Bank of the selected MIDI program" msgstr "Este es el banco del programa MIDI seleccionado" #. i18n: file: src/kmetropreferencesbase.ui:190 #. i18n: ectx: property (text), widget (QLabel, textLabel2) -#: po/rc.cpp:252 +#: po/rc.cpp:250 msgid "Channel:" msgstr "Canal:" #. i18n: file: src/kmetropreferencesbase.ui:207 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) -#: po/rc.cpp:255 +#: po/rc.cpp:253 msgid "" "This is the MIDI channel, between 1 and 16. \n" "General MIDI uses the channel 10 for percussion sounds." @@ -650,80 +656,80 @@ #. i18n: file: src/kmetropreferencesbase.ui:235 #. i18n: ectx: property (text), widget (QLabel, textLabel3) -#: po/rc.cpp:259 +#: po/rc.cpp:257 msgid "Program:" msgstr "Programa:" #. i18n: file: src/kmetropreferencesbase.ui:257 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) -#: po/rc.cpp:262 +#: po/rc.cpp:260 msgid "This is the MIDI program" msgstr "Este es el programa MIDI" #. i18n: file: src/kmetropreferencesbase.ui:270 #. i18n: ectx: property (text), widget (QLabel, textLabel7) -#: po/rc.cpp:265 +#: po/rc.cpp:263 msgid "Resolution:" msgstr "Resolución:" #. i18n: file: src/kmetropreferencesbase.ui:286 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) -#: po/rc.cpp:268 +#: po/rc.cpp:266 msgid "This is the MIDI time resolution (number of ticks in a quarter note)" msgstr "Esta es la resolución de tiempo MIDI (número de tics por negra)" #. i18n: file: src/kmetropreferencesbase.ui:305 #. i18n: ectx: property (text), widget (QLabel, textLabel4) -#: po/rc.cpp:271 +#: po/rc.cpp:269 msgid "Weak note:" msgstr "Nota débil:" #. i18n: file: src/kmetropreferencesbase.ui:327 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) -#: po/rc.cpp:274 +#: po/rc.cpp:272 msgid "This is the sound of the weak notes for the automatic patterns" msgstr "Este es sonido de las notas débiles en el patrón rítmico automático" #. i18n: file: src/kmetropreferencesbase.ui:340 #. i18n: ectx: property (text), widget (QLabel, textLabel8) -#: po/rc.cpp:277 +#: po/rc.cpp:275 msgid "Note duration:" msgstr "Duración:" #. i18n: file: src/kmetropreferencesbase.ui:356 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) -#: po/rc.cpp:280 +#: po/rc.cpp:278 msgid "This is the note duration in ticks, when using NOTE OFF events" msgstr "" "Esta es la duración de las notas en tics, cuando se utilizan eventos NOTE OFF" #. i18n: file: src/kmetropreferencesbase.ui:378 #. i18n: ectx: property (text), widget (QLabel, textLabel5) -#: po/rc.cpp:283 +#: po/rc.cpp:281 msgid "Strong note:" msgstr "Nota fuerte:" #. i18n: file: src/kmetropreferencesbase.ui:400 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) -#: po/rc.cpp:286 +#: po/rc.cpp:284 msgid "This is the sound of the strong notes for the automatic patterns" msgstr "Este es el sonido de las notas fuertes en el patrón rítmico automático" #. i18n: file: src/kmetropreferencesbase.ui:411 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:289 +#: po/rc.cpp:287 msgid "Optional setting to send NOTE OFF events" msgstr "Opción para emitir eventos NOTE OFF" #. i18n: file: src/kmetropreferencesbase.ui:414 #. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:292 +#: po/rc.cpp:290 msgid "Send NOTE OFF events" msgstr "Emitir eventos NOTE OFF" #. i18n: file: src/kmetropreferencesbase.ui:440 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:295 +#: po/rc.cpp:293 msgid "If this option is activated, the knobs are drawn using a custom style" msgstr "" "Si esta opción está seleccionada, los botones rotatorios se dibujarán con un " @@ -731,20 +737,23 @@ #. i18n: file: src/kmetropreferencesbase.ui:443 #. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:298 +#: po/rc.cpp:296 msgid "Styled Knobs" msgstr "Botones decorados" -#: po/rc.cpp:299 +#: po/rc.cpp:297 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Pedro López-Cabanillas" -#: po/rc.cpp:300 +#: po/rc.cpp:298 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "plcl@users.sf.net" +#~ msgid "100" +#~ msgstr "100" + #~ msgid "" #~ "This is the aire control to change the tempo value using musical names" #~ msgstr "Este es el valor del tempo en denominaciones musicales" diff -Nru kmetronome-0.10.0/po/fr.po kmetronome-0.10.1/po/fr.po --- kmetronome-0.10.0/po/fr.po 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/fr.po 2012-05-28 20:55:39.000000000 +0000 @@ -6,9 +6,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: http://sourceforge." -"net/tracker/?atid=731542&group_id=134956\n" -"POT-Creation-Date: 2010-05-23 11:30+0200\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"atid=731542&group_id=134956\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" "PO-Revision-Date: 2010-05-23 17:05+0200\n" "Last-Translator: Julien Richard-Foy \n" "Language-Team: French \n" @@ -18,44 +18,57 @@ "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: src/drumgrid.cpp:49 +#: src/drumgrid.cpp:51 msgid "Pattern Editor" msgstr "Éditeur de figures rythmiques" -#: src/drumgrid.cpp:254 +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "" + +#: src/drumgrid.cpp:69 +#, fuzzy +msgid "Paste" +msgstr "Figures" + +#: src/drumgrid.cpp:278 msgid "Do you want to remove the current pattern?" msgstr "Voulez-vous supprimer la figure actuelle ?" -#: src/drumgrid.cpp:255 +#: src/drumgrid.cpp:279 msgid "Remove Pattern" msgstr "Supprimer la figure" -#: src/drumgrid.cpp:309 +#: src/drumgrid.cpp:333 msgctxt "name of an automatically created pattern" msgid "Sample Pattern" msgstr "Exemple de figure" -#: src/drumgrid.cpp:340 +#: src/drumgrid.cpp:364 msgid "Insert Pattern Row" msgstr "Insérer une ligne" -#: src/drumgrid.cpp:341 +#: src/drumgrid.cpp:365 msgid "Drum Key:" msgstr "Touche « tambour » :" -#: src/drumgrid.cpp:361 +#: src/drumgrid.cpp:386 msgid "Please select one, and only one row" msgstr "Veuillez ne sélectionner qu’une seule ligne" -#: src/drumgrid.cpp:363 +#: src/drumgrid.cpp:388 msgid "Do you want to remove the selected pattern row?" msgstr "Voulez-vous supprimer la figure rythmique de cette ligne ?" -#: src/drumgrid.cpp:364 +#: src/drumgrid.cpp:389 msgid "Remove Row" msgstr "Supprimer la ligne" -#: src/kmetronome.cpp:85 +#: src/kmetronome.cpp:87 msgid "" "Fatal error from the ALSA sequencer. This usually happens when the kernel " "doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " @@ -67,45 +80,45 @@ "lorsque le module noyau « snd_seq » n'est pas chargé. Veuillez vérifier la " "configuration de ALSA/MIDI. Le nº d'erreur retourné est : %1" -#: src/kmetronome.cpp:91 +#: src/kmetronome.cpp:93 msgid "Error" msgstr "Erreur" -#: src/kmetronome.cpp:112 +#: src/kmetronome.cpp:114 msgid "Play/Stop" msgstr "Lire/Stop" -#: src/kmetronome.cpp:116 +#: src/kmetronome.cpp:118 msgid "Show Action Buttons" msgstr "Afficher les boutons d’action" #. i18n: file: src/kmetronomeviewbase.ui:126 #. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) -#: src/kmetronome.cpp:123 po/rc.cpp:130 +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 msgid "Patterns" msgstr "Figures" -#: src/kmetronome.cpp:128 src/kmetronome.cpp:490 +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 msgid "Import Patterns" msgstr "Importer des figures" -#: src/kmetronome.cpp:133 src/kmetronome.cpp:503 +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 msgid "Export Patterns" msgstr "Exporter des figures" -#: src/kmetronome.cpp:489 src/kmetronome.cpp:502 +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 msgid "*.pat|Pattern Files (*.pat)" msgstr "*.pat|Fichiers de figures rythmiques (*.pat)" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Tempo" msgstr "Tempo" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Enter new Tempo:" msgstr "Saisissez le nouveau tempo :" -#: src/kmetronomeview.cpp:177 +#: src/kmetronomeview.cpp:179 msgctxt "the pattern is created automatically" msgid "Automatic" msgstr "Automatique" @@ -118,15 +131,15 @@ msgid "KDE MIDI metronome using ALSA sequencer" msgstr "Métronome MIDI KDE utilisant le séquenceur ALSA" -#: src/main.cpp:40 +#: src/main.cpp:41 msgid "KMetronome" msgstr "KMetronome" -#: src/main.cpp:42 -msgid "(C) 2005-2010 Pedro Lopez-Cabanillas" -msgstr "(C) 2005-2010 Pedro Lopez-Cabanillas" +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" +msgstr "(C) 2005-2012 Pedro Lopez-Cabanillas" -#: src/main.cpp:46 +#: src/main.cpp:45 msgid "Pedro Lopez-Cabanillas" msgstr "Pedro Lopez-Cabanillas" @@ -138,7 +151,7 @@ #. i18n: ectx: property (text), widget (QLabel, patternLabel) #. i18n: file: src/kmetronomeviewbase.ui:191 #. i18n: ectx: property (text), widget (QLabel, lblPattern) -#: po/rc.cpp:3 po/rc.cpp:142 +#: po/rc.cpp:3 po/rc.cpp:140 msgid "Pattern:" msgstr "Figure :" @@ -242,7 +255,7 @@ msgid "This is the current beat number" msgstr "Numéro de battement actuel" -#. i18n: file: src/drumgrid.ui:184 +#. i18n: file: src/drumgrid.ui:187 #. i18n: ectx: property (whatsThis), widget (QTableView, tableView) #: po/rc.cpp:49 msgid "This is the pattern table, beats as columns and sounds as rows" @@ -250,190 +263,184 @@ "Table des figures rythmiques, les battements en colonnes et les sons sur les " "lignes." -#. i18n: file: src/drumgrid.ui:200 +#. i18n: file: src/drumgrid.ui:203 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) #: po/rc.cpp:52 msgid "Number of beats per measure (bar)" msgstr "Nombre de battements par mesure" -#. i18n: file: src/drumgrid.ui:216 +#. i18n: file: src/drumgrid.ui:219 #. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) #: po/rc.cpp:55 msgid "This is the beat length for the pattern column." msgstr "Durée du battement pour cette colonne de la figure" -#. i18n: file: src/drumgrid.ui:226 +#. i18n: file: src/drumgrid.ui:229 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:282 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:58 po/rc.cpp:164 +#: po/rc.cpp:58 po/rc.cpp:162 msgid "Whole" msgstr "Ronde" -#. i18n: file: src/drumgrid.ui:235 +#. i18n: file: src/drumgrid.ui:238 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:291 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:61 po/rc.cpp:167 +#: po/rc.cpp:61 po/rc.cpp:165 msgid "Half" msgstr "Blanche" -#. i18n: file: src/drumgrid.ui:244 +#. i18n: file: src/drumgrid.ui:247 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:300 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:64 po/rc.cpp:170 +#: po/rc.cpp:64 po/rc.cpp:168 msgid "Quarter" msgstr "Noire" -#. i18n: file: src/drumgrid.ui:253 +#. i18n: file: src/drumgrid.ui:256 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:309 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:67 po/rc.cpp:173 +#: po/rc.cpp:67 po/rc.cpp:171 msgid "Eighth" msgstr "Croche" -#. i18n: file: src/drumgrid.ui:262 +#. i18n: file: src/drumgrid.ui:265 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:318 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:70 po/rc.cpp:176 +#: po/rc.cpp:70 po/rc.cpp:174 msgid "Sixteenth" msgstr "Double croche" -#. i18n: file: src/drumgrid.ui:271 +#. i18n: file: src/drumgrid.ui:274 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:327 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:73 po/rc.cpp:179 +#: po/rc.cpp:73 po/rc.cpp:177 msgid "Thirty-Second" msgstr "Triple croche" -#. i18n: file: src/drumgrid.ui:280 +#. i18n: file: src/drumgrid.ui:283 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:336 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:76 po/rc.cpp:182 +#: po/rc.cpp:76 po/rc.cpp:180 msgid "Sixty-Fourth" msgstr "Quadruple croche" -#. i18n: file: src/drumgrid.ui:292 +#. i18n: file: src/drumgrid.ui:295 #. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) #: po/rc.cpp:79 msgid "This button starts playing the current pattern" msgstr "Démarre la lecture de la figure rythmique" -#. i18n: file: src/drumgrid.ui:295 +#. i18n: file: src/drumgrid.ui:298 #. i18n: ectx: property (text), widget (QPushButton, startButton) #. i18n: file: src/kmetronomeviewbase.ui:81 #. i18n: ectx: property (text), widget (KPushButton, m_playbtn) -#: po/rc.cpp:82 po/rc.cpp:112 +#: po/rc.cpp:82 po/rc.cpp:110 msgid "Play" msgstr "Lire" -#. i18n: file: src/drumgrid.ui:308 +#. i18n: file: src/drumgrid.ui:311 #. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) #: po/rc.cpp:85 msgid "This button stops the playback" msgstr "Interrompt la lecture" -#. i18n: file: src/drumgrid.ui:311 +#. i18n: file: src/drumgrid.ui:314 #. i18n: ectx: property (text), widget (QPushButton, stopButton) #. i18n: file: src/kmetronomeviewbase.ui:100 #. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:88 po/rc.cpp:118 +#: po/rc.cpp:88 po/rc.cpp:116 msgid "Stop" msgstr "Stop" -#. i18n: file: src/drumgrid.ui:327 +#. i18n: file: src/drumgrid.ui:330 #. i18n: ectx: property (whatsThis), widget (QLabel, label_3) #: po/rc.cpp:91 msgid "QPM: quarters per minute" msgstr "Tempo (en noires par minute)" -#. i18n: file: src/drumgrid.ui:330 +#. i18n: file: src/drumgrid.ui:333 #. i18n: ectx: property (text), widget (QLabel, label_3) #: po/rc.cpp:94 msgctxt "Quarters per Minute" msgid "QPM:" msgstr "Tempo :" -#. i18n: file: src/drumgrid.ui:340 +#. i18n: file: src/drumgrid.ui:343 #. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) #: po/rc.cpp:97 msgid "This is the current tempo in quarters per minute" msgstr "Tempo en noires par minute" -#. i18n: file: src/drumgrid.ui:343 -#. i18n: ectx: property (text), widget (QLabel, tempoLabel) -#: po/rc.cpp:100 -msgid "100" -msgstr "" - -#. i18n: file: src/drumgrid.ui:350 +#. i18n: file: src/drumgrid.ui:353 #. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) -#: po/rc.cpp:103 +#: po/rc.cpp:101 msgid "Drag the slider handle to change the tempo, in quarters per minute" msgstr "Déplacez le curseur pour modifier le tempo, en noires par minutes" #. i18n: file: src/kmetronomeviewbase.ui:58 #. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) -#: po/rc.cpp:106 +#: po/rc.cpp:104 msgid "MIDI Metronome" msgstr "Métronome MIDI" #. i18n: file: src/kmetronomeviewbase.ui:78 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) -#: po/rc.cpp:109 +#: po/rc.cpp:107 msgid "This button starts playing the rhythm pattern" msgstr "Démarre la lecture du motif rythmique" #. i18n: file: src/kmetronomeviewbase.ui:97 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:115 +#: po/rc.cpp:113 msgid "This button stops playing the rhythm pattern" msgstr "Arrête la lecture du motif rythmique" #. i18n: file: src/kmetronomeviewbase.ui:113 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) -#: po/rc.cpp:121 +#: po/rc.cpp:119 msgid "This button opens the configuration window" msgstr "Affiche la fenêtre de configuration" #. i18n: file: src/kmetronomeviewbase.ui:116 #. i18n: ectx: property (text), widget (KPushButton, m_configbtn) -#: po/rc.cpp:124 +#: po/rc.cpp:122 msgid "Settings" msgstr "Configuration" #. i18n: file: src/kmetronomeviewbase.ui:123 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) -#: po/rc.cpp:127 +#: po/rc.cpp:125 msgid "This button opens the pattern editor" msgstr "Ce bouton ouvre l’éditeur de figures rythmiques" #. i18n: file: src/kmetronomeviewbase.ui:139 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:133 +#: po/rc.cpp:131 msgid "This button exits the program" msgstr "Quitte le programme" #. i18n: file: src/kmetronomeviewbase.ui:142 #. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:136 +#: po/rc.cpp:134 msgid "Quit" msgstr "Quitter" #. i18n: file: src/kmetronomeviewbase.ui:173 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) -#: po/rc.cpp:139 +#: po/rc.cpp:137 msgid "Number of measures (bars) and beats played from beginning" msgstr "Nombre de mesures et de notes jouées depuis le début" #. i18n: file: src/kmetronomeviewbase.ui:210 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) -#: po/rc.cpp:145 +#: po/rc.cpp:143 msgid "" "This is the pattern definition to play, either \"Automatic\" or a custom " "defined one." @@ -441,71 +448,71 @@ #. i18n: file: src/kmetronomeviewbase.ui:217 #. i18n: ectx: property (text), widget (QLabel, lblBeats) -#: po/rc.cpp:148 +#: po/rc.cpp:146 msgid "Beats/Bar:" msgstr "Notes par mesure :" #. i18n: file: src/kmetronomeviewbase.ui:238 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) -#: po/rc.cpp:151 +#: po/rc.cpp:149 msgid "" -"This is the number of beats for each measure (bar).
\n" -"Values are from 1 to 32.
\n" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" "It is the numerator of the time signature specification." msgstr "" -"Nombre de temps dans une mesure
\n" -"Les valeurs vont de 1 à 32.
\n" +"Nombre de temps dans une mesure\n" +"Les valeurs vont de 1 à 32.\n" "C’est le numérateur de la signature rythmique." #. i18n: file: src/kmetronomeviewbase.ui:254 #. i18n: ectx: property (text), widget (QLabel, lblFigure) -#: po/rc.cpp:156 +#: po/rc.cpp:154 msgid "Beat Length:" msgstr "Durée de la note :" #. i18n: file: src/kmetronomeviewbase.ui:272 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) -#: po/rc.cpp:159 +#: po/rc.cpp:157 msgid "" -"This is the beat length.
\n" -"Values mean 1, 2, 4, 8, 16, 32 and 64.
\n" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" "It is the denominator in the time signature specification." msgstr "" -"Durée de la note.
\n" -"Les valeurs sont 1, 2, 4, 8, 16, 32 et 64.
\n" +"Durée de la note.\n" +"Les valeurs sont 1, 2, 4, 8, 16, 32 et 64.\n" "C'est le dénominateur de la signature rythmique." #. i18n: file: src/kmetronomeviewbase.ui:356 #. i18n: ectx: property (text), widget (QLabel, label_1) -#: po/rc.cpp:185 +#: po/rc.cpp:183 msgctxt "weak notes MIDI velocity" msgid "Weak" msgstr "Faible" #. i18n: file: src/kmetronomeviewbase.ui:369 #. i18n: ectx: property (text), widget (QLabel, label_2) -#: po/rc.cpp:188 +#: po/rc.cpp:186 msgctxt "strong notes MIDI velocity" msgid "Strong" msgstr "Fort" #. i18n: file: src/kmetronomeviewbase.ui:382 #. i18n: ectx: property (text), widget (QLabel, label_3) -#: po/rc.cpp:191 +#: po/rc.cpp:189 msgctxt "audio volume level" msgid "Volume" msgstr "Volume" #. i18n: file: src/kmetronomeviewbase.ui:395 #. i18n: ectx: property (text), widget (QLabel, label_4) -#: po/rc.cpp:194 +#: po/rc.cpp:192 msgctxt "audio panning" msgid "Pan" msgstr "Balance" #. i18n: file: src/kmetronomeviewbase.ui:414 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) -#: po/rc.cpp:197 +#: po/rc.cpp:195 msgid "" "This is the velocity of the weak notes in the automatic rhythm pattern (all " "of them, except the first one)" @@ -515,7 +522,7 @@ #. i18n: file: src/kmetronomeviewbase.ui:439 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) -#: po/rc.cpp:200 +#: po/rc.cpp:198 msgid "" "This is the velocity of the strong note in the automatic rhythm pattern (the " "first one)" @@ -523,48 +530,48 @@ #. i18n: file: src/kmetronomeviewbase.ui:464 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) -#: po/rc.cpp:203 +#: po/rc.cpp:201 msgid "This is the MIDI volume control (CC7)" msgstr "Contrôle du volume MIDI (CC7)" #. i18n: file: src/kmetronomeviewbase.ui:489 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) -#: po/rc.cpp:206 +#: po/rc.cpp:204 msgid "This is the MIDI pan control (CC10)" msgstr "Contrôle de la balance MIDI (CC10)" #. i18n: file: src/kmetronomeviewbase.ui:512 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) -#: po/rc.cpp:209 +#: po/rc.cpp:207 msgid "This is the musical name of the tempo value" msgstr "Nom musical de la valeur du tempo" #. i18n: file: src/kmetronomeviewbase.ui:531 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) -#: po/rc.cpp:212 +#: po/rc.cpp:210 msgid "The current tempo value" msgstr "Valeur actuelle du tempo" #. i18n: file: src/kmetronomeviewbase.ui:554 #. i18n: ectx: property (text), widget (QLabel, textLabel1_2) -#: po/rc.cpp:215 +#: po/rc.cpp:213 msgid "Tempo (in quarters per minute)" msgstr "Tempo (en noires par minute) :" #. i18n: file: src/kmetronomeviewbase.ui:580 #. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) -#: po/rc.cpp:218 +#: po/rc.cpp:216 msgid "" -"This slider changes the tempo, or speed of the rhythm.
\n" +"This slider changes the tempo, or speed of the rhythm.\n" "Values are 25 to 250 quarters per minute (Maelzel Metronome units)." msgstr "" -"Ce curseur modifie le tempo, ou la vitesse du rythme.
\n" +"Ce curseur modifie le tempo, ou la vitesse du rythme.\n" "Les valeurs possibles vont de 25 à 250 noires par minute (unités du " "métronome de Maelzel)" #. i18n: file: src/kmetropreferencesbase.ui:37 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:222 +#: po/rc.cpp:220 msgid "" "If this checkbox is activated, the the program will remember the connections " "for the input and output ports, and try to reconnect them at program startup." @@ -575,67 +582,67 @@ #. i18n: file: src/kmetropreferencesbase.ui:40 #. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:225 +#: po/rc.cpp:223 msgid "Automatic ports connection on startup" msgstr "Connexion automatique des ports au démarrage" #. i18n: file: src/kmetropreferencesbase.ui:61 #. i18n: ectx: property (text), widget (QLabel, lblInputPort) -#: po/rc.cpp:228 +#: po/rc.cpp:226 msgid "Optional input port conn:" msgstr "Connexion (optionnelle) du port d'entrée :" #. i18n: file: src/kmetropreferencesbase.ui:83 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) -#: po/rc.cpp:231 +#: po/rc.cpp:229 msgid "This is the optional connection for the MIDI IN port." msgstr "Connexion optionnelle du port d’entrée MIDI." #. i18n: file: src/kmetropreferencesbase.ui:102 #. i18n: ectx: property (text), widget (QLabel, lblOutputPort) -#: po/rc.cpp:234 +#: po/rc.cpp:232 msgid "Output port connection:" msgstr "Connexion du port de sortie :" #. i18n: file: src/kmetropreferencesbase.ui:124 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) -#: po/rc.cpp:237 +#: po/rc.cpp:235 msgid "This is the mandatory connection for the MIDI OUT port" msgstr "Connexion obligatoire du port MIDI de sortie" #. i18n: file: src/kmetropreferencesbase.ui:131 #. i18n: ectx: property (text), widget (QLabel, lblInstrument) -#: po/rc.cpp:240 +#: po/rc.cpp:238 msgid "Output instrument:" msgstr "Instrument de sortie :" #. i18n: file: src/kmetropreferencesbase.ui:147 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) -#: po/rc.cpp:243 +#: po/rc.cpp:241 msgid "This is the definition of the instrument connected to the MIDI OUT port" msgstr "Définition de l’instrument relié au port MIDI de sortie" #. i18n: file: src/kmetropreferencesbase.ui:158 #. i18n: ectx: property (text), widget (QLabel, lblBank) -#: po/rc.cpp:246 +#: po/rc.cpp:244 msgid "Bank:" msgstr "Banque :" #. i18n: file: src/kmetropreferencesbase.ui:171 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) -#: po/rc.cpp:249 +#: po/rc.cpp:247 msgid "This is the Bank of the selected MIDI program" msgstr "Banque du programme MIDI sélectionné" #. i18n: file: src/kmetropreferencesbase.ui:190 #. i18n: ectx: property (text), widget (QLabel, textLabel2) -#: po/rc.cpp:252 +#: po/rc.cpp:250 msgid "Channel:" msgstr "Canal :" #. i18n: file: src/kmetropreferencesbase.ui:207 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) -#: po/rc.cpp:255 +#: po/rc.cpp:253 msgid "" "This is the MIDI channel, between 1 and 16. \n" "General MIDI uses the channel 10 for percussion sounds." @@ -645,49 +652,49 @@ #. i18n: file: src/kmetropreferencesbase.ui:235 #. i18n: ectx: property (text), widget (QLabel, textLabel3) -#: po/rc.cpp:259 +#: po/rc.cpp:257 msgid "Program:" msgstr "Programme :" #. i18n: file: src/kmetropreferencesbase.ui:257 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) -#: po/rc.cpp:262 +#: po/rc.cpp:260 msgid "This is the MIDI program" msgstr "Programme MIDI" #. i18n: file: src/kmetropreferencesbase.ui:270 #. i18n: ectx: property (text), widget (QLabel, textLabel7) -#: po/rc.cpp:265 +#: po/rc.cpp:263 msgid "Resolution:" msgstr "Résolution :" #. i18n: file: src/kmetropreferencesbase.ui:286 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) -#: po/rc.cpp:268 +#: po/rc.cpp:266 msgid "This is the MIDI time resolution (number of ticks in a quarter note)" msgstr "Résolution MIDI (nombre de tics pour une noire)" #. i18n: file: src/kmetropreferencesbase.ui:305 #. i18n: ectx: property (text), widget (QLabel, textLabel4) -#: po/rc.cpp:271 +#: po/rc.cpp:269 msgid "Weak note:" msgstr "Note du temps faible :" #. i18n: file: src/kmetropreferencesbase.ui:327 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) -#: po/rc.cpp:274 +#: po/rc.cpp:272 msgid "This is the sound of the weak notes for the automatic patterns" msgstr "Son pour la note faible des figures rythmiques automatiques" #. i18n: file: src/kmetropreferencesbase.ui:340 #. i18n: ectx: property (text), widget (QLabel, textLabel8) -#: po/rc.cpp:277 +#: po/rc.cpp:275 msgid "Note duration:" msgstr "Durée d'une note :" #. i18n: file: src/kmetropreferencesbase.ui:356 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) -#: po/rc.cpp:280 +#: po/rc.cpp:278 msgid "This is the note duration in ticks, when using NOTE OFF events" msgstr "" "Durée d’une note, en nombre de tics d’horloge, lorsque vous utilisez les " @@ -695,31 +702,31 @@ #. i18n: file: src/kmetropreferencesbase.ui:378 #. i18n: ectx: property (text), widget (QLabel, textLabel5) -#: po/rc.cpp:283 +#: po/rc.cpp:281 msgid "Strong note:" msgstr "Note du temps fort :" #. i18n: file: src/kmetropreferencesbase.ui:400 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) -#: po/rc.cpp:286 +#: po/rc.cpp:284 msgid "This is the sound of the strong notes for the automatic patterns" msgstr "Son pour le temps fort des figures rythmiques automatiques" #. i18n: file: src/kmetropreferencesbase.ui:411 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:289 +#: po/rc.cpp:287 msgid "Optional setting to send NOTE OFF events" msgstr "Envoyer des évènements « NOTE OFF » (facultatif)" #. i18n: file: src/kmetropreferencesbase.ui:414 #. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:292 +#: po/rc.cpp:290 msgid "Send NOTE OFF events" msgstr "Envoyer des évènements « NOTE OFF »" #. i18n: file: src/kmetropreferencesbase.ui:440 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:295 +#: po/rc.cpp:293 msgid "If this option is activated, the knobs are drawn using a custom style" msgstr "" "Si cette option est activée, les boutons seront affichés avec un style " @@ -727,20 +734,23 @@ #. i18n: file: src/kmetropreferencesbase.ui:443 #. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:298 +#: po/rc.cpp:296 msgid "Styled Knobs" msgstr "Jolis boutons" -#: po/rc.cpp:299 +#: po/rc.cpp:297 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "Julien Richard-Foy" -#: po/rc.cpp:300 +#: po/rc.cpp:298 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "julien.rf@no-log.org" +#~ msgid "100" +#~ msgstr "100" + #~ msgid "Config" #~ msgstr "Configuration" diff -Nru kmetronome-0.10.0/po/kmetronome.pot kmetronome-0.10.1/po/kmetronome.pot --- kmetronome-0.10.0/po/kmetronome.pot 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/po/kmetronome.pot 2012-05-28 20:55:39.000000000 +0000 @@ -9,7 +9,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "atid=731542&group_id=134956\n" -"POT-Creation-Date: 2010-05-23 11:30+0200\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,44 +17,56 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/drumgrid.cpp:49 +#: src/drumgrid.cpp:51 msgid "Pattern Editor" msgstr "" -#: src/drumgrid.cpp:254 +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "" + +#: src/drumgrid.cpp:69 +msgid "Paste" +msgstr "" + +#: src/drumgrid.cpp:278 msgid "Do you want to remove the current pattern?" msgstr "" -#: src/drumgrid.cpp:255 +#: src/drumgrid.cpp:279 msgid "Remove Pattern" msgstr "" -#: src/drumgrid.cpp:309 +#: src/drumgrid.cpp:333 msgctxt "name of an automatically created pattern" msgid "Sample Pattern" msgstr "" -#: src/drumgrid.cpp:340 +#: src/drumgrid.cpp:364 msgid "Insert Pattern Row" msgstr "" -#: src/drumgrid.cpp:341 +#: src/drumgrid.cpp:365 msgid "Drum Key:" msgstr "" -#: src/drumgrid.cpp:361 +#: src/drumgrid.cpp:386 msgid "Please select one, and only one row" msgstr "" -#: src/drumgrid.cpp:363 +#: src/drumgrid.cpp:388 msgid "Do you want to remove the selected pattern row?" msgstr "" -#: src/drumgrid.cpp:364 +#: src/drumgrid.cpp:389 msgid "Remove Row" msgstr "" -#: src/kmetronome.cpp:85 +#: src/kmetronome.cpp:87 msgid "" "Fatal error from the ALSA sequencer. This usually happens when the kernel " "doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " @@ -62,45 +74,45 @@ "configuration. Returned error was: %1" msgstr "" -#: src/kmetronome.cpp:91 +#: src/kmetronome.cpp:93 msgid "Error" msgstr "" -#: src/kmetronome.cpp:112 +#: src/kmetronome.cpp:114 msgid "Play/Stop" msgstr "" -#: src/kmetronome.cpp:116 +#: src/kmetronome.cpp:118 msgid "Show Action Buttons" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:126 #. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) -#: src/kmetronome.cpp:123 po/rc.cpp:130 +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 msgid "Patterns" msgstr "" -#: src/kmetronome.cpp:128 src/kmetronome.cpp:490 +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 msgid "Import Patterns" msgstr "" -#: src/kmetronome.cpp:133 src/kmetronome.cpp:503 +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 msgid "Export Patterns" msgstr "" -#: src/kmetronome.cpp:489 src/kmetronome.cpp:502 +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 msgid "*.pat|Pattern Files (*.pat)" msgstr "" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Tempo" msgstr "" -#: src/kmetronomeview.cpp:143 +#: src/kmetronomeview.cpp:145 msgid "Enter new Tempo:" msgstr "" -#: src/kmetronomeview.cpp:177 +#: src/kmetronomeview.cpp:179 msgctxt "the pattern is created automatically" msgid "Automatic" msgstr "" @@ -113,15 +125,15 @@ msgid "KDE MIDI metronome using ALSA sequencer" msgstr "" -#: src/main.cpp:40 +#: src/main.cpp:41 msgid "KMetronome" msgstr "" -#: src/main.cpp:42 -msgid "(C) 2005-2010 Pedro Lopez-Cabanillas" +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" msgstr "" -#: src/main.cpp:46 +#: src/main.cpp:45 msgid "Pedro Lopez-Cabanillas" msgstr "" @@ -133,7 +145,7 @@ #. i18n: ectx: property (text), widget (QLabel, patternLabel) #. i18n: file: src/kmetronomeviewbase.ui:191 #. i18n: ectx: property (text), widget (QLabel, lblPattern) -#: po/rc.cpp:3 po/rc.cpp:142 +#: po/rc.cpp:3 po/rc.cpp:140 msgid "Pattern:" msgstr "" @@ -228,196 +240,190 @@ msgid "This is the current beat number" msgstr "" -#. i18n: file: src/drumgrid.ui:184 +#. i18n: file: src/drumgrid.ui:187 #. i18n: ectx: property (whatsThis), widget (QTableView, tableView) #: po/rc.cpp:49 msgid "This is the pattern table, beats as columns and sounds as rows" msgstr "" -#. i18n: file: src/drumgrid.ui:200 +#. i18n: file: src/drumgrid.ui:203 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) #: po/rc.cpp:52 msgid "Number of beats per measure (bar)" msgstr "" -#. i18n: file: src/drumgrid.ui:216 +#. i18n: file: src/drumgrid.ui:219 #. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) #: po/rc.cpp:55 msgid "This is the beat length for the pattern column." msgstr "" -#. i18n: file: src/drumgrid.ui:226 +#. i18n: file: src/drumgrid.ui:229 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:282 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:58 po/rc.cpp:164 +#: po/rc.cpp:58 po/rc.cpp:162 msgid "Whole" msgstr "" -#. i18n: file: src/drumgrid.ui:235 +#. i18n: file: src/drumgrid.ui:238 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:291 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:61 po/rc.cpp:167 +#: po/rc.cpp:61 po/rc.cpp:165 msgid "Half" msgstr "" -#. i18n: file: src/drumgrid.ui:244 +#. i18n: file: src/drumgrid.ui:247 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:300 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:64 po/rc.cpp:170 +#: po/rc.cpp:64 po/rc.cpp:168 msgid "Quarter" msgstr "" -#. i18n: file: src/drumgrid.ui:253 +#. i18n: file: src/drumgrid.ui:256 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:309 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:67 po/rc.cpp:173 +#: po/rc.cpp:67 po/rc.cpp:171 msgid "Eighth" msgstr "" -#. i18n: file: src/drumgrid.ui:262 +#. i18n: file: src/drumgrid.ui:265 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:318 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:70 po/rc.cpp:176 +#: po/rc.cpp:70 po/rc.cpp:174 msgid "Sixteenth" msgstr "" -#. i18n: file: src/drumgrid.ui:271 +#. i18n: file: src/drumgrid.ui:274 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:327 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:73 po/rc.cpp:179 +#: po/rc.cpp:73 po/rc.cpp:177 msgid "Thirty-Second" msgstr "" -#. i18n: file: src/drumgrid.ui:280 +#. i18n: file: src/drumgrid.ui:283 #. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) #. i18n: file: src/kmetronomeviewbase.ui:336 #. i18n: ectx: property (text), item, widget (KComboBox, m_figure) -#: po/rc.cpp:76 po/rc.cpp:182 +#: po/rc.cpp:76 po/rc.cpp:180 msgid "Sixty-Fourth" msgstr "" -#. i18n: file: src/drumgrid.ui:292 +#. i18n: file: src/drumgrid.ui:295 #. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) #: po/rc.cpp:79 msgid "This button starts playing the current pattern" msgstr "" -#. i18n: file: src/drumgrid.ui:295 +#. i18n: file: src/drumgrid.ui:298 #. i18n: ectx: property (text), widget (QPushButton, startButton) #. i18n: file: src/kmetronomeviewbase.ui:81 #. i18n: ectx: property (text), widget (KPushButton, m_playbtn) -#: po/rc.cpp:82 po/rc.cpp:112 +#: po/rc.cpp:82 po/rc.cpp:110 msgid "Play" msgstr "" -#. i18n: file: src/drumgrid.ui:308 +#. i18n: file: src/drumgrid.ui:311 #. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) #: po/rc.cpp:85 msgid "This button stops the playback" msgstr "" -#. i18n: file: src/drumgrid.ui:311 +#. i18n: file: src/drumgrid.ui:314 #. i18n: ectx: property (text), widget (QPushButton, stopButton) #. i18n: file: src/kmetronomeviewbase.ui:100 #. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:88 po/rc.cpp:118 +#: po/rc.cpp:88 po/rc.cpp:116 msgid "Stop" msgstr "" -#. i18n: file: src/drumgrid.ui:327 +#. i18n: file: src/drumgrid.ui:330 #. i18n: ectx: property (whatsThis), widget (QLabel, label_3) #: po/rc.cpp:91 msgid "QPM: quarters per minute" msgstr "" -#. i18n: file: src/drumgrid.ui:330 +#. i18n: file: src/drumgrid.ui:333 #. i18n: ectx: property (text), widget (QLabel, label_3) #: po/rc.cpp:94 msgctxt "Quarters per Minute" msgid "QPM:" msgstr "" -#. i18n: file: src/drumgrid.ui:340 +#. i18n: file: src/drumgrid.ui:343 #. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) #: po/rc.cpp:97 msgid "This is the current tempo in quarters per minute" msgstr "" -#. i18n: file: src/drumgrid.ui:343 -#. i18n: ectx: property (text), widget (QLabel, tempoLabel) -#: po/rc.cpp:100 -msgid "100" -msgstr "" - -#. i18n: file: src/drumgrid.ui:350 +#. i18n: file: src/drumgrid.ui:353 #. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) -#: po/rc.cpp:103 +#: po/rc.cpp:101 msgid "Drag the slider handle to change the tempo, in quarters per minute" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:58 #. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) -#: po/rc.cpp:106 +#: po/rc.cpp:104 msgid "MIDI Metronome" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:78 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) -#: po/rc.cpp:109 +#: po/rc.cpp:107 msgid "This button starts playing the rhythm pattern" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:97 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) -#: po/rc.cpp:115 +#: po/rc.cpp:113 msgid "This button stops playing the rhythm pattern" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:113 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) -#: po/rc.cpp:121 +#: po/rc.cpp:119 msgid "This button opens the configuration window" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:116 #. i18n: ectx: property (text), widget (KPushButton, m_configbtn) -#: po/rc.cpp:124 +#: po/rc.cpp:122 msgid "Settings" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:123 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) -#: po/rc.cpp:127 +#: po/rc.cpp:125 msgid "This button opens the pattern editor" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:139 #. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:133 +#: po/rc.cpp:131 msgid "This button exits the program" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:142 #. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) -#: po/rc.cpp:136 +#: po/rc.cpp:134 msgid "Quit" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:173 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) -#: po/rc.cpp:139 +#: po/rc.cpp:137 msgid "Number of measures (bars) and beats played from beginning" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:210 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) -#: po/rc.cpp:145 +#: po/rc.cpp:143 msgid "" "This is the pattern definition to play, either \"Automatic\" or a custom " "defined one." @@ -425,65 +431,65 @@ #. i18n: file: src/kmetronomeviewbase.ui:217 #. i18n: ectx: property (text), widget (QLabel, lblBeats) -#: po/rc.cpp:148 +#: po/rc.cpp:146 msgid "Beats/Bar:" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:238 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) -#: po/rc.cpp:151 +#: po/rc.cpp:149 msgid "" -"This is the number of beats for each measure (bar).
\n" -"Values are from 1 to 32.
\n" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" "It is the numerator of the time signature specification." msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:254 #. i18n: ectx: property (text), widget (QLabel, lblFigure) -#: po/rc.cpp:156 +#: po/rc.cpp:154 msgid "Beat Length:" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:272 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) -#: po/rc.cpp:159 +#: po/rc.cpp:157 msgid "" -"This is the beat length.
\n" -"Values mean 1, 2, 4, 8, 16, 32 and 64.
\n" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" "It is the denominator in the time signature specification." msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:356 #. i18n: ectx: property (text), widget (QLabel, label_1) -#: po/rc.cpp:185 +#: po/rc.cpp:183 msgctxt "weak notes MIDI velocity" msgid "Weak" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:369 #. i18n: ectx: property (text), widget (QLabel, label_2) -#: po/rc.cpp:188 +#: po/rc.cpp:186 msgctxt "strong notes MIDI velocity" msgid "Strong" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:382 #. i18n: ectx: property (text), widget (QLabel, label_3) -#: po/rc.cpp:191 +#: po/rc.cpp:189 msgctxt "audio volume level" msgid "Volume" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:395 #. i18n: ectx: property (text), widget (QLabel, label_4) -#: po/rc.cpp:194 +#: po/rc.cpp:192 msgctxt "audio panning" msgid "Pan" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:414 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) -#: po/rc.cpp:197 +#: po/rc.cpp:195 msgid "" "This is the velocity of the weak notes in the automatic rhythm pattern (all " "of them, except the first one)" @@ -491,7 +497,7 @@ #. i18n: file: src/kmetronomeviewbase.ui:439 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) -#: po/rc.cpp:200 +#: po/rc.cpp:198 msgid "" "This is the velocity of the strong note in the automatic rhythm pattern (the " "first one)" @@ -499,45 +505,45 @@ #. i18n: file: src/kmetronomeviewbase.ui:464 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) -#: po/rc.cpp:203 +#: po/rc.cpp:201 msgid "This is the MIDI volume control (CC7)" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:489 #. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) -#: po/rc.cpp:206 +#: po/rc.cpp:204 msgid "This is the MIDI pan control (CC10)" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:512 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) -#: po/rc.cpp:209 +#: po/rc.cpp:207 msgid "This is the musical name of the tempo value" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:531 #. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) -#: po/rc.cpp:212 +#: po/rc.cpp:210 msgid "The current tempo value" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:554 #. i18n: ectx: property (text), widget (QLabel, textLabel1_2) -#: po/rc.cpp:215 +#: po/rc.cpp:213 msgid "Tempo (in quarters per minute)" msgstr "" #. i18n: file: src/kmetronomeviewbase.ui:580 #. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) -#: po/rc.cpp:218 +#: po/rc.cpp:216 msgid "" -"This slider changes the tempo, or speed of the rhythm.
\n" +"This slider changes the tempo, or speed of the rhythm.\n" "Values are 25 to 250 quarters per minute (Maelzel Metronome units)." msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:37 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:222 +#: po/rc.cpp:220 msgid "" "If this checkbox is activated, the the program will remember the connections " "for the input and output ports, and try to reconnect them at program startup." @@ -545,67 +551,67 @@ #. i18n: file: src/kmetropreferencesbase.ui:40 #. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) -#: po/rc.cpp:225 +#: po/rc.cpp:223 msgid "Automatic ports connection on startup" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:61 #. i18n: ectx: property (text), widget (QLabel, lblInputPort) -#: po/rc.cpp:228 +#: po/rc.cpp:226 msgid "Optional input port conn:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:83 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) -#: po/rc.cpp:231 +#: po/rc.cpp:229 msgid "This is the optional connection for the MIDI IN port." msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:102 #. i18n: ectx: property (text), widget (QLabel, lblOutputPort) -#: po/rc.cpp:234 +#: po/rc.cpp:232 msgid "Output port connection:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:124 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) -#: po/rc.cpp:237 +#: po/rc.cpp:235 msgid "This is the mandatory connection for the MIDI OUT port" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:131 #. i18n: ectx: property (text), widget (QLabel, lblInstrument) -#: po/rc.cpp:240 +#: po/rc.cpp:238 msgid "Output instrument:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:147 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) -#: po/rc.cpp:243 +#: po/rc.cpp:241 msgid "This is the definition of the instrument connected to the MIDI OUT port" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:158 #. i18n: ectx: property (text), widget (QLabel, lblBank) -#: po/rc.cpp:246 +#: po/rc.cpp:244 msgid "Bank:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:171 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) -#: po/rc.cpp:249 +#: po/rc.cpp:247 msgid "This is the Bank of the selected MIDI program" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:190 #. i18n: ectx: property (text), widget (QLabel, textLabel2) -#: po/rc.cpp:252 +#: po/rc.cpp:250 msgid "Channel:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:207 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) -#: po/rc.cpp:255 +#: po/rc.cpp:253 msgid "" "This is the MIDI channel, between 1 and 16. \n" "General MIDI uses the channel 10 for percussion sounds." @@ -613,94 +619,94 @@ #. i18n: file: src/kmetropreferencesbase.ui:235 #. i18n: ectx: property (text), widget (QLabel, textLabel3) -#: po/rc.cpp:259 +#: po/rc.cpp:257 msgid "Program:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:257 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) -#: po/rc.cpp:262 +#: po/rc.cpp:260 msgid "This is the MIDI program" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:270 #. i18n: ectx: property (text), widget (QLabel, textLabel7) -#: po/rc.cpp:265 +#: po/rc.cpp:263 msgid "Resolution:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:286 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) -#: po/rc.cpp:268 +#: po/rc.cpp:266 msgid "This is the MIDI time resolution (number of ticks in a quarter note)" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:305 #. i18n: ectx: property (text), widget (QLabel, textLabel4) -#: po/rc.cpp:271 +#: po/rc.cpp:269 msgid "Weak note:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:327 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) -#: po/rc.cpp:274 +#: po/rc.cpp:272 msgid "This is the sound of the weak notes for the automatic patterns" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:340 #. i18n: ectx: property (text), widget (QLabel, textLabel8) -#: po/rc.cpp:277 +#: po/rc.cpp:275 msgid "Note duration:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:356 #. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) -#: po/rc.cpp:280 +#: po/rc.cpp:278 msgid "This is the note duration in ticks, when using NOTE OFF events" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:378 #. i18n: ectx: property (text), widget (QLabel, textLabel5) -#: po/rc.cpp:283 +#: po/rc.cpp:281 msgid "Strong note:" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:400 #. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) -#: po/rc.cpp:286 +#: po/rc.cpp:284 msgid "This is the sound of the strong notes for the automatic patterns" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:411 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:289 +#: po/rc.cpp:287 msgid "Optional setting to send NOTE OFF events" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:414 #. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) -#: po/rc.cpp:292 +#: po/rc.cpp:290 msgid "Send NOTE OFF events" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:440 #. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:295 +#: po/rc.cpp:293 msgid "If this option is activated, the knobs are drawn using a custom style" msgstr "" #. i18n: file: src/kmetropreferencesbase.ui:443 #. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) -#: po/rc.cpp:298 +#: po/rc.cpp:296 msgid "Styled Knobs" msgstr "" -#: po/rc.cpp:299 +#: po/rc.cpp:297 msgctxt "NAME OF TRANSLATORS" msgid "Your names" msgstr "" -#: po/rc.cpp:300 +#: po/rc.cpp:298 msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "" diff -Nru kmetronome-0.10.0/po/tr.po kmetronome-0.10.1/po/tr.po --- kmetronome-0.10.0/po/tr.po 1970-01-01 00:00:00.000000000 +0000 +++ kmetronome-0.10.1/po/tr.po 2012-05-28 20:55:39.000000000 +0000 @@ -0,0 +1,753 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Server Acim , 2011. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"atid=731542&group_id=134956\n" +"POT-Creation-Date: 2012-05-28 21:56+0200\n" +"PO-Revision-Date: 2011-02-05 17:58+0200\n" +"Last-Translator: Server Acim \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: src/drumgrid.cpp:51 +msgid "Pattern Editor" +msgstr "Kalıp Düzenleyici" + +#: src/drumgrid.cpp:67 +msgid "Cut" +msgstr "" + +#: src/drumgrid.cpp:68 +msgid "Copy" +msgstr "" + +#: src/drumgrid.cpp:69 +#, fuzzy +msgid "Paste" +msgstr "Kalıplar" + +#: src/drumgrid.cpp:278 +msgid "Do you want to remove the current pattern?" +msgstr "Bu kalıbı kaldırmak istiyor musunuz?" + +#: src/drumgrid.cpp:279 +msgid "Remove Pattern" +msgstr "Kalıbı Kaldır" + +#: src/drumgrid.cpp:333 +msgctxt "name of an automatically created pattern" +msgid "Sample Pattern" +msgstr "Örnek Kalıp" + +#: src/drumgrid.cpp:364 +msgid "Insert Pattern Row" +msgstr "Kalıp Sırası Ekle" + +#: src/drumgrid.cpp:365 +msgid "Drum Key:" +msgstr "Davul Tuşu" + +#: src/drumgrid.cpp:386 +msgid "Please select one, and only one row" +msgstr "Lütfen, sadece ve sadece bir sıra seçiniz" + +#: src/drumgrid.cpp:388 +msgid "Do you want to remove the selected pattern row?" +msgstr "Seçili kalıbı sırasını kaldırmak istiyor musunuz?" + +#: src/drumgrid.cpp:389 +msgid "Remove Row" +msgstr "Sırayı Kaldır" + +#: src/kmetronome.cpp:87 +msgid "" +"Fatal error from the ALSA sequencer. This usually happens when the kernel " +"doesn't have ALSA support, or the device node (/dev/snd/seq) doesn't exists, " +"or the kernel module (snd_seq) is not loaded. Please check your ALSA/MIDI " +"configuration. Returned error was: %1" +msgstr "" +"ALSA sekvansırdan ölümcül hata. Bu genelde çekirdeğin ALSA desteği olmadığı " +"veya aygıt yolunun (/dev/snd/seq gibi) olmadığı durumlarda ya da çekirdek " +"modülünün (örneğin snd seq) yüklü olmadığı durumlarda meydana gelir. Lütfen " +"ALSA/MIDI ayarlarınızı kontrol edin. Gelen hata şöyle idi: %1" + +#: src/kmetronome.cpp:93 +msgid "Error" +msgstr "Hata" + +#: src/kmetronome.cpp:114 +msgid "Play/Stop" +msgstr "Çal/Dur" + +#: src/kmetronome.cpp:118 +msgid "Show Action Buttons" +msgstr "Eylem Düğmelerini Göster" + +#. i18n: file: src/kmetronomeviewbase.ui:126 +#. i18n: ectx: property (text), widget (KPushButton, m_patternbtn) +#: src/kmetronome.cpp:125 src/kmetronome.cpp:527 po/rc.cpp:128 +msgid "Patterns" +msgstr "Kalıplar" + +#: src/kmetronome.cpp:130 src/kmetronome.cpp:498 +msgid "Import Patterns" +msgstr "Kalıpları İçeri Aktar" + +#: src/kmetronome.cpp:135 src/kmetronome.cpp:511 +msgid "Export Patterns" +msgstr "Kalıpları Dışarı Aktar" + +#: src/kmetronome.cpp:497 src/kmetronome.cpp:510 +msgid "*.pat|Pattern Files (*.pat)" +msgstr "*.pat|Kalıp Dosyaları (*.pat)" + +#: src/kmetronomeview.cpp:145 +msgid "Tempo" +msgstr "Tempo" + +#: src/kmetronomeview.cpp:145 +msgid "Enter new Tempo:" +msgstr "Yeni Tempo Giriniz:" + +#: src/kmetronomeview.cpp:179 +msgctxt "the pattern is created automatically" +msgid "Automatic" +msgstr "Otomatik" + +#: src/kmetropreferences.cpp:29 +msgid "Preferences" +msgstr "Tercihler" + +#: src/main.cpp:29 +msgid "KDE MIDI metronome using ALSA sequencer" +msgstr "KDE MIDI metronom ALSA sekvansır kullanıyor" + +#: src/main.cpp:41 +msgid "KMetronome" +msgstr "KMetronom" + +#: src/main.cpp:43 +msgid "(C) 2005-2012 Pedro Lopez-Cabanillas" +msgstr "(C) 2005-2012 Pedro Lopez-Cabanillas" + +#: src/main.cpp:45 +msgid "Pedro Lopez-Cabanillas" +msgstr "Pedro Lopez-Cabanillas" + +#: src/sequenceradapter.cpp:65 +msgid "No connection" +msgstr "Bağlantı Kurulamadı" + +#. i18n: file: src/drumgrid.ui:46 +#. i18n: ectx: property (text), widget (QLabel, patternLabel) +#. i18n: file: src/kmetronomeviewbase.ui:191 +#. i18n: ectx: property (text), widget (QLabel, lblPattern) +#: po/rc.cpp:3 po/rc.cpp:140 +msgid "Pattern:" +msgstr "Kalıp:" + +#. i18n: file: src/drumgrid.ui:62 +#. i18n: ectx: property (whatsThis), widget (KComboBox, patternCombo) +#: po/rc.cpp:6 +msgid "" +"Type a new name and press the \"Save\" button to create a new pattern, or " +"choose an existing pattern from the drop-down list." +msgstr "" +"Yeni bir kalıp oluşturmak için yeni bir başlık yazınız veya listeden var " +"olan bir kalıp seçiniz." + +#. i18n: file: src/drumgrid.ui:72 +#. i18n: ectx: property (whatsThis), widget (KPushButton, saveButton) +#: po/rc.cpp:9 +msgid "This button stores the current pattern definition with the name given" +msgstr "Bu düğme şu anki kalıp tanımını yükler ve verilen başlığı kullanır" + +#. i18n: file: src/drumgrid.ui:75 +#. i18n: ectx: property (text), widget (KPushButton, saveButton) +#: po/rc.cpp:12 +msgid "Save" +msgstr "Kaydet" + +#. i18n: file: src/drumgrid.ui:82 +#. i18n: ectx: property (whatsThis), widget (KPushButton, deleteButton) +#: po/rc.cpp:15 +msgid "This button deletes the current pattern definition" +msgstr "Bu düğme şu anki kalıp tanımını siler" + +#. i18n: file: src/drumgrid.ui:85 +#. i18n: ectx: property (text), widget (KPushButton, deleteButton) +#: po/rc.cpp:18 +msgid "Delete" +msgstr "Sil" + +#. i18n: file: src/drumgrid.ui:104 +#. i18n: ectx: property (text), widget (QLabel, label) +#: po/rc.cpp:21 +msgid "Rows:" +msgstr "Sıralar:" + +#. i18n: file: src/drumgrid.ui:111 +#. i18n: ectx: property (whatsThis), widget (KPushButton, addButton) +#: po/rc.cpp:24 +msgid "" +"Use this button to add new rows (sounds) to the current pattern definition" +msgstr "" +"Bu düğmeyi şu anki kalıp tanımına yeni sıralar (sesler) eklemek için kullanın" + +#. i18n: file: src/drumgrid.ui:114 +#. i18n: ectx: property (text), widget (KPushButton, addButton) +#: po/rc.cpp:27 +msgid "Add" +msgstr "Ekle" + +#. i18n: file: src/drumgrid.ui:121 +#. i18n: ectx: property (whatsThis), widget (KPushButton, removeButton) +#: po/rc.cpp:30 +msgid "" +"Use this button to remove the selected row (sound) from the pattern " +"definition" +msgstr "" +"Bu düğmeyi şu anki kalıp tanımından seçilmiş sırayı (sesleri) kaldırmak için " +"kullanın" + +#. i18n: file: src/drumgrid.ui:124 +#. i18n: ectx: property (text), widget (KPushButton, removeButton) +#: po/rc.cpp:33 +msgid "Remove" +msgstr "Kaldır" + +#. i18n: file: src/drumgrid.ui:144 +#. i18n: ectx: property (text), widget (QLabel, label_2) +#: po/rc.cpp:36 +msgid "Beats:" +msgstr "Vuruşlar:" + +#. i18n: file: src/drumgrid.ui:151 +#. i18n: ectx: property (whatsThis), widget (QCheckBox, chkselbeat) +#: po/rc.cpp:39 +msgid "Highligh the grid columns while playing" +msgstr "Çalarken ızgara sütünlarını vurgula" + +#. i18n: file: src/drumgrid.ui:155 +#. i18n: ectx: property (text), widget (QCheckBox, chkselbeat) +#: po/rc.cpp:42 +msgid "" +"Highlight\n" +"Columns" +msgstr "" +"Sütunları\n" +"Vurgula" + +#. i18n: file: src/drumgrid.ui:168 +#. i18n: ectx: property (whatsThis), widget (QLCDNumber, beatNumber) +#: po/rc.cpp:46 +msgid "This is the current beat number" +msgstr "Şu anki vuruş sayısıdır" + +#. i18n: file: src/drumgrid.ui:187 +#. i18n: ectx: property (whatsThis), widget (QTableView, tableView) +#: po/rc.cpp:49 +msgid "This is the pattern table, beats as columns and sounds as rows" +msgstr "" +"Bu, vuruşların sütunlarla ve seslerin sıralar halinde gösterildiği kalıp " +"tablosudur" + +#. i18n: file: src/drumgrid.ui:203 +#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, gridColumns) +#: po/rc.cpp:52 +msgid "Number of beats per measure (bar)" +msgstr "Ölçü başına düşen vuruş sayısı" + +#. i18n: file: src/drumgrid.ui:219 +#. i18n: ectx: property (whatsThis), widget (KComboBox, figureCombo) +#: po/rc.cpp:55 +msgid "This is the beat length for the pattern column." +msgstr "Bu, kalıp sütununda yer alan vuruş uzunluğudur." + +#. i18n: file: src/drumgrid.ui:229 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:282 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:58 po/rc.cpp:162 +msgid "Whole" +msgstr "Birlik süre" + +#. i18n: file: src/drumgrid.ui:238 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:291 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:61 po/rc.cpp:165 +msgid "Half" +msgstr "İkilik süre" + +#. i18n: file: src/drumgrid.ui:247 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:300 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:64 po/rc.cpp:168 +msgid "Quarter" +msgstr "Dörtlük süre" + +#. i18n: file: src/drumgrid.ui:256 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:309 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:67 po/rc.cpp:171 +msgid "Eighth" +msgstr "Sekizlik süre" + +#. i18n: file: src/drumgrid.ui:265 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:318 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:70 po/rc.cpp:174 +msgid "Sixteenth" +msgstr "Onaltılık süre" + +#. i18n: file: src/drumgrid.ui:274 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:327 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:73 po/rc.cpp:177 +msgid "Thirty-Second" +msgstr "Otuz-ikilik süre" + +#. i18n: file: src/drumgrid.ui:283 +#. i18n: ectx: property (text), item, widget (KComboBox, figureCombo) +#. i18n: file: src/kmetronomeviewbase.ui:336 +#. i18n: ectx: property (text), item, widget (KComboBox, m_figure) +#: po/rc.cpp:76 po/rc.cpp:180 +msgid "Sixty-Fourth" +msgstr "Atmış-dörtlük süre" + +#. i18n: file: src/drumgrid.ui:295 +#. i18n: ectx: property (whatsThis), widget (QPushButton, startButton) +#: po/rc.cpp:79 +msgid "This button starts playing the current pattern" +msgstr "Bu düğme bu kalıbın çalmasını başlatır" + +#. i18n: file: src/drumgrid.ui:298 +#. i18n: ectx: property (text), widget (QPushButton, startButton) +#. i18n: file: src/kmetronomeviewbase.ui:81 +#. i18n: ectx: property (text), widget (KPushButton, m_playbtn) +#: po/rc.cpp:82 po/rc.cpp:110 +msgid "Play" +msgstr "Çal" + +#. i18n: file: src/drumgrid.ui:311 +#. i18n: ectx: property (whatsThis), widget (QPushButton, stopButton) +#: po/rc.cpp:85 +msgid "This button stops the playback" +msgstr "Bu düğme çalmayı durdurur" + +#. i18n: file: src/drumgrid.ui:314 +#. i18n: ectx: property (text), widget (QPushButton, stopButton) +#. i18n: file: src/kmetronomeviewbase.ui:100 +#. i18n: ectx: property (text), widget (KPushButton, m_stopbtn) +#: po/rc.cpp:88 po/rc.cpp:116 +msgid "Stop" +msgstr "Dur" + +#. i18n: file: src/drumgrid.ui:330 +#. i18n: ectx: property (whatsThis), widget (QLabel, label_3) +#: po/rc.cpp:91 +msgid "QPM: quarters per minute" +msgstr "QPM: dakika başına düşen vuruş sayısı" + +#. i18n: file: src/drumgrid.ui:333 +#. i18n: ectx: property (text), widget (QLabel, label_3) +#: po/rc.cpp:94 +msgctxt "Quarters per Minute" +msgid "QPM:" +msgstr "QPM:" + +#. i18n: file: src/drumgrid.ui:343 +#. i18n: ectx: property (whatsThis), widget (QLabel, tempoLabel) +#: po/rc.cpp:97 +msgid "This is the current tempo in quarters per minute" +msgstr "Bu, dakika başına düşen şu anki tempodur" + +#. i18n: file: src/drumgrid.ui:353 +#. i18n: ectx: property (whatsThis), widget (QSlider, tempoSlider) +#: po/rc.cpp:101 +msgid "Drag the slider handle to change the tempo, in quarters per minute" +msgstr "" +"Tempoyu değiştirmek için dakika başına dörtlük olarak kaydırgaçı " +"sürükleyiniz, " + +#. i18n: file: src/kmetronomeviewbase.ui:58 +#. i18n: ectx: property (windowTitle), widget (QWidget, KmetronomeViewBase) +#: po/rc.cpp:104 +msgid "MIDI Metronome" +msgstr "MIDI Metronome" + +#. i18n: file: src/kmetronomeviewbase.ui:78 +#. i18n: ectx: property (whatsThis), widget (KPushButton, m_playbtn) +#: po/rc.cpp:107 +msgid "This button starts playing the rhythm pattern" +msgstr "Bu düğme ritm kalıbının çalmasını başlatır" + +#. i18n: file: src/kmetronomeviewbase.ui:97 +#. i18n: ectx: property (whatsThis), widget (KPushButton, m_stopbtn) +#: po/rc.cpp:113 +msgid "This button stops playing the rhythm pattern" +msgstr "Bu düğme ritm kalıbının çalmasını durdurur" + +#. i18n: file: src/kmetronomeviewbase.ui:113 +#. i18n: ectx: property (whatsThis), widget (KPushButton, m_configbtn) +#: po/rc.cpp:119 +msgid "This button opens the configuration window" +msgstr "Bu düğme yapılandırma penceresini açar" + +#. i18n: file: src/kmetronomeviewbase.ui:116 +#. i18n: ectx: property (text), widget (KPushButton, m_configbtn) +#: po/rc.cpp:122 +msgid "Settings" +msgstr "Ayarlar" + +#. i18n: file: src/kmetronomeviewbase.ui:123 +#. i18n: ectx: property (whatsThis), widget (KPushButton, m_patternbtn) +#: po/rc.cpp:125 +msgid "This button opens the pattern editor" +msgstr "Bu düğme kalıp düzenleyicisini açar" + +#. i18n: file: src/kmetronomeviewbase.ui:139 +#. i18n: ectx: property (whatsThis), widget (KPushButton, m_exitbtn) +#: po/rc.cpp:131 +msgid "This button exits the program" +msgstr "Bu düğme programdan çıkılmasını sağlar" + +#. i18n: file: src/kmetronomeviewbase.ui:142 +#. i18n: ectx: property (text), widget (KPushButton, m_exitbtn) +#: po/rc.cpp:134 +msgid "Quit" +msgstr "Çık" + +#. i18n: file: src/kmetronomeviewbase.ui:173 +#. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_measureLCD) +#: po/rc.cpp:137 +msgid "Number of measures (bars) and beats played from beginning" +msgstr "Baştan itibaren çalınan ölçü ve vuruşların sayısı" + +#. i18n: file: src/kmetronomeviewbase.ui:210 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_pattern) +#: po/rc.cpp:143 +msgid "" +"This is the pattern definition to play, either \"Automatic\" or a custom " +"defined one." +msgstr "" +"Bu, çalınacak kalıbın tanımıdır, bunu \"Otomatik\" olarak " +"ayarlayabileceğiniz gibi tanımı kendiniz de oluşturabilirsiniz." + +#. i18n: file: src/kmetronomeviewbase.ui:217 +#. i18n: ectx: property (text), widget (QLabel, lblBeats) +#: po/rc.cpp:146 +msgid "Beats/Bar:" +msgstr "Vuruşlar/Ölçüler:" + +#. i18n: file: src/kmetronomeviewbase.ui:238 +#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_beatsBar) +#: po/rc.cpp:149 +msgid "" +"This is the number of beats for each measure (bar).\n" +"Values are from 1 to 32.\n" +"It is the numerator of the time signature specification." +msgstr "" +"Bu, her ölçüdeki vuruşların sayısıdır.\n" +"Değerler 1 ile 32 arasındadır.\n" +"Ölçü birimi özelliğinin sayısal göstergesidir." + +#. i18n: file: src/kmetronomeviewbase.ui:254 +#. i18n: ectx: property (text), widget (QLabel, lblFigure) +#: po/rc.cpp:154 +msgid "Beat Length:" +msgstr "Vuruş Uzunluğu:" + +#. i18n: file: src/kmetronomeviewbase.ui:272 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_figure) +#: po/rc.cpp:157 +msgid "" +"This is the beat length.\n" +"Values mean 1, 2, 4, 8, 16, 32 and 64.\n" +"It is the denominator in the time signature specification." +msgstr "" +"Bu, vuruş süresidir.\n" +"Değerler 1, 2, 4, 8, 16, 32 ve 64 arasındadır.\n" +"Bunlar, ölçü birimi içindeki alt sürelerin özellikleridir." + +#. i18n: file: src/kmetronomeviewbase.ui:356 +#. i18n: ectx: property (text), widget (QLabel, label_1) +#: po/rc.cpp:183 +msgctxt "weak notes MIDI velocity" +msgid "Weak" +msgstr "Zayıf" + +#. i18n: file: src/kmetronomeviewbase.ui:369 +#. i18n: ectx: property (text), widget (QLabel, label_2) +#: po/rc.cpp:186 +msgctxt "strong notes MIDI velocity" +msgid "Strong" +msgstr "Kuvvetli" + +#. i18n: file: src/kmetronomeviewbase.ui:382 +#. i18n: ectx: property (text), widget (QLabel, label_3) +#: po/rc.cpp:189 +msgctxt "audio volume level" +msgid "Volume" +msgstr "Gürlük" + +#. i18n: file: src/kmetronomeviewbase.ui:395 +#. i18n: ectx: property (text), widget (QLabel, label_4) +#: po/rc.cpp:192 +msgctxt "audio panning" +msgid "Pan" +msgstr "Pan" + +#. i18n: file: src/kmetronomeviewbase.ui:414 +#. i18n: ectx: property (whatsThis), widget (Knob, m_dial1) +#: po/rc.cpp:195 +msgid "" +"This is the velocity of the weak notes in the automatic rhythm pattern (all " +"of them, except the first one)" +msgstr "" +"Bu, otomatik ritm kalıbındaki zayıf notanın seslendirme gücüdür (ilki " +"dışındaki tüm notaların)" + +#. i18n: file: src/kmetronomeviewbase.ui:439 +#. i18n: ectx: property (whatsThis), widget (Knob, m_dial2) +#: po/rc.cpp:198 +msgid "" +"This is the velocity of the strong note in the automatic rhythm pattern (the " +"first one)" +msgstr "" +"Bu, otomatik ritm kalıbındaki kuvvetli notanın seslendirme gücüdür (ilk " +"vuruşun)" + +#. i18n: file: src/kmetronomeviewbase.ui:464 +#. i18n: ectx: property (whatsThis), widget (Knob, m_dial3) +#: po/rc.cpp:201 +msgid "This is the MIDI volume control (CC7)" +msgstr "Bu MIDI ses denetimidir (CC7)" + +#. i18n: file: src/kmetronomeviewbase.ui:489 +#. i18n: ectx: property (whatsThis), widget (Knob, m_dial4) +#: po/rc.cpp:204 +msgid "This is the MIDI pan control (CC10)" +msgstr "Bu MIDI pan denetimidir (CC10)" + +#. i18n: file: src/kmetronomeviewbase.ui:512 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_air) +#: po/rc.cpp:207 +msgid "This is the musical name of the tempo value" +msgstr "Bu, tempo değerinin müziksel adıdır" + +#. i18n: file: src/kmetronomeviewbase.ui:531 +#. i18n: ectx: property (whatsThis), widget (QLCDNumber, m_tempoLCD) +#: po/rc.cpp:210 +msgid "The current tempo value" +msgstr "Geçerli tempo değeri" + +#. i18n: file: src/kmetronomeviewbase.ui:554 +#. i18n: ectx: property (text), widget (QLabel, textLabel1_2) +#: po/rc.cpp:213 +msgid "Tempo (in quarters per minute)" +msgstr "Tempo (dakika başına dörtlük süre)" + +#. i18n: file: src/kmetronomeviewbase.ui:580 +#. i18n: ectx: property (whatsThis), widget (QSlider, m_tempo) +#: po/rc.cpp:216 +msgid "" +"This slider changes the tempo, or speed of the rhythm.\n" +"Values are 25 to 250 quarters per minute (Maelzel Metronome units)." +msgstr "" +"Kaydırgaç, tempoyu, veya ritmin hızını değiştirir.\n" +"Değerler dakika başına 25 ile 250 dörtlüktür. (Maelzel Metronom birimine " +"göre)" + +#. i18n: file: src/kmetropreferencesbase.ui:37 +#. i18n: ectx: property (whatsThis), widget (QCheckBox, m_autoconn) +#: po/rc.cpp:220 +msgid "" +"If this checkbox is activated, the the program will remember the connections " +"for the input and output ports, and try to reconnect them at program startup." +msgstr "" +"Eğer bu seçim kutusu etkinse, program giriş çıkış portlarındaki bağlantıları " +"hatırlayacaktır, ve program yeniden başladığında yeniden bağlanmayı " +"deneyecektir." + +#. i18n: file: src/kmetropreferencesbase.ui:40 +#. i18n: ectx: property (text), widget (QCheckBox, m_autoconn) +#: po/rc.cpp:223 +msgid "Automatic ports connection on startup" +msgstr "Yeniden başlarken otomatik port bağlantıları yapılsın" + +#. i18n: file: src/kmetropreferencesbase.ui:61 +#. i18n: ectx: property (text), widget (QLabel, lblInputPort) +#: po/rc.cpp:226 +msgid "Optional input port conn:" +msgstr "Opsiyonel giriş portu conn değeri:" + +#. i18n: file: src/kmetropreferencesbase.ui:83 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_in_connection) +#: po/rc.cpp:229 +msgid "This is the optional connection for the MIDI IN port." +msgstr "Bu MIDI IN portu için opsiyonel bağlantıdır." + +#. i18n: file: src/kmetropreferencesbase.ui:102 +#. i18n: ectx: property (text), widget (QLabel, lblOutputPort) +#: po/rc.cpp:232 +msgid "Output port connection:" +msgstr "Çıkış portu bağlantısı:" + +#. i18n: file: src/kmetropreferencesbase.ui:124 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_out_connection) +#: po/rc.cpp:235 +msgid "This is the mandatory connection for the MIDI OUT port" +msgstr "MIDI OUT portu için zorunlu bağlantıdır" + +#. i18n: file: src/kmetropreferencesbase.ui:131 +#. i18n: ectx: property (text), widget (QLabel, lblInstrument) +#: po/rc.cpp:238 +msgid "Output instrument:" +msgstr "Çıkış çalgısı:" + +#. i18n: file: src/kmetropreferencesbase.ui:147 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_instrument) +#: po/rc.cpp:241 +msgid "This is the definition of the instrument connected to the MIDI OUT port" +msgstr "Bu, MIDI OUT portuna bağlı olan çalgının tanımıdır" + +#. i18n: file: src/kmetropreferencesbase.ui:158 +#. i18n: ectx: property (text), widget (QLabel, lblBank) +#: po/rc.cpp:244 +msgid "Bank:" +msgstr "Ses Bankası:" + +#. i18n: file: src/kmetropreferencesbase.ui:171 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_bank) +#: po/rc.cpp:247 +msgid "This is the Bank of the selected MIDI program" +msgstr "Bu, seçili MIDI programının Ses Bankasıdır" + +#. i18n: file: src/kmetropreferencesbase.ui:190 +#. i18n: ectx: property (text), widget (QLabel, textLabel2) +#: po/rc.cpp:250 +msgid "Channel:" +msgstr "Kanal:" + +#. i18n: file: src/kmetropreferencesbase.ui:207 +#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_channel) +#: po/rc.cpp:253 +msgid "" +"This is the MIDI channel, between 1 and 16. \n" +"General MIDI uses the channel 10 for percussion sounds." +msgstr "" +"Bu, 1 ile 16 arasındaki MIDI kanalıdır. \n" +"General MIDI vurma çalgı sesleri için 10 numaralı kanalı kullanır." + +#. i18n: file: src/kmetropreferencesbase.ui:235 +#. i18n: ectx: property (text), widget (QLabel, textLabel3) +#: po/rc.cpp:257 +msgid "Program:" +msgstr "Program:" + +#. i18n: file: src/kmetropreferencesbase.ui:257 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_program) +#: po/rc.cpp:260 +msgid "This is the MIDI program" +msgstr "Bu MIDI programıdır" + +#. i18n: file: src/kmetropreferencesbase.ui:270 +#. i18n: ectx: property (text), widget (QLabel, textLabel7) +#: po/rc.cpp:263 +msgid "Resolution:" +msgstr "Çözünürlük:" + +#. i18n: file: src/kmetropreferencesbase.ui:286 +#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_resolution) +#: po/rc.cpp:266 +msgid "This is the MIDI time resolution (number of ticks in a quarter note)" +msgstr "Bu, MIDI zaman çözünürlüğüdür (dörtlük notadaki tıkların sayısı)" + +#. i18n: file: src/kmetropreferencesbase.ui:305 +#. i18n: ectx: property (text), widget (QLabel, textLabel4) +#: po/rc.cpp:269 +msgid "Weak note:" +msgstr "Zayıf nota:" + +#. i18n: file: src/kmetropreferencesbase.ui:327 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_weak_note) +#: po/rc.cpp:272 +msgid "This is the sound of the weak notes for the automatic patterns" +msgstr "Bu, otomatik kalıplardaki zayıf notaların sesidir" + +#. i18n: file: src/kmetropreferencesbase.ui:340 +#. i18n: ectx: property (text), widget (QLabel, textLabel8) +#: po/rc.cpp:275 +msgid "Note duration:" +msgstr "Nota süresi:" + +#. i18n: file: src/kmetropreferencesbase.ui:356 +#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, m_duration) +#: po/rc.cpp:278 +msgid "This is the note duration in ticks, when using NOTE OFF events" +msgstr "BU, NOTE OFF seçeneği kullanıldığında, tıklardaki nota süresidir" + +#. i18n: file: src/kmetropreferencesbase.ui:378 +#. i18n: ectx: property (text), widget (QLabel, textLabel5) +#: po/rc.cpp:281 +msgid "Strong note:" +msgstr "Kuvvetli nota:" + +#. i18n: file: src/kmetropreferencesbase.ui:400 +#. i18n: ectx: property (whatsThis), widget (KComboBox, m_strong_note) +#: po/rc.cpp:284 +msgid "This is the sound of the strong notes for the automatic patterns" +msgstr "Bu, otomatik kalıplardaki kuvvetli notaların sesidir" + +#. i18n: file: src/kmetropreferencesbase.ui:411 +#. i18n: ectx: property (whatsThis), widget (QCheckBox, m_use_noteoff) +#: po/rc.cpp:287 +msgid "Optional setting to send NOTE OFF events" +msgstr "NOTE OFF seçimi gönderildiğindeki seçimlik ayarlar" + +#. i18n: file: src/kmetropreferencesbase.ui:414 +#. i18n: ectx: property (text), widget (QCheckBox, m_use_noteoff) +#: po/rc.cpp:290 +msgid "Send NOTE OFF events" +msgstr "NOTE OFF olaylarını gönder" + +#. i18n: file: src/kmetropreferencesbase.ui:440 +#. i18n: ectx: property (whatsThis), widget (QCheckBox, m_styledknobs) +#: po/rc.cpp:293 +msgid "If this option is activated, the knobs are drawn using a custom style" +msgstr "" +"Eğer bu seçenek etkinse, düğmeler özelleştirilmiş stili kullanacaklardır" + +#. i18n: file: src/kmetropreferencesbase.ui:443 +#. i18n: ectx: property (text), widget (QCheckBox, m_styledknobs) +#: po/rc.cpp:296 +msgid "Styled Knobs" +msgstr "Stilize Düğmeler" + +#: po/rc.cpp:297 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Server Acim" + +#: po/rc.cpp:298 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "serveracim@gmail.com" + +#~ msgid "100" +#~ msgstr "100" diff -Nru kmetronome-0.10.0/src/classicstyle.cpp kmetronome-0.10.1/src/classicstyle.cpp --- kmetronome-0.10.0/src/classicstyle.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/classicstyle.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010, Pedro Lopez-Cabanillas + Copyright (C) 2005-2012, Pedro Lopez-Cabanillas Based on an original design by Thorsten Wilms. Implemented as a widget for the Rosegarden MIDI and audio sequencer diff -Nru kmetronome-0.10.0/src/classicstyle.h kmetronome-0.10.1/src/classicstyle.h --- kmetronome-0.10.0/src/classicstyle.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/classicstyle.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010, Pedro Lopez-Cabanillas + Copyright (C) 2005-2012, Pedro Lopez-Cabanillas Based on an original design by Thorsten Wilms. Implemented as a widget for the Rosegarden MIDI and audio sequencer diff -Nru kmetronome-0.10.0/src/CMakeLists.txt kmetronome-0.10.1/src/CMakeLists.txt --- kmetronome-0.10.0/src/CMakeLists.txt 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/CMakeLists.txt 2012-05-28 20:55:39.000000000 +0000 @@ -1,5 +1,5 @@ # KMetronome - ALSA Sequencer based MIDI metronome -# Copyright (C) 2005-2010 Pedro Lopez-Cabanillas +# Copyright (C) 2005-2012 Pedro Lopez-Cabanillas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/defs.h kmetronome-0.10.1/src/defs.h --- kmetronome-0.10.0/src/defs.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/defs.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software); you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/drumgrid.cpp kmetronome-0.10.1/src/drumgrid.cpp --- kmetronome-0.10.0/src/drumgrid.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/drumgrid.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas + Copyright (C) 2006-2012, Pedro Lopez-Cabanillas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,7 +53,9 @@ m_ui->tableView->setSelectionMode(QTableView::ContiguousSelection); m_ui->startButton->setIcon(KIcon("media-playback-start")); + m_ui->startButton->setShortcut( Qt::Key_MediaPlay ); m_ui->stopButton->setIcon(KIcon("media-playback-stop")); + m_ui->stopButton->setShortcut( Qt::Key_MediaStop ); m_ui->saveButton->setIcon(KIcon("document-save")); m_ui->deleteButton->setIcon(KIcon("edit-delete")); m_ui->addButton->setIcon(KIcon("list-add")); diff -Nru kmetronome-0.10.0/src/drumgrid.h kmetronome-0.10.1/src/drumgrid.h --- kmetronome-0.10.0/src/drumgrid.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/drumgrid.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas + Copyright (C) 2006-2012, Pedro Lopez-Cabanillas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/drumgridmodel.cpp kmetronome-0.10.1/src/drumgridmodel.cpp --- kmetronome-0.10.0/src/drumgridmodel.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/drumgridmodel.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas + Copyright (C) 2006-2012, Pedro Lopez-Cabanillas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/drumgridmodel.h kmetronome-0.10.1/src/drumgridmodel.h --- kmetronome-0.10.0/src/drumgridmodel.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/drumgridmodel.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2006-2010, Pedro Lopez-Cabanillas + Copyright (C) 2006-2012, Pedro Lopez-Cabanillas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/drumgrid.ui kmetronome-0.10.1/src/drumgrid.ui --- kmetronome-0.10.0/src/drumgrid.ui 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/drumgrid.ui 2012-05-28 20:55:39.000000000 +0000 @@ -3,7 +3,7 @@ Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> KMetronome - ALSA Sequencer based MIDI metronome -Copyright (C) 2005-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> +Copyright (C) 2005-2012 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/instrument.cpp kmetronome-0.10.1/src/instrument.cpp --- kmetronome-0.10.0/src/instrument.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/instrument.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,9 +1,9 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010 Pedro Lopez-Cabanillas + Copyright (C) 2005-2012 Pedro Lopez-Cabanillas For this file, the following copyright notice is also applicable: - Copyright (C) 2005-2010, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2005-2012, rncbc aka Rui Nuno Capela. All rights reserved. See http://qtractor.sourceforge.net This program is free software; you can redistribute it and/or modify diff -Nru kmetronome-0.10.0/src/instrument.h kmetronome-0.10.1/src/instrument.h --- kmetronome-0.10.0/src/instrument.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/instrument.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,9 +1,9 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010 Pedro Lopez-Cabanillas + Copyright (C) 2005-2012 Pedro Lopez-Cabanillas For this file, the following copyright notice is also applicable: - Copyright (C) 2005-2010, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2005-2012, rncbc aka Rui Nuno Capela. All rights reserved. See http://qtractor.sourceforge.net This program is free software; you can redistribute it and/or modify diff -Nru kmetronome-0.10.0/src/kmetronome.cpp kmetronome-0.10.1/src/kmetronome.cpp --- kmetronome-0.10.0/src/kmetronome.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetronome.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/kmetronome.h kmetronome-0.10.1/src/kmetronome.h --- kmetronome-0.10.0/src/kmetronome.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetronome.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/kmetronomeviewbase.ui kmetronome-0.10.1/src/kmetronomeviewbase.ui --- kmetronome-0.10.0/src/kmetronomeviewbase.ui 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetronomeviewbase.ui 2012-05-28 20:55:39.000000000 +0000 @@ -3,7 +3,7 @@ Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> KMetronome - ALSA Sequencer based MIDI metronome -Copyright (C) 2005-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> +Copyright (C) 2005-2012 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +26,8 @@ 0 0 - 390 - 368 + 388 + 364 @@ -233,8 +233,8 @@ - This is the number of beats for each measure (bar).<br> -Values are from 1 to 32.<br> + This is the number of beats for each measure (bar). +Values are from 1 to 32. It is the numerator of the time signature specification. @@ -267,8 +267,8 @@ - This is the beat length.<br> -Values mean 1, 2, 4, 8, 16, 32 and 64.<br> + This is the beat length. +Values mean 1, 2, 4, 8, 16, 32 and 64. It is the denominator in the time signature specification. @@ -576,7 +576,7 @@ - This slider changes the <i>tempo</i>, or speed of the rhythm.<br> + This slider changes the <i>tempo</i>, or speed of the rhythm. Values are 25 to 250 quarters per minute (<i>Maelzel Metronome units</i>). @@ -606,11 +606,6 @@ - KComboBox - QComboBox -
kcombobox.h
-
- KIntSpinBox QSpinBox
knuminput.h
@@ -621,6 +616,11 @@
kpushbutton.h
+ KComboBox + QComboBox +
kcombobox.h
+
+ Knob QDial
knob.h
diff -Nru kmetronome-0.10.0/src/kmetronomeview.cpp kmetronome-0.10.1/src/kmetronomeview.cpp --- kmetronome-0.10.0/src/kmetronomeview.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetronomeview.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,7 +41,9 @@ m_exitbtn->setFocusPolicy(Qt::NoFocus); m_configbtn->setIcon(KIcon("configure")); m_playbtn->setIcon(KIcon("media-playback-start")); + m_playbtn->setShortcut( Qt::Key_MediaPlay ); m_stopbtn->setIcon(KIcon("media-playback-stop")); + m_stopbtn->setShortcut( Qt::Key_MediaStop ); m_patternbtn->setIcon(KIcon("document-edit")); m_dialStyle = new ClassicStyle(); diff -Nru kmetronome-0.10.0/src/kmetronomeview.h kmetronome-0.10.1/src/kmetronomeview.h --- kmetronome-0.10.0/src/kmetronomeview.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetronomeview.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/kmetropreferencesbase.ui kmetronome-0.10.1/src/kmetropreferencesbase.ui --- kmetronome-0.10.0/src/kmetropreferencesbase.ui 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetropreferencesbase.ui 2012-05-28 20:55:39.000000000 +0000 @@ -3,7 +3,7 @@ Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> KMetronome - ALSA Sequencer based MIDI metronome -Copyright (C) 2005-2010 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> +Copyright (C) 2005-2012 Pedro Lopez-Cabanillas <plcl@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru kmetronome-0.10.0/src/kmetropreferences.cpp kmetronome-0.10.1/src/kmetropreferences.cpp --- kmetronome-0.10.0/src/kmetropreferences.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetropreferences.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/kmetropreferences.h kmetronome-0.10.1/src/kmetropreferences.h --- kmetronome-0.10.0/src/kmetropreferences.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/kmetropreferences.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff -Nru kmetronome-0.10.0/src/knob.cpp kmetronome-0.10.1/src/knob.cpp --- kmetronome-0.10.0/src/knob.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/knob.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,9 +1,9 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010, Pedro Lopez-Cabanillas + Copyright (C) 2005-2012, Pedro Lopez-Cabanillas For this file, the following copyright notice is also applicable: - Copyright (C) 2005-2010, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2005-2012, rncbc aka Rui Nuno Capela. All rights reserved. See http://qsynth.sourceforge.net This program is free software; you can redistribute it and/or modify diff -Nru kmetronome-0.10.0/src/knob.h kmetronome-0.10.1/src/knob.h --- kmetronome-0.10.0/src/knob.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/knob.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,9 +1,9 @@ /* KMetronome - ALSA Sequencer based MIDI metronome - Copyright (C) 2005-2010, Pedro Lopez-Cabanillas + Copyright (C) 2005-2012, Pedro Lopez-Cabanillas For this file, the following copyright notice is also applicable: - Copyright (C) 2005-2010, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2005-2012, rncbc aka Rui Nuno Capela. All rights reserved. See http://qsynth.sourceforge.net This program is free software; you can redistribute it and/or modify diff -Nru kmetronome-0.10.0/src/main.cpp kmetronome-0.10.1/src/main.cpp --- kmetronome-0.10.0/src/main.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/main.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -26,32 +26,31 @@ #include "kmetronome.h" static const char description[] = - I18N_NOOP("KDE MIDI metronome using ALSA sequencer"); + I18N_NOOP("KDE MIDI metronome using ALSA sequencer"); static const char version[] = VERSION; /*static KCmdLineOptions options[] = + { + // { "+[URL]", I18N_NOOP( "Document to open." ), 0 }, + KCmdLineLastOption + };*/ + +int main (int argc, char **argv) { -// { "+[URL]", I18N_NOOP( "Document to open." ), 0 }, - KCmdLineLastOption -};*/ - -int main(int argc, char **argv) { - KAboutData about("kmetronome", 0, ki18n("KMetronome"), version, - ki18n(description), KAboutData::License_GPL, - ki18n("(C) 2005-2010 Pedro Lopez-Cabanillas"), - KLocalizedString(), - "http://kmetronome.sourceforge.net", - "plcl@users.sourceforge.net"); - about.addAuthor( ki18n("Pedro Lopez-Cabanillas"), KLocalizedString(), - "plcl@users.sourceforge.net"); - KCmdLineArgs::init(argc, argv, &about); + KAboutData about("kmetronome", 0, ki18n("KMetronome"), version, ki18n( + description), KAboutData::License_GPL, ki18n( + "(C) 2005-2012 Pedro Lopez-Cabanillas"), KLocalizedString(), + "http://kmetronome.sourceforge.net", "plcl@users.sourceforge.net"); + about.addAuthor(ki18n("Pedro Lopez-Cabanillas"), KLocalizedString(), + "plcl@users.sourceforge.net"); + KCmdLineArgs::init(argc, argv, &about); //KCmdLineOptions options; //options.add("+[URL]", ki18n( "Document to open" )); - //KCmdLineArgs::addCmdLineOptions( options ); + //KCmdLineArgs::addCmdLineOptions( options ); - KApplication app; - KMetronome *mainWin = 0; + KApplication app; + KMetronome *mainWin = 0; if (app.isSessionRestored()) { RESTORE(KMetronome); } else { diff -Nru kmetronome-0.10.0/src/qt_kde.h kmetronome-0.10.1/src/qt_kde.h --- kmetronome-0.10.0/src/qt_kde.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/qt_kde.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * plcl@users.sourceforge.net * * * * This program is free software; you can redistribute it and/or modify * diff -Nru kmetronome-0.10.0/src/sequenceradapter.cpp kmetronome-0.10.1/src/sequenceradapter.cpp --- kmetronome-0.10.0/src/sequenceradapter.cpp 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/sequenceradapter.cpp 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -89,6 +89,7 @@ m_Queue = m_Client->createQueue("KMetronome"); m_queueId = m_Queue->getId(); + m_Client->setRealTimeInput(true); m_Client->startSequencerInput(); } @@ -342,7 +343,7 @@ case 0x02: case 0x42: if (syx->getLength() < 9) return; - *ptr++; + (void) *ptr++; num = *ptr++; den = *ptr++; emit signalNotation(num, den); diff -Nru kmetronome-0.10.0/src/sequenceradapter.h kmetronome-0.10.1/src/sequenceradapter.h --- kmetronome-0.10.0/src/sequenceradapter.h 2010-06-06 08:09:17.000000000 +0000 +++ kmetronome-0.10.1/src/sequenceradapter.h 2012-05-28 20:55:39.000000000 +0000 @@ -1,6 +1,6 @@ /*************************************************************************** * KMetronome - ALSA Sequencer based MIDI metronome * - * Copyright (C) 2005-2010 Pedro Lopez-Cabanillas * + * Copyright (C) 2005-2012 Pedro Lopez-Cabanillas * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by *