swift
Loading...
Searching...
No Matches
swift::misc::audio::CAudioDeviceInfo Class Reference

Value object encapsulating information of a audio device. More...

#include <audiodeviceinfo.h>

Inheritance diagram for swift::misc::audio::CAudioDeviceInfo:
[legend]

Public Types

enum  ColumnIndex { IndexName = CPropertyIndexRef::GlobalIndexCAudioDeviceInfo , IndexDeviceType , IndexDeviceTypeAsString , IndexIdentifier }
 Properties by index. More...
enum  DeviceType { InputDevice , OutputDevice , Unknown }
 Type. More...
Public Types inherited from swift::misc::CValueObject< CAudioDeviceInfo >
using base_type
 Base class.
Public Types inherited from swift::misc::CEmpty
using base_type = CEmpty
 Base class is alias of itself.
Public Types inherited from swift::misc::mixin::Index< CAudioDeviceInfo >
enum  ColumnIndex
 Base class enums. More...

Public Member Functions

 CAudioDeviceInfo ()
 Default constructor.
 CAudioDeviceInfo (DeviceType type, const QString &name)
 Constructor.
const QString & getName () const
 Get the device name.
const QString & getMachineName () const
 Machine name.
const CIdentifier & getIdentifier () const
 Identifier.
DeviceType getType () const
 Type.
const QString & getTypeAsString () const
 Type as string.
bool isInputDevice () const
 Input device.
bool isOutputDevice () const
 Output device.
bool isValid () const
 Valid audio device object?
bool isDefault () const
 Is this a default device?
bool matchesNameTypeMachineName (const CAudioDeviceInfo &device) const
 Matching name, type and machine.
bool matchesNameTypeMachineProcess (const CAudioDeviceInfo &device) const
 Matching name, type and machine and process.
QVariant propertyByIndex (swift::misc::CPropertyIndexRef index) const
 Property by index.
void setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
QString convertToQString (bool i18n=false) const
 Cast as QString.
int comparePropertyByIndex (CPropertyIndexRef index, const CAudioDeviceInfo &compareValue) const
 Compare for index.
Public Member Functions inherited from swift::misc::mixin::MetaType< CAudioDeviceInfo >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CAudioDeviceInfo >
void marshallToDbus (QDBusArgument &arg, Tags...) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &arg, Tags...)
 Unmarshall without begin/endStructure, for when composed within another object.
Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CAudioDeviceInfo >
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAudioDeviceInfo >
QJsonObject toJson () const
 Cast to JSON object.
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const
 Convenience function JSON as string.
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
Public Member Functions inherited from swift::misc::mixin::String< CAudioDeviceInfo >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.
Public Member Functions inherited from swift::misc::mixin::Index< CAudioDeviceInfo >
CPropertyIndexList apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
 Update by variant map.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CAudioDeviceInfo &compareValue) const
 Compare for index.
bool equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const
 Is given variant equal to value of property index?
Public Member Functions inherited from swift::misc::mixin::Icon< CAudioDeviceInfo >
CIcons::CIcons::StandardIconUnknown16 toIcon () const
 As icon, not implemented by all classes.

Static Public Member Functions

static CAudioDeviceInfo getDefaultOutputDevice ()
 Default output device.
static CAudioDeviceInfo getDefaultInputDevice ()
 Default input device.
static const QString & deviceTypeToString (DeviceType t)
 Device type as string.
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CAudioDeviceInfo >
static void registerMetadata ()
 Register metadata.
Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAudioDeviceInfo >
static DerivedObj fromJson (const QJsonObject &json)
 Get object from QJsonObject.
static DerivedObj fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg)
 Get object from JSON string.

Additional Inherited Members

Protected Member Functions inherited from swift::misc::CValueObject< CAudioDeviceInfo >
 CEmpty ()=default
 Inheriting constructors.
 CEmpty (const CEmpty &)=default
 Inheriting constructors.
 CValueObject ()=default
 Default constructor.
CValueObject & operator= (const CValueObject &)=default
 Copy assignment operator.
 ~CValueObject ()=default
 Destructor.
Protected Member Functions inherited from swift::misc::CEmpty
 CEmpty ()=default
 Protected default constructor.
 CEmpty (const CEmpty &)=default
 Protected copy constructor.
CEmpty & operator= (const CEmpty &)=default
 Protected copy assignment operator.
 ~CEmpty ()=default
 Non-virtual protected destructor.

Detailed Description

Value object encapsulating information of a audio device.

If you want to safe this object, use the name instead of the index, since the index can change after a restart.

Definition at line 26 of file audiodeviceinfo.h.

Member Enumeration Documentation

◆ ColumnIndex

Properties by index.

Definition at line 30 of file audiodeviceinfo.h.

◆ DeviceType

Constructor & Destructor Documentation

◆ CAudioDeviceInfo() [1/2]

swift::misc::audio::CAudioDeviceInfo::CAudioDeviceInfo ( )

Default constructor.

Definition at line 19 of file audiodeviceinfo.cpp.

◆ CAudioDeviceInfo() [2/2]

swift::misc::audio::CAudioDeviceInfo::CAudioDeviceInfo ( DeviceType type,
const QString & name )

Constructor.

Definition at line 21 of file audiodeviceinfo.cpp.

Member Function Documentation

◆ comparePropertyByIndex()

int swift::misc::audio::CAudioDeviceInfo::comparePropertyByIndex ( CPropertyIndexRef index,
const CAudioDeviceInfo & compareValue ) const

Compare for index.

Definition at line 107 of file audiodeviceinfo.cpp.

◆ convertToQString()

QString swift::misc::audio::CAudioDeviceInfo::convertToQString ( bool i18n = false) const

Cast as QString.

Definition at line 141 of file audiodeviceinfo.cpp.

◆ deviceTypeToString()

const QString & swift::misc::audio::CAudioDeviceInfo::deviceTypeToString ( CAudioDeviceInfo::DeviceType t)
static

Device type as string.

Definition at line 126 of file audiodeviceinfo.cpp.

◆ getDefaultInputDevice()

CAudioDeviceInfo swift::misc::audio::CAudioDeviceInfo::getDefaultInputDevice ( )
static

Default input device.

Definition at line 67 of file audiodeviceinfo.cpp.

◆ getDefaultOutputDevice()

CAudioDeviceInfo swift::misc::audio::CAudioDeviceInfo::getDefaultOutputDevice ( )
static

Default output device.

Definition at line 61 of file audiodeviceinfo.cpp.

◆ getIdentifier()

const CIdentifier & swift::misc::audio::CAudioDeviceInfo::getIdentifier ( ) const
inline

Identifier.

Definition at line 59 of file audiodeviceinfo.h.

◆ getMachineName()

const QString & swift::misc::audio::CAudioDeviceInfo::getMachineName ( ) const
inline

Machine name.

Definition at line 56 of file audiodeviceinfo.h.

◆ getName()

const QString & swift::misc::audio::CAudioDeviceInfo::getName ( ) const
inline

Get the device name.

Definition at line 53 of file audiodeviceinfo.h.

◆ getType()

DeviceType swift::misc::audio::CAudioDeviceInfo::getType ( ) const
inline

Type.

Definition at line 62 of file audiodeviceinfo.h.

◆ getTypeAsString()

const QString & swift::misc::audio::CAudioDeviceInfo::getTypeAsString ( ) const
inline

Type as string.

Definition at line 65 of file audiodeviceinfo.h.

◆ isDefault()

bool swift::misc::audio::CAudioDeviceInfo::isDefault ( ) const

Is this a default device?

Definition at line 25 of file audiodeviceinfo.cpp.

◆ isInputDevice()

bool swift::misc::audio::CAudioDeviceInfo::isInputDevice ( ) const
inline

Input device.

Definition at line 68 of file audiodeviceinfo.h.

◆ isOutputDevice()

bool swift::misc::audio::CAudioDeviceInfo::isOutputDevice ( ) const
inline

Output device.

Definition at line 71 of file audiodeviceinfo.h.

◆ isValid()

bool swift::misc::audio::CAudioDeviceInfo::isValid ( ) const
inline

Valid audio device object?

Definition at line 74 of file audiodeviceinfo.h.

◆ matchesNameTypeMachineName()

bool swift::misc::audio::CAudioDeviceInfo::matchesNameTypeMachineName ( const CAudioDeviceInfo & device) const

Matching name, type and machine.

Definition at line 46 of file audiodeviceinfo.cpp.

◆ matchesNameTypeMachineProcess()

bool swift::misc::audio::CAudioDeviceInfo::matchesNameTypeMachineProcess ( const CAudioDeviceInfo & device) const

Matching name, type and machine and process.

Definition at line 53 of file audiodeviceinfo.cpp.

◆ propertyByIndex()

QVariant swift::misc::audio::CAudioDeviceInfo::propertyByIndex ( swift::misc::CPropertyIndexRef index) const

Property by index.

Definition at line 73 of file audiodeviceinfo.cpp.

◆ setPropertyByIndex()

void swift::misc::audio::CAudioDeviceInfo::setPropertyByIndex ( swift::misc::CPropertyIndexRef index,
const QVariant & variant )

Set property by index.

Definition at line 90 of file audiodeviceinfo.cpp.


The documentation for this class was generated from the following files: