## AgsRecyclingContext

AgsRecyclingContext — A context of recycling acting as dynamic context

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_RECYCLING_CONTEXT_GET_OBJ_MUTEX()
GList * | ags_recycling_context_find_scope ()
void | ags_recycling_context_replace ()
void | ags_recycling_context_add ()
void | ags_recycling_context_remove ()
void | ags_recycling_context_insert ()
AgsRecyclingContext * | ags_recycling_context_get_toplevel ()
gint | ags_recycling_context_find ()
gint | ags_recycling_context_find_child ()
gint | ags_recycling_context_find_parent ()
void | ags_recycling_context_add_child ()
void | ags_recycling_context_remove_child ()
GList * | ags_recycling_context_get_child_recall_id ()
AgsRecyclingContext * | ags_recycling_context_reset_recycling ()
AgsRecyclingContext * | ags_recycling_context_new ()

## Properties

gpointer | child | Read / Write
guint64 | length | Read / Write
AgsRecyclingContext * | parent | Read / Write
AgsRecallID * | recall-id | Read / Write

## Types and Values

enum | AgsRecyclingContextFlags

## Object Hierarchy

        GFlags
        ╰── AgsRecyclingContextFlags
        GObject
        ╰── AgsRecyclingContext

## Includes

    #include <ags/audio/ags_recycling_context.h>

## Description

AgsRecyclingContext organizes AgsRecycling objects as dynamic context within nested tree.

This object is only to reference the current recycling context. This may be replaced by another recycling context as calling `ags_channel_set_link()`.

Further it provides the `parent` property, if this is `NULL` your audio signal won't be recycled anymore. This means you are going to copy the recycling's audio signals to soundcard. As it is not `NULL` you are entering recursion.

There is a strong relation to AgsRecallID.

## Functions

### AGS_RECYCLING_CONTEXT_GET_OBJ_MUTEX()

    #define AGS_RECYCLING_CONTEXT_GET_OBJ_MUTEX(obj) (&(((AgsRecyclingContext *) obj)->obj_mutex))

### ags_recycling_context_find_scope ()

    GList *
    ags_recycling_context_find_scope (GList *recycling_context,
                                      gint sound_scope);

Find matching `sound_scope` in `recycling_context` .

#### Parameters

recycling_context | the GList containing AgsRecyclingContext. | [element-type AgsAudio.RecyclingContext][transfer none]
sound_scope | the sound scope |

#### Returns

the matching GList or `NULL` if not found.

[element-type AgsAudio.RecyclingContext][transfer none]

Since: 3.0.0

### ags_recycling_context_replace ()

    void
    ags_recycling_context_replace (AgsRecyclingContext *recycling_context,
                                   AgsRecycling *recycling,
                                   gint position);

Replaces one recycling entry in a context.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to add |
position | the index of `recycling` |

Since: 3.0.0

### ags_recycling_context_add ()

    void
    ags_recycling_context_add (AgsRecyclingContext *recycling_context,
                               AgsRecycling *recycling);

Adds a recycling to a context.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to add |

Since: 3.0.0

### ags_recycling_context_remove ()

    void
    ags_recycling_context_remove (AgsRecyclingContext *recycling_context,
                                  AgsRecycling *recycling);

Removes a recycling in a context.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to remove |

Since: 3.0.0

### ags_recycling_context_insert ()

    void
    ags_recycling_context_insert (AgsRecyclingContext *recycling_context,
                                  AgsRecycling *recycling,
                                  gint position);

Inserts a recycling to a context.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to insert |
position | the index to insert at |

Since: 3.0.0

### ags_recycling_context_get_toplevel ()

    AgsRecyclingContext *
    ags_recycling_context_get_toplevel (AgsRecyclingContext *recycling_context);

Iterates the tree up to highest level.

#### Parameters

recycling_context | the AgsRecyclingContext |

#### Returns

the topmost recycling context.

[transfer full]

Since: 3.0.0

### ags_recycling_context_find ()

    gint
    ags_recycling_context_find (AgsRecyclingContext *recycling_context,
                                AgsRecycling *recycling);

Find position of recycling within array.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to look up |

#### Returns

recycling array index

Since: 3.0.0

### ags_recycling_context_find_child ()

    gint
    ags_recycling_context_find_child (AgsRecyclingContext *recycling_context,
                                      AgsRecycling *recycling);

Find position of recycling within arrays.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to look up |

#### Returns

recycling array index

Since: 3.0.0

### ags_recycling_context_find_parent ()

    gint
    ags_recycling_context_find_parent (AgsRecyclingContext *recycling_context,
                                       AgsRecycling *recycling);

Find position of recycling within array.

#### Parameters

recycling_context | the AgsRecyclingContext |
recycling | the AgsRecycling to look up |

#### Returns

recycling array index

Since: 3.0.0

### ags_recycling_context_add_child ()

    void
    ags_recycling_context_add_child (AgsRecyclingContext *parent,
                                     AgsRecyclingContext *child);

Adds a recycling context as child.

#### Parameters

parent | the parental AgsRecyclingContext |
child | the child |

Since: 3.0.0

### ags_recycling_context_remove_child ()

    void
    ags_recycling_context_remove_child (AgsRecyclingContext *parent,
                                        AgsRecyclingContext *child);

Removes a recycling context of its parent.

#### Parameters

parent | the AgsRecyclingContext |
child | the child to remove |

Since: 3.0.0

### ags_recycling_context_get_child_recall_id ()

    GList *
    ags_recycling_context_get_child_recall_id
                                   (AgsRecyclingContext *recycling_context);

Retrieve all child recall ids.

#### Parameters

recycling_context | the AgsRecyclingContext |

#### Returns

the AgsRecallID as GList.

[element-type AgsAudio.RecallID][transfer full]

Since: 3.0.0

### ags_recycling_context_reset_recycling ()

    AgsRecyclingContext *
    ags_recycling_context_reset_recycling (AgsRecyclingContext *recycling_context,
                                           AgsRecycling *old_first_recycling,
                                           AgsRecycling *old_last_recycling,
                                           AgsRecycling *new_first_recycling,
                                           AgsRecycling *new_last_recycling);

Modify recycling of context.

#### Parameters

recycling_context | the AgsRecyclingContext |
old_first_recycling | the first recycling to replace |
old_last_recycling | the last recycling to replace |
new_first_recycling | the first recycling to insert |
new_last_recycling | the last recycling to insert |

#### Returns

the new AgsRecyclingContext.

[transfer full]

Since: 3.0.0

### ags_recycling_context_new ()

    AgsRecyclingContext *
    ags_recycling_context_new (guint64 length);

Creates a AgsRecyclingContext, boundaries are specified by `length`

#### Parameters

length | array dimension of context |

#### Returns

a new AgsRecyclingContext

Since: 3.0.0

## Types and Values

### enum AgsRecyclingContextFlags

Enum values to control the behavior or indicate internal state of AgsRecyclingContext by enable/disable as flags.

#### Members

AGS_RECYCLING_CONTEXT_CHAINED_TO_OUTPUT | chained to output |
AGS_RECYCLING_CONTEXT_CHAINED_TO_INPUT | chained to input |

## Property Details

### The `“child”` property

      “child”                    gpointer

The child recycling contexts.

[transfer full]

Owner: AgsRecyclingContext

Flags: Read / Write

Since: 3.0.0

### The `“length”` property

      “length”                   guint64

Boundary length.

Owner: AgsRecyclingContext

Flags: Read / Write

Default value: 0

Since: 3.0.0

### The `“parent”` property

      “parent”                   AgsRecyclingContext *

The parent recycling context within tree.

Owner: AgsRecyclingContext

Flags: Read / Write

Since: 3.0.0

### The `“recall-id”` property

      “recall-id”                AgsRecallID *

The assigned AgsRecallID.

Owner: AgsRecyclingContext

Flags: Read / Write

Since: 3.0.0