[AFV] Ref T731, Ref T739 audio adv./distributed component as dialog

This commit is contained in:
Klaus Basan
2019-11-02 19:19:10 +01:00
committed by Mat Sutcliffe
parent 0a1835f1a5
commit 4e7c490d3b
6 changed files with 180 additions and 7 deletions

View File

@@ -31,7 +31,7 @@ namespace BlackGui
connect(sGui->getCContextAudioBase(), &CContextAudioBase::stoppedAudio, this, &CAudioAdvancedDistributedComponent::onAudioStoppend, Qt::QueuedConnection);
connect(ui->pb_EnableDisable, &QPushButton::pressed, this, &CAudioAdvancedDistributedComponent::toggleAudioEnableDisable, Qt::QueuedConnection);
connect(ui->pb_StartStop, &QPushButton::pressed, this, &CAudioAdvancedDistributedComponent::toggleAudioStartStop, Qt::QueuedConnection);
connect(ui->pb_ReloadRegistered, &QPushButton::pressed, this, &CAudioAdvancedDistributedComponent::reloadRegistered, Qt::QueuedConnection);
connect(ui->pb_ReloadRegistered, &QPushButton::pressed, this, &CAudioAdvancedDistributedComponent::reloadRegisteredDevices, Qt::QueuedConnection);
this->setButtons();
}
@@ -75,7 +75,7 @@ namespace BlackGui
this->setButtons(2000);
}
void CAudioAdvancedDistributedComponent::reloadRegistered()
void CAudioAdvancedDistributedComponent::reloadRegisteredDevices()
{
if (!hasContexts()) { return; }
const CAudioDeviceInfoList registeredDevices = sGui->getIContextAudio()->getRegisteredDevices();
@@ -108,13 +108,13 @@ namespace BlackGui
Q_UNUSED(inputDevice)
Q_UNUSED(outputDevice)
this->setButtons();
this->reloadRegistered();
this->reloadRegisteredDevices();
}
void CAudioAdvancedDistributedComponent::onAudioStoppend()
{
this->setButtons();
this->reloadRegistered();
this->reloadRegisteredDevices();
}
bool CAudioAdvancedDistributedComponent::hasContexts()

View File

@@ -33,6 +33,9 @@ namespace BlackGui
//! Dtor
virtual ~CAudioAdvancedDistributedComponent() override;
//! Reload registered devices
void reloadRegisteredDevices();
private:
QScopedPointer<Ui::CAudioAdvancedDistributedComponent> ui;
@@ -42,9 +45,6 @@ namespace BlackGui
//! Audio enable/disable
void toggleAudioEnableDisable();
//! Reload registered devices
void reloadRegistered();
//! Start/stop button @{
void setButtons();
void setButtons(int delayMs);

View File

@@ -23,6 +23,12 @@
</item>
<item row="2" column="0" colspan="3">
<widget class="BlackGui::Views::CAudioDeviceInfoView" name="tvp_RegisteredDevices">
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>

View File

@@ -0,0 +1,34 @@
/* Copyright (C) 2019
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
* or distributed except according to the terms contained in the LICENSE file.
*/
#include "audioadvanceddistributeddialog.h"
#include "ui_audioadvanceddistributeddialog.h"
namespace BlackGui
{
namespace Components
{
CAudioAdvancedDistributedDialog::CAudioAdvancedDistributedDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CAudioAdvancedDistributedDialog)
{
ui->setupUi(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->reloadRegisteredDevices();
}
CAudioAdvancedDistributedDialog::~CAudioAdvancedDistributedDialog()
{ }
void CAudioAdvancedDistributedDialog::reloadRegisteredDevices()
{
ui->comp_AudioAdvancedDistributed->reloadRegisteredDevices();
}
} // ns
} // ns

View File

@@ -0,0 +1,45 @@
/* Copyright (C) 2019
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
* or distributed except according to the terms contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_COMPONENTS_AUDIOADVANCEDDISTRIBUTEDDIALOG_H
#define BLACKGUI_COMPONENTS_AUDIOADVANCEDDISTRIBUTEDDIALOG_H
#include "blackgui/blackguiexport.h"
#include <QDialog>
#include <QScopedPointer>
namespace Ui { class CAudioAdvancedDistributedDialog; }
namespace BlackGui
{
namespace Components
{
//! Audio advanced setup as dialog
class BLACKGUI_EXPORT CAudioAdvancedDistributedDialog : public QDialog
{
Q_OBJECT
public:
//! Ctor
explicit CAudioAdvancedDistributedDialog(QWidget *parent = nullptr);
//! Dtor
virtual ~CAudioAdvancedDistributedDialog() override;
//! Reload registered devices
void reloadRegisteredDevices();
private:
QScopedPointer<Ui::CAudioAdvancedDistributedDialog> ui;
};
} // ns
} // ns
#endif // guard

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CAudioAdvancedDistributedDialog</class>
<widget class="QDialog" name="CAudioAdvancedDistributedDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>350</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>350</height>
</size>
</property>
<property name="windowTitle">
<string>Advanced and sitributed audio setup</string>
</property>
<layout class="QVBoxLayout" name="vl_CAudioAdvancedDistributedComponent">
<item>
<widget class="BlackGui::Components::CAudioAdvancedDistributedComponent" name="comp_AudioAdvancedDistributed">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="bb_AudioAdvancedDistributedDialog">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BlackGui::Components::CAudioAdvancedDistributedComponent</class>
<extends>QFrame</extends>
<header>blackgui/components/audioadvanceddistributedcomponent.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>bb_AudioAdvancedDistributedDialog</sender>
<signal>accepted()</signal>
<receiver>CAudioAdvancedDistributedDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>bb_AudioAdvancedDistributedDialog</sender>
<signal>rejected()</signal>
<receiver>CAudioAdvancedDistributedDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>