Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::DataType Class Reference

#include <data_type.h>

Classes

class  iterator
 

Public Types

enum  Symbol { AUDIO = 0 , MIDI = 1 , NIL = 2 }
 

Public Member Functions

 DataType (const Symbol &symbol)
 
 DataType (const std::string &str)
 
const char * to_string () const
 
const char * to_i18n_string () const
 
 operator uint32_t () const
 
bool operator== (const Symbol symbol)
 
bool operator!= (const Symbol symbol)
 
bool operator== (const DataType other)
 
bool operator!= (const DataType other)
 

Static Public Member Functions

static DataType front ()
 
static iterator begin ()
 
static iterator end ()
 

Static Public Attributes

static const uint32_t num_types = 2
 

Private Attributes

Symbol _symbol
 

Detailed Description

A type of Data Ardour is capable of processing.

The majority of this class is dedicated to conversion to and from various other type representations, simple comparison between then, etc. This code is deliberately 'ugly' so other code doesn't have to be.

Definition at line 37 of file data_type.h.

Member Enumeration Documentation

◆ Symbol

Numeric symbol for this DataType.

Castable to int for use as an array index (e.g. by ChanCount). Note this means NIL is (ntypes-1) and guaranteed to change when types are added, so this number is NOT suitable for serialization, network, or binary anything.

Some heuristics in Ardour's UI assume that the DataTypes are ordered from most to least likely to be the main intended type of a route.

WARNING: The number of non-NIL entries here must match num_types.

Enumerator
AUDIO 
MIDI 
NIL 

Definition at line 52 of file data_type.h.

Constructor & Destructor Documentation

◆ DataType() [1/2]

ARDOUR::DataType::DataType ( const Symbol symbol)
inline

Definition at line 63 of file data_type.h.

◆ DataType() [2/2]

ARDOUR::DataType::DataType ( const std::string &  str)
inline

Construct from a string (Used for loading from XML and Ports) The string can be as in an XML file (eg "audio" or "midi"), or a

Definition at line 72 of file data_type.h.

Member Function Documentation

◆ begin()

static iterator ARDOUR::DataType::begin ( )
inlinestatic

Definition at line 113 of file data_type.h.

◆ end()

static iterator ARDOUR::DataType::end ( )
inlinestatic

Definition at line 114 of file data_type.h.

◆ front()

static DataType ARDOUR::DataType::front ( )
inlinestatic

Definition at line 67 of file data_type.h.

◆ operator uint32_t()

ARDOUR::DataType::operator uint32_t ( ) const
inline

Definition at line 92 of file data_type.h.

◆ operator!=() [1/2]

bool ARDOUR::DataType::operator!= ( const DataType  other)
inline

Definition at line 120 of file data_type.h.

◆ operator!=() [2/2]

bool ARDOUR::DataType::operator!= ( const Symbol  symbol)
inline

Definition at line 117 of file data_type.h.

◆ operator==() [1/2]

bool ARDOUR::DataType::operator== ( const DataType  other)
inline

Definition at line 119 of file data_type.h.

◆ operator==() [2/2]

bool ARDOUR::DataType::operator== ( const Symbol  symbol)
inline

Definition at line 116 of file data_type.h.

◆ to_i18n_string()

const char* ARDOUR::DataType::to_i18n_string ( ) const

◆ to_string()

const char* ARDOUR::DataType::to_string ( ) const
inline

Inverse of the from-string constructor

Definition at line 82 of file data_type.h.

Member Data Documentation

◆ _symbol

Symbol ARDOUR::DataType::_symbol
private

Definition at line 123 of file data_type.h.

◆ num_types

const uint32_t ARDOUR::DataType::num_types = 2
static

Number of types (not including NIL). WARNING: make sure this matches Symbol!

Definition at line 61 of file data_type.h.


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