4#ifndef __ACTION_PORT_CONNECTION_ACTION_H__
5#define __ACTION_PORT_CONNECTION_ACTION_H__
16enum class PortConnectionActionType
18 PORT_CONNECTION_CONNECT,
19 PORT_CONNECTION_DISCONNECT,
20 PORT_CONNECTION_ENABLE,
21 PORT_CONNECTION_DISABLE,
22 PORT_CONNECTION_CHANGE_MULTIPLIER,
29 PortConnectionActionType type;
49 PortConnectionActionType type,
55#define port_connection_action_new_connect(src_id, dest_id, error) \
56 port_connection_action_new ( \
57 PortConnectionActionType::PORT_CONNECTION_CONNECT, src_id, dest_id, 0.f, \
60#define port_connection_action_new_disconnect(src_id, dest_id, error) \
61 port_connection_action_new ( \
62 PortConnectionActionType::PORT_CONNECTION_DISCONNECT, src_id, dest_id, \
65#define port_connection_action_new_enable(src_id, dest_id, enable, error) \
66 port_connection_action_new ( \
68 ? PortConnectionActionType::PORT_CONNECTION_ENABLE \
69 : PortConnectionActionType::PORT_CONNECTION_DISABLE, \
70 src_id, dest_id, 0.f, error)
72#define port_connection_action_new_change_multiplier( \
73 src_id, dest_id, new_multiplier, error) \
74 port_connection_action_new ( \
75 PortConnectionActionType::PORT_CONNECTION_CHANGE_MULTIPLIER, src_id, \
76 dest_id, new_multiplier, error)
82port_connection_action_perform (
83 PortConnectionActionType type,
89#define port_connection_action_perform_connect(src_id, dest_id, error) \
90 port_connection_action_perform ( \
91 PortConnectionActionType::PORT_CONNECTION_CONNECT, src_id, dest_id, 0.f, \
94#define port_connection_action_perform_disconnect(src_id, dest_id, error) \
95 port_connection_action_perform ( \
96 PortConnectionActionType::PORT_CONNECTION_DISCONNECT, src_id, dest_id, \
99#define port_connection_action_perform_enable(src_id, dest_id, enable, error) \
100 port_connection_action_perform ( \
102 ? PortConnectionActionType::PORT_CONNECTION_ENABLE \
103 : PortConnectionActionType::PORT_CONNECTION_DISABLE, \
104 src_id, dest_id, 0.f, error)
106#define port_connection_action_perform_change_multiplier( \
107 src_id, dest_id, new_multiplier, error) \
108 port_connection_action_perform ( \
109 PortConnectionActionType::PORT_CONNECTION_CHANGE_MULTIPLIER, src_id, \
110 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.