From ec60e9dba152a2053e7530c23c61bb3ffa342efb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Apr 2006 12:48:11 +0000 Subject: optimizations git-svn-id: file:///home/lennart/svn/public/paman/trunk@61 cdefa82f-4ce1-0310-97f5-ab6066f37c3c --- src/SampleWindow.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/SampleWindow.cc') diff --git a/src/SampleWindow.cc b/src/SampleWindow.cc index d726942..d30f10f 100644 --- a/src/SampleWindow.cc +++ b/src/SampleWindow.cc @@ -68,23 +68,21 @@ void SampleWindow::updateInfo(const SampleInfo &i) { snprintf(t, sizeof(t), "%0.0f%%", (double) pa_sw_volume_to_linear(pa_cvolume_avg(&i.volume)) * 100); volumeLabel->set_text(t); - if (pa_sample_spec_valid(&i.sample_spec)) { + if (i.bytes > 0) { + pa_sample_spec_snprint(ss, sizeof(ss), &i.sample_spec); sampleTypeLabel->set_text(ss); - } else - sampleTypeLabel->set_markup("n/a"); - if (i.duration > 0) { snprintf(t, sizeof(t), "%0.1fs", (double) i.duration/1000000); durationLabel->set_text(t); - } else - durationLabel->set_markup("n/a"); - if (i.bytes > 0) { pa_bytes_snprint(t, sizeof(t), i.bytes); sizeLabel->set_text(t); - } else + } else { + sampleTypeLabel->set_markup("n/a"); + durationLabel->set_markup("n/a"); sizeLabel->set_markup("n/a"); + } lazyLabel->set_text(i.lazy ? "yes" : "no"); -- cgit