/** * @RDE_HEADER@ * SetVideoProfil * $Id$ * $HeadURL$ * $Author$ * Created by Astrid Mueller, SGAS, 2017-11-30 */ #include "set_video_profile.h" #include "iava_comm.h" #include "iava_command_done_observer.h" #include "av_helper.h" namespace AudioVideoManagement { namespace AvaCommands { SetVideoProfile::SetVideoProfile(IAvaComm *comm, IAvaCommandDoneObserver *observer, const QString &dialogId, const QString &menuDef) : m_dialogId(dialogId) , m_menuDef(menuDef) , m_comm(comm) , m_observer(observer) { Q_ASSERT(comm); Q_ASSERT(observer); } void SetVideoProfile::send() { connect(m_comm, &IAvaComm::ok, this, &SetVideoProfile::onOk); connect(m_comm, &IAvaComm::invalidNameListBeginReceived, this, &SetVideoProfile::onInvalidNameListBeginReceived); connect(m_comm, &IAvaComm::listValueReceived, this, &SetVideoProfile::onListValueReceived); connect(m_comm, &IAvaComm::endOfListReceived, this, &SetVideoProfile::onEndOfListReceived); m_comm->setVideoProfile(m_dialogId, m_menuDef); } void SetVideoProfile::onOk() { Q_ASSERT(!m_ok); Q_ASSERT(!m_withinList); m_ok = true; } void SetVideoProfile::onInvalidNameListBeginReceived() { Q_ASSERT(m_ok); Q_ASSERT(!m_withinList); m_withinList = true; } void SetVideoProfile::onListValueReceived(const QVector &parts) { if (!m_withinList) return; Q_ASSERT(parts.size() == 1); m_invalidNameList.push_back(QString::fromUtf8(parts.at(0))); } void SetVideoProfile::onEndOfListReceived() { if (!m_withinList) return; m_withinList = false; done(); } void SetVideoProfile::done() { m_comm->disconnect(this); m_observer->done(this); } } // namespace AvaCommands } // namespace AudioVideoManagement