universes have provenances or metadata, not sources
This commit is contained in:
parent
9b4f698b9a
commit
c808341eff
|
@ -116,7 +116,7 @@ void MergeProxyUniverse::deleteSourceUniverse(const Provenance& src)
|
|||
*/
|
||||
void MergeProxyUniverse::addSourceUniverse(Universe* universe)
|
||||
{
|
||||
sources_.at(*universe->source()) = universe;
|
||||
sources_.at(*universe->provenance()) = universe;
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,7 +130,7 @@ void MergeProxyUniverse::dataChangedNotifier(DMX::Universe* dmx)
|
|||
auto universe = dominant_();
|
||||
if (!universe)
|
||||
return;
|
||||
if (sacn->source() == universe->source())
|
||||
if (sacn->provenance() == universe->provenance())
|
||||
for (const auto &cb : callbacks_)
|
||||
cb(this);
|
||||
}
|
||||
|
@ -150,15 +150,15 @@ bool MergeProxyUniverse::isSyncronized() const
|
|||
|
||||
|
||||
/**
|
||||
* @brief MergeProxyUniverse::source
|
||||
* @brief MergeProxyUniverse::provenance
|
||||
* @return
|
||||
*/
|
||||
std::shared_ptr<Provenance> MergeProxyUniverse::source() const
|
||||
std::shared_ptr<Provenance> MergeProxyUniverse::provenance() const
|
||||
{
|
||||
auto universe = dominant_();
|
||||
if (!universe)
|
||||
return nullptr;
|
||||
return universe->source();
|
||||
return universe->provenance();
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,7 +238,7 @@ Universe* MergeProxyUniverse::dominant_() const
|
|||
{
|
||||
if (uni->rxRate() < (DMX::E111_DATA_LOSS_TIMEOUT / 1000.0))
|
||||
continue; // stale universes cannot be dominant
|
||||
if (!ret || uni->source()->priority > ret->source()->priority)
|
||||
if (!ret || uni->provenance()->priority > ret->provenance()->priority)
|
||||
ret = uni;
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -56,10 +56,10 @@ public:
|
|||
void dataChangedNotifier(DMX::Universe* universe);
|
||||
|
||||
// SACN::Universe overrides:
|
||||
bool isSyncronized() const override;
|
||||
std::shared_ptr<Provenance> source() const override;
|
||||
void set(std::shared_ptr<ACN::DMP::Pdu>, std::shared_ptr<Provenance>) override;
|
||||
std::shared_ptr<Provenance> provenance() const override;
|
||||
void setProvenance(std::shared_ptr<Provenance>) override {};
|
||||
bool isSyncronized() const override;
|
||||
void synchronize() override;
|
||||
|
||||
// DMX::Universe Overrides:
|
||||
|
|
|
@ -63,14 +63,14 @@ void Source::terminate(const uint16_t num)
|
|||
if (!universes_.count(num))
|
||||
return;
|
||||
|
||||
auto source = universes_[num]->source();
|
||||
auto metadata = universes_[num]->provenance();
|
||||
auto options = DATA::data_options();
|
||||
|
||||
options.force_synchronization = source->options.force_synchronization;
|
||||
options.preview_data = source->options.preview_data;
|
||||
options.force_synchronization = metadata->options.force_synchronization;
|
||||
options.preview_data = metadata->options.preview_data;
|
||||
options.stream_terminated = true;
|
||||
|
||||
source->options = options;
|
||||
metadata->options = options;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ bool Universe::isSyncronized() const
|
|||
* @brief Universe::source
|
||||
* @return
|
||||
*/
|
||||
std::shared_ptr<Provenance> Universe::source() const
|
||||
std::shared_ptr<Provenance> Universe::provenance() const
|
||||
{
|
||||
return provenance_;
|
||||
}
|
||||
|
|
|
@ -46,12 +46,12 @@ public:
|
|||
Universe();
|
||||
~Universe();
|
||||
|
||||
virtual bool isSyncronized() const;;
|
||||
virtual std::shared_ptr<Provenance> source() const;
|
||||
|
||||
virtual void set(ACN::PDU::Message<ACN::DMP::Pdu>, std::shared_ptr<Provenance>);
|
||||
|
||||
virtual std::shared_ptr<Provenance> provenance() const;
|
||||
virtual void setProvenance(std::shared_ptr<Provenance>);
|
||||
|
||||
virtual bool isSyncronized() const;
|
||||
virtual void synchronize();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -124,14 +124,14 @@ TEST_F(sACNdataTest, stream_in) {
|
|||
|
||||
EXPECT_DOUBLE_EQ(universe->rxRate(), 1.2) << "rate calucation mismatch";
|
||||
|
||||
auto source = universe->source();
|
||||
ASSERT_TRUE(source) << "stream failure";
|
||||
auto metadata = universe->provenance();
|
||||
ASSERT_TRUE(metadata) << "stream failure";
|
||||
|
||||
EXPECT_EQ(source->cid, cid) << "UUID mismatch";
|
||||
EXPECT_EQ(source->source_name, desc) << "Source Description mismatch";
|
||||
EXPECT_EQ(source->universe, univ) << "universe number mismatch";
|
||||
EXPECT_EQ(source->priority, priority) << "priority mismatch";
|
||||
EXPECT_EQ(source->sync_address, 0) << "sync address mismatch";
|
||||
EXPECT_EQ(metadata->cid, cid) << "UUID mismatch";
|
||||
EXPECT_EQ(metadata->source_name, desc) << "Source Description mismatch";
|
||||
EXPECT_EQ(metadata->universe, univ) << "universe number mismatch";
|
||||
EXPECT_EQ(metadata->priority, priority) << "priority mismatch";
|
||||
EXPECT_EQ(metadata->sync_address, 0) << "sync address mismatch";
|
||||
EXPECT_EQ(universe->slot(512), (univ & 0xff)) << "slot 512 data mismatch";
|
||||
|
||||
node.unsubscribe(univ);
|
||||
|
|
Loading…
Reference in New Issue