Ardour  9.0-pre0-582-g084a23a80d
Evoral::SMF Class Reference

#include <SMF.h>

Inheritance diagram for Evoral::SMF:
[legend]

Classes

class  FileError
 
struct  MarkerAt
 
struct  Tempo
 

Public Types

typedef std::bitset< 16 > UsedChannels
 
typedef std::vector< MarkerAtMarkers
 

Public Member Functions

 SMF ()
 
virtual ~SMF ()
 
virtual Temporal::Beats duration () const
 
int open (const std::string &path, int track=1, bool scan=true)
 
int create (const std::string &path, int track=1, uint16_t ppqn=19200)
 
void close ()
 
void seek_to_start () const
 
int seek_to_track (int track)
 
int read_event (uint32_t *delta_t, uint32_t *size, uint8_t **buf, event_id_t *note_id) const
 
uint16_t num_tracks () const
 
uint16_t ppqn () const
 
bool is_empty () const
 
void begin_write ()
 
void append_event_delta (uint32_t delta_t, uint32_t size, const uint8_t *buf, event_id_t note_id)
 
void end_write (std::string const &)
 
void flush ()
 
void set_length (Temporal::Beats const &)
 
double round_to_file_precision (double val) const
 
int smf_format () const
 
Temporal::Beats file_duration () const
 
int num_channels () const
 
UsedChannels const & used_channels () const
 
void set_used_channels (UsedChannels used)
 
uint64_t n_note_on_events () const
 
bool has_pgm_change () const
 
void track_names (std::vector< std::string > &) const
 
void instrument_names (std::vector< std::string > &) const
 
int num_tempos () const
 
Temponth_tempo (size_t n) const
 
Markers const & markers () const
 
void load_markers ()
 
std::shared_ptr< Temporal::TempoMaptempo_map (bool &provided) const
 

Static Public Member Functions

static bool test (const std::string &path)
 

Protected Attributes

uint64_t _n_note_on_events
 
bool _has_pgm_change
 
int _num_channels
 
UsedChannels _used_channels
 

Private Attributes

smf_t_smf
 
smf_track_t_smf_track
 
bool _empty
 true iff file contains(non-empty) events More...
 
Glib::Threads::Mutex _smf_lock
 
Markers _markers
 

Detailed Description

Standard Midi File. Currently only tempo-based time of a given PPQN is supported.

For WRITING: this object specifically wraps a type0 file or a type1 file with only a single track. It has no support at this time for a type1 file with multiple tracks.

For READING: this object can read a single arbitrary track from a type1 file, or the single track of a type0 file. It has no support at this time for reading more than 1 track.

Definition at line 59 of file SMF.h.

Member Typedef Documentation

◆ Markers

typedef std::vector<MarkerAt> Evoral::SMF::Markers

Definition at line 148 of file SMF.h.

◆ UsedChannels

typedef std::bitset<16> Evoral::SMF::UsedChannels

Definition at line 105 of file SMF.h.

Constructor & Destructor Documentation

◆ SMF()

Evoral::SMF::SMF ( )

◆ ~SMF()

virtual Evoral::SMF::~SMF ( )
virtual

Member Function Documentation

◆ append_event_delta()

void Evoral::SMF::append_event_delta ( uint32_t  delta_t,
uint32_t  size,
const uint8_t *  buf,
event_id_t  note_id 
)

◆ begin_write()

void Evoral::SMF::begin_write ( )

◆ close()

void Evoral::SMF::close ( )

◆ create()

int Evoral::SMF::create ( const std::string &  path,
int  track = 1,
uint16_t  ppqn = 19200 
)

◆ duration()

virtual Temporal::Beats Evoral::SMF::duration ( ) const
inlinevirtual

Reimplemented in ARDOUR::SMFSource, and ARDOUR::ExportSMFWriter.

Definition at line 74 of file SMF.h.

◆ end_write()

void Evoral::SMF::end_write ( std::string const &  )

◆ file_duration()

Temporal::Beats Evoral::SMF::file_duration ( ) const

◆ flush()

void Evoral::SMF::flush ( void  )
inline

Definition at line 95 of file SMF.h.

◆ has_pgm_change()

bool Evoral::SMF::has_pgm_change ( ) const
inline

Definition at line 109 of file SMF.h.

◆ instrument_names()

void Evoral::SMF::instrument_names ( std::vector< std::string > &  ) const

◆ is_empty()

bool Evoral::SMF::is_empty ( ) const
inline

Definition at line 89 of file SMF.h.

◆ load_markers()

void Evoral::SMF::load_markers ( )

◆ markers()

Markers const& Evoral::SMF::markers ( ) const
inline

Definition at line 149 of file SMF.h.

◆ n_note_on_events()

uint64_t Evoral::SMF::n_note_on_events ( ) const
inline

Definition at line 108 of file SMF.h.

◆ nth_tempo()

Tempo* Evoral::SMF::nth_tempo ( size_t  n) const

◆ num_channels()

int Evoral::SMF::num_channels ( ) const
inline

Definition at line 104 of file SMF.h.

◆ num_tempos()

int Evoral::SMF::num_tempos ( ) const

◆ num_tracks()

uint16_t Evoral::SMF::num_tracks ( ) const

◆ open()

int Evoral::SMF::open ( const std::string &  path,
int  track = 1,
bool  scan = true 
)

◆ ppqn()

uint16_t Evoral::SMF::ppqn ( ) const

◆ read_event()

int Evoral::SMF::read_event ( uint32_t *  delta_t,
uint32_t *  size,
uint8_t **  buf,
event_id_t note_id 
) const

◆ round_to_file_precision()

double Evoral::SMF::round_to_file_precision ( double  val) const

◆ seek_to_start()

void Evoral::SMF::seek_to_start ( ) const

◆ seek_to_track()

int Evoral::SMF::seek_to_track ( int  track)

◆ set_length()

void Evoral::SMF::set_length ( Temporal::Beats const &  )

◆ set_used_channels()

void Evoral::SMF::set_used_channels ( UsedChannels  used)
inline

Definition at line 107 of file SMF.h.

◆ smf_format()

int Evoral::SMF::smf_format ( ) const

◆ tempo_map()

std::shared_ptr<Temporal::TempoMap> Evoral::SMF::tempo_map ( bool &  provided) const

◆ test()

static bool Evoral::SMF::test ( const std::string &  path)
static

◆ track_names()

void Evoral::SMF::track_names ( std::vector< std::string > &  ) const

◆ used_channels()

UsedChannels const& Evoral::SMF::used_channels ( ) const
inline

Definition at line 106 of file SMF.h.

Member Data Documentation

◆ _empty

bool Evoral::SMF::_empty
private

true iff file contains(non-empty) events

Definition at line 157 of file SMF.h.

◆ _has_pgm_change

bool Evoral::SMF::_has_pgm_change
protected

Definition at line 165 of file SMF.h.

◆ _markers

Markers Evoral::SMF::_markers
mutableprivate

Definition at line 161 of file SMF.h.

◆ _n_note_on_events

uint64_t Evoral::SMF::_n_note_on_events
protected

Definition at line 164 of file SMF.h.

◆ _num_channels

int Evoral::SMF::_num_channels
protected

Definition at line 166 of file SMF.h.

◆ _smf

smf_t* Evoral::SMF::_smf
private

Definition at line 155 of file SMF.h.

◆ _smf_lock

Glib::Threads::Mutex Evoral::SMF::_smf_lock
mutableprivate

Definition at line 159 of file SMF.h.

◆ _smf_track

smf_track_t* Evoral::SMF::_smf_track
private

Definition at line 156 of file SMF.h.

◆ _used_channels

UsedChannels Evoral::SMF::_used_channels
protected

Definition at line 167 of file SMF.h.


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