From 80ed58c9e6e6906cbf7d203a7695e57a48e3eb5f Mon Sep 17 00:00:00 2001 From: Nils Hilbricht Date: Thu, 13 Oct 2016 23:11:12 +0200 Subject: [PATCH 1/3] The server actually sends :server-control: not :server_control:. Reflect that in the documentation --- session-manager/doc/API.html | 14 ++++++------ session-manager/doc/API.mu | 44 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/session-manager/doc/API.html b/session-manager/doc/API.html index eb6e4e3..1529c24 100644 --- a/session-manager/doc/API.html +++ b/session-manager/doc/API.html @@ -120,7 +120,7 @@ This option may empty/reset the current file or project (possibly after user con

1.1.1.2. Open

-This option MUST be disabled. +This option MUST be disabled.

The application may, however, elect to implement an option called 'Import into Session', creates a copy of a file/project which is then saved at the session path provided by NSM. @@ -228,7 +228,7 @@ Presently, the server capabilities are: Fig. 1.2. Available Server Capabilities NameDescription -server_controlclient-to-server control +server-controlclient-to-server control broadcastserver responds to /nsm/server/broadcast message optional-guiserver responds to optional-gui messages--if this capability is not present then clients with optional-guis MUST always keep them visible @@ -397,7 +397,7 @@ This message does not require a response. If the client has specified the optional-gui capability, then it may receive this message from the server when the user wishes to change the visibility state of the GUI. It doesn't matter if the optional GUI is integrated with the program or if it is a separate program \(as is the case with SooperLooper\). When the GUI is hidden, there should be no window mapped and if the GUI is a separate program, it should be killed.

-/nsm/client/show_optional_gui 
+/nsm/client/show_optional_gui
 
@@ -456,7 +456,7 @@ Clients which intend to send progress messages should include :prog
 

-Some clients may be able to inform the server when they have unsaved changes pending. Such clients may optionally send is_dirty and is_clean messages. +Some clients may be able to inform the server when they have unsaved changes pending. Such clients may optionally send is_dirty and is_clean messages.

Clients which have this capability should include :dirty: in their announce capability string. @@ -491,7 +491,7 @@ Clients which have this capability should include :message: in their

1.2.6. Client to Server Control

-If the server publishes the :server_control: capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a /nsm/server/save message to the server, rather than requiring the user to switch to the session management interface to effect the save. +If the server publishes the :server-control: capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a /nsm/server/save message to the server, rather than requiring the user to switch to the session management interface to effect the save.

1.2.7. Server Control API

@@ -565,7 +565,7 @@ Saves and closes the current session.

/nsm/server/abort

-Closes the current session WITHOUT SAVING +Closes the current session WITHOUT SAVING

/nsm/server/quit
@@ -591,7 +591,7 @@ The format of this message is as follows:

-The message will then be relayed to all clients in the session at the path path (with the arguments shifted by one). +The message will then be relayed to all clients in the session at the path path (with the arguments shifted by one).

For example the message: diff --git a/session-manager/doc/API.mu b/session-manager/doc/API.mu index 8558f7b..5e85d22 100644 --- a/session-manager/doc/API.mu +++ b/session-manager/doc/API.mu @@ -1,8 +1,8 @@ -! title Non Session Management API -! author Jonathan Moore Liles #(email,male@tuxfamily.org) -! revision Version 1.2 -! extra #(image,logo,icon.png) +! title Non Session Management API +! author Jonathan Moore Liles #(email,male@tuxfamily.org) +! revision Version 1.2 +! extra #(image,logo,icon.png) -- Table Of Contents @@ -24,7 +24,7 @@ (such as LADISH), although consistency and robustness will likely suffer if non-NSM compliant clients are allowed to participate in a session. - + The only dependency for client implementations `liblo` (the OSC library), which several Linux audio applications already link to or plan to link to in the future. @@ -56,8 +56,8 @@ The following sub-sections describe how these options should behave when the application is part of an NSM session. These rules only apply when session management is active (that is, after the `announce` - handshake described in the #(ref,Non Session Management API::NSM OSC Protocol) section). - + handshake described in the #(ref,Non Session Management API::NSM OSC Protocol) section). + In order to provide a consistent and predictable user experience, it is critically important for applications to adhere to these guidelines. @@ -72,7 +72,7 @@ :::: Open - This option *MUST* be disabled. + This option *MUST* be disabled. The application may, however, elect to implement an option called 'Import into Session', creates a copy of a file\/project which is @@ -96,7 +96,7 @@ outside of the session path provided by NSM. :::: Close (as distinguished from Quit or Exit) - + This option *MUST* be disabled unless its meaning is to disconnect the application from session management. @@ -190,7 +190,7 @@ [[ switch, client is capable of responding to multiple `open` messages without restarting [[ dirty, client knows when it has unsaved changes [[ progress, client can send progress updates during time-consuming operations -[[ message, client can send textual status updates +[[ message, client can send textual status updates [[ optional-gui, client has an optional GUI :::: Response @@ -213,7 +213,7 @@ // Available Server Capabilities [[ Name, Description -[[ server_control, client-to-server control +[[ server-control, client-to-server control [[ broadcast, server responds to /nsm/server/broadcast message [[ optional-gui, server responds to optional-gui messages--if this capability is not present then clients with optional-guis MUST always keep them visible @@ -265,7 +265,7 @@ application will receive this signal soon after having responded to a `save` message. -:::: Open +:::: Open > /nsm/client/open s:path_to_instance_specific_project s:display_name s:client_id @@ -365,7 +365,7 @@ established in the 'open' message. *UNDER NO CIRCUMSTANCES* should a dialog be displayed to the user (giving a choice of where to save, etc.) - + However, if the client is incapable of saving at the specific moment without disturbing the user (e.g. a JACK client that can't save while the transport is rolling without causing massive XRUNS), then @@ -393,7 +393,7 @@ ::: Server to Client Informational Messages :::: Session is Loaded - + Accepting this message is optional. The intent is to signal to clients which may have some interdependence (say, peer to peer OSC connections) that the session is fully loaded and all their peers @@ -417,7 +417,7 @@ hidden, there should be no window mapped and if the GUI is a separate program, it should be killed. -> /nsm/client/show_optional_gui +> /nsm/client/show_optional_gui > /nsm/client/hide_optional_gui @@ -475,7 +475,7 @@ Some clients may be able to inform the server when they have unsaved changes pending. Such clients may optionally send `is\_dirty` and `is\_clean` - messages. + messages. Clients which have this capability should include `:dirty:` in their `announce` capability string. @@ -509,7 +509,7 @@ ::: Client to Server Control - If the server publishes the `:server\_control:` capability, then + If the server publishes the `:server-control:` capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a `\/nsm\/server\/save` message to the server, rather than requiring @@ -528,7 +528,7 @@ > /reply s:path s:message > /error s:path i:error_code s:message - + The first parameter of the reply is the path to the message being replied to. The `\/error` reply includes an integer error code (non-zero indicates error). `message` will be a description of the @@ -570,13 +570,13 @@ = /nsm/server/abort - Closes the current session *WITHOUT SAVING* + Closes the current session *WITHOUT SAVING* = /nsm/server/quit Saves and closes the current session and terminates the server. -= /nsm/server/list += /nsm/server/list Lists available projects. One `\/reply` message will be sent for each existing project. @@ -585,7 +585,7 @@ If the server includes `:broadcast:` in its capability string, then clients may send broadcast messages to each other through the NSM server. - + Clients may send messages to the server at the path `\/nsm\/server\/broadcast`. @@ -594,7 +594,7 @@ > /nsm/server/broadcast s:path [arguments...] The message will then be relayed to all clients in the session at - the path `path` (with the arguments shifted by one). + the path `path` (with the arguments shifted by one). For example the message: From 19eec7ec9fbfbdd3838eb160ef7edb8dd6b882ff Mon Sep 17 00:00:00 2001 From: Nils Hilbricht Date: Fri, 14 Oct 2016 00:01:43 +0200 Subject: [PATCH 2/3] Correct session manager docs. Server sends 'server-control' as capabilities, not 'server_control' --- session-manager/doc/API.html | 4 ++-- session-manager/doc/API.mu | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/session-manager/doc/API.html b/session-manager/doc/API.html index eb6e4e3..66188b0 100644 --- a/session-manager/doc/API.html +++ b/session-manager/doc/API.html @@ -228,7 +228,7 @@ Presently, the server capabilities are: Fig. 1.2. Available Server Capabilities NameDescription -server_controlclient-to-server control +server-controlclient-to-server control broadcastserver responds to /nsm/server/broadcast message optional-guiserver responds to optional-gui messages--if this capability is not present then clients with optional-guis MUST always keep them visible @@ -491,7 +491,7 @@ Clients which have this capability should include :message: in their

1.2.6. Client to Server Control

-If the server publishes the :server_control: capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a /nsm/server/save message to the server, rather than requiring the user to switch to the session management interface to effect the save. +If the server publishes the :server-control: capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a /nsm/server/save message to the server, rather than requiring the user to switch to the session management interface to effect the save.

1.2.7. Server Control API

diff --git a/session-manager/doc/API.mu b/session-manager/doc/API.mu index 8558f7b..2ee3475 100644 --- a/session-manager/doc/API.mu +++ b/session-manager/doc/API.mu @@ -213,7 +213,7 @@ // Available Server Capabilities [[ Name, Description -[[ server_control, client-to-server control +[[ server-control, client-to-server control [[ broadcast, server responds to /nsm/server/broadcast message [[ optional-gui, server responds to optional-gui messages--if this capability is not present then clients with optional-guis MUST always keep them visible @@ -509,7 +509,7 @@ ::: Client to Server Control - If the server publishes the `:server\_control:` capability, then + If the server publishes the `:server-control:` capability, then clients can also initiate action by the server. For example, a client might implement a 'Save All' option which sends a `\/nsm\/server\/save` message to the server, rather than requiring From 204790bb1335286b02a5849763ed317a185387ef Mon Sep 17 00:00:00 2001 From: Nils Hilbricht Date: Fri, 14 Oct 2016 00:11:42 +0200 Subject: [PATCH 3/3] Add /nsm/server/stop to the client-to-server control messages. Now clients can instruct nsmD to tell themselves to stop. This enables the client behaviour to for example ignore local close events (like from X11) and instead ask NSM to send the proper quit signal. The result is that NSM actually awaits the client quitting and does not respond with '...died unexpectedly' anymore --- session-manager/src/nsmd.C | 1 + 1 file changed, 1 insertion(+) diff --git a/session-manager/src/nsmd.C b/session-manager/src/nsmd.C index e047098..9147b3b 100644 --- a/session-manager/src/nsmd.C +++ b/session-manager/src/nsmd.C @@ -2327,6 +2327,7 @@ int main(int argc, char *argv[]) osc_server->add_method( "/nsm/server/open", "s", OSC_NAME( open ), NULL, "name" ); osc_server->add_method( "/nsm/server/close", "", OSC_NAME( close ), NULL, "" ); osc_server->add_method( "/nsm/server/quit", "", OSC_NAME( quit ), NULL, "" ); + osc_server->add_method( "/nsm/server/stop", "s", OSC_NAME( stop ), NULL, "client_id" ); osc_server->add_method( NULL, NULL, OSC_NAME( null ),NULL, "" );