[beast: 4/14] DRIVERS: use Bse diagnostics and BSE_CONVENIENCE
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 4/14] DRIVERS: use Bse diagnostics and BSE_CONVENIENCE
- Date: Thu, 23 Mar 2017 17:13:41 +0000 (UTC)
commit 655dad4d774361bff6d35ad2620fa16f28141b89
Author: Tim Janik <timj gnu org>
Date: Tue Mar 14 00:45:00 2017 +0100
DRIVERS: use Bse diagnostics and BSE_CONVENIENCE
Signed-off-by: Tim Janik <timj gnu org>
drivers/Makefile.am | 2 +-
drivers/bsemididevice-alsa.cc | 18 +++++++++---------
drivers/bsepcmdevice-alsa.cc | 12 ++++++------
3 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/drivers/Makefile.am b/drivers/Makefile.am
index 015642d..5969e16 100644
--- a/drivers/Makefile.am
+++ b/drivers/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.decl
AM_CPPFLAGS += -I$(top_srcdir) -I.
DEFS += @DEFINE__FILE_DIR__@ $(strip -DG_LOG_DOMAIN=\"BSE-ALSA\")
-AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE
+AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DBSE_CONVENIENCE
# Plugin bsedevice-alsa
driversdir = $(bselibdir)/drivers
diff --git a/drivers/bsemididevice-alsa.cc b/drivers/bsemididevice-alsa.cc
index 38ccb91..20aa8d9 100644
--- a/drivers/bsemididevice-alsa.cc
+++ b/drivers/bsemididevice-alsa.cc
@@ -99,7 +99,7 @@ bse_midi_device_alsa_list_devices (BseDevice *device)
while (cindex >= 0)
{
snd_ctl_card_info_clear (cinfo);
- String hwid = string_format ("hw:CARD=%u", cindex);
+ std::string hwid = Bse::string_format ("hw:CARD=%u", cindex);
snd_ctl_t *chandle = NULL;
if (snd_ctl_open (&chandle, hwid.c_str(), SND_CTL_NONBLOCK) < 0 || !chandle)
continue;
@@ -207,20 +207,20 @@ bse_midi_device_alsa_open (BseDevice *device,
if (error == 0 && snd_rawmidi_params_current (alsa->read_handle, mparams) < 0)
error = Bse::Error::FILE_OPEN_FAILED;
if (0)
- printerr ("midiread: buffer=%zd active_sensing=%d min_avail=%zd\n",
- snd_rawmidi_params_get_buffer_size (mparams),
- !snd_rawmidi_params_get_no_active_sensing (mparams),
- snd_rawmidi_params_get_avail_min (mparams));
+ Bse::printerr ("midiread: buffer=%zd active_sensing=%d min_avail=%zd\n",
+ snd_rawmidi_params_get_buffer_size (mparams),
+ !snd_rawmidi_params_get_no_active_sensing (mparams),
+ snd_rawmidi_params_get_avail_min (mparams));
}
if (alsa->write_handle)
{
if (error == 0 && snd_rawmidi_params_current (alsa->write_handle, mparams) < 0)
error = Bse::Error::FILE_OPEN_FAILED;
if (0)
- printerr ("midiwrite: buffer=%zd active_sensing=%d min_avail=%zd\n",
- snd_rawmidi_params_get_buffer_size (mparams),
- !snd_rawmidi_params_get_no_active_sensing (mparams),
- snd_rawmidi_params_get_avail_min (mparams));
+ Bse::printerr ("midiwrite: buffer=%zd active_sensing=%d min_avail=%zd\n",
+ snd_rawmidi_params_get_buffer_size (mparams),
+ !snd_rawmidi_params_get_no_active_sensing (mparams),
+ snd_rawmidi_params_get_avail_min (mparams));
}
if (error == 0 && alsa->read_handle && snd_rawmidi_poll_descriptors_count (alsa->read_handle) <= 0)
error = Bse::Error::FILE_OPEN_FAILED;
diff --git a/drivers/bsepcmdevice-alsa.cc b/drivers/bsepcmdevice-alsa.cc
index d949534..0b472c5 100644
--- a/drivers/bsepcmdevice-alsa.cc
+++ b/drivers/bsepcmdevice-alsa.cc
@@ -123,7 +123,7 @@ bse_pcm_device_alsa_list_devices (BseDevice *device)
while (cindex >= 0)
{
snd_ctl_card_info_clear (cinfo);
- String hwid = string_format ("hw:CARD=%u", cindex);
+ std::string hwid = Bse::string_format ("hw:CARD=%u", cindex);
snd_ctl_t *chandle = NULL;
if (snd_ctl_open (&chandle, hwid.c_str(), SND_CTL_NONBLOCK) < 0 || !chandle)
continue;
@@ -437,11 +437,11 @@ alsa_device_check_io (BsePcmHandle *handle,
ws = snd_pcm_state (alsa->write_handle);
}
guint wn = snd_pcm_status_get_avail (stat);
- printerr ("ALSA: check_io: read=%4u/%4u (%s) write=%4u/%4u (%s) block=%u: %s\n",
- rn, alsa->period_size * alsa->n_periods, snd_pcm_state_name (rs),
- wn, alsa->period_size * alsa->n_periods, snd_pcm_state_name (ws),
- handle->block_length,
- rn >= handle->block_length ? "TRUE" : "FALSE");
+ Bse::printerr ("ALSA: check_io: read=%4u/%4u (%s) write=%4u/%4u (%s) block=%u: %s\n",
+ rn, alsa->period_size * alsa->n_periods, snd_pcm_state_name (rs),
+ wn, alsa->period_size * alsa->n_periods, snd_pcm_state_name (ws),
+ handle->block_length,
+ rn >= handle->block_length ? "TRUE" : "FALSE");
}
/* quick check for data availability */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]