Chapter 6. Your tree linked with AgsChannel

Table of Contents

The pattern
Linking overview

AgsChannel forms your audio processing tree and contains recalls, too. You might want to iterate the channels of your audio object or just call one of these functions:

As you see there is a grained access to channels. You can lookup channels from with the same audio channel with the functions containing pad in its name. An other exciting feature is finding channels having an assigned recycling. These functions operate on the very same audio channel.

Following object fields are changed during linking. Further a new AgsRecycling might be instantiated to be provided as first_recycling and last_recycling of specified AgsInput eg. if it is NULL. So this input has got its very own recycling as specified by AGS_AUDIO_INPUT_HAS_RECYCLING:

The pattern

There can AgsPattern being added to a channel by void ags_channel_add_pattern(AgsChannel*, GObject*). Later if not used anymore likewise call void ags_channel_remove_pattern(AgsChannel*, GObject*).

Example 6.1. Adding AgsPattern

#include <glib.h>
#include <glib-object.h>

#include <ags/libags.h>
#include <ags/libags-audio.h>

AgsChannel *channel;
AgsPattern *pattern;

guint n_bank_0, n_bank_1;
guint length;

/* create channel */
channel = ags_channel_new(NULL);

/* create pattern, set dimension and add it to channel */
n_bank_0 = 4;
n_bank_1 = 12;

length = 64;

pattern = ags_pattern_new();