diff --git a/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp b/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp index 620ebec5..08512c51 100644 --- a/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp +++ b/DolbyIO/Source/Private/Subsystem/DolbyIOConference.cpp @@ -235,6 +235,7 @@ void UDolbyIOSubsystem::Handle(const remote_participant_added& Event) { return; } + const FDolbyIOParticipantInfo Info = ToFDolbyIOParticipantInfo(Event.participant); DLB_UE_LOG("Participant status added: UserID=%s Name=%s ExternalID=%s Status=%s", *Info.UserID, *Info.Name, *Info.ExternalID, *ToString(*Event.participant.status)); @@ -253,6 +254,7 @@ void UDolbyIOSubsystem::Handle(const remote_participant_updated& Event) { return; } + const FDolbyIOParticipantInfo Info = ToFDolbyIOParticipantInfo(Event.participant); DLB_UE_LOG("Participant status updated: UserID=%s Name=%s ExternalID=%s Status=%s", *Info.UserID, *Info.Name, *Info.ExternalID, *ToString(*Event.participant.status)); @@ -264,6 +266,20 @@ void UDolbyIOSubsystem::Handle(const remote_participant_updated& Event) BroadcastEvent(OnParticipantUpdated, Info.Status, Info); } +void UDolbyIOSubsystem::Handle(const local_participant_updated& Event) +{ + if (!Event.participant.status) + { + return; + } + + const FDolbyIOParticipantInfo Info = ToFDolbyIOParticipantInfo(Event.participant); + DLB_UE_LOG("Local participant status updated: UserID=%s Name=%s ExternalID=%s Status=%s", *Info.UserID, *Info.Name, + *Info.ExternalID, *ToString(*Event.participant.status)); + + BroadcastEvent(OnLocalParticipantUpdated, Info.Status, Info); +} + void UDolbyIOSubsystem::Handle(const conference_message_received& Event) { const FString Message = ToFString(Event.message); diff --git a/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp b/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp index ddac67de..012d64a7 100644 --- a/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp +++ b/DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp @@ -131,6 +131,7 @@ void UDolbyIOSubsystem::Initialize(const FString& Token) .then(DLB_REGISTER_HANDLER(device_management, audio_device_changed)) .then(DLB_REGISTER_HANDLER(conference, audio_levels)) .then(DLB_REGISTER_HANDLER(conference, conference_message_received)) + .then(DLB_REGISTER_HANDLER(conference, local_participant_updated)) .then(DLB_REGISTER_HANDLER(conference, remote_participant_added)) .then(DLB_REGISTER_HANDLER(conference, remote_participant_updated)) .then(DLB_REGISTER_HANDLER(conference, remote_video_track_added)) @@ -176,10 +177,10 @@ void UDolbyIOObserver::InitializeComponent() DLB_BIND(OnConnectError); DLB_BIND(OnDemoConferenceError); - DLB_BIND(OnDisconnected) + DLB_BIND(OnDisconnected); DLB_BIND(OnDisconnectError); - DLB_BIND(OnSetSpatialEnvironmentScaleError) + DLB_BIND(OnSetSpatialEnvironmentScaleError); DLB_BIND(OnMuteInputError); @@ -197,6 +198,8 @@ void UDolbyIOObserver::InitializeComponent() DLB_BIND(OnParticipantUpdated); + DLB_BIND(OnLocalParticipantUpdated); + DLB_BIND(OnVideoTrackAdded); DLB_BIND(OnVideoTrackRemoved); @@ -205,7 +208,7 @@ void UDolbyIOObserver::InitializeComponent() DLB_BIND(OnVideoTrackDisabled); - DLB_BIND(OnVideoEnabled) + DLB_BIND(OnVideoEnabled); DLB_BIND(OnEnableVideoError); DLB_BIND(OnVideoDisabled); @@ -218,7 +221,7 @@ void UDolbyIOObserver::InitializeComponent() DLB_BIND(OnStartScreenshareError); DLB_BIND(OnScreenshareStopped); - DLB_BIND(OnStopScreenshareError) + DLB_BIND(OnStopScreenshareError); DLB_BIND(OnChangeScreenshareParametersError); diff --git a/DolbyIO/Source/Public/DolbyIO.h b/DolbyIO/Source/Public/DolbyIO.h index 1a8e0474..46cf5641 100644 --- a/DolbyIO/Source/Public/DolbyIO.h +++ b/DolbyIO/Source/Public/DolbyIO.h @@ -21,6 +21,8 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnParticipantAddedDelegate, Status, const FDolbyIOParticipantInfo&, ParticipantInfo); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnParticipantUpdatedDelegate, const EDolbyIOParticipantStatus, Status, const FDolbyIOParticipantInfo&, ParticipantInfo); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDolbyIOOnLocalParticipantUpdatedDelegate, const EDolbyIOParticipantStatus, + Status, const FDolbyIOParticipantInfo&, ParticipantInfo); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnVideoTrackAddedDelegate, const FDolbyIOVideoTrack&, VideoTrack); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnVideoTrackRemovedDelegate, const FDolbyIOVideoTrack&, VideoTrack); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDolbyIOOnVideoTrackEnabledDelegate, const FDolbyIOVideoTrack&, VideoTrack); @@ -306,6 +308,8 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnParticipantUpdatedDelegate OnParticipantUpdated; UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnLocalParticipantUpdatedDelegate OnLocalParticipantUpdated; + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnVideoTrackAddedDelegate OnVideoTrackAdded; UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnVideoTrackRemovedDelegate OnVideoTrackRemoved; @@ -349,6 +353,7 @@ class DOLBYIO_API UDolbyIOSubsystem : public UGameInstanceSubsystem void Handle(const dolbyio::comms::audio_device_changed&); void Handle(const dolbyio::comms::audio_levels&); void Handle(const dolbyio::comms::conference_message_received&); + void Handle(const dolbyio::comms::local_participant_updated&); void Handle(const dolbyio::comms::remote_participant_added&); void Handle(const dolbyio::comms::remote_participant_updated&); void Handle(const dolbyio::comms::remote_video_track_added&); @@ -477,6 +482,10 @@ class DOLBYIO_API UDolbyIOObserver : public UActorComponent UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnParticipantUpdatedDelegate OnParticipantUpdated; + /** Triggered when the local participant's status is updated. */ + UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") + FDolbyIOOnLocalParticipantUpdatedDelegate OnLocalParticipantUpdated; + /** Triggered when a video track is added. */ UPROPERTY(BlueprintAssignable, Category = "Dolby.io Comms") FDolbyIOOnVideoTrackAddedDelegate OnVideoTrackAdded; @@ -701,6 +710,11 @@ class DOLBYIO_API UDolbyIOObserver : public UActorComponent void FwdOnParticipantUpdated(const EDolbyIOParticipantStatus Status, const FDolbyIOParticipantInfo& ParticipantInfo) DLB_DEFINE_FORWARDER(OnParticipantUpdated, Status, ParticipantInfo); + UFUNCTION() + void FwdOnLocalParticipantUpdated(const EDolbyIOParticipantStatus Status, + const FDolbyIOParticipantInfo& ParticipantInfo) + DLB_DEFINE_FORWARDER(OnLocalParticipantUpdated, Status, ParticipantInfo); + UFUNCTION() void FwdOnVideoTrackAdded(const FDolbyIOVideoTrack& VideoTrack) DLB_DEFINE_FORWARDER(OnVideoTrackAdded, VideoTrack); diff --git a/DolbyIO/Source/Public/DolbyIOCppSdkFwd.h b/DolbyIO/Source/Public/DolbyIOCppSdkFwd.h index 879f4010..61c4c80e 100644 --- a/DolbyIO/Source/Public/DolbyIOCppSdkFwd.h +++ b/DolbyIO/Source/Public/DolbyIOCppSdkFwd.h @@ -17,6 +17,7 @@ namespace dolbyio::comms struct audio_device_changed; struct audio_levels; struct conference_message_received; + struct local_participant_updated; struct remote_participant_added; struct remote_participant_updated; struct remote_video_track_added; diff --git a/docs/docs/blueprints/events.md b/docs/docs/blueprints/events.md index 5c9abfee..84477b5e 100644 --- a/docs/docs/blueprints/events.md +++ b/docs/docs/blueprints/events.md @@ -152,6 +152,18 @@ Triggered by [**Dolby.io Set Token**](functions.md#dolbyio-set-token) when the p --- +## On Local Participant Updated + +Triggered when the local participant's status is updated as a result of calling [Connect](functions.md#dolbyio-connect), [Demo Conference](functions.md#dolbyio-demo-conference) or [Update User Metadata](functions.md#dolbyio-update-user-metadata). + +#### Data provided +| Provides | Type | Description | +|---|:---|:---| +| **Status** | [Dolby.io Participant Status](types.mdx#dolbyio-participant-status) | The status of the participant. | +| **Participant Info** | [Dolby.io Participant Info](types.mdx#dolbyio-participant-info) | Information about the participant. | + +--- + ## On Message Received Triggered automatically when a message is received.