4#ifndef __ACTION_PORT_CONNECTION_ACTION_H__
5#define __ACTION_PORT_CONNECTION_ACTION_H__
16typedef enum PortConnectionActionType
18 PORT_CONNECTION_CONNECT,
19 PORT_CONNECTION_DISCONNECT,
20 PORT_CONNECTION_ENABLE,
21 PORT_CONNECTION_DISABLE,
22 PORT_CONNECTION_CHANGE_MULTIPLIER,
23} PortConnectionActionType;
29 PortConnectionActionType type;
49 PortConnectionActionType type,
55#define port_connection_action_new_connect(src_id, dest_id, error) \
56 port_connection_action_new ( \
57 PORT_CONNECTION_CONNECT, src_id, dest_id, 0.f, error)
59#define port_connection_action_new_disconnect(src_id, dest_id, error) \
60 port_connection_action_new ( \
61 PORT_CONNECTION_DISCONNECT, src_id, dest_id, 0.f, error)
63#define port_connection_action_new_enable(src_id, dest_id, enable, error) \
64 port_connection_action_new ( \
65 enable ? PORT_CONNECTION_ENABLE : PORT_CONNECTION_DISABLE, src_id, \
68#define port_connection_action_new_change_multiplier( \
69 src_id, dest_id, new_multiplier, error) \
70 port_connection_action_new ( \
71 PORT_CONNECTION_CHANGE_MULTIPLIER, src_id, dest_id, new_multiplier, error)
77port_connection_action_perform (
78 PortConnectionActionType type,
84#define port_connection_action_perform_connect(src_id, dest_id, error) \
85 port_connection_action_perform ( \
86 PORT_CONNECTION_CONNECT, src_id, dest_id, 0.f, error)
88#define port_connection_action_perform_disconnect(src_id, dest_id, error) \
89 port_connection_action_perform ( \
90 PORT_CONNECTION_DISCONNECT, src_id, dest_id, 0.f, error)
92#define port_connection_action_perform_enable(src_id, dest_id, enable, error) \
93 port_connection_action_perform ( \
94 enable ? PORT_CONNECTION_ENABLE : PORT_CONNECTION_DISABLE, src_id, \
97#define port_connection_action_perform_change_multiplier( \
98 src_id, dest_id, new_multiplier, error) \
99 port_connection_action_perform ( \
100 PORT_CONNECTION_CHANGE_MULTIPLIER, src_id, dest_id, new_multiplier, error)
WARN_UNUSED_RESULT UndoableAction * port_connection_action_new(PortConnectionActionType type, PortIdentifier *src_id, PortIdentifier *dest_id, float new_val, GError **error)
Create a new action.
float val
Value before/after the change.
A connection between two ports.
Struct used to identify Ports in the project.
Base struct to be inherited by implementing undoable actions.