+ // Add a submenu for choosing the output resolution. Since this is
+ // card-dependent, it is disabled if we haven't chosen a card
+ // (but it's still there so that the user will know it exists).
+ QMenu resolution_submenu;
+ QActionGroup resolution_group(&resolution_submenu);
+ if (current_card == -1) {
+ resolution_submenu.setEnabled(false);
+ } else {
+ uint32_t current_mode = global_mixer->get_output_video_mode();
+ map<uint32_t, bmusb::VideoMode> video_modes = global_mixer->get_available_output_video_modes();
+ for (const auto &mode : video_modes) {
+ QString description(QString::fromStdString(mode.second.name));
+ QAction *action = new QAction(description, &resolution_group);
+ action->setCheckable(true);
+ if (current_mode == mode.first) {
+ action->setChecked(true);
+ }
+ action->setData(QList<QVariant>{"video_mode", mode.first});
+ resolution_submenu.addAction(action);
+ }
+ }
+
+ resolution_submenu.setTitle("HDMI/SDI output resolution");
+ menu.addMenu(&resolution_submenu);
+