diff options
Diffstat (limited to 'src/slxoutput.h')
-rw-r--r-- | src/slxoutput.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/slxoutput.h b/src/slxoutput.h index 15f8554..c175899 100644 --- a/src/slxoutput.h +++ b/src/slxoutput.h @@ -10,20 +10,43 @@ class SlxOutput : public QWidget, public Ui::SlxOutput { Q_OBJECT public: - SlxOutput(QWidget *parent, const QString &id); + + 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 updateOutput(const QString &name, bool isDefault, bool isMuted, int volume, const QString &card, const QString &sink, const QString &port); - const QString &sink() const { return _sink; } - const bool isSink() const { return !_sink.isEmpty(); } + void updateDeviceAndPort(bool isDefault, bool isMuted, int volume); + void updateCardAndProfile(); + + const QString &deviceId() const { return _deviceId; } + const bool isDevice() const { return !_deviceId.isEmpty(); } + + 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 _card; - QString _sink; - QString _port; + QString _cardId; + QString _profileId; + QString _deviceId; + QString _portId; QTimer _volumeTimer; private slots: |