Phase 6: Add WAV clips, graph playback and bounded recording
This commit is contained in:
parent
65640c4aad
commit
8a37090b81
40 changed files with 1450 additions and 69 deletions
|
|
@ -59,6 +59,8 @@ xtc_result xtc_graph_add_oscillator(xtc_graph *graph, float frequency, size_t *o
|
|||
}
|
||||
xtc_result xtc_graph_add_meter(xtc_graph *graph, size_t *out_node_id)
|
||||
{ return add_node(graph, XTC_NODE_METER, 0.0f, out_node_id); }
|
||||
xtc_result xtc_graph_add_audio(xtc_graph *graph, size_t *out_node_id)
|
||||
{ return add_node(graph, XTC_NODE_AUDIO, 0.0f, out_node_id); }
|
||||
xtc_result xtc_graph_add_output(xtc_graph *graph, size_t *out_node_id)
|
||||
{ return add_node(graph, XTC_NODE_OUTPUT, 0.0f, out_node_id); }
|
||||
|
||||
|
|
@ -70,7 +72,7 @@ xtc_result xtc_graph_get_port(const xtc_graph *graph, size_t node_id,
|
|||
node_id = node_index(graph, node_id);
|
||||
if (node_id == SIZE_MAX) return XTC_ERR_NOT_FOUND;
|
||||
type = graph->nodes[node_id].type;
|
||||
if (port_id > 1U || (port_id == 0U && type == XTC_NODE_OSCILLATOR) ||
|
||||
if (port_id > 1U || (port_id == 0U && (type == XTC_NODE_OSCILLATOR || type == XTC_NODE_AUDIO)) ||
|
||||
(port_id == 1U && type == XTC_NODE_OUTPUT)) return XTC_ERR_NOT_FOUND;
|
||||
out_port->direction = port_id == 0U ? XTC_PORT_INPUT : XTC_PORT_OUTPUT;
|
||||
out_port->signal_type = XTC_SIGNAL_AUDIO;
|
||||
|
|
@ -226,6 +228,7 @@ xtc_result xtc_graph_apply_edit(const xtc_graph *source, const xtc_graph_edit *e
|
|||
case XTC_NODE_GAIN: result = xtc_graph_add_gain(graph, edit->data.add.value, &added_id); break;
|
||||
case XTC_NODE_OSCILLATOR: result = xtc_graph_add_oscillator(graph, edit->data.add.value, &added_id); break;
|
||||
case XTC_NODE_METER: result = xtc_graph_add_meter(graph, &added_id); break;
|
||||
case XTC_NODE_AUDIO: result = xtc_graph_add_audio(graph, &added_id); break;
|
||||
case XTC_NODE_OUTPUT: result = xtc_graph_add_output(graph, &added_id); break;
|
||||
default: result = XTC_ERR_INVALID_ARGUMENT; break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue