rpms/drumstick/devel drumstick-0.2.99-20100208svn.patch, NONE, 1.1 drumstick.spec, 1.2, 1.3
Kevin Kofler
kkofler at fedoraproject.org
Tue Feb 9 16:54:15 UTC 2010
Author: kkofler
Update of /cvs/pkgs/rpms/drumstick/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17779/devel
Modified Files:
drumstick.spec
Added Files:
drumstick-0.2.99-20100208svn.patch
Log Message:
* Tue Feb 08 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0.2.99-0.3.svn20100208
- update from SVN for KMid2 0.2.1
drumstick-0.2.99-20100208svn.patch:
library/include/alsaclient.h | 7 ++
library/include/drumstickcommon.h | 6 +-
library/src/alsaclient.cpp | 105 ++++++++++++++++++++++++++++++++++----
library/src/alsaqueue.cpp | 9 ++-
tests/sysinfo/sysinfo.cpp | 13 ++++
5 files changed, 126 insertions(+), 14 deletions(-)
--- NEW FILE drumstick-0.2.99-20100208svn.patch ---
Index: tests/sysinfo/sysinfo.cpp
===================================================================
--- tests/sysinfo/sysinfo.cpp (revision 137)
+++ tests/sysinfo/sysinfo.cpp (revision 141)
@@ -184,7 +184,18 @@
client->setClientName(pgmi.baseName());
SystemInfo info = client->getSystemInfo();
cout << "ALSA Sequencer System Info" << endl;
- cout << "Max Clients: " << info.getMaxClients() << endl;
+ cout << "Compiled ALSA library: " << LIBRARY_VERSION << endl;
+ cout << "Runtime ALSA library: "
+ << getRuntimeALSALibraryVersion() << endl;
+ cout << "Runtime ALSA drivers: "
+ << getRuntimeALSADriverVersion() << endl;
+ cout << "Numeric ALSA compiled library: "
+ << hex << SND_LIB_VERSION << endl;
+ cout << "Numeric ALSA runtime library: "
+ << getRuntimeALSALibraryNumber() << endl;
+ cout << "Numeric ALSA runtime driver: "
+ << getRuntimeALSADriverNumber() << endl;
+ cout << "Max Clients: " << dec << info.getMaxClients() << endl;
cout << "Max Ports: " << info.getMaxPorts() << endl;
cout << "Max Queues: " << info.getMaxQueues() << endl;
cout << "Max Channels: " << info.getMaxChannels() << endl;
Index: library/include/drumstickcommon.h
===================================================================
--- library/include/drumstickcommon.h (revision 137)
+++ library/include/drumstickcommon.h (revision 141)
@@ -145,7 +145,11 @@
#define CHECK_WARNING(x) (checkWarning((x),__PRETTY_FUNCTION__))
/**
- * ALSA library version as a constant string
+ * 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);
Index: library/include/alsaclient.h
===================================================================
--- library/include/alsaclient.h (revision 137)
+++ library/include/alsaclient.h (revision 141)
@@ -364,6 +364,13 @@
PoolInfo m_poolInfo;
};
+#if SND_LIB_VERSION > 0x010004
+QString getRuntimeALSALibraryVersion();
+int getRuntimeALSALibraryNumber();
+#endif
+QString getRuntimeALSADriverVersion();
+int getRuntimeALSADriverNumber();
+
} /* namespace drumstick */
/** @} */
Index: library/src/alsaclient.cpp
===================================================================
--- library/src/alsaclient.cpp (revision 137)
+++ library/src/alsaclient.cpp (revision 141)
@@ -20,6 +20,8 @@
#include "alsaclient.h"
#include "alsaqueue.h"
#include "alsaevent.h"
+#include <QFile>
+#include <QRegExp>
#include <QThread>
#include <pthread.h>
@@ -235,6 +237,12 @@
* enqueued using the application's event loop, and it is safe to call any GUI
* methods in this case.</li>
* </ul>
+ * 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/4.5/threads.html#qobject-reentrancy
*
@@ -627,18 +635,21 @@
break;
}
// first, process the callback (if any)
- if (m_handler != NULL)
+ if (m_handler != NULL) {
m_handler->handleSequencerEvent(event->clone());
- // 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 {
+ // 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());
}
}
- // finally, process signals
- emit eventReceived(event->clone());
delete event;
}
}
@@ -2276,4 +2287,80 @@
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 */
Index: library/src/alsaqueue.cpp
===================================================================
--- library/src/alsaqueue.cpp (revision 137)
+++ library/src/alsaqueue.cpp (revision 141)
@@ -846,8 +846,10 @@
*/
void MidiQueue::stop()
{
- CHECK_WARNING(snd_seq_stop_queue(m_MidiClient->getHandle(), m_Id, NULL));
- CHECK_WARNING(snd_seq_drain_output(m_MidiClient->getHandle()));
+ 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()));
+ }
}
/**
@@ -866,7 +868,8 @@
*/
void MidiQueue::clear()
{
- snd_seq_drop_output(m_MidiClient->getHandle());
+ if (m_MidiClient != NULL && m_MidiClient->getHandle() != NULL)
+ snd_seq_drop_output(m_MidiClient->getHandle());
}
/**
Index: drumstick.spec
===================================================================
RCS file: /cvs/pkgs/rpms/drumstick/devel/drumstick.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- drumstick.spec 31 Jan 2010 21:46:48 -0000 1.2
+++ drumstick.spec 9 Feb 2010 16:54:15 -0000 1.3
@@ -1,13 +1,15 @@
Summary: C++/Qt4 wrapper around the ALSA library sequencer interface
Name: drumstick
Version: 0.2.99
-Release: 0.2.20100107svn%{?dist}
+Release: 0.3.20100208svn%{?dist}
%define svn svn
Group: System Environment/Libraries
License: GPLv2+
URL: http://drumstick.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/drumstick/%{version}%{?svn}/drumstick-%{version}%{?svn}.tar.bz2
+# svn diff -r 137:141 https://drumstick.svn.sourceforge.net/svnroot/drumstick/trunk
+Patch0: drumstick-0.2.99-20100208svn.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cmake qt4-devel alsa-lib-devel desktop-file-utils
@@ -41,6 +43,7 @@ This package contains the test/example p
%prep
%setup -q -n %{name}-%{version}%{?svn}
+%patch0 -p0
# don't create .la file
sed -i -e 's/CREATE_LIBTOOL_FILE/#CREATE_LIBTOOL_FILE/g' library/CMakeLists.txt
@@ -105,6 +108,9 @@ gtk-update-icon-cache %{_datadir}/icons/
%changelog
+* Tue Feb 08 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0.2.99-0.3.svn20100208
+- update from SVN for KMid2 0.2.1
+
* Sun Jan 31 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0.2.99-0.2.svn20100107
- put the alphatag before the disttag
More information about the scm-commits
mailing list