summaryrefslogtreecommitdiffstats
path: root/src/AlsaDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-14 20:35:43 +0000
committerDavid Robillard <d@drobilla.net>2010-12-14 20:35:43 +0000
commitd9a54049e99f6c3963e1f48e04b9a7adcd81899b (patch)
tree42fb887b2a97c96f550110b88ab18891c6d9da2f /src/AlsaDriver.cpp
parent14921f4a865f0eb06b45cd70e3ee71e42a8148e0 (diff)
downloadpatchage-d9a54049e99f6c3963e1f48e04b9a7adcd81899b.tar.gz
patchage-d9a54049e99f6c3963e1f48e04b9a7adcd81899b.tar.bz2
patchage-d9a54049e99f6c3963e1f48e04b9a7adcd81899b.zip
Use Raul::log for console logging.
Print error message if unsubscribed client is not found (Re: ticket #137). git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2684 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AlsaDriver.cpp')
-rw-r--r--src/AlsaDriver.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp
index e10c120..19ebfa8 100644
--- a/src/AlsaDriver.cpp
+++ b/src/AlsaDriver.cpp
@@ -17,8 +17,8 @@
#include <string>
#include <set>
-#include <iostream>
#include <cassert>
+#include "raul/log.hpp"
#include "raul/SharedPtr.hpp"
#include "PatchageCanvas.hpp"
#include "AlsaDriver.hpp"
@@ -66,7 +66,7 @@ AlsaDriver::attach(bool /*launch_daemon*/)
ret = pthread_create(&_refresh_thread, &attr, &AlsaDriver::refresh_main, this);
if (ret)
- cerr << "Couldn't start refresh thread" << endl;
+ Raul::error << "Couldn't start refresh thread" << endl;
signal_attached.emit();
}
@@ -358,13 +358,13 @@ AlsaDriver::connect(boost::shared_ptr<PatchagePort> src_port, boost::shared_ptr<
// Already connected (shouldn't happen)
if (!snd_seq_get_port_subscription(_seq, subs)) {
- cerr << "Error: Attempt to subscribe Alsa ports that are already subscribed." << endl;
+ Raul::error << "[ALSA] Attempt to subscribe ports that are already subscribed." << endl;
result = false;
}
int ret = snd_seq_subscribe_port(_seq, subs);
if (ret < 0) {
- cerr << "Alsa subscription failed: " << snd_strerror(ret) << endl;
+ Raul::error << "[ALSA] Subscription failed: " << snd_strerror(ret) << endl;
result = false;
}
}
@@ -402,13 +402,13 @@ AlsaDriver::disconnect(boost::shared_ptr<PatchagePort> src_port, boost::shared_p
// Not connected (shouldn't happen)
if (snd_seq_get_port_subscription(_seq, subs) != 0) {
- cerr << "Error: Attempt to unsubscribe Alsa ports that are not subscribed." << endl;
+ Raul::error << "[ALSA] Attempt to unsubscribe ports that are not subscribed." << endl;
result = false;
}
int ret = snd_seq_unsubscribe_port(_seq, subs);
if (ret < 0) {
- cerr << "Alsa unsubscription failed: " << snd_strerror(ret) << endl;
+ Raul::error << "[ALSA] Unsubscription failed: " << snd_strerror(ret) << endl;
result = false;
}
@@ -440,7 +440,7 @@ AlsaDriver::create_refresh_port()
ret = snd_seq_create_port(_seq, port_info);
if (ret) {
- cerr << "Error creating alsa port: " << snd_strerror(ret) << endl;
+ Raul::error << "[ALSA] Error creating port: " << snd_strerror(ret) << endl;
return false;
}
@@ -451,7 +451,8 @@ AlsaDriver::create_refresh_port()
SND_SEQ_PORT_SYSTEM_ANNOUNCE);
if (ret) {
- cerr << "Could not connect to system announcer port: " << snd_strerror(ret) << endl;
+ Raul::error << "[ALSA] Could not connect to system announcer port: "
+ << snd_strerror(ret) << endl;
return false;
}
@@ -472,7 +473,7 @@ void
AlsaDriver::_refresh_main()
{
if (!create_refresh_port()) {
- cerr << "Could not create Alsa listen port. Auto refreshing will not work." << endl;
+ Raul::error << "[ALSA] Could not create listen port, auto-refresh will not work." << endl;
return;
}
@@ -489,14 +490,14 @@ AlsaDriver::_refresh_main()
if (errno == EINTR)
continue;
- cerr << "Error polling Alsa sequencer: " << strerror(errno) << endl;
+ Raul::error << "[ALSA] Error polling sequencer: " << strerror(errno) << endl;
continue;
}
ret = snd_seq_poll_descriptors_revents(_seq, pfds, nfds, revents);
if (ret) {
- cerr << "Error getting Alsa sequencer poll events: "
- << snd_strerror(ret) << endl;
+ Raul::error << "[ALSA] Error getting sequencer poll events: "
+ << snd_strerror(ret) << endl;
continue;
}