diff options
author | Colin Guthrie <cguthrie@mandriva.org> | 2009-06-27 18:14:05 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-06-27 18:14:05 +0100 |
commit | 159609135f34c2791eee7f2d6576e50fff80fa6a (patch) | |
tree | 97e19ae990125a289394a04e88d0e668524b6713 /src/devicewidget.h | |
parent | 7b3083df574d15941449ae8532fef472aedc1ae6 (diff) |
Add support for changing ports.
This commit adds a combo box for selecting ports.
Overall this implementation could have taken two paths:
* Implement port selection as combo box.
* Implement port selection as a button.
I went for the first option as is done in selecting card profiles over the
second method used for selecting devices for streams. This seems more like
how a config option should be presented as opposed to a runtime type thing.
Diffstat (limited to 'src/devicewidget.h')
-rw-r--r-- | src/devicewidget.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/devicewidget.h b/src/devicewidget.h index d092a49..e4ba4af 100644 --- a/src/devicewidget.h +++ b/src/devicewidget.h @@ -53,6 +53,32 @@ public: virtual void executeVolumeUpdate(); virtual void setBaseVolume(pa_volume_t v); virtual void setSteps(unsigned n); + + std::vector< std::pair<Glib::ustring,Glib::ustring> > ports; + Glib::ustring activePort; + + void prepareMenu(); + +protected: + virtual void onPortChange() = 0; + + /* Tree model columns */ + class ModelColumns : public Gtk::TreeModel::ColumnRecord + { + public: + + ModelColumns() + { add(name); add(desc); } + + Gtk::TreeModelColumn<Glib::ustring> name; + Gtk::TreeModelColumn<Glib::ustring> desc; + }; + + ModelColumns portModel; + + Gtk::HBox *portSelect; + Gtk::ComboBox *portList; + Glib::RefPtr<Gtk::ListStore> treeModel; }; #endif |