gstreamermm 1.10.0

Public Member Functions | Public Attributes | List of all members
Gst::Range< T > Class Template Reference
gstreamermm Helper Classes

A class that represents a range (min - max). More...

`#include <gstreamermm/value.h>`

## Public Member Functions
| Range ()
| Constructs a zero Gst::Range. More...
| Range (T min, T max)
| Constructs a Gst::Range (min - max). More...
| Range (const Range& src)
| Constructs an Gst::Range from another range. More...
| Range (const Glib::Value< Range< T >>& range_value)
| Constructs an Gst::Range from a Glib::ValueBase. More...
| Range (const GValue& range_value)
| Constructs an Gst::Range from a GValue. More...
Range& | operator= (const Range& src)

## Public Attributes
T | min
T | max

## Detailed Description

### template<typename T>
class Gst::Range< T >

A class that represents a range (min - max).

Gst::Range is used to store a range in Gst::Structures of Gst::Caps as a value representing a property (see GStreamer Application Development Manual section 8.2.2 and GstValue docs). When the value is set, it is transformed to a GStreamer GType so retrieving the value is a bit different. The class can be used in setting and getting a Gst::Structure field like so:

Glib::Value<Gst::Range<int>> value;
value.init(Glib::Value<Gst::Range<int>>::value_type());
value.set(Gst::Range<int>(8000, 50000));
Gst::Structure structure("my-structure");
structure.set_field("rate", value);
...
Glib::ValueBase gst_value;
structure.get_field("rate", gst_value);
Gst::Range<int> range(gst_value);
int max = range.max;
...

Gst::Range should be used with following types: int, double, Gst::Fraction.

Last reviewed on 2016-08-27 (1.8.0)

## Constructor & Destructor Documentation

## ◆ Range() [1/5]

template <typename T >

Gst::Range< T >::Range | ( |  | ) |
| inline

Constructs a zero Gst::Range.

## ◆ Range() [2/5]

template <typename T >

Gst::Range< T >::Range | ( | T | min,
|  | T | max
| ) |  |
| inline

Constructs a Gst::Range (min - max).

## ◆ Range() [3/5]

template <typename T >

Gst::Range< T >::Range | ( | const Range< T >& | src | ) |
| inline

Constructs an Gst::Range from another range.

## ◆ Range() [4/5]

template <typename T >

Gst::Range< T >::Range | ( | const Glib::Value< Range< T >>& | range_value | ) |
| inline explicit

Constructs an Gst::Range from a Glib::ValueBase.

## ◆ Range() [5/5]

template <typename T >

Gst::Range< T >::Range | ( | const GValue & | range_value | ) |
| inline explicit

Constructs an Gst::Range from a GValue.

## Member Function Documentation

## ◆ operator=()

template <typename T >

Range& Gst::Range< T >::operator= | ( | const Range< T >& | src | ) |
| inline

## Member Data Documentation

## ◆ max

template <typename T >

T Gst::Range< T >::max

## ◆ min

template <typename T >

T Gst::Range< T >::min

Glib::Value
Glib::Value::set
void set(const CppType &data)
Gst::Range
A class that represents a range (min - max).
Definition: value.h:196
Gst::Structure
Generic class containing fields of names and values.
Definition: structure.h:75
Glib::ValueBase::init
void init(GType type)
Gst::Range::max
T max
Definition: value.h:234