LCOV - code coverage report
Current view: top level - src/engraving/playback/mapping - voicessetupdataresolver.cpp Coverage Total Hit
Test: filtered_coverage.info Lines: 75.0 % 8 6
Test Date: 2026-11-05 04:07:02

            Line data    Source code
       1              : /*
       2              :  * SPDX-License-Identifier: GPL-3.0-only
       3              :  * MuseScore-Studio-CLA-applies
       4              :  *
       5              :  * MuseScore Studio
       6              :  * Music Composition & Notation
       7              :  *
       8              :  * Copyright (C) 2021 MuseScore Limited and others
       9              :  *
      10              :  * This program is free software: you can redistribute it and/or modify
      11              :  * it under the terms of the GNU General Public License version 3 as
      12              :  * published by the Free Software Foundation.
      13              :  *
      14              :  * This program is distributed in the hope that it will be useful,
      15              :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      16              :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17              :  * GNU General Public License for more details.
      18              :  *
      19              :  * You should have received a copy of the GNU General Public License
      20              :  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
      21              :  */
      22              : 
      23              : #include "voicessetupdataresolver.h"
      24              : 
      25              : using namespace mu::engraving;
      26              : using namespace muse::mpe;
      27              : using namespace muse;
      28              : 
      29            3 : PlaybackSetupData VoicesSetupDataResolver::doResolve(const Instrument* instrument)
      30              : {
      31              :     static const std::unordered_map<std::string, mpe::PlaybackSetupData> SETUP_DATA_MAP = {
      32              :         { "boy-soprano", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Soprano,
      33              :                                                                     SoundSubCategory::Boy } } },
      34              :         { "soprano", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Soprano } } },
      35              :         { "soprano-c-clef", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Soprano } } },
      36              :         { "mezzo-soprano", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Soprano } } },
      37              :         { "mezzo-soprano-c-clef", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Soprano } } },
      38              :         { "countertenor", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Counter_Tenor } } },
      39              :         { "alto", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Alto } } },
      40              :         { "alto-c-clef", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Alto } } },
      41              :         { "contralto", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Contra_Alto } } },
      42              :         { "tenor", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Tenor } } },
      43              :         { "tenor-c-clef", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Tenor } } },
      44              :         { "baritone", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Baritone } } },
      45              :         { "baritone-c-clef", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Baritone } } },
      46              :         { "bass", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Bass } } },
      47              :         { "voice", { SoundId::Choir, SoundCategory::Voices } },
      48              :         { "women", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Female } } },
      49              :         { "men", { SoundId::Choir, SoundCategory::Voices, { SoundSubCategory::Male } } },
      50           40 :     };
      51              : 
      52            3 :     auto search = SETUP_DATA_MAP.find(instrument->id().toStdString());
      53            3 :     if (search == SETUP_DATA_MAP.cend()) {
      54            0 :         static PlaybackSetupData empty;
      55            0 :         return empty;
      56              :     }
      57              : 
      58            3 :     return search->second;
      59           18 : }
        

Generated by: LCOV version 2.0-1