## AgsLv2Worker

AgsLv2Worker — LV2 worker thread

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_LV2_WORKER_GET_OBJ_MUTEX()
#define | AGS_LV2_WORKER_RESPONSE_DATA()
gboolean | ags_lv2_worker_test_flags ()
void | ags_lv2_worker_set_flags ()
void | ags_lv2_worker_unset_flags ()
AgsLv2WorkerResponseData * | ags_lv2_worker_alloc_response_data ()
void | ags_lv2_worker_free_response_data ()
LV2_Worker_Status | ags_lv2_worker_respond ()
LV2_Worker_Status | ags_lv2_worker_schedule_work ()
void | ags_lv2_worker_do_poll ()
AgsLv2Worker * | ags_lv2_worker_new ()

## Properties

gpointer | handle | Read / Write
gpointer | response-data | Read / Write
gpointer | work-data | Read / Write
guint | work-size | Read / Write
AgsWorkerThread * | worker-thread | Read / Write

## Types and Values

enum | AgsLv2WorkerFlags
struct | AgsLv2WorkerResponseData

## Object Hierarchy

        GFlags
        ╰── AgsLv2WorkerFlags
        GObject
        ╰── AgsLv2Worker

## Includes

    #include <ags/plugin/ags_lv2_worker.h>

## Description

The AgsLv2Worker acts as task queue thread.

## Functions

### AGS_LV2_WORKER_GET_OBJ_MUTEX()

    #define AGS_LV2_WORKER_GET_OBJ_MUTEX(obj) (&(((AgsLv2Worker *) obj)->obj_mutex))

### AGS_LV2_WORKER_RESPONSE_DATA()

    #define AGS_LV2_WORKER_RESPONSE_DATA(ptr) ((AgsLv2WorkerResponseData *)(ptr))

### ags_lv2_worker_test_flags ()

    gboolean
    ags_lv2_worker_test_flags (AgsLv2Worker *lv2_worker,
                               guint flags);

Test `flags` to be set on `recall` .

#### Parameters

lv2_worker | the AgsLv2Worker |
flags | the flags |

#### Returns

`TRUE` if flags are set, else `FALSE`

Since: 3.0.0

### ags_lv2_worker_set_flags ()

    void
    ags_lv2_worker_set_flags (AgsLv2Worker *lv2_worker,
                              guint flags);

Set flags.

#### Parameters

lv2_worker | the AgsLv2Worker |
flags | the flags |

Since: 3.0.0

### ags_lv2_worker_unset_flags ()

    void
    ags_lv2_worker_unset_flags (AgsLv2Worker *lv2_worker,
                                guint flags);

Unset flags.

#### Parameters

lv2_worker | the AgsLv2Worker |
flags | the flags |

Since: 3.0.0

### ags_lv2_worker_alloc_response_data ()

    AgsLv2WorkerResponseData *
    ags_lv2_worker_alloc_response_data ();

Allocate a new AgsLv2WorkerResponseData.

#### Returns

the new AgsLv2WorkerResponseData

Since: 3.0.0

### ags_lv2_worker_free_response_data ()

    void
    ags_lv2_worker_free_response_data (AgsLv2WorkerResponseData *response_data);

Free `response_data` .

#### Parameters

response_data | the AgsLv2WorkerResponseData |

Since: 3.0.0

### ags_lv2_worker_respond ()

    LV2_Worker_Status
    ags_lv2_worker_respond (LV2_Worker_Respond_Handle handle,
                            uint32_t data_size,
                            const void *data);

Respond lv2 worker `handle` .

#### Parameters

handle | the LV2_Worker_Respond_Handle |
data_size | the data size |
data | the data |

#### Returns

LV2_Worker_Status

Since: 3.0.0

### ags_lv2_worker_schedule_work ()

    LV2_Worker_Status
    ags_lv2_worker_schedule_work (LV2_Worker_Schedule_Handle handle,
                                  uint32_t data_size,
                                  const void *data);

Schedule work of lv2 worker `handle` .

#### Parameters

handle | the LV2_Worker_Respond_Handle |
data_size | the data size |
data | the data |

#### Returns

LV2_Worker_Status

Since: 3.0.0

### ags_lv2_worker_do_poll ()

    void
    ags_lv2_worker_do_poll (AgsWorkerThread *worker_thread,
                            gpointer data);

Safe run callback.

#### Parameters

worker_thread | the AgsWorkerThread |
data | the data |

Since: 3.0.0

### ags_lv2_worker_new ()

    AgsLv2Worker *
    ags_lv2_worker_new ();

Create a new instance of AgsLv2Worker.

#### Returns

the new AgsLv2Worker

Since: 3.0.0

## Types and Values

### enum AgsLv2WorkerFlags

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

#### Members

AGS_LV2_WORKER_RUN | the worker is running |

### struct AgsLv2WorkerResponseData

    struct AgsLv2WorkerResponseData {
      uint32_t data_size;
      void *data;
    };

## Property Details

### The `“handle”` property

      “handle”                   gpointer

The assigned LV2_Handle

Owner: AgsLv2Worker

Flags: Read / Write

Since: 3.0.0

### The `“response-data”` property

      “response-data”            gpointer

The assigned GList containing AgsLv2WorkerResponseData

Owner: AgsLv2Worker

Flags: Read / Write

Since: 3.0.0

### The `“work-data”` property

      “work-data”                gpointer

The assigned work data

Owner: AgsLv2Worker

Flags: Read / Write

Since: 3.0.0

### The `“work-size”` property

      “work-size”                guint

The work size.

Owner: AgsLv2Worker

Flags: Read / Write

Default value: 0

Since: 3.0.0

### The `“worker-thread”` property

      “worker-thread”            AgsWorkerThread *

The assigned worker-thread.

Owner: AgsLv2Worker

Flags: Read / Write

Since: 3.0.0