AgsSequencer

AgsSequencer — unique access to sequencers

Functions

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── AgsSequencer

Known Implementations

AgsSequencer is implemented by AgsJackMidiin and AgsMidiin.

Includes

#include <ags/object/ags_sequencer.h>

Description

The AgsSequencer interface gives you a unique access to MIDI devices.

Functions

ags_sequencer_set_application_context ()

void
ags_sequencer_set_application_context (AgsSequencer *sequencer,
                                       AgsApplicationContext *application_context);

Set application context.

Parameters

sequencer

an AgsSequencer

 

application_context

the application context to set

 

Since: 0.7.0


ags_sequencer_get_application_context ()

AgsApplicationContext *
ags_sequencer_get_application_context (AgsSequencer *sequencer);

Get application context.

Parameters

sequencer

an AgsSequencer

 

Since: 0.7.0


ags_sequencer_set_application_mutex ()

void
ags_sequencer_set_application_mutex (AgsSequencer *sequencer,
                                     pthread_mutex_t *application_mutex);

Set application mutex.

Parameters

sequencer

an AgsSequencer

 

application_mutex

the application mutex to set

 

Since: 0.7.0


ags_sequencer_get_application_mutex ()

pthread_mutex_t *
ags_sequencer_get_application_mutex (AgsSequencer *sequencer);

Get application mutex.

Parameters

sequencer

an AgsSequencer

 

Returns

AgsApplicationMutex

Since: 0.7.0


ags_sequencer_set_device ()

void
ags_sequencer_set_device (AgsSequencer *sequencer,
                          gchar *device_id);

Set device.

Parameters

sequencer

an AgsSequencer

 

device_id

the device to set

 

Since: 0.7.0


ags_sequencer_get_device ()

gchar *
ags_sequencer_get_device (AgsSequencer *sequencer);

Get device.

Parameters

sequencer

an AgsSequencer

 

Returns

the device's identifier

Since: 0.7.0


ags_sequencer_list_cards ()

void
ags_sequencer_list_cards (AgsSequencer *sequencer,
                          GList **card_id,
                          GList **card_name);

Retrieve card_id and card_name as a list of strings.

Parameters

sequencer

an AgsSequencer

 

card_id

a list containing card ids

 

card_name

a list containing card names

 

Since: 0.7.0


ags_sequencer_is_starting ()

gboolean
ags_sequencer_is_starting (AgsSequencer *sequencer);

Get starting.

Parameters

sequencer

an AgsSequencer

 

Returns

TRUE if starting, else FALSE

Since: 0.7.0


ags_sequencer_is_playing ()

gboolean
ags_sequencer_is_playing (AgsSequencer *sequencer);

Get playing.

Parameters

sequencer

an AgsSequencer

 

Returns

TRUE if playing, else FALSE

Since: 0.7.0


ags_sequencer_is_recording ()

gboolean
ags_sequencer_is_recording (AgsSequencer *sequencer);

Get recording.

Parameters

sequencer

an AgsSequencer

 

Returns

TRUE if recording, else FALSE

Since: 0.7.0


ags_sequencer_play_init ()

void
ags_sequencer_play_init (AgsSequencer *sequencer,
                         GError **error);


ags_sequencer_play ()

void
ags_sequencer_play (AgsSequencer *sequencer,
                    GError **error);

Plays the current buffer of sequencer.

Parameters

sequencer

an AgsSequencer

 

error

an error that may occure

 

Since: 0.7.0


ags_sequencer_record_init ()

void
ags_sequencer_record_init (AgsSequencer *sequencer,
                           GError **error);


ags_sequencer_record ()

void
ags_sequencer_record (AgsSequencer *sequencer,
                      GError **error);

Records the current buffer of sequencer.

Parameters

sequencer

an AgsSequencer

 

error

an error that may occure

 

Since: 0.7.0


ags_sequencer_stop ()

void
ags_sequencer_stop (AgsSequencer *sequencer);

Stops the sequencer from playing to it.

Parameters

sequencer

an AgsSequencer

 

Since: 0.7.0


ags_sequencer_tic ()

void
ags_sequencer_tic (AgsSequencer *sequencer);

Callback when counter expires minor note offset.

Parameters

sequencer

an AgsSequencer

 

Since: 0.7.0


ags_sequencer_offset_changed ()

void
ags_sequencer_offset_changed (AgsSequencer *sequencer,
                              guint note_offset);


ags_sequencer_get_buffer ()

void *
ags_sequencer_get_buffer (AgsSequencer *sequencer,
                          guint *buffer_length);

Get current playback buffer.

Parameters

sequencer

an AgsSequencer

 

buffer_length

the buffer's length

 

Returns

current playback buffer

Since: 0.7.0


ags_sequencer_get_next_buffer ()

void *
ags_sequencer_get_next_buffer (AgsSequencer *sequencer,
                               guint *buffer_length);

Get future playback buffer.

Parameters

sequencer

an AgsSequencer

 

buffer_length

the buffer's length

 

Returns

next playback buffer

Since: 0.7.0


ags_sequencer_set_bpm ()

void
ags_sequencer_set_bpm (AgsSequencer *sequencer,
                       gdouble bpm);

Set current playback bpm.

Parameters

sequencer

an AgsSequencer

 

bpm

the bpm to set

 

Since: 0.7.0


ags_sequencer_get_bpm ()

gdouble
ags_sequencer_get_bpm (AgsSequencer *sequencer);

Get current playback bpm.

Parameters

sequencer

an AgsSequencer

 

Returns

bpm

Since: 0.7.0


ags_sequencer_set_delay_factor ()

void
ags_sequencer_set_delay_factor (AgsSequencer *sequencer,
                                gdouble delay_factor);

Set current playback delay factor.

Parameters

sequencer

an AgsSequencer

 

delay_factor

the delay factor to set

 

Since: 0.7.0


ags_sequencer_get_delay_factor ()

gdouble
ags_sequencer_get_delay_factor (AgsSequencer *sequencer);

Get current playback delay factor.

Parameters

sequencer

an AgsSequencer

 

Returns

delay factor

Since: 0.7.0


ags_sequencer_set_note_offset ()

void
ags_sequencer_set_note_offset (AgsSequencer *sequencer,
                               guint note_offset);

Set current playback note offset.

Parameters

sequencer

an AgsSequencer

 

note_offset

the note offset to set

 

Since: 0.7.0


ags_sequencer_get_note_offset ()

guint
ags_sequencer_get_note_offset (AgsSequencer *sequencer);

Get current playback note offset.

Parameters

sequencer

an AgsSequencer

 

Returns

offset

Since: 0.7.0


ags_sequencer_set_audio ()

void
ags_sequencer_set_audio (AgsSequencer *sequencer,
                         GList *audio);

Set audio.

Parameters

sequencer

an AgsSequencer

 

audio

the audio to set

 

Since: 0.7.0


ags_sequencer_get_audio ()

GList *
ags_sequencer_get_audio (AgsSequencer *sequencer);

Get audio.

Parameters

sequencer

an AgsSequencer

 

Returns

a GList container AgsAudio

Since: 0.7.0

Types and Values

AGS_SEQUENCER_DEFAULT_SAMPLERATE

#define AGS_SEQUENCER_DEFAULT_SAMPLERATE (44100.0)


AGS_SEQUENCER_DEFAULT_BUFFER_SIZE

#define AGS_SEQUENCER_DEFAULT_BUFFER_SIZE (944)


AGS_SEQUENCER_DEFAULT_DEVICE

#define AGS_SEQUENCER_DEFAULT_DEVICE "hw:0"


AGS_SEQUENCER_DEFAULT_BPM

#define AGS_SEQUENCER_DEFAULT_BPM (120.0)


AGS_SEQUENCER_DEFAULT_DELAY_FACTOR

#define AGS_SEQUENCER_DEFAULT_DELAY_FACTOR (1.0 / 4.0)


AGS_SEQUENCER_DEFAULT_JIFFIE

#define AGS_SEQUENCER_DEFAULT_JIFFIE ((double) AGS_SEQUENCER_DEFAULT_SAMPLERATE / (double) AGS_SEQUENCER_DEFAULT_BUFFER_SIZE)


AGS_SEQUENCER_DEFAULT_TACT

#define AGS_SEQUENCER_DEFAULT_TACT (1.0 / 1.0)


AGS_SEQUENCER_DEFAULT_TACT_JIFFIE

#define AGS_SEQUENCER_DEFAULT_TACT_JIFFIE (60.0 / AGS_SEQUENCER_DEFAULT_BPM * AGS_SEQUENCER_DEFAULT_TACT)


AGS_SEQUENCER_DEFAULT_TACTRATE

#define AGS_SEQUENCER_DEFAULT_TACTRATE (1.0 / AGS_SEQUENCER_DEFAULT_TACT_JIFFIE)


AGS_SEQUENCER_DEFAULT_SCALE

#define AGS_SEQUENCER_DEFAULT_SCALE (1.0)


AGS_SEQUENCER_DEFAULT_DELAY

#define AGS_SEQUENCER_DEFAULT_DELAY (AGS_SEQUENCER_DEFAULT_JIFFIE * (60.0 / AGS_SEQUENCER_DEFAULT_BPM))


AGS_SEQUENCER_DEFAULT_PERIOD

#define AGS_SEQUENCER_DEFAULT_PERIOD (64.0)


AGS_SEQUENCER_DEFAULT_LATENCY

#define AGS_SEQUENCER_DEFAULT_LATENCY (400)

Signal Details

The “offset-changed” signal

void
user_function (AgsSequencer *sequencer,
               guint         note_offset,
               gpointer      user_data)

Flags: Run Last


The “tic” signal

void
user_function (AgsSequencer *sequencer,
               gpointer      user_data)

Flags: Run Last