[haiku-commits] Change in haiku[master]: desklink: watch media_server quit event to disconnect itself.

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 14 Feb 2020 14:13:17 +0000

From Jérôme Duval <jerome.duval@xxxxxxxxx>:

Jérôme Duval has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2244 ;)


Change subject: desklink: watch media_server quit event to disconnect itself.
......................................................................

desklink: watch media_server quit event to disconnect itself.

StartWatching() must be called for each notification type.
---
M src/bin/desklink/MediaReplicant.cpp
1 file changed, 10 insertions(+), 2 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/44/2244/1

diff --git a/src/bin/desklink/MediaReplicant.cpp 
b/src/bin/desklink/MediaReplicant.cpp
index d37a205..8b43e0e 100644
--- a/src/bin/desklink/MediaReplicant.cpp
+++ b/src/bin/desklink/MediaReplicant.cpp
@@ -408,6 +408,10 @@
                        _ConnectMixer();
                        break;

+               case B_MEDIA_SERVER_QUIT:
+                       _DisconnectMixer();
+                       break;
+
                case B_MEDIA_NODE_CREATED:
                {
                        // It's not enough to wait for B_MEDIA_SERVER_STARTED 
message, as
@@ -594,7 +598,9 @@
        if (roster == NULL)
                return;

-       roster->StopWatching(this, B_MEDIA_SERVER_STARTED | 
B_MEDIA_NODE_CREATED);
+       roster->StopWatching(this, B_MEDIA_SERVER_STARTED);
+       roster->StopWatching(this, B_MEDIA_SERVER_QUIT);
+       roster->StopWatching(this, B_MEDIA_NODE_CREATED);

        if (fMixerControl == NULL)
                return;
@@ -618,7 +624,9 @@
        if (roster == NULL)
                return B_ERROR;

-       roster->StartWatching(this, B_MEDIA_SERVER_STARTED | 
B_MEDIA_NODE_CREATED);
+       roster->StartWatching(this, B_MEDIA_SERVER_STARTED);
+       roster->StartWatching(this, B_MEDIA_SERVER_QUIT);
+       roster->StartWatching(this, B_MEDIA_NODE_CREATED);

        fMixerControl = new MixerControl(fVolumeWhich);


--
To view, visit https://review.haiku-os.org/c/haiku/+/2244
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I34957af526a0af557a86eef0c3de5722f3503ca5
Gerrit-Change-Number: 2244
Gerrit-PatchSet: 1
Gerrit-Owner: Jérôme Duval <jerome.duval@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: desklink: watch media_server quit event to disconnect itself. - Gerrit