diff --git a/flutter/ayf_pack/example/lib/models/ayf_ui_specific_widgets.dart b/flutter/ayf_pack/example/lib/models/ayf_ui_specific_widgets.dart index 7eafad62..5689dfb1 100644 --- a/flutter/ayf_pack/example/lib/models/ayf_ui_specific_widgets.dart +++ b/flutter/ayf_pack/example/lib/models/ayf_ui_specific_widgets.dart @@ -11,7 +11,7 @@ import 'package:flutter/foundation.dart' show kIsWeb; // Callback to allocate an audio device sliver in the list of active/inactive // devices lists Widget? allocateAudioDeviceSliver(AudYoFloOneDeviceSelectionOptionWithId option, - bool fromActiveList, AudYoFloSingleSelectionComponent? reportW) => + bool fromActiveList, AudYoFloSelectionComponentUi? reportW) => AudYoFloOneDeviceSliver(option, fromActiveList, reportW); // ============================================================================ @@ -20,7 +20,7 @@ Widget? allocateAudioDeviceSliver(AudYoFloOneDeviceSelectionOptionWithId option, Widget? allocateHeadtrackerDeviceSliver( AudYoFloOneDeviceSelectionOptionWithId option, bool fromActiveList, - AudYoFloSingleSelectionComponent? reportW) => + AudYoFloSelectionComponentUi? reportW) => AudYoFloOneHeadtrackerDeviceSliver(option, fromActiveList, reportW); BottomAppBar? allocatorBottomAppBar() { diff --git a/flutter/ayf_pack/lib/main-widgets/ayf_audio_settings_widget.dart b/flutter/ayf_pack/lib/main-widgets/ayf_audio_settings_widget.dart index 88328574..9b0633cc 100644 --- a/flutter/ayf_pack/lib/main-widgets/ayf_audio_settings_widget.dart +++ b/flutter/ayf_pack/lib/main-widgets/ayf_audio_settings_widget.dart @@ -22,7 +22,7 @@ class AudYoFloAudioSettingsWidget extends StatefulWidget { final Widget? Function( AudYoFloOneDeviceSelectionOptionWithId option, bool fromActiveList, - AudYoFloSingleSelectionComponent?) callbackActiveInactiveDeviceSliver; + AudYoFloSelectionComponentUi?) callbackActiveInactiveDeviceSliver; @override _AudYoFloAudioSettingsWidgetState createState() => _AudYoFloAudioSettingsWidgetState(); diff --git a/flutter/ayf_pack/lib/models/ayf_backend_cache.dart b/flutter/ayf_pack/lib/models/ayf_backend_cache.dart index 305af550..16667289 100644 --- a/flutter/ayf_pack/lib/models/ayf_backend_cache.dart +++ b/flutter/ayf_pack/lib/models/ayf_backend_cache.dart @@ -655,7 +655,7 @@ abstract class AudYoFloBackendCache @override List findProcessesMatchComponent(JvxComponentIdentification cpId, - {List? lstIn}) { + {List? lstIn, bool asFirstElement = false}) { List lst = []; if (lstIn != null) { lst = List.from(lstIn); @@ -666,7 +666,13 @@ abstract class AudYoFloBackendCache var involvedElementStart = con.involved; bool foundElm = false; if (involvedElementStart != null) { - foundElm = involvedElementStart.findProcessMatchComponent(cpId); + if (asFirstElement) { + if (cpId == involvedElementStart.cpId) { + foundElm = true; + } + } else { + foundElm = involvedElementStart.findProcessMatchComponent(cpId); + } } if (foundElm) { lst.add(con.uId); diff --git a/flutter/ayf_pack/lib/models/ayf_component_selection.dart b/flutter/ayf_pack/lib/models/ayf_component_selection.dart index 242b14ee..fd2b0b32 100644 --- a/flutter/ayf_pack/lib/models/ayf_component_selection.dart +++ b/flutter/ayf_pack/lib/models/ayf_component_selection.dart @@ -25,6 +25,15 @@ class AudYoFloOneDeviceSelectionOptionWithId { AudYoFloOneDeviceSelectionOptionWithId(this.option, this.idx); } +class AudYoFloOneDeviceSelectionOptionWithIdAndProcess + extends AudYoFloOneDeviceSelectionOptionWithId { + AudYoFloOneConnectedProcess? proc; + List relChainComponents = []; + AudYoFloOneDeviceSelectionOptionWithIdAndProcess( + AudYoFloOneDeviceSelectionOption option, int idx) + : super(option, idx) {} +} + class AudYoFloOneComponentSelectionOption extends AudYoFloOneSelectionOptionBase { List sids = []; diff --git a/flutter/ayf_pack/lib/sub-widgets/audio-devices/ayf_audio_device_active_inactive_sliver.dart b/flutter/ayf_pack/lib/sub-widgets/audio-devices/ayf_audio_device_active_inactive_sliver.dart index 49588e9d..a7428267 100644 --- a/flutter/ayf_pack/lib/sub-widgets/audio-devices/ayf_audio_device_active_inactive_sliver.dart +++ b/flutter/ayf_pack/lib/sub-widgets/audio-devices/ayf_audio_device_active_inactive_sliver.dart @@ -18,7 +18,7 @@ class AudYoFloAudioDeviceRenderSection { class AudYoFloOneDeviceSliver extends StatelessWidget { final AudYoFloOneDeviceSelectionOptionWithId option; final bool fromActiveList; - final AudYoFloSingleSelectionComponent? reportTarget; + final AudYoFloSelectionComponentUi? reportTarget; AudYoFloOneDeviceSliver(this.option, this.fromActiveList, this.reportTarget); @@ -147,7 +147,7 @@ class AudYoFloOneDeviceSliver extends StatelessWidget { // update the widget which is in parallel to the device selection construct if (reportTarget != null) { - reportTarget!.reportSelectionComponent(option.option.devIdent); + reportTarget!.reportSelectionComponentUi(option.option.devIdent); } }, child: Card( diff --git a/flutter/ayf_pack/lib/sub-widgets/devices/ayf_device_selection_widget.dart b/flutter/ayf_pack/lib/sub-widgets/devices/ayf_device_selection_widget.dart index 1befe5c2..a0811047 100644 --- a/flutter/ayf_pack/lib/sub-widgets/devices/ayf_device_selection_widget.dart +++ b/flutter/ayf_pack/lib/sub-widgets/devices/ayf_device_selection_widget.dart @@ -14,7 +14,7 @@ class AudYoFloDeviceSelectionWidget extends StatefulWidget { final Widget? Function( AudYoFloOneDeviceSelectionOptionWithId option, bool fromActiveList, - AudYoFloSingleSelectionComponent?) callbackActiveInactiveDeviceSliver; + AudYoFloSelectionComponentUi?) callbackActiveInactiveDeviceSliver; AudYoFloDeviceSelectionWidget(this.identT, this.tagDevices, this.callbackDeviceWidget, this.callbackActiveInactiveDeviceSliver); @@ -26,9 +26,7 @@ class AudYoFloDeviceSelectionWidget extends StatefulWidget { class _AudYoFloDeviceSelectionWidgetStates extends State - with - AudYoFloSingleSelectionComponent, - AudYoFloOneTechnologyDevicesOnChange { + with AudYoFloSelectionComponentUi, AudYoFloOneTechnologyDevicesOnChange { List? pContent; JvxComponentIdentification selCpId = JvxComponentIdentification( cpTp: JvxComponentTypeEnum.JVX_COMPONENT_UNKNOWN); @@ -38,7 +36,7 @@ class _AudYoFloDeviceSelectionWidgetStates // At the moment, this callback is called if a device was chosen in the list // of active devices. @override - void reportSelectionComponent(JvxComponentIdentification cpId) { + void reportSelectionComponentUi(JvxComponentIdentification cpId) { setState(() { selCpId = cpId; }); diff --git a/flutter/ayf_pack/lib/sub-widgets/devices/ayf_devices_active_inactive_widget.dart b/flutter/ayf_pack/lib/sub-widgets/devices/ayf_devices_active_inactive_widget.dart index 75b68341..f9538cc7 100644 --- a/flutter/ayf_pack/lib/sub-widgets/devices/ayf_devices_active_inactive_widget.dart +++ b/flutter/ayf_pack/lib/sub-widgets/devices/ayf_devices_active_inactive_widget.dart @@ -38,12 +38,12 @@ class deviceSelectionDragData { class AudYoFloDeviceActiveInactiveWidget extends StatefulWidget { final List? pContent; final JvxComponentIdentification cpId; - final AudYoFloSingleSelectionComponent? reportWidget; + final AudYoFloSelectionComponentUi? reportWidget; final String tagDevices; final Widget? Function( AudYoFloOneDeviceSelectionOptionWithId option, bool fromActiveList, - AudYoFloSingleSelectionComponent?) callbackActiveInactiveDeviceSliver; + AudYoFloSelectionComponentUi?) callbackActiveInactiveDeviceSliver; AudYoFloDeviceActiveInactiveWidget(this.pContent, this.cpId, this.tagDevices, this.callbackActiveInactiveDeviceSliver, {this.reportWidget}); diff --git a/flutter/ayf_pack/lib/sub-widgets/file-input-devices/ayf_file_input_active_devices_sliver.dart b/flutter/ayf_pack/lib/sub-widgets/file-input-devices/ayf_file_input_active_devices_sliver.dart index 13e8db15..a79de782 100644 --- a/flutter/ayf_pack/lib/sub-widgets/file-input-devices/ayf_file_input_active_devices_sliver.dart +++ b/flutter/ayf_pack/lib/sub-widgets/file-input-devices/ayf_file_input_active_devices_sliver.dart @@ -7,7 +7,7 @@ class AudYoFloOneFileDeviceSliver extends StatelessWidget with AudYoFloOneComponentPropertyOnChange, AudYoFloPropertyOnChangeGroups { final AudYoFloOneDeviceSelectionOptionWithId option; final JvxComponentIdentification cpIdConf; - final AudYoFloSingleSelectionComponent? reportTarget; + final AudYoFloSelectionComponentUi? reportTarget; AudYoFloBackendCache? theBeCache; AudYoFloPropertyOnChangeOneGroup oneGroupThisWidget = @@ -170,7 +170,7 @@ class AudYoFloOneFileDeviceSliver extends StatelessWidget return GestureDetector( onTap: () { if (reportTarget != null) { - reportTarget!.reportSelectionComponent(option.option.devIdent); + reportTarget!.reportSelectionComponentUi(option.option.devIdent); } }, child: Padding( diff --git a/flutter/ayf_pack/lib/sub-widgets/headtracker-devices/ayf_active_inactive_headtracker_device_sliver.dart b/flutter/ayf_pack/lib/sub-widgets/headtracker-devices/ayf_active_inactive_headtracker_device_sliver.dart index 3b1f9ba0..237b5bf0 100644 --- a/flutter/ayf_pack/lib/sub-widgets/headtracker-devices/ayf_active_inactive_headtracker_device_sliver.dart +++ b/flutter/ayf_pack/lib/sub-widgets/headtracker-devices/ayf_active_inactive_headtracker_device_sliver.dart @@ -13,7 +13,7 @@ class AudYoFloHeadtrackerDeviceRenderSection { class AudYoFloOneHeadtrackerDeviceSliver extends StatelessWidget { final AudYoFloOneDeviceSelectionOptionWithId option; final bool fromActiveList; - final AudYoFloSingleSelectionComponent? reportTarget; + final AudYoFloSelectionComponentUi? reportTarget; AudYoFloOneHeadtrackerDeviceSliver( this.option, this.fromActiveList, this.reportTarget); @@ -94,7 +94,7 @@ class AudYoFloOneHeadtrackerDeviceSliver extends StatelessWidget { // here, we run a callback to the next higher layer in the widget hierarchy to // update the widget which is in parallel to the device selection construct if (reportTarget != null) { - reportTarget!.reportSelectionComponent(option.option.devIdent); + reportTarget!.reportSelectionComponentUi(option.option.devIdent); } }, child: Card( diff --git a/flutter/ayf_pack/lib/types/ayf_types.dart b/flutter/ayf_pack/lib/types/ayf_types.dart index 1d28f800..379c4217 100644 --- a/flutter/ayf_pack/lib/types/ayf_types.dart +++ b/flutter/ayf_pack/lib/types/ayf_types.dart @@ -55,9 +55,9 @@ class AudYoFloCallByReference { // This class defines a callback that reports the selection (=clicked) of a // specific component. Currently, it is used to select a device within the list of active // devices -abstract class AudYoFloSingleSelectionComponent { +abstract class AudYoFloSelectionComponentUi { // End up in this callback in case a selection was chosen (=clicked) - void reportSelectionComponent(JvxComponentIdentification cpId); + void reportSelectionComponentUi(JvxComponentIdentification cpId); } class AudYoFloCompileFlags {