Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
wrapped_object_with_change_signal.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2021-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_WRAPPED_OBJECT_WITH_CHANGE_SIGNAL_H__
11#define __GUI_BACKEND_WRAPPED_OBJECT_WITH_CHANGE_SIGNAL_H__
12
13#include "utils/types.h"
14
15#include <glib-object.h>
16
17#define WRAPPED_OBJECT_WITH_CHANGE_SIGNAL_TYPE \
18 (wrapped_object_with_change_signal_get_type ())
19G_DECLARE_FINAL_TYPE (
21 wrapped_object_with_change_signal,
22 Z,
23 WRAPPED_OBJECT_WITH_CHANGE_SIGNAL,
24 GObject)
25
26
32typedef enum WrappedObjectType
33{
34 WRAPPED_OBJECT_TYPE_TRACK,
35 WRAPPED_OBJECT_TYPE_PLUGIN,
36 WRAPPED_OBJECT_TYPE_PLUGIN_DESCR,
37 WRAPPED_OBJECT_TYPE_CHORD_DESCR,
38 WRAPPED_OBJECT_TYPE_CHORD_PSET,
39 WRAPPED_OBJECT_TYPE_CHORD_PSET_PACK,
40 WRAPPED_OBJECT_TYPE_SUPPORTED_FILE,
41 WRAPPED_OBJECT_TYPE_MIDI_MAPPING,
42 WRAPPED_OBJECT_TYPE_ARRANGER_OBJECT,
43 WRAPPED_OBJECT_TYPE_PROJECT_INFO,
44 WRAPPED_OBJECT_TYPE_PORT,
45 WRAPPED_OBJECT_TYPE_CHANNEL_SEND_TARGET,
46 WRAPPED_OBJECT_TYPE_PLUGIN_COLLECTION,
47 WRAPPED_OBJECT_TYPE_EXT_PORT,
48 WRAPPED_OBJECT_TYPE_FILE_BROWSER_LOCATION,
49} WrappedObjectType;
50
58typedef struct _WrappedObjectWithChangeSignal
59{
60 GObject parent_instance;
61
62 WrappedObjectType type;
63 void * obj;
64
66 GListModel * parent_model;
67
70 GListModel * child_model;
71
72 ObjectFreeFunc free_func;
74
80void
82
89char *
91
96wrapped_object_with_change_signal_new (void * obj, WrappedObjectType type);
97
103 void * obj,
104 WrappedObjectType type,
105 ObjectFreeFunc free_func);
106
111#endif
void(* ObjectFreeFunc)(void *)
Function to call to free objects.
Definition types.h:118
WrappedObjectWithChangeSignal * wrapped_object_with_change_signal_new_with_free_func(void *obj, WrappedObjectType type, ObjectFreeFunc free_func)
If this function is not used, the internal object will not be free'd.
char * wrapped_object_with_change_signal_get_display_name(void *data)
Returns a display name for the given object, intended to be used where the object should be displayed...
void wrapped_object_with_change_signal_fire(WrappedObjectWithChangeSignal *self)
Fires the signal.
WrappedObjectWithChangeSignal * wrapped_object_with_change_signal_new(void *obj, WrappedObjectType type)
Instantiates a new WrappedObjectWithChangeSignal.
A GObject-ified normal C object with a signal that interested parties can listen to for changes.
GListModel * parent_model
Parent model, if using tree model.
GListModel * child_model
Model containing the children for this object (if using tree model).
Custom types.