GUPnP DLNA Values

## GUPnP DLNA Values GUPnP DLNA Values — State values for metadata attributes. |

## Synopsis

    enum                GUPnPDLNAValueState;
                        GUPnPDLNABoolValue;
    #define             GUPNP_DLNA_BOOL_VALUE_UNSET
    #define             GUPNP_DLNA_BOOL_VALUE_UNSUPPORTED
                        GUPnPDLNAFractionValue;
    #define             GUPNP_DLNA_FRACTION_VALUE_UNSET
    #define             GUPNP_DLNA_FRACTION_VALUE_UNSUPPORTED
                        GUPnPDLNAIntValue;
    #define             GUPNP_DLNA_INT_VALUE_UNSET
    #define             GUPNP_DLNA_INT_VALUE_UNSUPPORTED
                        GUPnPDLNAStringValue;
    #define             GUPNP_DLNA_STRING_VALUE_UNSET
    #define             GUPNP_DLNA_STRING_VALUE_UNSUPPORTED

## Description

The GUPnPDLNABoolValue, GUPnPDLNAFractionValue, GUPnPDLNAIntValue and GUPnPDLNAStringValue hold respectively boolean, fraction, integer and string values.

The value can be in one of three possible states - set, unset or unsupported. When value is in set state it is possible to use the underlying value it holds. In other states using such value is undefined.

Main difference between unset state and unsupported state is that the former is set when metadata extractor is capable of extracting some attribute in general, but current media file does not have such attribute, while the latter means that metadata extractor has no idea how to extract such attribute at all.

One note on GUPnPDLNAStringValue - it holds a string that has to be allocated with `g_malloc()` (that is - `g_strdup()` and others are fine as well as they use `g_malloc()` internally). The string is freed by consumer.

## Details

### enum GUPnPDLNAValueState

    typedef enum {
            GUPNP_DLNA_VALUE_STATE_SET,
            GUPNP_DLNA_VALUE_STATE_UNSET,
            GUPNP_DLNA_VALUE_STATE_UNSUPPORTED
    } GUPnPDLNAValueState;

Flags describing a state of GUPnP DLNA Value.

`GUPNP_DLNA_VALUE_STATE_SET` | Value is set.
`GUPNP_DLNA_VALUE_STATE_UNSET` | Value is unset.
`GUPNP_DLNA_VALUE_STATE_UNSUPPORTED` | Value is unsupported.

### GUPnPDLNABoolValue

    typedef struct {
            gboolean            value;
            GUPnPDLNAValueState state;
    } GUPnPDLNABoolValue;

GUPnP DLNA Value representing a boolean value of some metadata attribute.

gboolean `value`; | The boolean value.
GUPnPDLNAValueState `state`; | The state of GUPnPDLNABoolValue.

### GUPNP_DLNA_BOOL_VALUE_UNSET

    #define             GUPNP_DLNA_BOOL_VALUE_UNSET

Static initializer for unset GUPnPDLNABoolValue. Can be used in two ways:

    1
    GUPnPDLNABoolValue value = GUPNP_DLNA_BOOL_VALUE_UNSET;

or

    1
    return GUPNP_DLNA_BOOL_VALUE_UNSET;

### GUPNP_DLNA_BOOL_VALUE_UNSUPPORTED

    #define             GUPNP_DLNA_BOOL_VALUE_UNSUPPORTED

Static initializer for unsupported GUPnPDLNABoolValue. Can be used in two ways:

    1
    GUPnPDLNABoolValue value = GUPNP_DLNA_BOOL_VALUE_UNSUPPORTED;

or

    1
    return GUPNP_DLNA_BOOL_VALUE_UNSUPPORTED;

### GUPnPDLNAFractionValue

    typedef struct {
            gint                numerator;
            gint                denominator;
            GUPnPDLNAValueState state;
    } GUPnPDLNAFractionValue;

GUPnP DLNA Value representing a fraction value of some metadata attribute.

gint `numerator`; | The numerator of fraction.
gint `denominator`; | The denominator of fraction.
GUPnPDLNAValueState `state`; | The state of GUPnPDLNAFractionValue.

### GUPNP_DLNA_FRACTION_VALUE_UNSET

    #define             GUPNP_DLNA_FRACTION_VALUE_UNSET

Static initializer for unset GUPnPDLNAFractionValue. Can be used in two ways:

    1
    GUPnPDLNAFractionValue value = GUPNP_DLNA_FRACTION_VALUE_UNSET;

or

    1
    return GUPNP_DLNA_FRACTION_VALUE_UNSET;

### GUPNP_DLNA_FRACTION_VALUE_UNSUPPORTED

    #define             GUPNP_DLNA_FRACTION_VALUE_UNSUPPORTED

Static initializer for unsupported GUPnPDLNAFractionValue. Can be used in two ways:

    1
    GUPnPDLNAFractionValue value = GUPNP_DLNA_FRACTION_VALUE_UNSUPPORTED;

or

    1
    return GUPNP_DLNA_FRACTION_VALUE_UNSUPPORTED;

### GUPnPDLNAIntValue

    typedef struct {
            gint                value;
            GUPnPDLNAValueState state;
    } GUPnPDLNAIntValue;

GUPnP DLNA Value representing an integer value of some metadata attribute.

gint `value`; | The integer value.
GUPnPDLNAValueState `state`; | The state of GUPnPDLNAIntValue.

### GUPNP_DLNA_INT_VALUE_UNSET

    #define             GUPNP_DLNA_INT_VALUE_UNSET

Static initializer for unset GUPnPDLNAIntValue. Can be used in two ways:

    1
    GUPnPDLNAIntValue value = GUPNP_DLNA_INT_VALUE_UNSET;

or

    1
    return GUPNP_DLNA_INT_VALUE_UNSET;

### GUPNP_DLNA_INT_VALUE_UNSUPPORTED

    #define             GUPNP_DLNA_INT_VALUE_UNSUPPORTED

Static initializer for unsupported GUPnPDLNAIntValue. Can be used in two ways:

    1
    GUPnPDLNAIntValue value = GUPNP_DLNA_INT_VALUE_UNSUPPORTED;

or

    1
    return GUPNP_DLNA_INT_VALUE_UNSUPPORTED;

### GUPnPDLNAStringValue

    typedef struct {
            gchar               *value;
            GUPnPDLNAValueState  state;
    } GUPnPDLNAStringValue;

GUPnP DLNA Value representing a string value of some metadata attribute.

gchar *`value`; | The string value.
GUPnPDLNAValueState `state`; | The state of GUPnPDLNAStringValue.

### GUPNP_DLNA_STRING_VALUE_UNSET

    #define             GUPNP_DLNA_STRING_VALUE_UNSET

Static initializer for unset GUPnPDLNAStringValue. Can be used in two ways:

    1
    GUPnPDLNAStringValue value = GUPNP_DLNA_STRING_VALUE_UNSET;

or

    1
    return GUPNP_DLNA_STRING_VALUE_UNSET;

### GUPNP_DLNA_STRING_VALUE_UNSUPPORTED

    #define             GUPNP_DLNA_STRING_VALUE_UNSUPPORTED

Static initializer for unsupported GUPnPDLNAStringValue. Can be used in two ways:

    1
    GUPnPDLNAStringValue value = GUPNP_DLNA_STRING_VALUE_UNSUPPORTED;

or

    1
    return GUPNP_DLNA_STRING_VALUE_UNSUPPORTED;