Device
Device
#include <icy/av/devicemanager.h>struct DeviceDefined in src/av/include/icy/av/devicemanager.h:44
Represents a system audio, video or render device.
List of all members
| Name | Kind | Owner |
|---|---|---|
type | variable | Declared here |
id | variable | Declared here |
name | variable | Declared here |
isDefault | variable | Declared here |
isConnected | variable | Declared here |
isInUse | variable | Declared here |
videoCapabilities | variable | Declared here |
audioCapabilities | variable | Declared here |
Device | function | Declared here |
Device | function | Declared here |
print | function | Declared here |
operator== | function | Declared here |
bestVideoCapability | function | Declared here |
bestAudioCapability | function | Declared here |
Type | enum | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
Type | type | |
std::string | id | |
std::string | name | |
bool | isDefault | |
bool | isConnected | |
bool | isInUse | |
std::vector< VideoCapability > | videoCapabilities | |
std::vector< AudioCapability > | audioCapabilities |
type
Type type {}Defined in src/av/include/icy/av/devicemanager.h:73
id
std::string idDefined in src/av/include/icy/av/devicemanager.h:74
name
std::string nameDefined in src/av/include/icy/av/devicemanager.h:75
isDefault
bool isDefault {false}Defined in src/av/include/icy/av/devicemanager.h:76
isConnected
bool isConnected {true}Defined in src/av/include/icy/av/devicemanager.h:77
isInUse
bool isInUse {false}Defined in src/av/include/icy/av/devicemanager.h:78
videoCapabilities
std::vector< VideoCapability > videoCapabilitiesDefined in src/av/include/icy/av/devicemanager.h:80
audioCapabilities
std::vector< AudioCapability > audioCapabilitiesDefined in src/av/include/icy/av/devicemanager.h:81
Public Methods
| Return | Name | Description |
|---|---|---|
Device | Construct a device with Unknown type and empty fields. | |
Device | Construct a device with explicit fields. | |
void | print const | Print device details (type, id, name, capabilities) to the given stream. |
bool | operator== const inline | Equality based on type, id, and name. |
VideoCapability | bestVideoCapability const inline | Find the video capability closest to the requested parameters. |
AudioCapability | bestAudioCapability const inline | Find the audio capability closest to the requested parameters. |
Device
Device()Defined in src/av/include/icy/av/devicemanager.h:84
Construct a device with Unknown type and empty fields.
Device
Device(Type type, const std::string & id, const std::string & name, bool isDefault = false)Defined in src/av/include/icy/av/devicemanager.h:91
Construct a device with explicit fields.
Parameters
typeThe device type (VideoInput, AudioInput, etc.).idThe platform-specific device identifier.nameThe human-readable device name.isDefaultTrue if this is the system default device of its type.
const
void print(std::ostream & os) constDefined in src/av/include/icy/av/devicemanager.h:95
Print device details (type, id, name, capabilities) to the given stream.
Parameters
osThe output stream to write to.
operator==
const inline
inline bool operator==(const Device & that) constDefined in src/av/include/icy/av/devicemanager.h:98
Equality based on type, id, and name.
bestVideoCapability
const inline
inline VideoCapability bestVideoCapability(int width, int height, double fps) constDefined in src/av/include/icy/av/devicemanager.h:112
Find the video capability closest to the requested parameters.
Scoring: resolution match weighted 70%, fps match weighted 30%. Both dimensions are normalised to [0,1] so the weights are meaningful. Prefers capabilities that are >= the requested resolution (upscaling is worse than slight downscaling).
Returns a default capability with the requested values if none are available (allows callers to skip the empty check).
bestAudioCapability
const inline
inline AudioCapability bestAudioCapability(int sampleRate, int channels) constDefined in src/av/include/icy/av/devicemanager.h:151
Find the audio capability closest to the requested parameters.
Scoring: sample rate match weighted 70%, channel count weighted 30%. Both dimensions are normalised to [0,1].
Returns a default capability with the requested values if none are available.
Public Types
| Name | Description |
|---|---|
Type |
Type
enum TypeDefined in src/av/include/icy/av/devicemanager.h:46
| Value | Description |
|---|---|
Unknown | |
VideoInput | |
VideoOutput | |
AudioInput | |
AudioOutput |
