@@ -89,6 +89,7 @@ void LabSoundProvider::create_noodle_data_for_node(
89
89
if (!audio_node)
90
90
return ;
91
91
92
+ // prep the reverse table if necessary
92
93
auto reverse_it = g_node_reverse_lookups.find (node.id );
93
94
if (reverse_it == g_node_reverse_lookups.end ())
94
95
{
@@ -97,6 +98,8 @@ void LabSoundProvider::create_noodle_data_for_node(
97
98
}
98
99
auto & reverse = reverse_it->second ;
99
100
101
+ // ---------- custom renderers
102
+
100
103
lab::ContextRenderLock r (g_audio_context.get (), " LabSoundGraphToy_init" );
101
104
if (nullptr != dynamic_cast <lab::AnalyserNode*>(audio_node.get ()))
102
105
{
@@ -116,8 +119,9 @@ void LabSoundProvider::create_noodle_data_for_node(
116
119
{
117
120
ln_Pin pin_id = { create_entity (), true };
118
121
node.pins .push_back (pin_id);
119
- std::string name = " " ; // audio_node->input(i)->name(); @TODO an IDL for all the things
120
- reverse.input_pin_map [name] = pin_id;
122
+ // currently input names are not part of the LabSound API
123
+ std::string name = " " ; // audio_node->input(i)->name();
124
+ reverse.input_pin_map [name] = pin_id; // making this line currently meaningless
121
125
_noodlePins[pin_id] = lab::noodle::NoodlePin{
122
126
lab::noodle::NoodlePin::Kind::BusIn,
123
127
lab::noodle::NoodlePin::DataType::Bus,
@@ -192,7 +196,6 @@ void LabSoundProvider::create_noodle_data_for_node(
192
196
ln_Pin pin_id{ create_entity (), true };
193
197
node.pins .push_back (pin_id);
194
198
_audioPins[pin_id] = LabSoundPinData{ 0 , settings[i] };
195
-
196
199
_noodlePins[pin_id] = lab::noodle::NoodlePin {
197
200
lab::noodle::NoodlePin::Kind::Setting,
198
201
dataType,
@@ -233,7 +236,9 @@ void LabSoundProvider::create_noodle_data_for_node(
233
236
}
234
237
}
235
238
236
- void LabSoundProvider::pin_set_setting_bus_value (const std::string& node_name, const std::string& setting_name, const std::string& path)
239
+ // override
240
+ void LabSoundProvider::pin_set_setting_bus_value (
241
+ const std::string& node_name, const std::string& setting_name, const std::string& path)
237
242
{
238
243
ln_Node node = entity_for_node_named (node_name);
239
244
if (!node.valid )
@@ -256,6 +261,7 @@ void LabSoundProvider::pin_set_setting_bus_value(const std::string& node_name, c
256
261
}
257
262
}
258
263
264
+ // override
259
265
void LabSoundProvider::pin_set_bus_from_file (ln_Pin pin_id, const std::string& path)
260
266
{
261
267
if (!pin_id.valid || !path.length ())
@@ -280,6 +286,7 @@ void LabSoundProvider::pin_set_bus_from_file(ln_Pin pin_id, const std::string& p
280
286
}
281
287
}
282
288
289
+ // override
283
290
void LabSoundProvider::connect_bus_out_to_bus_in (ln_Node output_node_id, ln_Pin output_pin_id, ln_Node input_node_id)
284
291
{
285
292
if (!output_node_id.valid || !output_pin_id.valid || !input_node_id.valid )
@@ -301,6 +308,7 @@ void LabSoundProvider::connect_bus_out_to_bus_in(ln_Node output_node_id, ln_Pin
301
308
printf (" ConnectBusOutToBusIn %lld %lld\n " , input_node_id.id , output_node_id.id );
302
309
}
303
310
311
+ // override
304
312
void LabSoundProvider::connect_bus_out_to_param_in (ln_Node output_node_id, ln_Pin output_pin_id, ln_Pin param_pin_id)
305
313
{
306
314
if (!output_node_id.valid || !output_pin_id.valid || !param_pin_id.valid )
@@ -342,6 +350,7 @@ void LabSoundProvider::connect_bus_out_to_param_in(ln_Node output_node_id, ln_Pi
342
350
printf (" ConnectBusOutToParamIn %lld %lld, index %d\n " , param_pin_id.id , output_node_id.id , output_index);
343
351
}
344
352
353
+ // override
345
354
void LabSoundProvider::disconnect (ln_Connection connection_id_)
346
355
{
347
356
auto conn = _connections.find (connection_id_);
@@ -397,6 +406,7 @@ void LabSoundProvider::disconnect(ln_Connection connection_id_)
397
406
return ;
398
407
}
399
408
409
+ // override
400
410
ln_Context LabSoundProvider::create_runtime_context (ln_Node id)
401
411
{
402
412
const auto defaultAudioDeviceConfigurations = GetDefaultAudioDeviceConfiguration (true );
@@ -417,6 +427,7 @@ ln_Context LabSoundProvider::create_runtime_context(ln_Node id)
417
427
return ln_Context{id.id };
418
428
}
419
429
430
+ // override
420
431
void LabSoundProvider::node_start_stop (ln_Node node_id, float when)
421
432
{
422
433
if (node_id.id == ln_Node_null ().id )
@@ -444,6 +455,7 @@ void LabSoundProvider::node_start_stop(ln_Node node_id, float when)
444
455
}
445
456
}
446
457
458
+ // override
447
459
void LabSoundProvider::node_bang (ln_Node node_id)
448
460
{
449
461
if (node_id.id == ln_Node_null ().id )
@@ -467,6 +479,7 @@ void LabSoundProvider::node_bang(ln_Node node_id)
467
479
printf (" Bang %lld\n " , node_id.id );
468
480
}
469
481
482
+ // override
470
483
ln_Pin LabSoundProvider::node_output_named (ln_Node node_id, const std::string& output_name)
471
484
{
472
485
if (!node_id.valid )
@@ -496,6 +509,7 @@ ln_Pin LabSoundProvider::node_output_named(ln_Node node_id, const std::string& o
496
509
return result;
497
510
}
498
511
512
+ // override
499
513
ln_Pin LabSoundProvider::node_input_with_index (ln_Node node_id, int output)
500
514
{
501
515
if (!node_id.valid )
@@ -525,6 +539,7 @@ ln_Pin LabSoundProvider::node_input_with_index(ln_Node node_id, int output)
525
539
return result;
526
540
}
527
541
542
+ // override
528
543
ln_Pin LabSoundProvider::node_output_with_index (ln_Node node_id, int output)
529
544
{
530
545
if (!node_id.valid )
@@ -554,6 +569,7 @@ ln_Pin LabSoundProvider::node_output_with_index(ln_Node node_id, int output)
554
569
return result;
555
570
}
556
571
572
+ // override
557
573
ln_Pin LabSoundProvider::node_param_named (ln_Node node_id, const std::string& output_name)
558
574
{
559
575
if (!node_id.valid )
@@ -583,6 +599,7 @@ ln_Pin LabSoundProvider::node_param_named(ln_Node node_id, const std::string& ou
583
599
return result;
584
600
}
585
601
602
+ // override
586
603
ln_Node LabSoundProvider::node_create (const std::string& kind, ln_Node id)
587
604
{
588
605
if (kind == " OSC" )
@@ -613,6 +630,7 @@ ln_Node LabSoundProvider::node_create(const std::string& kind, ln_Node id)
613
630
return ln_Node{ id };
614
631
}
615
632
633
+ // override
616
634
void LabSoundProvider::node_delete (ln_Node node_id)
617
635
{
618
636
if (node_id.id != ln_Node_null ().id )
@@ -664,6 +682,7 @@ void LabSoundProvider::node_delete(ln_Node node_id)
664
682
}
665
683
}
666
684
685
+ // override
667
686
char const * const * LabSoundProvider::node_names () const
668
687
{
669
688
static std::vector<const char *> names;
@@ -679,6 +698,7 @@ char const* const* LabSoundProvider::node_names() const
679
698
return &names[0 ];
680
699
}
681
700
701
+ // override
682
702
void LabSoundProvider::pin_set_param_value (const std::string& node_name, const std::string& param_name, float v)
683
703
{
684
704
ln_Node node = entity_for_node_named (node_name);
@@ -698,6 +718,7 @@ void LabSoundProvider::pin_set_param_value(const std::string& node_name, const s
698
718
p->setValue (v);
699
719
}
700
720
721
+ // override
701
722
void LabSoundProvider::pin_set_setting_float_value (const std::string& node_name, const std::string& setting_name, float v)
702
723
{
703
724
ln_Node node = entity_for_node_named (node_name);
@@ -717,6 +738,7 @@ void LabSoundProvider::pin_set_setting_float_value(const std::string& node_name,
717
738
s->setFloat (v);
718
739
}
719
740
741
+ // override
720
742
void LabSoundProvider::pin_set_float_value (ln_Pin pin, float v)
721
743
{
722
744
if (!pin.valid )
@@ -739,6 +761,7 @@ void LabSoundProvider::pin_set_float_value(ln_Pin pin, float v)
739
761
}
740
762
}
741
763
764
+ // override
742
765
float LabSoundProvider::pin_float_value (ln_Pin pin)
743
766
{
744
767
if (!pin.valid )
@@ -757,6 +780,7 @@ float LabSoundProvider::pin_float_value(ln_Pin pin)
757
780
return 0 .f ;
758
781
}
759
782
783
+ // override
760
784
void LabSoundProvider::pin_set_setting_int_value (const std::string& node_name, const std::string& setting_name, int v)
761
785
{
762
786
ln_Node node = entity_for_node_named (node_name);
@@ -776,6 +800,7 @@ void LabSoundProvider::pin_set_setting_int_value(const std::string& node_name, c
776
800
s->setUint32 (v);
777
801
}
778
802
803
+ // override
779
804
void LabSoundProvider::pin_set_int_value (ln_Pin pin, int v)
780
805
{
781
806
if (!pin.valid )
@@ -798,6 +823,7 @@ void LabSoundProvider::pin_set_int_value(ln_Pin pin, int v)
798
823
}
799
824
}
800
825
826
+ // override
801
827
int LabSoundProvider::pin_int_value (ln_Pin pin)
802
828
{
803
829
if (!pin.valid )
@@ -816,7 +842,7 @@ int LabSoundProvider::pin_int_value(ln_Pin pin)
816
842
return 0 ;
817
843
}
818
844
819
-
845
+ // override
820
846
void LabSoundProvider::pin_set_enumeration_value (ln_Pin pin, const std::string& value)
821
847
{
822
848
if (!pin.valid )
@@ -838,6 +864,7 @@ void LabSoundProvider::pin_set_enumeration_value(ln_Pin pin, const std::string&
838
864
}
839
865
}
840
866
867
+ // override
841
868
void LabSoundProvider::pin_set_setting_enumeration_value (const std::string& node_name, const std::string& setting_name, const std::string& value)
842
869
{
843
870
ln_Node node = entity_for_node_named (node_name);
@@ -864,6 +891,7 @@ void LabSoundProvider::pin_set_setting_enumeration_value(const std::string& node
864
891
}
865
892
}
866
893
894
+ // override
867
895
void LabSoundProvider::pin_set_setting_bool_value (const std::string& node_name, const std::string& setting_name, bool v)
868
896
{
869
897
ln_Node node = entity_for_node_named (node_name);
@@ -883,6 +911,7 @@ void LabSoundProvider::pin_set_setting_bool_value(const std::string& node_name,
883
911
s->setBool (v);
884
912
}
885
913
914
+ // override
886
915
void LabSoundProvider::pin_set_bool_value (ln_Pin pin, bool v)
887
916
{
888
917
if (!pin.valid )
@@ -905,6 +934,7 @@ void LabSoundProvider::pin_set_bool_value(ln_Pin pin, bool v)
905
934
}
906
935
}
907
936
937
+ // override
908
938
bool LabSoundProvider::pin_bool_value (ln_Pin pin)
909
939
{
910
940
if (!pin.valid )
@@ -923,6 +953,7 @@ bool LabSoundProvider::pin_bool_value(ln_Pin pin)
923
953
return false ;
924
954
}
925
955
956
+ // override
926
957
void LabSoundProvider::pin_create_output (const std::string& node_name, const std::string& output_name, int channels)
927
958
{
928
959
ln_Node node_e = entity_for_node_named (node_name);
@@ -973,6 +1004,7 @@ void LabSoundProvider::pin_create_output(const std::string& node_name, const std
973
1004
}
974
1005
}
975
1006
1007
+ // node_get_timing
976
1008
float LabSoundProvider::node_get_timing (ln_Node node)
977
1009
{
978
1010
auto n_it = _audioNodes.find (node);
@@ -986,6 +1018,7 @@ float LabSoundProvider::node_get_timing(ln_Node node)
986
1018
return n->graphTime .microseconds .count () * 1 .e -6f ;
987
1019
}
988
1020
1021
+ // override
989
1022
float LabSoundProvider::node_get_self_timing (ln_Node node)
990
1023
{
991
1024
auto n_it = _audioNodes.find (node);
0 commit comments