Browse Source

Only trigger property callback on close if there is 1 or more

Also document this usecase

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.9.13
falkTX 6 years ago
parent
commit
294d0ffd96
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 24 additions and 7 deletions
  1. +12
    -7
      common/JackEngine.cpp
  2. +12
    -0
      common/jack/metadata.h

+ 12
- 7
common/JackEngine.cpp View File

@@ -773,11 +773,12 @@ int JackEngine::ClientCloseAux(int refnum, bool wait)
}
}

fMetadata.RemoveProperties(NULL, uuid);
/* have to do the notification ourselves, since the client argument
to fMetadata->RemoveProperties() was NULL
*/
PropertyChangeNotify(uuid, NULL, PropertyDeleted);
if (fMetadata.RemoveProperties(NULL, uuid) > 0) {
/* have to do the notification ourselves, since the client argument
to fMetadata->RemoveProperties() was NULL
*/
PropertyChangeNotify(uuid, NULL, PropertyDeleted);
}

// Notify running clients
NotifyRemoveClient(client->GetClientControl()->fName, refnum);
@@ -912,8 +913,12 @@ int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index)
const jack_uuid_t uuid = jack_port_uuid_generate(port_index);
if (!jack_uuid_empty(uuid))
{
fMetadata.RemoveProperties(NULL, uuid);
PropertyChangeNotify(uuid, NULL, PropertyDeleted);
if (fMetadata.RemoveProperties(NULL, uuid) > 0) {
/* have to do the notification ourselves, since the client argument
to fMetadata->RemoveProperties() was NULL
*/
PropertyChangeNotify(uuid, NULL, PropertyDeleted);
}
}

if (client->GetClientControl()->fActive) {


+ 12
- 0
common/jack/metadata.h View File

@@ -194,6 +194,18 @@ typedef enum {
PropertyDeleted
} jack_property_change_t;

/**
* Prototype for the client supplied function that is called by the
* engine anytime a property or properties have been modified.
*
* Note that when the key is empty, it means all properties have been
* modified. This is often used to indicate that the removal of all keys.
*
* @param subject The subject the change relates to, this can be either a client or port
* @param key The key of the modified property (URI string)
* @param change Wherever the key has been created, changed or deleted
* @param arg pointer to a client supplied structure
*/
typedef void (*JackPropertyChangeCallback)(jack_uuid_t subject,
const char* key,
jack_property_change_t change,


Loading…
Cancel
Save