MCPcopy Create free account
hub / github.com/clementgallet/libTAS / addUniqueInputs

Method addUniqueInputs

src/program/ui/InputEditorModel.cpp:966–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

964}
965
966void InputEditorModel::addUniqueInputs(const AllInputs &ai)
967{
968 std::set<SingleInput> new_input_set;
969 ai.extractInputs(new_input_set);
970
971 /* Check if added inputs are already in the list */
972 bool any_new_input = false;
973 for (SingleInput si : new_input_set) {
974
975 bool new_input = true;
976 for (SingleInput ti : movie->editor->input_set) {
977 if (si == ti) {
978 new_input = false;
979 break;
980 }
981 }
982
983 /* Insert input if new */
984 if (new_input) {
985 any_new_input = true;
986
987 /* Gather input description */
988 for (int i=0; i<KeyMapping::INPUTLIST_SIZE; i++) {
989 for (SingleInput ti : context->config.km->input_list[i]) {
990 if (si == ti) {
991 si.description = ti.description;
992 break;
993 }
994 }
995 }
996
997 beginInsertColumns(QModelIndex(), columnCount(), columnCount());
998 movie->editor->input_set.push_back(si);
999 endInsertColumns();
1000 }
1001 }
1002
1003 if (any_new_input)
1004 emit inputSetChanged();
1005}
1006
1007void InputEditorModel::addUniqueInputs(int minRow, int maxRow)
1008{

Callers

nothing calls this directly

Calls 2

extractInputsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected