summaryrefslogtreecommitdiffstats
path: root/src/pavucontrol.cc
diff options
context:
space:
mode:
authorColin Guthrie <cguthrie@mandriva.org>2009-02-28 18:01:07 +0000
committerColin Guthrie <cguthrie@mandriva.org>2009-02-28 18:01:07 +0000
commit1f1c8c85762910ff0b031aa8ee3eec2a7f74df7d (patch)
tree08039e5d00178b9d2f4ddfb00985d05780bbe3cb /src/pavucontrol.cc
parent3372cd120cdeca82a1f9d89930e9e1fe3323ee21 (diff)
Create a new 'Configuration' tab
Move the card listing into this tab.
Diffstat (limited to 'src/pavucontrol.cc')
-rw-r--r--src/pavucontrol.cc40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index ae0e464..c9c5ae2 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -24,7 +24,6 @@
#include <signal.h>
#include <string.h>
-#include <set>
#include <gtkmm.h>
#include <libglademm.h>
@@ -356,8 +355,8 @@ public:
void removeClient(uint32_t index);
Gtk::Notebook *notebook;
- Gtk::VBox *streamsVBox, *recsVBox, *sinksVBox, *sourcesVBox;
- Gtk::Label *noStreamsLabel, *noRecsLabel, *noSinksLabel, *noSourcesLabel;
+ Gtk::VBox *streamsVBox, *recsVBox, *sinksVBox, *sourcesVBox, *cardsVBox;
+ Gtk::Label *noStreamsLabel, *noRecsLabel, *noSinksLabel, *noSourcesLabel, *noCardsLabel;
Gtk::ComboBox *sinkInputTypeComboBox, *sourceOutputTypeComboBox, *sinkTypeComboBox, *sourceTypeComboBox;
std::map<uint32_t, CardWidget*> cardWidgets;
@@ -1126,10 +1125,12 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
showSourceType(SOURCE_NO_MONITOR),
eventRoleWidget(NULL){
+ x->get_widget("cardsVBox", cardsVBox);
x->get_widget("streamsVBox", streamsVBox);
x->get_widget("recsVBox", recsVBox);
x->get_widget("sinksVBox", sinksVBox);
x->get_widget("sourcesVBox", sourcesVBox);
+ x->get_widget("noCardsLabel", noCardsLabel);
x->get_widget("noStreamsLabel", noStreamsLabel);
x->get_widget("noRecsLabel", noRecsLabel);
x->get_widget("noSinksLabel", noSinksLabel);
@@ -1140,6 +1141,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
x->get_widget("sourceTypeComboBox", sourceTypeComboBox);
x->get_widget("notebook", notebook);
+ cardsVBox->set_reallocate_redraws(true);
sourcesVBox->set_reallocate_redraws(true);
streamsVBox->set_reallocate_redraws(true);
recsVBox->set_reallocate_redraws(true);
@@ -1185,8 +1187,7 @@ void MainWindow::updateCard(const pa_card_info &info) {
w = cardWidgets[info.index];
else {
cardWidgets[info.index] = w = CardWidget::create();
- sinksVBox->pack_start(*w, false, false, 0);
- //sourcesVBox->pack_start(*w, false, false, 0);
+ cardsVBox->pack_start(*w, false, false, 0);
w->index = info.index;
is_new = true;
}
@@ -1198,7 +1199,7 @@ void MainWindow::updateCard(const pa_card_info &info) {
else
w->name = info.name;
- w->boldNameLabel->set_text("Card: ");
+ w->boldNameLabel->set_text("");
gchar *txt;
w->nameLabel->set_markup(txt = g_markup_printf_escaped("%s", w->name.c_str()));
g_free(txt);
@@ -1299,6 +1300,7 @@ void MainWindow::createMonitorStreamForSource(uint32_t source_idx) {
char t[16];
pa_buffer_attr attr;
pa_sample_spec ss;
+ return;
ss.channels = 1;
ss.format = PA_SAMPLE_FLOAT32;
@@ -1331,6 +1333,7 @@ void MainWindow::createMonitorStreamForSinkInput(uint32_t sink_input_idx, uint32
pa_buffer_attr attr;
pa_sample_spec ss;
uint32_t monitor_source_idx;
+ return;
ss.channels = 1;
ss.format = PA_SAMPLE_FLOAT32;
@@ -1704,8 +1707,6 @@ void MainWindow::updateDeviceVisibility() {
void MainWindow::reallyUpdateDeviceVisibility() {
bool is_empty = true;
- std::set<uint32_t> visible_cards;
- std::set<uint32_t>::iterator it_card;
for (std::map<uint32_t, SinkInputWidget*>::iterator i = sinkInputWidgets.begin(); i != sinkInputWidgets.end(); ++i) {
SinkInputWidget* w = i->second;
@@ -1743,7 +1744,6 @@ void MainWindow::reallyUpdateDeviceVisibility() {
noRecsLabel->hide();
is_empty = true;
- visible_cards.clear();
for (std::map<uint32_t, SinkWidget*>::iterator i = sinkWidgets.begin(); i != sinkWidgets.end(); ++i) {
SinkWidget* w = i->second;
@@ -1751,26 +1751,28 @@ void MainWindow::reallyUpdateDeviceVisibility() {
if (showSinkType == SINK_ALL || w->type == showSinkType) {
w->show();
is_empty = false;
- if (w->card_index != PA_INVALID_INDEX)
- visible_cards.insert(w->card_index);
} else
w->hide();
}
+ if (is_empty)
+ noSinksLabel->show();
+ else
+ noSinksLabel->hide();
+
+ is_empty = true;
+
for (std::map<uint32_t, CardWidget*>::iterator i = cardWidgets.begin(); i != cardWidgets.end(); ++i) {
CardWidget* w = i->second;
- if (true || (!visible_cards.count(w->index) && w->hasSinks)) {
- w->show();
- is_empty = false;
- } else
- w->hide();
+ w->show();
+ is_empty = false;
}
if (is_empty)
- noSinksLabel->show();
+ noCardsLabel->show();
else
- noSinksLabel->hide();
+ noCardsLabel->hide();
is_empty = true;
@@ -1801,6 +1803,8 @@ void MainWindow::reallyUpdateDeviceVisibility() {
streamsVBox->show();
recsVBox->hide();
recsVBox->show();
+ cardsVBox->hide();
+ cardsVBox->show();
}
void MainWindow::removeCard(uint32_t index) {