mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Some cleanup
* removed audio utils from blackmiscfreefunctions (we wanna give it up) * comments * formatting
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "audiodeviceinfo.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <tuple>
|
||||
#include <QHostInfo>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -18,12 +19,12 @@ namespace BlackMisc
|
||||
|
||||
CAudioDeviceInfo::CAudioDeviceInfo() :
|
||||
m_type(Unknown), m_deviceIndex(invalidDeviceIndex()),
|
||||
m_deviceName(""), m_hostName(BlackMisc::localHostName())
|
||||
m_deviceName(""), m_hostName(QHostInfo::localHostName())
|
||||
{ }
|
||||
|
||||
CAudioDeviceInfo::CAudioDeviceInfo(DeviceType type, const int index, const QString &name) :
|
||||
m_type(type), m_deviceIndex(index),
|
||||
m_deviceName(name), m_hostName(BlackMisc::localHostName())
|
||||
m_deviceName(name), m_hostName(QHostInfo::localHostName())
|
||||
{ }
|
||||
|
||||
QString CAudioDeviceInfo::convertToQString(bool i18n) const
|
||||
|
||||
@@ -37,11 +37,9 @@ namespace BlackMisc
|
||||
Unknown
|
||||
};
|
||||
|
||||
/*!
|
||||
* Default constructor.
|
||||
* If m_deviceIndex is -1, default should be used. However on Windows this doesnt work. Needs
|
||||
* to be checked in Vatlib.
|
||||
*/
|
||||
//!
|
||||
//! Default constructor.
|
||||
//! \note If m_deviceIndex is -1, default should be used. However on Windows this doesnt work. Needs to be checked in Vatlib.
|
||||
CAudioDeviceInfo();
|
||||
|
||||
//! Constructor.
|
||||
@@ -85,17 +83,11 @@ namespace BlackMisc
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CAudioDeviceInfo)
|
||||
//! Device type, @see CAudioDeviceInfo::DeviceType
|
||||
DeviceType m_type;
|
||||
/*!
|
||||
* deviceIndex is the number is the reference for the VVL. The device is selected by this index.
|
||||
* The managing class needs to take care, that indexes are valid.
|
||||
*/
|
||||
int m_deviceIndex;
|
||||
//! Device name
|
||||
QString m_deviceName;
|
||||
//! We use a DBus based system. Hence an audio device can reside on a differen computers, this here is its name
|
||||
QString m_hostName;
|
||||
|
||||
DeviceType m_type; //!< Device type, @see CAudioDeviceInfo::DeviceType
|
||||
int m_deviceIndex; //!< deviceIndex is the number is the reference for the VVL. The device is selected by this index. The managing class needs to take care, that indexes are valid.
|
||||
QString m_deviceName; //!< Device name
|
||||
QString m_hostName; //!< We use a DBus based system. Hence an audio device can reside on a differen computers, this here is its name
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
25
src/blackmisc/audio/audioutils.cpp
Normal file
25
src/blackmisc/audio/audioutils.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Copyright (C) 2013
|
||||
* 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 and at http://www.swift-project.org/license.html. 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 "audioutils.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include <QProcess>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Audio
|
||||
{
|
||||
bool startWindowsMixer()
|
||||
{
|
||||
if (!CProject::isRunningOnWindowsNtPlatform()) { return false; }
|
||||
QStringList parameterlist;
|
||||
return QProcess::startDetached("SndVol.exe", parameterlist);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
26
src/blackmisc/audio/audioutils.h
Normal file
26
src/blackmisc/audio/audioutils.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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 and at http://www.swift-project.org/license.html. 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 BLACKMISC_AUDIO_UTILS_H
|
||||
#define BLACKMISC_AUDIO_UTILS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Audio
|
||||
{
|
||||
//! Start the Windows mixer
|
||||
BLACKMISC_EXPORT bool startWindowsMixer();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user