Allow feed labels in config

This commit is contained in:
Johanness
2026-05-24 21:28:11 +03:00
parent 58f9f7edaf
commit 102b1fb95f
5 changed files with 40 additions and 5 deletions
+19 -3
View File
@@ -464,6 +464,7 @@ static ImU32 tileLabelColor(
static void drawTileLabels(
const std::vector<std::unique_ptr<IVideoFeed>>& feeds,
const std::vector<FeedConfig>& feedConfigs,
uint32_t gridCols,
uint32_t gridRows)
{
@@ -492,12 +493,20 @@ static void drawTileLabels(
feeds[i]->status();
const std::string sourceInfo =
feeds[i]->sourceInfo();
const std::string labelOverride =
i < feedConfigs.size()
? feedConfigs[i].label
: "";
const std::string labelText =
!labelOverride.empty()
? labelOverride
: sourceInfo.empty()
? feedRuntimeStatusDisplayName(status)
: sourceInfo;
const std::string label =
std::to_string(i + 1) +
": " +
(sourceInfo.empty()
? feedRuntimeStatusDisplayName(status)
: sourceInfo);
labelText;
const ImVec2 labelMin(
tileRect.x0,
@@ -716,6 +725,12 @@ int main(int argc, char* argv[])
<< " flowId=" << config.feeds[i].mxlFlowId;
}
if (!config.feeds[i].label.empty())
{
std::cout
<< " label=\"" << config.feeds[i].label << "\"";
}
std::cout << std::endl;
feeds[i] = createFeed(
@@ -1809,6 +1824,7 @@ int main(int argc, char* argv[])
drawTileLabels(
feeds,
config.feeds,
config.gridCols,
config.gridRows
);