MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / AddFPSRanges

Function AddFPSRanges

plugins/scripting/utils/properties-view.cpp:1163–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1161}
1162
1163static void AddFPSRanges(vector<common_frame_rate> &items,
1164 const frame_rate_ranges_t &ranges)
1165{
1166 auto InsertFPS = [&](media_frames_per_second fps) {
1167 auto fps_val = media_frames_per_second_to_fps(fps);
1168
1169 auto end_ = end(items);
1170 auto i = begin(items);
1171 for (; i != end_; i++) {
1172 auto i_fps_val = media_frames_per_second_to_fps(i->fps);
1173 if (fabsl(i_fps_val - fps_val) < 0.01)
1174 return;
1175
1176 if (i_fps_val > fps_val)
1177 continue;
1178
1179 break;
1180 }
1181
1182 items.insert(i, {nullptr, fps});
1183 };
1184
1185 for (auto &range : ranges) {
1186 InsertFPS(range.first);
1187 InsertFPS(range.second);
1188 }
1189}
1190
1191static QWidget *
1192CreateSimpleFPSValues(OBSFrameRatePropertyWidget *fpsProps, bool &selected,

Callers 1

CreateSimpleFPSValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected