Ardour
9.0-pre0-582-g084a23a80d
|
#include <SMF.h>
Classes | |
class | FileError |
struct | MarkerAt |
struct | Tempo |
Public Types | |
typedef std::bitset< 16 > | UsedChannels |
typedef std::vector< MarkerAt > | Markers |
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 |
Tempo * | nth_tempo (size_t n) const |
Markers const & | markers () const |
void | load_markers () |
std::shared_ptr< Temporal::TempoMap > | tempo_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 |
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.
typedef std::vector<MarkerAt> Evoral::SMF::Markers |
typedef std::bitset<16> Evoral::SMF::UsedChannels |
Evoral::SMF::SMF | ( | ) |
|
virtual |
void Evoral::SMF::append_event_delta | ( | uint32_t | delta_t, |
uint32_t | size, | ||
const uint8_t * | buf, | ||
event_id_t | note_id | ||
) |
void Evoral::SMF::begin_write | ( | ) |
void Evoral::SMF::close | ( | ) |
int Evoral::SMF::create | ( | const std::string & | path, |
int | track = 1 , |
||
uint16_t | ppqn = 19200 |
||
) |
|
inlinevirtual |
Reimplemented in ARDOUR::SMFSource, and ARDOUR::ExportSMFWriter.
void Evoral::SMF::end_write | ( | std::string const & | ) |
Temporal::Beats Evoral::SMF::file_duration | ( | ) | const |
void Evoral::SMF::instrument_names | ( | std::vector< std::string > & | ) | const |
void Evoral::SMF::load_markers | ( | ) |
Tempo* Evoral::SMF::nth_tempo | ( | size_t | n | ) | const |
int Evoral::SMF::num_tempos | ( | ) | const |
uint16_t Evoral::SMF::num_tracks | ( | ) | const |
int Evoral::SMF::open | ( | const std::string & | path, |
int | track = 1 , |
||
bool | scan = true |
||
) |
uint16_t Evoral::SMF::ppqn | ( | ) | const |
int Evoral::SMF::read_event | ( | uint32_t * | delta_t, |
uint32_t * | size, | ||
uint8_t ** | buf, | ||
event_id_t * | note_id | ||
) | const |
double Evoral::SMF::round_to_file_precision | ( | double | val | ) | const |
void Evoral::SMF::seek_to_start | ( | ) | const |
int Evoral::SMF::seek_to_track | ( | int | track | ) |
void Evoral::SMF::set_length | ( | Temporal::Beats const & | ) |
|
inline |
int Evoral::SMF::smf_format | ( | ) | const |
std::shared_ptr<Temporal::TempoMap> Evoral::SMF::tempo_map | ( | bool & | provided | ) | const |
|
static |
void Evoral::SMF::track_names | ( | std::vector< std::string > & | ) | const |
|
inline |
|
private |
|
private |
|
protected |