swift
audioadvanceddistributedcomponent.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include "ui_audioadvanceddistributedcomponent.h"
7 
11 #include "gui/guiapplication.h"
12 
13 using namespace swift::misc::audio;
14 using namespace swift::core::context;
15 
16 namespace swift::gui::components
17 {
18  CAudioAdvancedDistributedComponent::CAudioAdvancedDistributedComponent(QWidget *parent)
19  : QFrame(parent), ui(new Ui::CAudioAdvancedDistributedComponent)
20  {
21  ui->setupUi(this);
22 
23  connect(ui->pb_ReloadRegistered, &QPushButton::pressed, this,
25  }
26 
28 
30  {
31  if (!hasContexts()) { return; }
32  const CAudioDeviceInfoList registeredDevices = sGui->getIContextAudio()->getRegisteredDevices();
33  ui->tvp_RegisteredDevices->updateContainerMaybeAsync(registeredDevices);
34  }
35 
36  bool CAudioAdvancedDistributedComponent::hasContexts()
37  {
38  if (!sGui || sGui->isShuttingDown() || !sGui->getCContextAudioBase()) { return false; }
39  if (!sGui->getIContextNetwork()) { return false; }
40  return true;
41  }
42 } // namespace swift::gui::components
const context::IContextAudio * getIContextAudio() const
Direct access to contexts if a CCoreFacade has been initialized.
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
bool isShuttingDown() const
Is application shutting down?
const context::CContextAudioBase * getCContextAudioBase() const
Direct access to contexts if a CCoreFacade has been initialized.
virtual swift::misc::audio::CAudioDeviceInfoList getRegisteredDevices() const =0
All registered devices.
Value object encapsulating a list of audio devices.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
Definition: aboutdialog.cpp:13