summaryrefslogtreecommitdiffstats
path: root/src/devicewidget.h
diff options
context:
space:
mode:
authorColin Guthrie <cguthrie@mandriva.org>2009-06-28 15:57:59 +0100
committerColin Guthrie <cguthrie@mandriva.org>2009-10-15 13:03:16 +0100
commit375c2c2d6207763ff3ac8d7fb289b2b5ea1f8d54 (patch)
treee0ad7ddb2959da06a3de3501efed019d1c0e3a51 /src/devicewidget.h
parent400c69acf4b550d8ad2e7ad2f4e6232dfc19bb3d (diff)
Add support for the device-manager module.
Currently this module only really allows for devices to be renamed, so we add a new dialog that can be activated by right clicking on devices (i.e. sinks/sources). This dialog allows you to enter a new name which will be set via the extension provided by the device-manager module. Future work will allow you to manage (i.e. rename, delete etc) offline devices too.
Diffstat (limited to 'src/devicewidget.h')
-rw-r--r--src/devicewidget.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/devicewidget.h b/src/devicewidget.h
index e4ba4af..3170f04 100644
--- a/src/devicewidget.h
+++ b/src/devicewidget.h
@@ -25,16 +25,21 @@
#include "minimalstreamwidget.h"
+class MainWindow;
class ChannelWidget;
class DeviceWidget : public MinimalStreamWidget {
public:
DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& x);
+ void init(MainWindow* mainWindow, Glib::ustring);
void setChannelMap(const pa_channel_map &m, bool can_decibel);
void setVolume(const pa_cvolume &volume, bool force = false);
virtual void updateChannelVolume(int channel, pa_volume_t v);
+ Glib::ustring name;
+ Glib::ustring description;
+
Gtk::ToggleButton *lockToggleButton, *muteToggleButton, *defaultToggleButton;
pa_channel_map channelMap;
@@ -45,6 +50,7 @@ public:
virtual void onMuteToggleButton();
virtual void onDefaultToggleButton();
virtual void setDefault(bool isDefault);
+ virtual bool onContextTriggerEvent(GdkEventButton*);
sigc::connection timeoutConnection;
@@ -59,9 +65,17 @@ public:
void prepareMenu();
+ void renamePopup();
+
protected:
+ MainWindow *mpMainWindow;
+
virtual void onPortChange() = 0;
+ Gtk::Menu contextMenu;
+ Gtk::MenuItem rename;
+
+
/* Tree model columns */
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
@@ -79,6 +93,10 @@ protected:
Gtk::HBox *portSelect;
Gtk::ComboBox *portList;
Glib::RefPtr<Gtk::ListStore> treeModel;
+
+private:
+ Glib::ustring mDeviceType;
+
};
#endif