4#ifndef __UNDO_CHANNEL_SEND_ACTION_H__
5#define __UNDO_CHANNEL_SEND_ACTION_H__
17enum class ChannelSendActionType
19 CHANNEL_SEND_ACTION_CONNECT_STEREO,
20 CHANNEL_SEND_ACTION_CONNECT_MIDI,
21 CHANNEL_SEND_ACTION_CONNECT_SIDECHAIN,
22 CHANNEL_SEND_ACTION_CHANGE_AMOUNT,
23 CHANNEL_SEND_ACTION_CHANGE_PORTS,
24 CHANNEL_SEND_ACTION_DISCONNECT,
52 ChannelSendActionType
type;
70 ChannelSendActionType type,
77#define channel_send_action_new_disconnect(send, error) \
78 channel_send_action_new ( \
79 send, ChannelSendActionType::CHANNEL_SEND_ACTION_DISCONNECT, NULL, NULL, \
80 0.f, PORT_CONNECTIONS_MGR, error)
82#define channel_send_action_new_connect_midi(send, midi, error) \
83 channel_send_action_new ( \
84 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_MIDI, midi, NULL, \
85 0.f, PORT_CONNECTIONS_MGR, error)
87#define channel_send_action_new_connect_audio(send, stereo, error) \
88 channel_send_action_new ( \
89 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_STEREO, NULL, \
90 stereo, 0.f, PORT_CONNECTIONS_MGR, error)
92#define channel_send_action_new_connect_sidechain(send, stereo, error) \
93 channel_send_action_new ( \
94 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_SIDECHAIN, NULL, \
95 stereo, 0.f, PORT_CONNECTIONS_MGR, error)
97#define channel_send_action_new_change_amount(send, amt, error) \
98 channel_send_action_new ( \
99 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CHANGE_AMOUNT, NULL, \
100 NULL, amt, NULL, error)
114 ChannelSendActionType type,
121#define channel_send_action_perform_disconnect(send, error) \
122 channel_send_action_perform ( \
123 send, ChannelSendActionType::CHANNEL_SEND_ACTION_DISCONNECT, NULL, NULL, \
124 0.f, PORT_CONNECTIONS_MGR, error)
126#define channel_send_action_perform_connect_midi(send, midi, error) \
127 channel_send_action_perform ( \
128 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_MIDI, midi, NULL, \
129 0.f, PORT_CONNECTIONS_MGR, error)
131#define channel_send_action_perform_connect_audio(send, stereo, error) \
132 channel_send_action_perform ( \
133 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_STEREO, NULL, \
134 stereo, 0.f, PORT_CONNECTIONS_MGR, error)
136#define channel_send_action_perform_connect_sidechain(send, stereo, error) \
137 channel_send_action_perform ( \
138 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CONNECT_SIDECHAIN, NULL, \
139 stereo, 0.f, PORT_CONNECTIONS_MGR, error)
141#define channel_send_action_perform_change_amount(send, amt, error) \
142 channel_send_action_perform ( \
143 send, ChannelSendActionType::CHANNEL_SEND_ACTION_CHANGE_AMOUNT, NULL, \
144 NULL, amt, NULL, error)
WARN_UNUSED_RESULT UndoableAction * channel_send_action_new(ChannelSend *send, ChannelSendActionType type, Port *port, StereoPorts *stereo, float amount, const PortConnectionsManager *port_connections_mgr, GError **error)
Creates a new action.
bool channel_send_action_perform(ChannelSend *send, ChannelSendActionType type, Port *port, StereoPorts *stereo, float amount, const PortConnectionsManager *port_connections_mgr, GError **error)
Wrapper to create action and perform it.
Port connections manager.
Action for channel send changes.
PortIdentifier * l_id
Target port identifiers.
PortConnectionsManager * connections_mgr_before
A clone of the port connections at the start of the action.
PortConnectionsManager * connections_mgr_after
A clone of the port connections after applying the action.
ChannelSendActionType type
Action type.
Port connections manager.
Struct used to identify Ports in the project.
Must ONLY be created via port_new()
L & R port, for convenience.
Base struct to be inherited by implementing undoable actions.