| 117 | } |
| 118 | |
| 119 | FFmpegSourceProvider::TrackSelection |
| 120 | FFmpegSourceProvider::AskForTrackSelection(const std::map<int, std::string> &TrackList, |
| 121 | FFMS_TrackType Type) { |
| 122 | std::vector<int> TrackNumbers; |
| 123 | wxArrayString Choices; |
| 124 | |
| 125 | for (auto const& track : TrackList) { |
| 126 | Choices.Add(agi::wxformat(_("Track %02d: %s"), track.first, track.second)); |
| 127 | TrackNumbers.push_back(track.first); |
| 128 | } |
| 129 | |
| 130 | int Choice = wxGetSingleChoiceIndex( |
| 131 | Type == FFMS_TYPE_VIDEO ? _("Multiple video tracks detected, please choose the one you wish to load:") : _("Multiple audio tracks detected, please choose the one you wish to load:"), |
| 132 | Type == FFMS_TYPE_VIDEO ? _("Choose video track") : _("Choose audio track"), |
| 133 | Choices); |
| 134 | |
| 135 | if (Choice < 0) |
| 136 | return TrackSelection::None; |
| 137 | return static_cast<TrackSelection>(TrackNumbers[Choice]); |
| 138 | } |
| 139 | |
| 140 | /// @brief Set ffms2 log level according to setting in config.dat |
| 141 | void FFmpegSourceProvider::SetLogLevel() { |