2009-03-16 16:59:15 +00:00
|
|
|
/***
|
|
|
|
This file is part of pavucontrol.
|
|
|
|
|
|
|
|
Copyright 2006-2008 Lennart Poettering
|
|
|
|
Copyright 2009 Colin Guthrie
|
|
|
|
|
|
|
|
pavucontrol is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
pavucontrol is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with pavucontrol. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
|
|
|
#ifndef devicewidget_h
|
|
|
|
#define devicewidget_h
|
|
|
|
|
|
|
|
#include "pavucontrol.h"
|
|
|
|
|
|
|
|
#include "minimalstreamwidget.h"
|
|
|
|
|
2009-06-28 14:57:59 +00:00
|
|
|
class MainWindow;
|
2009-03-16 16:59:15 +00:00
|
|
|
class ChannelWidget;
|
|
|
|
|
|
|
|
class DeviceWidget : public MinimalStreamWidget {
|
|
|
|
public:
|
2011-03-03 14:31:14 +00:00
|
|
|
DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
|
2009-06-28 14:57:59 +00:00
|
|
|
void init(MainWindow* mainWindow, Glib::ustring);
|
2009-03-16 16:59:15 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2009-06-28 14:57:59 +00:00
|
|
|
Glib::ustring name;
|
|
|
|
Glib::ustring description;
|
|
|
|
|
2009-03-16 23:18:40 +00:00
|
|
|
Gtk::ToggleButton *lockToggleButton, *muteToggleButton, *defaultToggleButton;
|
2009-03-16 16:59:15 +00:00
|
|
|
|
|
|
|
pa_channel_map channelMap;
|
|
|
|
pa_cvolume volume;
|
|
|
|
|
|
|
|
ChannelWidget *channelWidgets[PA_CHANNELS_MAX];
|
|
|
|
|
|
|
|
virtual void onMuteToggleButton();
|
2009-03-16 23:18:40 +00:00
|
|
|
virtual void onDefaultToggleButton();
|
2009-06-17 21:44:02 +00:00
|
|
|
virtual void setDefault(bool isDefault);
|
2009-06-28 14:57:59 +00:00
|
|
|
virtual bool onContextTriggerEvent(GdkEventButton*);
|
2009-03-16 16:59:15 +00:00
|
|
|
|
|
|
|
sigc::connection timeoutConnection;
|
|
|
|
|
|
|
|
bool timeoutEvent();
|
|
|
|
|
|
|
|
virtual void executeVolumeUpdate();
|
2009-03-22 16:38:57 +00:00
|
|
|
virtual void setBaseVolume(pa_volume_t v);
|
2009-06-27 17:14:05 +00:00
|
|
|
|
|
|
|
std::vector< std::pair<Glib::ustring,Glib::ustring> > ports;
|
|
|
|
Glib::ustring activePort;
|
|
|
|
|
|
|
|
void prepareMenu();
|
|
|
|
|
2009-06-28 14:57:59 +00:00
|
|
|
void renamePopup();
|
|
|
|
|
2009-06-27 17:14:05 +00:00
|
|
|
protected:
|
2009-06-28 14:57:59 +00:00
|
|
|
MainWindow *mpMainWindow;
|
|
|
|
|
2009-06-27 17:14:05 +00:00
|
|
|
virtual void onPortChange() = 0;
|
|
|
|
|
2009-06-28 14:57:59 +00:00
|
|
|
Gtk::Menu contextMenu;
|
|
|
|
Gtk::MenuItem rename;
|
|
|
|
|
|
|
|
|
2009-06-27 17:14:05 +00:00
|
|
|
/* 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;
|
2009-06-28 14:57:59 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Glib::ustring mDeviceType;
|
|
|
|
|
2009-03-16 16:59:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|