mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
[AFV] Ref T731, Ref T739 model/view for audio device info
This commit is contained in:
committed by
Mat Sutcliffe
parent
8a89b8f261
commit
80725e96dc
@@ -23,6 +23,7 @@
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include "blackmisc/network/textmessagelist.h"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "blackgui/models/airportlistmodel.h"
|
||||
#include "blackgui/models/applicationinfolistmodel.h"
|
||||
#include "blackgui/models/atcstationlistmodel.h"
|
||||
#include "blackgui/models/audiodeviceinfolistmodel.h"
|
||||
#include "blackgui/models/clientlistmodel.h"
|
||||
#include "blackgui/models/cloudlayerlistmodel.h"
|
||||
#include "blackgui/models/countrylistmodel.h"
|
||||
|
||||
36
src/blackgui/models/audiodeviceinfolistmodel.cpp
Normal file
36
src/blackgui/models/audiodeviceinfolistmodel.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/* 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 "blackgui/models/audiodeviceinfolistmodel.h"
|
||||
#include "blackgui/models/columnformatters.h"
|
||||
#include "blackgui/models/columns.h"
|
||||
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Audio;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
CAudioDeviceInfoListModel::CAudioDeviceInfoListModel(QObject *parent) :
|
||||
CListModelBase("AudioDeviceInfoListModel", parent)
|
||||
{
|
||||
m_columns.addColumn(CColumn::standardString("type", CAudioDeviceInfo::IndexDeviceTypeAsString));
|
||||
m_columns.addColumn(CColumn::standardString("name", CAudioDeviceInfo::IndexName));
|
||||
m_columns.addColumn(CColumn::standardString("machine", { CAudioDeviceInfo::IndexIdentifier, CIdentifier::IndexMachineName }));
|
||||
m_columns.addColumn(CColumn::standardString("process", { CAudioDeviceInfo::IndexIdentifier, CIdentifier::IndexProcessName }));
|
||||
|
||||
// default sort order
|
||||
this->setSortColumnByPropertyIndex(CAudioDeviceInfo::IndexName);
|
||||
m_sortOrder = Qt::AscendingOrder;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
37
src/blackgui/models/audiodeviceinfolistmodel.h
Normal file
37
src/blackgui/models/audiodeviceinfolistmodel.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* 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_MODELS_AUDIODEVICEINFOLISTMODEL_H
|
||||
#define BLACKGUI_MODELS_AUDIODEVICEINFOLISTMODEL_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/listmodelbase.h"
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
//! Audio device list model
|
||||
class BLACKGUI_EXPORT CAudioDeviceInfoListModel :
|
||||
public CListModelBase<BlackMisc::Audio::CAudioDeviceInfoList, true>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAudioDeviceInfoListModel(QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CAudioDeviceInfoListModel() override {}
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // guard
|
||||
@@ -20,5 +20,7 @@ namespace BlackGui
|
||||
template class CListModelBase<BlackMisc::CNameVariantPairList, false>;
|
||||
template class CListModelBase<BlackMisc::CCountryList, true>;
|
||||
|
||||
template class CListModelBase<BlackMisc::Audio::CAudioDeviceInfoList, true>;
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
24
src/blackgui/views/audiodeviceinfoview.cpp
Normal file
24
src/blackgui/views/audiodeviceinfoview.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/* 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 "blackgui/models/audiodeviceinfolistmodel.h"
|
||||
#include "blackgui/views/audiodeviceinfoview.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui::Models;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
{
|
||||
CAudioDeviceInfoView::CAudioDeviceInfoView(QWidget *parent) : CViewBase(parent)
|
||||
{
|
||||
this->standardInit(new CAudioDeviceInfoListModel(this));
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
34
src/blackgui/views/audiodeviceinfoview.h
Normal file
34
src/blackgui/views/audiodeviceinfoview.h
Normal 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.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_VIEWS_AUDIODEVICEINFOVIEW_H
|
||||
#define BLACKGUI_VIEWS_AUDIODEVICEINFOVIEW_H
|
||||
|
||||
#include "blackgui/models/audiodeviceinfolistmodel.h"
|
||||
#include "blackgui/views/viewbase.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
{
|
||||
//! Audio device view
|
||||
class BLACKGUI_EXPORT CAudioDeviceInfoView : public CViewBase<Models::CAudioDeviceInfoListModel>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CAudioDeviceInfoView(QWidget *parent = nullptr);
|
||||
};
|
||||
}
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
@@ -17,5 +17,8 @@ namespace BlackGui
|
||||
template class CViewBase<BlackGui::Models::CStatusMessageListModel>;
|
||||
template class CViewBase<BlackGui::Models::CIdentifierListModel>;
|
||||
template class CViewBase<BlackGui::Models::CNameVariantPairModel>;
|
||||
|
||||
template class CViewBase<BlackGui::Models::CAudioDeviceInfoListModel>;
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user