LCOV - code coverage report
Current view: top level - muse/framework/audioplugins - audiopluginsmodule.cpp Coverage Total Hit
Test: filtered_coverage.info Lines: 0.0 % 27 0
Test Date: 2026-11-05 04:07:02

            Line data    Source code
       1              : /*
       2              :  * SPDX-License-Identifier: GPL-3.0-only
       3              :  * MuseScore-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              : #include "audiopluginsmodule.h"
      23              : 
      24              : #include "internal/audiopluginsconfiguration.h"
      25              : #include "internal/audiopluginsloadguard.h"
      26              : #include "internal/knownaudiopluginsregister.h"
      27              : #include "internal/knownaudiopluginsmigrationregister.h"
      28              : #include "internal/audiopluginsscannerregister.h"
      29              : #include "internal/audiopluginmetareaderregister.h"
      30              : #include "internal/registeraudiopluginsscenario.h"
      31              : 
      32              : #include "diagnostics/idiagnosticspathsregister.h"
      33              : 
      34              : using namespace muse;
      35              : using namespace muse::modularity;
      36              : using namespace muse::audioplugins;
      37              : 
      38              : static const std::string mname("audio_plugins");
      39              : 
      40            0 : std::string AudioPluginsModule::moduleName() const
      41              : {
      42            0 :     return mname;
      43              : }
      44              : 
      45            0 : void AudioPluginsModule::registerExports()
      46              : {
      47            0 :     m_configuration = std::make_shared<AudioPluginsConfiguration>(globalCtx());
      48              : 
      49            0 :     globalIoc()->registerExport<IAudioPluginsConfiguration>(moduleName(), m_configuration);
      50            0 :     globalIoc()->registerExport<IKnownAudioPluginsMigrationRegister>(moduleName(), std::make_shared<KnownAudioPluginsMigrationRegister>());
      51            0 :     globalIoc()->registerExport<IKnownAudioPluginsRegister>(moduleName(), std::make_shared<KnownAudioPluginsRegister>());
      52            0 :     globalIoc()->registerExport<IAudioPluginsScannerRegister>(moduleName(), std::make_shared<AudioPluginsScannerRegister>());
      53            0 :     globalIoc()->registerExport<IAudioPluginsLoadGuard>(moduleName(), std::make_shared<AudioPluginsLoadGuard>());
      54            0 :     globalIoc()->registerExport<IAudioPluginMetaReaderRegister>(moduleName(), std::make_shared<AudioPluginMetaReaderRegister>());
      55            0 : }
      56              : 
      57            0 : void AudioPluginsModule::resolveImports()
      58              : {
      59              :     //! --- Diagnostics ---
      60            0 :     auto pr = globalIoc()->resolve<muse::diagnostics::IDiagnosticsPathsRegister>(moduleName());
      61            0 :     if (pr) {
      62            0 :         pr->reg("known_audio_plugins", m_configuration->knownAudioPluginsFilePath());
      63              :     }
      64            0 : }
      65              : 
      66            0 : modularity::IContextSetup* AudioPluginsModule::newContext(const muse::modularity::ContextPtr& ctx) const
      67              : {
      68            0 :     return new AudioPluginsContext(ctx);
      69              : }
      70              : 
      71            0 : void AudioPluginsContext::registerExports()
      72              : {
      73            0 :     m_registerAudioPluginsScenario = std::make_shared<RegisterAudioPluginsScenario>(iocContext());
      74              : 
      75            0 :     ioc()->registerExport<IRegisterAudioPluginsScenario>(mname, m_registerAudioPluginsScenario);
      76            0 : }
      77              : 
      78            0 : void AudioPluginsContext::onInit(const IApplication::RunMode& mode)
      79              : {
      80            0 :     m_registerAudioPluginsScenario->init();
      81              : 
      82            0 :     if (mode != IApplication::RunMode::AudioPluginRegistration) {
      83            0 :         m_registerAudioPluginsScenario->markCrashedPluginsAsBroken();
      84              :     }
      85            0 : }
        

Generated by: LCOV version 2.0-1