emit changed signal with every change
This commit is contained in:
parent
a699210d77
commit
4f7d77c803
|
@ -9,8 +9,9 @@ QSacnUniverse::QSacnUniverse(QObject *parent, sACN::Universe *universe)
|
|||
: QObject(parent)
|
||||
, universe_(universe)
|
||||
{
|
||||
universe_->onData(std::bind(&QSacnUniverse::dataChangedNotifier,
|
||||
this, std::placeholders::_1));
|
||||
universe_->onData([this](DMX::Universe*) {
|
||||
emit changed();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
@ -101,6 +102,7 @@ uint16_t QSacnUniverse::activeSlots() const
|
|||
void QSacnUniverse::setDescription(std::string desc)
|
||||
{
|
||||
universe_->provenance()->source_name = desc;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,6 +113,7 @@ void QSacnUniverse::setDescription(std::string desc)
|
|||
void QSacnUniverse::setOptions(sACN::DATA::data_options o)
|
||||
{
|
||||
universe_->provenance()->options = o;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,6 +124,7 @@ void QSacnUniverse::setOptions(sACN::DATA::data_options o)
|
|||
void QSacnUniverse::setPriority(uint8_t p)
|
||||
{
|
||||
universe_->provenance()->priority = p;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -131,6 +135,7 @@ void QSacnUniverse::setPriority(uint8_t p)
|
|||
void QSacnUniverse::setSyncAddress(uint16_t a)
|
||||
{
|
||||
universe_->provenance()->sync_address = a;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,6 +147,7 @@ void QSacnUniverse::setSyncAddress(uint16_t a)
|
|||
void QSacnUniverse::setValue (const uint16_t addr, const uint8_t level)
|
||||
{
|
||||
universe_->sACN::Universe::setValue(addr, level);
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -155,19 +161,5 @@ void QSacnUniverse::setValue (const uint16_t addr, const uint16_t size,
|
|||
const uint8_t* profile)
|
||||
{
|
||||
universe_->sACN::Universe::setValue(addr, size, profile);
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief QSacnUniverse::dataChangedNotifier
|
||||
* @param universe
|
||||
*/
|
||||
void QSacnUniverse::dataChangedNotifier(DMX::Universe* universe)
|
||||
{
|
||||
Q_UNUSED(universe)
|
||||
emit changed(universe_);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,12 +20,11 @@ public:
|
|||
|
||||
const QString description() const;
|
||||
uint16_t number() const;
|
||||
uint8_t priority() const;
|
||||
double rxRate() const;
|
||||
uint8_t slot(const u_int16_t slot) const;
|
||||
|
||||
bool isEditable() const;
|
||||
uint8_t priority() const;
|
||||
double rxRate() const;
|
||||
uint8_t slot(const u_int16_t) const;
|
||||
uint16_t activeSlots() const;
|
||||
bool isEditable() const;
|
||||
|
||||
public slots:
|
||||
void setDescription(std::string desc);
|
||||
|
@ -37,10 +36,7 @@ public slots:
|
|||
const uint8_t* profile);
|
||||
|
||||
signals:
|
||||
void changed(sACN::Universe*);
|
||||
|
||||
protected:
|
||||
void dataChangedNotifier(DMX::Universe* universe = nullptr);
|
||||
void changed();
|
||||
|
||||
private:
|
||||
sACN::Universe *universe_;
|
||||
|
|
Loading…
Reference in New Issue