GstBtTempo

GstBtTempo — helper for tempo synced gstreamer elements

Functions

Includes

#include <gst/tempo.h>

Description

Methods to work with a GstContext that distributes tempo and timing information.

Applications use gstbt_audio_tempo_context_new() to create and initialize the context and gst_element_set_context() to set it on the top-level pipeline. The context is persistent and therefore can be set at any time.

GstElements that implement the GstElementClass::set_context() vmethod can use gstbt_audio_tempo_context_get_tempo() to retrieve the values. Based on the parameters they can adjust their gst_object_sync_values() cycle.

The difference between the tempo context and GST_TAG_BEATS_PER_MINUTE is that the tag describes the overall tempo, but the context allows to change the tempo during playback and offers more finegrained control.

Functions

gstbt_audio_tempo_context_new ()

GstContext *
gstbt_audio_tempo_context_new (guint bpm,
                               guint tpb,
                               guint stpb);

The values of bpm and tpb define the meassure and speed of an audio track. Elements (mostly sources) use these value to configure how the quantise controller events and size their buffers. Elements can also use this for tempo synced effects.

When using controllers one can also use stpb to achieve smoother modulation.

Parameters

bpm

beats per minute

 

tpb

ticks per beat

 

stpb

sub-ticks per beat

 

Returns

a new persistent context that can be send to the pipeline


gstbt_audio_tempo_context_get_tempo ()

gboolean
gstbt_audio_tempo_context_get_tempo (GstContext *ctx,
                                     guint *bpm,
                                     guint *tpb,
                                     guint *stpb);

Get values from the audio-tempo context. Pointers can be NULL to skip them.

Parameters

ctx

the context

 

bpm

beats per minute

 

tpb

ticks per beat

 

stpb

sub-ticks per beat

 

Returns

FALSE if the context if of the wrong type or any of the values were not stored in the context.