diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-09-16 00:02:32 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-09-16 00:02:32 +0000 |
commit | 0a84f669d3d4c72c498b01b999dd89af7f917480 (patch) | |
tree | 77960fce506b9297682ef79be9274467f595bf8a /src/SampleWindow.cc | |
parent | ae4653849a9a5990caf84d5ecd1466435760dd60 (diff) |
update to new API
show source and source_output latencies
ad kill buttons to client/sink_input/source_output (incomplete)
add vumeter buttons to sink/source
git-svn-id: file:///home/lennart/svn/public/paman/trunk@33 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
Diffstat (limited to 'src/SampleWindow.cc')
-rw-r--r-- | src/SampleWindow.cc | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/SampleWindow.cc b/src/SampleWindow.cc index c3ff7fc..1685213 100644 --- a/src/SampleWindow.cc +++ b/src/SampleWindow.cc @@ -11,8 +11,10 @@ SampleWindow::SampleWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl indexLabel(NULL), volumeLabel(NULL), sampleTypeLabel(NULL), - sizeLabel(NULL), durationLabel(NULL), + sizeLabel(NULL), + lazyLabel(NULL), + filenameLabel(NULL), closeButton(NULL) { refGlade->get_widget("nameLabel", nameLabel); @@ -21,6 +23,8 @@ SampleWindow::SampleWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl refGlade->get_widget("sampleTypeLabel", sampleTypeLabel); refGlade->get_widget("durationLabel", durationLabel); refGlade->get_widget("sizeLabel", sizeLabel); + refGlade->get_widget("lazyLabel", lazyLabel); + refGlade->get_widget("filenameLabel", filenameLabel); refGlade->get_widget("closeButton", closeButton); closeButton->signal_clicked().connect(sigc::mem_fun(*this, &SampleWindow::onCloseButton)); @@ -43,14 +47,30 @@ void SampleWindow::updateInfo(const SampleInfo &i) { snprintf(t, sizeof(t), "%0.0f%%", (double) i.volume / 0x100 * 100); volumeLabel->set_text(t); - pa_sample_spec_snprint(ss, sizeof(ss), &i.sample_spec); - sampleTypeLabel->set_text(ss); + if (pa_sample_spec_valid(&i.sample_spec)) { + pa_sample_spec_snprint(ss, sizeof(ss), &i.sample_spec); + sampleTypeLabel->set_text(ss); + } else + sampleTypeLabel->set_markup("<i>n/a</i>"); + + if (i.duration > 0) { + snprintf(t, sizeof(t), "%0.1fs", (double) i.duration/1000000); + durationLabel->set_text(t); + } else + durationLabel->set_markup("<i>n/a</i>"); + + if (i.bytes > 0) { + pa_bytes_snprint(t, sizeof(t), i.bytes); + sizeLabel->set_text(t); + } else + sizeLabel->set_markup("<i>n/a</i>"); - snprintf(t, sizeof(t), "%0.1fs", (double) i.duration/1000000); - durationLabel->set_text(t); + lazyLabel->set_text(i.lazy ? "yes" : "no"); - pa_bytes_snprint(t, sizeof(t), i.bytes); - sizeLabel->set_text(t); + if (i.filename.size() > 0) + filenameLabel->set_text(i.filename); + else + filenameLabel->set_markup("<i>n/a</i>"); set_title("Sample: "+i.name); } @@ -59,7 +79,7 @@ void SampleWindow::onCloseButton() { hide(); } -bool SampleWindow::on_delete_event(GdkEventAny* e) { +bool SampleWindow::on_delete_event(GdkEventAny*) { hide(); return false; } |