TMediaSocketList

primo::avblocks::modern::TMediaSocketList

class TMediaSocketList

Non-owning view of a MediaSocketList.

Returned by TMediaInfo::inputs() / outputs().

Public Functions

inline explicit TMediaSocketList(primo::avblocks::MediaSocketList *list)

Wraps a non-owned MediaSocketList pointer.

inline int32_t count() const

Returns the number of sockets in the collection.

inline TMediaSocket at(int32_t index) const

Returns the socket at index, wrapping the existing (non-owned) pointer.

inline ItemRef operator[](int32_t index) &

Non-const lvalue subscript — returns a proxy supporting read and setAt write.

inline TMediaSocket operator[](int32_t index) const &

Const subscript — same as at(index).

inline bool setAt(int32_t index, TMediaSocket &&socket)

Replaces the socket at index with socket. Returns true on success.

inline bool insert(int32_t index, TMediaSocket &&socket)

Inserts socket before index, shifting later items. Returns true on success.

inline bool immutable() const

Returns true when the list (and its parent Transcoder) is immutable.

inline bool remove(int32_t index)

Removes the socket at index. Returns true on success.

inline bool clear()

Removes all sockets from the list. Returns true on success.

struct ItemRef

Proxy returned by the non-const lvalue operator[](int32_t).

Supports both read (implicit conversion to TMediaSocket) and write (operator= calls setAt on the parent list).

Public Functions

inline operator TMediaSocket() const

Read — implicit conversion to a non-owning socket wrapper.

inline bool operator=(TMediaSocket &&s)

Write — calls setAt; returns true on success.

Public Members

TMediaSocketList &list_

The list this proxy refers to.

int32_t index_

Index of the item the proxy refers to.