- // Add a submenu for selecting video input, with an action for each input.
- QMenu video_input_submenu;
- QActionGroup video_input_group(&video_input_submenu);
- std::map<uint32_t, string> video_inputs = global_mixer->get_available_video_inputs(current_card);
- uint32_t current_video_input = global_mixer->get_current_video_input(current_card);
- for (const auto &mode : video_inputs) {
- QString description(QString::fromStdString(mode.second));
- QAction *action = new QAction(description, &video_input_group);
- action->setCheckable(true);
- if (mode.first == current_video_input) {
- action->setChecked(true);
+ bool has_auto_mode = false;
+ QAction *change_url_action = nullptr;
+ if (is_ffmpeg) {
+ // Add a menu to change the source URL if we're an FFmpeg card.
+ // (The theme can still override.)
+ if (global_mixer->card_is_ffmpeg(current_card)) {
+ change_url_action = new QAction("Change source filename/URL…", &menu);
+ menu.addAction(change_url_action);
+ }
+ } else {
+ // Add a submenu for selecting video input, with an action for each input.
+ std::map<uint32_t, string> video_inputs = global_mixer->get_available_video_inputs(current_card);
+ uint32_t current_video_input = global_mixer->get_current_video_input(current_card);
+ for (const auto &mode : video_inputs) {
+ QString description(QString::fromStdString(mode.second));
+ QAction *action = new QAction(description, &video_input_group);
+ action->setCheckable(true);
+ if (mode.first == current_video_input) {
+ action->setChecked(true);
+ }
+ action->setData(QList<QVariant>{"video_input", mode.first});
+ video_input_submenu.addAction(action);