summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-01-08 22:33:43 +0000
committerLennart Poettering <lennart@poettering.net>2005-01-08 22:33:43 +0000
commit07752848b29988288416259360ab2ad49107f3a6 (patch)
treec243617ab88a353e84a5e2e1d16705c60eabaeb3
parent1d1efe5311bd65b58e23547975927e5c1ddeea47 (diff)
fix paman for polypaudio 0.8
git-svn-id: file:///home/lennart/svn/public/paman/trunk@46 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
-rw-r--r--configure.ac6
-rw-r--r--src/ClientWindow.cc7
-rw-r--r--src/ClientWindow.hh2
-rw-r--r--src/ServerInfoManager.cc12
-rw-r--r--src/ServerInfoManager.hh7
-rw-r--r--src/SinkInputWindow.cc8
-rw-r--r--src/SinkInputWindow.hh1
-rw-r--r--src/SinkWindow.cc8
-rw-r--r--src/SinkWindow.hh1
-rw-r--r--src/paman.glade4
10 files changed, 40 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 3bcdca4..7711771 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AC_PREREQ(2.57)
-AC_INIT([paman],[0.6],[mzcnzna (at) 0pointer (dot) de])
+AC_INIT([paman],[0.7],[mzcnzna (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([src/paman.cc])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
@@ -45,10 +45,10 @@ AC_SUBST(GUILIBS_LIBS)
if test -d ../polypaudio ; then
POLYP_CFLAGS='-I$(top_srcdir)/../polypaudio'
- POLYP_LIBS='-L$(top_srcdir)/../polypaudio/polyp/.libs -lpolyp-0.7 -lpolyp-mainloop-0.7 -lpolyp-mainloop-glib-0.7 -lpolyp-error-0.7'
+ POLYP_LIBS='-L$(top_srcdir)/../polypaudio/polyp/.libs -lpolyp-0.8 -lpolyp-mainloop-0.8 -lpolyp-mainloop-glib-0.8 -lpolyp-error-0.8'
echo "*** Found polypaudio in ../polypaudio, using that version ***"
else
- PKG_CHECK_MODULES(POLYP, [ polyplib >= 0.7 polyplib-glib-mainloop >= 0.7 ])
+ PKG_CHECK_MODULES(POLYP, [ polyplib >= 0.8 polyplib-glib-mainloop >= 0.8 ])
fi
AC_SUBST(POLYP_LIBS)
diff --git a/src/ClientWindow.cc b/src/ClientWindow.cc
index 01f3ecf..014095b 100644
--- a/src/ClientWindow.cc
+++ b/src/ClientWindow.cc
@@ -8,7 +8,7 @@
ClientWindow::ClientWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade) :
Gtk::Window(cobject),
nameLabel(NULL),
- protocolLabel(NULL),
+ typeidLabel(NULL),
indexLabel(NULL),
ownerModuleLabel(NULL),
closeButton(NULL),
@@ -16,7 +16,7 @@ ClientWindow::ClientWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
killButton(NULL) {
refGlade->get_widget("nameLabel", nameLabel);
- refGlade->get_widget("protocolLabel", protocolLabel);
+ refGlade->get_widget("typeidLabel", typeidLabel);
refGlade->get_widget("indexLabel", indexLabel);
refGlade->get_widget("ownerModuleLabel", ownerModuleLabel);
refGlade->get_widget("closeButton", closeButton);
@@ -39,7 +39,8 @@ void ClientWindow::updateInfo(const ClientInfo &i) {
char t[20];
nameLabel->set_text(i.name);
- protocolLabel->set_text(i.protocol_name);
+
+ typeidLabel->set_text(pa_typeid_to_string(i._typeid, t, sizeof(t)));
snprintf(t, sizeof(t), "#%u", i.index);
indexLabel->set_text(t);
diff --git a/src/ClientWindow.hh b/src/ClientWindow.hh
index da0049a..74bd601 100644
--- a/src/ClientWindow.hh
+++ b/src/ClientWindow.hh
@@ -14,7 +14,7 @@ public:
static ClientWindow* create();
Gtk::Label *nameLabel,
- *protocolLabel,
+ *typeidLabel,
*indexLabel,
*ownerModuleLabel;
diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc
index adb91b2..44e668f 100644
--- a/src/ServerInfoManager.cc
+++ b/src/ServerInfoManager.cc
@@ -13,6 +13,7 @@ SinkInfo::SinkInfo(const struct pa_sink_info &i) :
volume(i.volume),
latency(i.latency),
monitor_source_name(i.monitor_source_name),
+ _typeid(i._typeid),
window(NULL) {
if (i.description)
@@ -33,6 +34,7 @@ void SinkInfo::update(const struct pa_sink_info &i) {
volume = i.volume;
latency = i.latency;
monitor_source_name = i.monitor_source_name;
+ _typeid = i._typeid;
description = i.description ? i.description : "";
@@ -59,6 +61,7 @@ SourceInfo::SourceInfo(const struct pa_source_info &i) :
owner_module(i.owner_module),
monitor_of_sink(i.monitor_of_sink),
latency(i.latency),
+ _typeid(i._typeid),
window(NULL) {
if (i.description)
@@ -77,6 +80,7 @@ void SourceInfo::update(const struct pa_source_info &i) {
owner_module = i.owner_module;
monitor_of_sink = i.monitor_of_sink;
latency = i.latency;
+ _typeid = i._typeid;
description = i.description ? i.description : "";
@@ -99,8 +103,8 @@ void SourceInfo::showWindow() {
ClientInfo::ClientInfo(const struct pa_client_info &i) :
index(i.index),
name(i.name),
- protocol_name(i.protocol_name),
owner_module(i.owner_module),
+ _typeid(i._typeid),
window(NULL) {
}
@@ -111,9 +115,9 @@ ClientInfo::~ClientInfo() {
void ClientInfo::update(const struct pa_client_info &i) {
name = i.name;
- protocol_name = i.protocol_name;
index = i.index;
owner_module = i.owner_module;
+ _typeid = i._typeid;
if (window)
window->updateInfo(*this);
@@ -183,6 +187,7 @@ SinkInputInfo::SinkInputInfo(const struct pa_sink_input_info &i) :
buffer_usec(i.buffer_usec),
sink_usec(i.sink_usec),
resample_method(i.resample_method ? i.resample_method : "<i>n/a</i>"),
+ _typeid(i._typeid),
window(NULL) {
}
@@ -201,6 +206,7 @@ void SinkInputInfo::update(const struct pa_sink_input_info &i) {
volume = i.volume;
buffer_usec = i.buffer_usec;
sink_usec = i.sink_usec;
+ _typeid = i._typeid;
resample_method = i.resample_method ? i.resample_method : "<i>n/a</i>";
if (window)
@@ -229,6 +235,7 @@ SourceOutputInfo::SourceOutputInfo(const struct pa_source_output_info &i) :
buffer_usec(i.buffer_usec),
source_usec(i.source_usec),
resample_method(i.resample_method ? i.resample_method : "<i>n/a</i>"),
+ _typeid(i._typeid),
window(NULL) {
}
@@ -246,6 +253,7 @@ void SourceOutputInfo::update(const struct pa_source_output_info &i) {
owner_module = i.owner_module;
buffer_usec = i.buffer_usec;
source_usec = i.source_usec;
+ _typeid = i._typeid;
resample_method = i.resample_method ? i.resample_method : "<i>n/a</i>";
if (window)
diff --git a/src/ServerInfoManager.hh b/src/ServerInfoManager.hh
index bdce711..df9f37a 100644
--- a/src/ServerInfoManager.hh
+++ b/src/ServerInfoManager.hh
@@ -42,6 +42,7 @@ public:
pa_volume_t volume;
pa_usec_t latency;
Glib::ustring monitor_source_name;
+ pa_typeid_t _typeid;
Gtk::TreeRowReference treeRef, sinkComboBoxTreeRef;
@@ -62,6 +63,7 @@ public:
uint32_t owner_module;
uint32_t monitor_of_sink;
pa_usec_t latency;
+ pa_typeid_t _typeid;
Gtk::TreeRowReference treeRef;
SourceWindow *window;
@@ -93,8 +95,9 @@ public:
void showWindow();
uint32_t index;
- Glib::ustring name, protocol_name;
+ Glib::ustring name;
uint32_t owner_module;
+ pa_typeid_t _typeid;
Gtk::TreeRowReference treeRef;
ClientWindow *window;
@@ -118,6 +121,7 @@ public:
pa_volume_t volume;
pa_usec_t buffer_usec, sink_usec;
Glib::ustring resample_method;
+ pa_typeid_t _typeid;
Gtk::TreeRowReference treeRef;
@@ -141,6 +145,7 @@ public:
uint32_t owner_module;
pa_usec_t buffer_usec, source_usec;
Glib::ustring resample_method;
+ pa_typeid_t _typeid;
Gtk::TreeRowReference treeRef;
diff --git a/src/SinkInputWindow.cc b/src/SinkInputWindow.cc
index 5b2365d..784cb90 100644
--- a/src/SinkInputWindow.cc
+++ b/src/SinkInputWindow.cc
@@ -23,7 +23,8 @@ SinkInputWindow::SinkInputWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno
volumeResetButton(NULL),
volumeMuteButton(NULL),
killButton(NULL),
- volumeScale(NULL) {
+ volumeScale(NULL),
+ scaleEnabled(true) {
refGlade->get_widget("nameLabel", nameLabel);
refGlade->get_widget("indexLabel", indexLabel);
@@ -92,7 +93,9 @@ void SinkInputWindow::updateInfo(const SinkInputInfo &i) {
percent = pa_volume_to_user(i.volume) * 100;
db = pa_volume_to_dB(i.volume);
+ scaleEnabled = false;
volumeScale->set_value(percent);
+ scaleEnabled = true;
if (db != PA_DECIBEL_MININFTY)
snprintf(t, sizeof(t), "%0.0f%% (%0.2fdB)", percent, db);
else
@@ -130,7 +133,8 @@ void SinkInputWindow::onToClientButton() {
}
void SinkInputWindow::onVolumeScaleValueChanged() {
- serverInfoManager->setSinkInputVolume(index, pa_volume_from_user(volumeScale->get_value()/100));
+ if (scaleEnabled)
+ serverInfoManager->setSinkInputVolume(index, pa_volume_from_user(volumeScale->get_value()/100));
}
void SinkInputWindow::onVolumeResetButton() {
diff --git a/src/SinkInputWindow.hh b/src/SinkInputWindow.hh
index fd78fd2..1931e13 100644
--- a/src/SinkInputWindow.hh
+++ b/src/SinkInputWindow.hh
@@ -34,6 +34,7 @@ public:
Gtk::HScale *volumeScale;
uint32_t index, owner_module, sink, client;
+ bool scaleEnabled;
void updateInfo(const SinkInputInfo &i);
diff --git a/src/SinkWindow.cc b/src/SinkWindow.cc
index e551f53..bcf1681 100644
--- a/src/SinkWindow.cc
+++ b/src/SinkWindow.cc
@@ -21,7 +21,8 @@ SinkWindow::SinkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
volumeResetButton(NULL),
volumeMuteButton(NULL),
volumeMeterButton(NULL),
- volumeScale(NULL) {
+ volumeScale(NULL),
+ scaleEnabled(true) {
refGlade->get_widget("nameLabel", nameLabel);
refGlade->get_widget("descriptionLabel", descriptionLabel);
@@ -76,7 +77,9 @@ void SinkWindow::updateInfo(const SinkInfo &i) {
percent = pa_volume_to_user(i.volume) * 100;
db = pa_volume_to_dB(i.volume);
+ scaleEnabled = false;
volumeScale->set_value(percent);
+ scaleEnabled = true;
if (db != PA_DECIBEL_MININFTY)
snprintf(t, sizeof(t), "%0.0f%% (%0.2fdB)", percent, db);
else
@@ -107,7 +110,8 @@ void SinkWindow::onToOwnerModuleButton() {
}
void SinkWindow::onVolumeScaleValueChanged() {
- serverInfoManager->setSinkVolume(index, pa_volume_from_user(volumeScale->get_value()/100));
+ if (scaleEnabled)
+ serverInfoManager->setSinkVolume(index, pa_volume_from_user(volumeScale->get_value()/100));
}
void SinkWindow::onVolumeResetButton() {
diff --git a/src/SinkWindow.hh b/src/SinkWindow.hh
index bc88e30..d75e505 100644
--- a/src/SinkWindow.hh
+++ b/src/SinkWindow.hh
@@ -33,6 +33,7 @@ public:
uint32_t index, owner_module, monitor_source;
Glib::ustring monitor_source_name;
+ bool scaleEnabled;
void updateInfo(const SinkInfo &i);
diff --git a/src/paman.glade b/src/paman.glade
index 881884f..7c8ed5b 100644
--- a/src/paman.glade
+++ b/src/paman.glade
@@ -3323,7 +3323,7 @@
</child>
<child>
- <widget class="GtkLabel" id="protocolLabel">
+ <widget class="GtkLabel" id="typeidLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">foo</property>
<property name="use_underline">False</property>
@@ -3373,7 +3373,7 @@
<child>
<widget class="GtkLabel" id="label4740">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Protocol:&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Type ID:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>