59 lines
1.1 KiB
C++
Executable File
59 lines
1.1 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* GetElokaList
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Fröbel, SLSE, 2017-10-23
|
|
*/
|
|
|
|
#include "get_eloka_list.h"
|
|
#include "iava_comm.h"
|
|
#include "iava_command_done_observer.h"
|
|
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
namespace AvaCommands
|
|
{
|
|
|
|
GetElokaList::GetElokaList(IAvaComm *comm, IAvaCommandDoneObserver *observer, const QString &streamName)
|
|
: m_streamName(streamName)
|
|
, m_collector(comm, [this] (QVector<QString> &&elokaSignals) { onElokaListReceived(std::move(elokaSignals)); })
|
|
, m_comm(comm)
|
|
, m_observer(observer)
|
|
{
|
|
Q_ASSERT(comm);
|
|
Q_ASSERT(observer);
|
|
}
|
|
|
|
void GetElokaList::send()
|
|
{
|
|
connect(m_comm, &IAvaComm::ok, this, &GetElokaList::onOk);
|
|
m_collector.start();
|
|
m_comm->getElokaList(m_streamName);
|
|
}
|
|
|
|
void GetElokaList::onOk()
|
|
{
|
|
Q_ASSERT(!m_ok);
|
|
m_ok = true;
|
|
}
|
|
|
|
void GetElokaList::done()
|
|
{
|
|
m_comm->disconnect(this);
|
|
m_observer->done(this);
|
|
}
|
|
|
|
void GetElokaList::onElokaListReceived(QVector<QString> &&elokaSignals)
|
|
{
|
|
Q_ASSERT(m_ok);
|
|
m_elokaSignals = std::move(elokaSignals);
|
|
done();
|
|
}
|
|
|
|
} // namespace AvaCommands
|
|
} // namespace AudioVideoManagement
|