summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/MainWindow.cc6
-rw-r--r--src/SampleWindow.cc4
-rw-r--r--src/ServerInfoManager.cc34
-rw-r--r--src/ServerInfoManager.hh2
-rw-r--r--src/SinkInputWindow.cc2
-rw-r--r--src/SinkWindow.cc2
-rw-r--r--src/SourceOutputWindow.cc2
-rw-r--r--src/SourceWindow.cc2
8 files changed, 37 insertions, 17 deletions
diff --git a/src/MainWindow.cc b/src/MainWindow.cc
index 67dfe37..46e083b 100644
--- a/src/MainWindow.cc
+++ b/src/MainWindow.cc
@@ -339,15 +339,15 @@ void MainWindow::onSampleTreeViewRowActivated(const Gtk::TreeModel::Path& path,
}
void MainWindow::updateInfo(const struct pa_server_info &i) {
- char t[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[PA_SAMPLE_SPEC_SNPRINT_MAX];
serverNameLabel->set_text(i.server_name);
serverVersionLabel->set_text(i.server_version);
pa_sample_spec_snprint(t, sizeof(t), &i.sample_spec);
defaultSampleTypeLabel->set_text(t);
hostNameLabel->set_text(i.host_name);
userNameLabel->set_text(i.user_name);
- defaultSinkLabel->set_markup(*i.default_sink_name ? i.default_sink_name : "<i>not set</i>");
- defaultSourceLabel->set_markup(*i.default_source_name ? i.default_source_name: "<i>not set</i>");
+ defaultSinkLabel->set_markup(i.default_sink_name ? i.default_sink_name : "<i>not set</i>");
+ defaultSourceLabel->set_markup(i.default_source_name ? i.default_source_name: "<i>not set</i>");
}
void MainWindow::showSuccess(const char *t) {
diff --git a/src/SampleWindow.cc b/src/SampleWindow.cc
index 1685213..81ddaa0 100644
--- a/src/SampleWindow.cc
+++ b/src/SampleWindow.cc
@@ -38,7 +38,7 @@ SampleWindow* SampleWindow::create() {
}
void SampleWindow::updateInfo(const SampleInfo &i) {
- char t[60], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[60], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
nameLabel->set_text(i.name);
snprintf(t, sizeof(t), "#%u", i.index);
@@ -67,7 +67,7 @@ void SampleWindow::updateInfo(const SampleInfo &i) {
lazyLabel->set_text(i.lazy ? "yes" : "no");
- if (i.filename.size() > 0)
+ if (i.filename_valid)
filenameLabel->set_text(i.filename);
else
filenameLabel->set_markup("<i>n/a</i>");
diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc
index 5d0a6f0..e05b401 100644
--- a/src/ServerInfoManager.cc
+++ b/src/ServerInfoManager.cc
@@ -6,7 +6,6 @@
SinkInfo::SinkInfo(const struct pa_sink_info &i) :
name(i.name),
- description(i.description),
index(i.index),
sample_spec(i.sample_spec),
monitor_source(i.monitor_source),
@@ -15,6 +14,9 @@ SinkInfo::SinkInfo(const struct pa_sink_info &i) :
latency(i.latency),
monitor_source_name(i.monitor_source_name),
window(NULL) {
+
+ if (i.description)
+ description = i.description;
}
SinkInfo::~SinkInfo() {
@@ -24,7 +26,6 @@ SinkInfo::~SinkInfo() {
void SinkInfo::update(const struct pa_sink_info &i) {
name = Glib::ustring(i.name);
- description = i.description;
index = i.index;
sample_spec = i.sample_spec;
monitor_source = i.monitor_source;
@@ -33,6 +34,8 @@ void SinkInfo::update(const struct pa_sink_info &i) {
latency = i.latency;
monitor_source_name = i.monitor_source_name;
+ description = i.description ? i.description : "";
+
if (window)
window->updateInfo(*this);
g_assert(mainWindow);
@@ -51,13 +54,15 @@ void SinkInfo::showWindow() {
SourceInfo::SourceInfo(const struct pa_source_info &i) :
name(i.name),
- description(i.description),
index(i.index),
sample_spec(i.sample_spec),
owner_module(i.owner_module),
monitor_of_sink(i.monitor_of_sink),
latency(i.latency),
window(NULL) {
+
+ if (i.description)
+ description = i.description;
}
SourceInfo::~SourceInfo() {
@@ -67,13 +72,14 @@ SourceInfo::~SourceInfo() {
void SourceInfo::update(const struct pa_source_info &i) {
name = i.name;
- description = i.description;
index = i.index;
sample_spec = i.sample_spec;
owner_module = i.owner_module;
monitor_of_sink = i.monitor_of_sink;
latency = i.latency;
+ description = i.description ? i.description : "";
+
if (window)
window->updateInfo(*this);
g_assert(mainWindow);
@@ -129,10 +135,12 @@ void ClientInfo::showWindow() {
ModuleInfo::ModuleInfo(const struct pa_module_info &i) :
index(i.index),
name(i.name),
- argument(i.argument),
autoloaded(i.auto_unload),
used(i.n_used),
window(NULL) {
+
+ if (i.argument)
+ argument = i.argument;
}
ModuleInfo::~ModuleInfo() {
@@ -142,11 +150,12 @@ ModuleInfo::~ModuleInfo() {
void ModuleInfo::update(const struct pa_module_info &i) {
name = i.name;
- argument = i.argument;
index = i.index;
autoloaded = i.auto_unload;
used = i.n_used;
+ argument = i.argument ? i.argument : "";
+
if (window)
window->updateInfo(*this);
g_assert(mainWindow);
@@ -259,8 +268,13 @@ SampleInfo::SampleInfo(const struct pa_sample_info &i) :
duration(i.duration),
bytes(i.bytes),
lazy(!!i.lazy),
- filename(i.filename),
+ filename_valid(false),
window(NULL) {
+
+ if (i.filename) {
+ filename = i.filename;
+ filename_valid = true;
+ }
}
SampleInfo::~SampleInfo() {
@@ -276,8 +290,12 @@ void SampleInfo::update(const struct pa_sample_info &i) {
duration = i.duration;
bytes = i.bytes;
lazy = !!i.lazy;
- filename = i.filename;
+ filename_valid = !!i.filename;
+
+ if (i.filename)
+ filename = i.filename;
+
if (window)
window->updateInfo(*this);
g_assert(mainWindow);
diff --git a/src/ServerInfoManager.hh b/src/ServerInfoManager.hh
index 5cd5c5e..a3f0aaf 100644
--- a/src/ServerInfoManager.hh
+++ b/src/ServerInfoManager.hh
@@ -161,6 +161,8 @@ public:
bool lazy;
Glib::ustring filename;
+ bool filename_valid;
+
Gtk::TreeRowReference treeRef;
SampleWindow *window;
diff --git a/src/SinkInputWindow.cc b/src/SinkInputWindow.cc
index ffd1791..9a07304 100644
--- a/src/SinkInputWindow.cc
+++ b/src/SinkInputWindow.cc
@@ -59,7 +59,7 @@ SinkInputWindow* SinkInputWindow::create() {
}
void SinkInputWindow::updateInfo(const SinkInputInfo &i) {
- char t[80], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[80], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
double percent, db;
nameLabel->set_text(i.name);
diff --git a/src/SinkWindow.cc b/src/SinkWindow.cc
index 4c6a01a..76153d1 100644
--- a/src/SinkWindow.cc
+++ b/src/SinkWindow.cc
@@ -56,7 +56,7 @@ SinkWindow* SinkWindow::create() {
}
void SinkWindow::updateInfo(const SinkInfo &i) {
- char t[64], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[64], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
double percent, db;
nameLabel->set_text(i.name);
diff --git a/src/SourceOutputWindow.cc b/src/SourceOutputWindow.cc
index e2cc5db..fde5c0e 100644
--- a/src/SourceOutputWindow.cc
+++ b/src/SourceOutputWindow.cc
@@ -48,7 +48,7 @@ SourceOutputWindow* SourceOutputWindow::create() {
}
void SourceOutputWindow::updateInfo(const SourceOutputInfo &i) {
- char t[100], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[100], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
nameLabel->set_text(i.name);
snprintf(t, sizeof(t), "#%u", i.index);
diff --git a/src/SourceWindow.cc b/src/SourceWindow.cc
index bb48071..ff12e8b 100644
--- a/src/SourceWindow.cc
+++ b/src/SourceWindow.cc
@@ -43,7 +43,7 @@ SourceWindow* SourceWindow::create() {
}
void SourceWindow::updateInfo(const SourceInfo &i) {
- char t[20], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH];
+ char t[20], ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
nameLabel->set_text(i.name);
descriptionLabel->set_text(i.description);