Migrates AudioVideoManagement to generated rtiddsgen API
Converts accessor calls to plain member access across avm service and plugin.
This commit is contained in:
29 files changed
+308
-295
No files matched your search
@@ -43,18 +43,18 @@ QString toMenuDef(const AudioVideoManagement::AvMenuEntry &menuEntry,
|
||||
// no prefix2
|
||||
}
|
||||
|
||||
if (!menuEntry.isGroup())
|
||||
return QStringLiteral("%1{%2}").arg(prefix1, QString::fromStdString(menuEntry.name().get()));
|
||||
if (!menuEntry.isGroup)
|
||||
return QStringLiteral("%1{%2}").arg(prefix1, QString::fromStdString(menuEntry.name.get()));
|
||||
|
||||
QString def = QStringLiteral("%1{%2:").arg(prefix1, QString::fromStdString(menuEntry.name().get()));
|
||||
QString def = QStringLiteral("%1{%2:").arg(prefix1, QString::fromStdString(menuEntry.name.get()));
|
||||
|
||||
for (const auto &entry : meCont)
|
||||
{
|
||||
bool isChildEntry = entry.parentId() == menuEntry.id();
|
||||
bool isChildEntry = entry.parentId == menuEntry.id;
|
||||
if (!isChildEntry)
|
||||
continue;
|
||||
Q_ASSERT(!entry.isGroup());
|
||||
def += QStringLiteral(" %1{%2}").arg(prefix2, QString::fromStdString(entry.name().get()));
|
||||
Q_ASSERT(!entry.isGroup);
|
||||
def += QStringLiteral(" %1{%2}").arg(prefix2, QString::fromStdString(entry.name.get()));
|
||||
}
|
||||
def += QLatin1Char('}');
|
||||
return def;
|
||||
@@ -65,12 +65,12 @@ QString toMenuDef(const AudioVideoManagement::MenuStruct &menuStruct)
|
||||
// Hint: MenuStruct-entries are sorted already (done by the Service (HandlerMenuStruct)).
|
||||
|
||||
QStringList entries;
|
||||
entries.reserve(menuStruct.menuEntries().size()); // probably more than needed, but avoid clazy warning
|
||||
for (const auto &entry : menuStruct.menuEntries())
|
||||
entries.reserve(menuStruct.menuEntries.size()); // probably more than needed, but avoid clazy warning
|
||||
for (const auto &entry : menuStruct.menuEntries)
|
||||
{
|
||||
bool isToplevelEntry = entry.parentId() == menuStruct.id();
|
||||
bool isToplevelEntry = entry.parentId == menuStruct.id;
|
||||
if (isToplevelEntry)
|
||||
entries.append(toMenuDef(entry, menuStruct.menuEntries(), menuStruct.isAudio()));
|
||||
entries.append(toMenuDef(entry, menuStruct.menuEntries, menuStruct.isAudio));
|
||||
}
|
||||
return entries.join(QLatin1Char(' '));
|
||||
}
|
||||
@@ -83,13 +83,13 @@ void selectAtFirstPos(const AudioVideoManagement::MenuStruct &menu, QStringList
|
||||
{
|
||||
using AudioVideoManagement::AvMenuEntry;
|
||||
|
||||
auto withMountingPointId = [mountingPointId] (const AvMenuEntry &entry) { return entry.mountingPointId() && entry.mountingPointId().get() == mountingPointId; };
|
||||
auto found = std::find_if(menu.menuEntries().begin(), menu.menuEntries().end(), withMountingPointId);
|
||||
auto withMountingPointId = [mountingPointId] (const AvMenuEntry &entry) { return entry.mountingPointId && entry.mountingPointId.get() == mountingPointId; };
|
||||
auto found = std::find_if(menu.menuEntries.begin(), menu.menuEntries.end(), withMountingPointId);
|
||||
|
||||
if (found == menu.menuEntries().end())
|
||||
if (found == menu.menuEntries.end())
|
||||
return;
|
||||
|
||||
QString streamName = QString::fromStdString(found->name().get());
|
||||
QString streamName = QString::fromStdString(found->name.get());
|
||||
|
||||
auto currentPosInSelection = std::find(selection.begin(), selection.end(), streamName);
|
||||
if (currentPosInSelection == selection.begin())
|
||||
@@ -170,7 +170,7 @@ void AvsMenus::onSessionEstablished()
|
||||
|
||||
void AvsMenus::onMenuStructChanged(const MenuStruct &menu, DataModification modType)
|
||||
{
|
||||
if (menu.isAudio())
|
||||
if (menu.isAudio)
|
||||
m_announcementMenu.onChanged(menu, modType);
|
||||
else
|
||||
m_videoMenu.onChanged(menu, modType);
|
||||
@@ -188,13 +188,13 @@ void AvsMenus::sendAnnouncementMenu(const MenuStruct &menu, const boost::optiona
|
||||
stateList.reserve(6);
|
||||
|
||||
int i = 0;
|
||||
for (const auto &audioEntry : menu.menuEntries())
|
||||
for (const auto &audioEntry : menu.menuEntries)
|
||||
{
|
||||
bool isToplevel = audioEntry.parentId() == menu.id();
|
||||
bool isToplevel = audioEntry.parentId == menu.id;
|
||||
if (!isToplevel)
|
||||
break; // only select toplevel entries. Hint: menuEntries are ordered so that all toplevel entries are at the front.
|
||||
|
||||
selection.append(QString::fromStdString(audioEntry.name().get()));
|
||||
selection.append(QString::fromStdString(audioEntry.name.get()));
|
||||
int zustand = 1; // wird derzeit nicht gespeichert, also per default auf 1
|
||||
stateList += QString::number(zustand);
|
||||
++i;
|
||||
@@ -247,10 +247,10 @@ void AvsMenus::Menu::setMenu(int menuId)
|
||||
{
|
||||
Q_ASSERT(menuId > 0);
|
||||
MenuStruct menu = m_dtc->menuStruct(menuId);
|
||||
if (menu.id() != menuId)
|
||||
if (menu.id != menuId)
|
||||
return;
|
||||
|
||||
Q_ASSERT(menu.isAudio() == m_isAudio);
|
||||
Q_ASSERT(menu.isAudio == m_isAudio);
|
||||
//replace mvs streams
|
||||
|
||||
replaceMvsEntries(menu);
|
||||
@@ -260,14 +260,14 @@ void AvsMenus::Menu::setMenu(int menuId)
|
||||
void AvsMenus::Menu::replaceMvsEntries(MenuStruct &menu) const
|
||||
{
|
||||
std::vector<AvMenuEntry> newMenu;
|
||||
newMenu.reserve(menu.menuEntries().size());
|
||||
for (auto menuEntry : menu.menuEntries())
|
||||
newMenu.reserve(menu.menuEntries.size());
|
||||
for (auto menuEntry : menu.menuEntries)
|
||||
{
|
||||
if (menuEntry.mountingPointId().is_set() && menuEntry.mountingPointId().get() < 0)
|
||||
menuEntry.name() = m_dtc->videoTeam(menuEntry.mountingPointId().get()*-1).streamName();
|
||||
if (menuEntry.mountingPointId.is_set() && menuEntry.mountingPointId.get() < 0)
|
||||
menuEntry.name = m_dtc->videoTeam(menuEntry.mountingPointId.get()*-1).streamName;
|
||||
newMenu.push_back(std::move(menuEntry));
|
||||
}
|
||||
std::swap(menu.menuEntries(), newMenu);
|
||||
std::swap(menu.menuEntries, newMenu);
|
||||
}
|
||||
|
||||
void AvsMenus::Menu::setAnnouncementUnit(int mountingPointId)
|
||||
@@ -278,10 +278,10 @@ void AvsMenus::Menu::setAnnouncementUnit(int mountingPointId)
|
||||
return;
|
||||
|
||||
const MenuStruct menu = m_dtc->menuStruct(*m_defaultMenu);
|
||||
if (menu.id() != *m_defaultMenu)
|
||||
if (menu.id != *m_defaultMenu)
|
||||
return;
|
||||
|
||||
Q_ASSERT(menu.isAudio() == m_isAudio);
|
||||
Q_ASSERT(menu.isAudio == m_isAudio);
|
||||
|
||||
setMenu(menu, mountingPointId);
|
||||
}
|
||||
@@ -317,10 +317,10 @@ void AvsMenus::Menu::onSessionEstablished()
|
||||
|
||||
void AvsMenus::Menu::onMenuAdded(MenuStruct menu)
|
||||
{
|
||||
if (!menu.isDefault())
|
||||
if (!menu.isDefault)
|
||||
return;
|
||||
|
||||
m_defaultMenu = menu.id();
|
||||
m_defaultMenu = menu.id;
|
||||
|
||||
if (!m_currentMenu)
|
||||
{
|
||||
@@ -331,7 +331,7 @@ void AvsMenus::Menu::onMenuAdded(MenuStruct menu)
|
||||
|
||||
void AvsMenus::Menu::onMenuChanged(MenuStruct menu)
|
||||
{
|
||||
if (m_currentMenu == menu.id())
|
||||
if (m_currentMenu == menu.id)
|
||||
{
|
||||
replaceMvsEntries(menu);
|
||||
setMenu(menu);
|
||||
@@ -340,7 +340,7 @@ void AvsMenus::Menu::onMenuChanged(MenuStruct menu)
|
||||
|
||||
void AvsMenus::Menu::onMenuRemoved(const MenuStruct &menu)
|
||||
{
|
||||
if (m_currentMenu != menu.id())
|
||||
if (m_currentMenu != menu.id)
|
||||
return;
|
||||
|
||||
m_currentMenu.reset();
|
||||
@@ -349,9 +349,9 @@ void AvsMenus::Menu::onMenuRemoved(const MenuStruct &menu)
|
||||
|
||||
void AvsMenus::Menu::setMenu(const MenuStruct &menu, const boost::optional<int> &mountingPointIdOfSelectedStream)
|
||||
{
|
||||
Q_ASSERT(menu.id() > 0);
|
||||
Q_ASSERT(menu.id > 0);
|
||||
Q_ASSERT(m_ismDtc);
|
||||
m_currentMenu = menu.id();
|
||||
m_currentMenu = menu.id;
|
||||
|
||||
/*
|
||||
const auto &mountedAssets = m_ismDtc->mountingPointAssets();
|
||||
@@ -360,17 +360,17 @@ void AvsMenus::Menu::setMenu(const MenuStruct &menu, const boost::optional<int>
|
||||
std::vector<AudioVideoManagement::AvMenuEntry> menuEntriesToUse;
|
||||
for (const auto &entry : realMenu.menuEntries())
|
||||
{
|
||||
if (!entry.isGroup() && !entry.mountingPointId().is_set() )
|
||||
if (!entry.isGroup() && !entry.mountingPointId.is_set() )
|
||||
continue;
|
||||
|
||||
bool isMounted = false;
|
||||
|
||||
if(!entry.isGroup() && entry.mountingPointId().is_set())
|
||||
if(!entry.isGroup() && entry.mountingPointId.is_set())
|
||||
{
|
||||
|
||||
for (const auto &mountedAsset : mountedAssets)
|
||||
{
|
||||
if (mountedAsset.structureElementId() == entry.mountingPointId().get())
|
||||
if (mountedAsset.structureElementId() == entry.mountingPointId.get())
|
||||
{
|
||||
isMounted = true;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user