#ifndef _SLX_OUTPUT_H_ #define _SLX_OUTPUT_H_ #include #include #include "ui_slxoutput.h" class SlxOutput : public QWidget, public Ui::SlxOutput { Q_OBJECT public: enum ItemType { UnknownItem, SinkPortItem, SourcePortItem, CardProfileItem, }; SlxOutput(ItemType type, const QString &id, const QString &card, const QString &profile, const QString &sink, const QString &port, const QString &heading, const QString &title); virtual ~SlxOutput(); void updateDeviceAndPort(bool isDefault, bool isMuted, int volume); void updateCardAndProfile(); const QString &deviceId() const { return _deviceId; } bool isDevice() const { return !_deviceId.isEmpty(); } ItemType type() const { return _type; } int compareTo(SlxOutput* other) const { int c = this->nameLabel->text().compare(other->nameLabel->text()); if (c != 0) return c; return this->headingLabel->text().compare(other->headingLabel->text()); } bool unused; private: ItemType _type; QString _id; QString _cardId; QString _profileId; QString _deviceId; QString _portId; QTimer _volumeTimer; private slots: void volumeSliderChanged(int value); }; #endif