-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnsm-proto.html
1550 lines (1467 loc) · 56.8 KB
/
nsm-proto.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 10.2.0">
<title>Non Session Manager protocol</title>
<style type="text/css">
/*
* AsciiDoc 'ladi' theme, based on 'volnitsky' theme for xhtml11 and html5 backends.
* Based on css from http://volnitsky.com, which was in turn based on default
* theme from AsciiDoc
*
* FIXME: The styling is still a bit rough in places.
*
*/
/* Default font. */
body {
font-family: Georgia,"Times New Roman",Times,serif;
font-size: 16pt;
}
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
font-family: Candara,Arial,sans-serif;
}
a.image { border-bottom: 0; }
#toc a {
border-bottom: 1px dotted #999999;
color: #3A3A4D !important;
text-decoration: none !important;
}
#toc a:hover {
border-bottom: 1px solid #6D4100;
color: #6D4100 !important;
text-decoration: none !important;
}
a { color: #666688; text-decoration: none; border-bottom: 1px dotted #666688; }
a:visited { color: #615FA0; border-bottom: 1px dotted #615FA0; }
a:hover { color: #6D4100; border-bottom: 1px solid #6D4100; }
em {
font-style: italic;
color: #444466;
}
strong {
font-weight: bold;
color: #444466;
}
h1, h2, h3, h4, h5, h6 {
color: #666688;
margin-bottom: 0.5em;
margin-right: 1em;
line-height: 1.3;
letter-spacing:+0.15em;
}
h1, h2, h3, h4, h5, h6 {
margin-left: 0em;
}
/* h1 { margin-left: 2em; } */
h2 { margin-left: 2em; }
/* h3 { margin-left: 4em; } */
/* h4 { margin-left: 5em; } */
/* h5 { margin-left: 6em; } */
/* h6 { margin-left: 7em; } */
h2 { border-bottom: 4px solid #ccd; }
h3 { border-bottom: 2px dotted #ccd; }
/* h2, h3 { border-bottom: 2px solid #ccd; } */
/* h2 { padding-top: 0.5em; } */
/* h3 { float: left; } */
/* h3 + * { clear: left; } */
div.banner {
background: #004455;
text-align: center;
color: #C6E9AF;
padding: 0;
margin: 0;
}
div.sectionbody {
margin-top: 0;
margin-left: 3em;
margin-right: 1em;
margin-bottom: 1em;
}
hr {
border: 1px solid #444466;
}
p {
margin-left: 0.5em;
margin-right: 0.5em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul, ol, li > p {
margin-top: 0;
}
pre {
padding: 0;
margin: 0;
}
#author {
color: #444466;
font-weight: bold;
font-size: 1.1em;
}
#footer {
font-size: small;
border-top: 2px solid silver;
margin: 0;
}
#footer-text {
/* float: left; */
padding: 1em;
text-align: center;
}
#footer-badges {
float: right;
padding: 0.5em;
}
#preamble {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
#content { /* Block element content. */
margin: 2em;
}
/* Block element titles. */
div.title, caption.title {
color: #444466;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock {
padding-left: 2.0em;
margin-right: 10%;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
div.verseblock {
padding-left: 2.0em;
margin-right: 10%;
}
div.verseblock > pre.content {
font-family: inherit;
}
div.verseblock > div.attribution {
padding-top: 0.75em;
text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #444466;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
color: #444466;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
ol.arabic {
list-style-type: decimal;
}
ol.loweralpha {
list-style-type: lower-alpha;
}
ol.upperalpha {
list-style-type: upper-alpha;
}
ol.lowerroman {
list-style-type: lower-roman;
}
ol.upperroman {
list-style-type: upper-roman;
}
div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
margin-top: 0.1em;
margin-bottom: 0.1em;
}
div.tableblock > table {
border: 3px solid #444466;
}
thead {
font-weight: bold;
color: #444466;
}
tfoot {
font-weight: bold;
}
td > div.verse {
white-space: pre;
}
p.table {
margin-top: 0;
}
/* Because the table frame attribute is overridden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
div.tableblock > table[frame="hsides"] {
border-left-style: none;
border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
border-top-style: none;
border-bottom-style: none;
}
div.hdlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hdlist tr {
padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
font-weight: bold;
}
td.hdlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
color: #444466;
}
td.hdlist2 {
vertical-align: top;
}
div.hdlist.compact tr {
margin: 0;
padding-bottom: 0;
}
.comment {
background: yellow;
}
@media print {
#footer-badges { display: none; }
}
#toctitle {
color: #666688;
font-size: 1.2em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { margin-top: 0; margin-bottom: 0; }
div.toclevel1 { margin-top: 0.3em; margin-left: 0; font-size: 1.0em; }
div.toclevel2 { margin-top: 0.25em; margin-left: 2em; font-size: 0.9em; }
div.toclevel3 { margin-left: 4em; font-size: 0.8em; }
div.toclevel4 { margin-left: 6em; font-size: 0.8em; }
body {
margin: 0;
padding: 0;
}
.monospaced, tt, div.listingblock > div.content {
font-family: Consolas, "Andale Mono", "Courier New", monospace;
color: #004400;
background: #f4f4f4;
max-width: 80em;
line-height: 1.2em;
}
#header {
text-align: center;
margin: 2em;
}
#toc {
text-align: left;
margin-left: 3em;
max-width: 80%;
}
.paragraph p {
line-height: 1.5em;
/* margin: 1em; */
}
.paragraph p, li, dd, .content { max-width: 80em; }
.admonitionblock { max-width: 35em; }
div.sectionbody div.ulist > ul > li {
list-style-type: square;
color: #aaa;
}
div.sectionbody div.ulist > ul > li > * {
color: black;
/*font-size: 50%;*/
}
div.sectionbody div.ulist > ul > li div.ulist > ul > li {
color: #ccd ;
}
div.sectionbody div.ulist > ul > li div.ulist > ul > li > * {
color: black ;
}
em {
font-style: normal ! important;
font-weight: bold ! important;
color: #662222 ! important;
letter-spacing:+0.08em ! important;
}
span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
/*
* html5 specific
*
* */
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
thead, p.tableblock.header {
font-weight: bold;
color: #666688;
}
p.tableblock {
margin-top: 0;
}
table.tableblock {
border-width: 3px;
border-spacing: 0px;
border-style: solid;
border-color: #444466;
border-collapse: collapse;
}
th.tableblock, td.tableblock {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #444466;
}
table.tableblock.frame-topbot {
border-left-style: hidden;
border-right-style: hidden;
}
table.tableblock.frame-sides {
border-top-style: hidden;
border-bottom-style: hidden;
}
table.tableblock.frame-none {
border-style: hidden;
}
th.tableblock.halign-left, td.tableblock.halign-left {
text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
text-align: right;
}
th.tableblock.valign-top, td.tableblock.valign-top {
vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
vertical-align: bottom;
}
</style>
<script type="text/javascript">
/*<![CDATA[*/
var asciidoc = { // Namespace.
/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////
/* Author: Mihai Bazon, September 2002
* http://students.infoiasi.ro/~mishoo
*
* Table Of Content generator
* Version: 0.4
*
* Feel free to use this script under the terms of the GNU General Public
* License, as long as you do not remove or alter this notice.
*/
/* modified by Troy D. Hanson, September 2006. License: GPL */
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
// toclevels = 1..4.
toc: function (toclevels) {
function getText(el) {
var text = "";
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
text += i.data;
else if (i.firstChild != null)
text += getText(i);
}
return text;
}
function TocEntry(el, text, toclevel) {
this.element = el;
this.text = text;
this.toclevel = toclevel;
}
function tocEntries(el, toclevels) {
var result = new Array;
var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName);
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
}
iterate(i);
}
}
}
iterate(el);
return result;
}
var toc = document.getElementById("toc");
if (!toc) {
return;
}
// Delete existing TOC entries in case we're reloading the TOC.
var tocEntriesToRemove = [];
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
}
for (i = 0; i < tocEntriesToRemove.length; i++) {
toc.removeChild(tocEntriesToRemove[i]);
}
// Rebuild TOC entries.
var entries = tocEntries(document.getElementById("content"), toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "_toc_" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
if (entries.length == 0)
toc.parentNode.removeChild(toc);
},
/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////
/* Based on footnote generation code from:
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
*/
footnotes: function () {
// Delete existing footnote entries in case we're reloading the footnodes.
var i;
var noteholder = document.getElementById("footnotes");
if (!noteholder) {
return;
}
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
noteholder.removeChild(entriesToRemove[i]);
}
// Rebuild footnote entries.
var cont = document.getElementById("content");
var spans = cont.getElementsByTagName("span");
var refs = {};
var n = 0;
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnote") {
n++;
var note = spans[i].getAttribute("data-note");
if (!note) {
// Use [\s\S] in place of . so multi-line matches work.
// Because JavaScript has no s (dotall) regex flag.
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
spans[i].innerHTML =
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
spans[i].setAttribute("data-note", note);
}
noteholder.innerHTML +=
"<div class='footnote' id='_footnote_" + n + "'>" +
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
n + "</a>. " + note + "</div>";
var id =spans[i].getAttribute("id");
if (id != null) refs["#"+id] = n;
}
}
if (n == 0)
noteholder.parentNode.removeChild(noteholder);
else {
// Process footnoterefs.
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnoteref") {
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
href = href.match(/#.*/)[0]; // Because IE return full URL.
n = refs[href];
spans[i].innerHTML =
"[<a href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
}
}
}
},
install: function(toclevels) {
var timerId;
function reinstall() {
asciidoc.footnotes();
if (toclevels) {
asciidoc.toc(toclevels);
}
}
function reinstallAndRemoveTimer() {
clearInterval(timerId);
reinstall();
}
timerId = setInterval(reinstall, 500);
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
else
window.onload = reinstallAndRemoveTimer;
}
}
asciidoc.install(2);
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1>Non Session Manager protocol</h1>
<span id="author">This is adaptation of non-session-manager documentation for needs of LADI project</span><br>
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Document authors:</p></div>
<div class="ulist"><ul>
<li>
<p>
Jonathan Moore Liles (revisions from 1 to revision 1.2 from 2013-04-06)
</p>
</li>
<li>
<p>
Nils Hilbricht (2020-07 initial adaptation of the NON project version)
</p>
</li>
<li>
<p>
Nedko Arnaudov (2022 onward, as part of LADI project)
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_versioning">Versioning</h2>
<div class="sectionbody">
<table class="tableblock frame-all grid-all"
style="
width:100%;
">
<col style="width:50%;">
<col style="width:50%;">
<tbody>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">api_version_major</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">1</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">api_version_minor</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">0</p></td>
</tr>
</tbody>
</table>
<div class="paragraph"><p>This document describes the NON Session Manager OSC API as defined and
implemented by NON project. The only difference is server-control
capability which was fixed in NON project codebase before the New
Session Manager schism but as of when this document is written, is not
fixed at the NSM API URL, see <a href="http://non.tuxfamily.org/nsm/API.html">http://non.tuxfamily.org/nsm/API.html</a>
for more info.</p></div>
<div class="paragraph"><p>For definition of the new-session-manager OSC API,
see <a href="https://new-session-manager.jackaudio.org/api/index.html">https://new-session-manager.jackaudio.org/api/index.html</a></p></div>
</div>
</div>
<div class="sect1">
<h2 id="_session_management_as_part_of_the_non_audio_production_suite">Session Management as part of the Non audio production suite</h2>
<div class="sectionbody">
<div class="paragraph"><p>The Non Session Management API is used by the various components of the Non audio production suite
to allow any number of independent programs to be managed together as part of a logical session
(i.e. a song). Thus, operations such as loading and saving are synchronized.</p></div>
<div class="paragraph"><p>The API comprises a simple Open Sound Control (OSC) based protocol, along with some behavioral
guidelines, which can easily be implemented by various applications.</p></div>
<div class="paragraph"><p>The Non project contains an program called <span class="monospaced">nsmd</span> which is an implementation of the server side of
the NSM API. <span class="monospaced">nsmd</span> is controlled by the <span class="monospaced">non-session-manager</span> GUI. However, the same server-side
API can also be implemented by other session managers (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 <span class="monospaced">liblo</span> (the OSC library), which several Linux audio
applications already link to or plan to link to in the future.</p></div>
<div class="paragraph"><p>The aim of this project is to thoroughly define the behavior required of clients. This is an area
where other attempts at session management (LASH and JACK-Session) have failed. Often the
difficulty with these systems has been not in implementing support for them, but in attempting to
interpret the confusing, ambiguous, or ill-conceived API documentation. For these reasons and more
all previous attempts at Linux audio session management protocols are considered harmful.</p></div>
<div class="paragraph"><p>You WILL see some unambiguous and emphatic language in this document. For the good of the user,
these rules are meant to be followed and are non-negotiable. If an application does not conform to
this specification it should be considered broken. Consistency across applications under session
management is very important for a good user experience.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_client_behavior_under_session_management">Client Behavior Under Session Management</h2>
<div class="sectionbody">
<div class="paragraph"><p>Most graphical applications make available to the user a common set of file operations, typically
presented under a File or Project menu.</p></div>
<div class="paragraph"><p>These are: New, Open, Save, Save As, Close and Quit or Exit.</p></div>
<div class="paragraph"><p>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
<span class="monospaced">announce</span> handshake described in the <a href="#NSM OSC Protocol">[NSM OSC Protocol]</a> section. In order to provide a
consistent and predictable user experience, it is critically important for applications to adhere
to these guidelines.</p></div>
<div class="sect2">
<h3 id="_file_menu">File Menu</h3>
<div class="sect3">
<h4 id="_new">New</h4>
<div class="paragraph"><p>This option may empty/reset the current file or project (possibly after user confirmation). UNDER
NO CIRCUMSTANCES should it allow the user to create a new project/file in another location.</p></div>
</div>
<div class="sect3">
<h4 id="_open">Open</h4>
<div class="paragraph"><p>This option MUST be disabled.</p></div>
<div class="paragraph"><p>The application may, however, elect to implement an option called <em>Import into Session</em>, creates a
copy of a file/project which is then saved at the session path provided by NSM.</p></div>
</div>
<div class="sect3">
<h4 id="_save">Save</h4>
<div class="paragraph"><p>This option should behave as normal, saving the current file/project as established by the NSM
<span class="monospaced">open</span> message.</p></div>
<div class="paragraph"><p>UNDER NO CIRCUMSTANCES should this option present the user with a choice of where to save the file.</p></div>
</div>
<div class="sect3">
<h4 id="_save_as">Save As</h4>
<div class="paragraph"><p>This option MUST be disabled.</p></div>
<div class="paragraph"><p>The application may, however, elect to implement an option called <em>Export from Session</em>, which
creates a copy of the current file/project which is then saved in a user-specified location outside
of the session path provided by NSM.</p></div>
</div>
<div class="sect3">
<h4 id="_close_as_distinguished_from_quit_or_exit">Close (as distinguished from Quit or Exit)</h4>
<div class="paragraph"><p>This option MUST be disabled unless its meaning is to disconnect the application from session
management.</p></div>
</div>
<div class="sect3">
<h4 id="_quit_or_exit">Quit or Exit</h4>
<div class="paragraph"><p>This option may behave as normal (possibly asking the user to confirm exiting).</p></div>
</div>
</div>
<div class="sect2">
<h3 id="_data_storage">Data Storage</h3>
<div class="sect3">
<h4 id="_internal_files">Internal Files</h4>
<div class="paragraph"><p>All project specific data created by a client MUST be stored in the per-client storage area
provided by NSM. This includes all recorded audio and MIDI files, snapshots, etc. Only global
configuration items, exports, and renders of the project may be stored elsewhere (wherever the user
specifies).</p></div>
</div>
<div class="sect3">
<h4 id="_external_files">External Files</h4>
<div class="paragraph"><p>Files required by the project but external to it (typically read-only data such as audio samples)
SHOULD be referenced by creating a symbolic link within the assigned session area, and then
referring to the symlink. This allows sessions to be archived and transported simply (e.g. with
"tar -h") by tools that have no knowledge of the project formats of the various clients in the
session. The symlinks thus created should, at the very least, be named after the files they refer
to (some unique component may be required to prevent collisions)</p></div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_nsm_osc_protocol">NSM OSC Protocol</h2>
<div class="sectionbody">
<div class="paragraph"><p>All message parameters are REQUIRED. All messages MUST be sent from the same socket as the <span class="monospaced">announce</span>
message, using the <span class="monospaced">lo_send_from</span> method of liblo or its equivalent, as the server uses the return
addresses to distinguish between clients.</p></div>
<div class="paragraph"><p>Clients MUST create thier OSC servers using the same protocol (UDP,TCP) as found in <span class="monospaced">NSM_URL</span>. liblo
is lacking a robust TCP implementation at the time of writing, but in the future it may be useful.</p></div>
<div class="sect2">
<h3 id="_establishing_a_connection">Establishing a Connection</h3>
<div class="sect3">
<h4 id="_announce">Announce</h4>
<div class="paragraph"><p>At launch, the client MUST check the environment for the value of <span class="monospaced">NSM_URL</span>. If present, the client
MUST send the following message to the provided address as soon as it is ready to respond to the
<span class="monospaced">/nsm/client/open</span> event:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>/nsm/server/announce s:application_name s:capabilities s:executable_name i:api_version_major i:api_version_minor i:pid</pre>
</div></div>
<div class="paragraph"><p>If <span class="monospaced">NSM_URL</span> is undefined, invalid, or unreachable, then the client should proceed assuming that
session management is unavailable.</p></div>
<div class="paragraph"><p><span class="monospaced">api_version_major</span> and <span class="monospaced">api_version_minor</span> must be the two parts of the version number of the NSM API
as defined by this document.</p></div>
<div class="paragraph"><p>Note that if the application intends to register JACK clients, <span class="monospaced">application_name</span> MUST be the same as
the name that would normally be passed to <span class="monospaced">jack_client_open</span>. For example, Non-Mixer sends
"Non-Mixer" as its <span class="monospaced">application_name</span>. Applications MUST NOT register their JACK clients until
receiving an <span class="monospaced">open</span> message; the <span class="monospaced">open</span> message will provide a unique client name prefix suitable for
passing to JACK. This is probably the most complex requirement of the NSM API, but it isn’t
difficult to implement, especially if the application simply wishes to delay its initialization
process breifly while awaiting the <span class="monospaced">announce</span> reply and subsequent <span class="monospaced">open</span> message.</p></div>
<div class="paragraph"><p><span class="monospaced">capabilities</span> MUST be a string containing a colon separated list of the special capabilities the
client possesses. e.g. <span class="monospaced">:dirty:switch:progress:</span></p></div>
<div class="paragraph"><p><span class="monospaced">executable_name</span> MUST be the executable name that the program was launched with. For C programs,
this is simply the value of <span class="monospaced">argv[0]</span>. Note that hardcoding the name of the program here is not the
same as using, as the user may have launched the program from a script with a different name using
exec, or have created a symlink to the program. Getting the correct value in scripting languages
like Python can be more challenging.</p></div>
<table class="tableblock frame-all grid-all"
style="
width:100%;
">
<caption class="title">Table 1. Available Client Capabilities</caption>
<col style="width:50%;">
<col style="width:50%;">
<tbody>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Name</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Description</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">switch</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client is capable of responding to multiple <span class="monospaced">open</span> messages without restarting</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">dirty</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client knows when it has unsaved changes</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">progress</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client can send progress updates during time-consuming operations</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">message</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client can send textual status updates</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">optional-gui</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client has an optional GUI</p></td>
</tr>
</tbody>
</table>
<div class="sect4">
<h5 id="_response">Response</h5>
<div class="paragraph"><p>The server will respond to the client’s announce message with the following message:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>/reply "/nsm/server/announce" s:message s:name_of_session_manager s:capabilities</pre>
</div></div>
<div class="paragraph"><p><span class="monospaced">message</span> is a welcome message.</p></div>
<div class="paragraph"><p>The value of <span class="monospaced">name_of_session_manager</span> will depend on the implementation of the NSM server. It might
say "Non Session Manager", or it might say "LADISH". This is for display to the user.</p></div>
<div class="paragraph"><p><span class="monospaced">capabilities</span> will be a string containing a colon separated list of special server capabilities.</p></div>
<div class="paragraph"><p>Presently, the server <span class="monospaced">capabilities</span> are:</p></div>
<table class="tableblock frame-all grid-all"
style="
width:100%;
">
<caption class="title">Table 2. Available Server Capabilities</caption>
<col style="width:50%;">
<col style="width:50%;">
<tbody>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Name</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Description</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">server-control</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">client-to-server control</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">broadcast</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">server responds to /nsm/server/broadcast message</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">optional-gui</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">server responds to optional-gui messages—if this capability is not present then clients with optional-guis MUST always keep them visible</p></td>
</tr>
</tbody>
</table>
<div class="paragraph"><p>A client should not consider itself to be under session management until it receives this response.
For example, the Non applications activate their "SM" blinkers at this time.</p></div>
<div class="paragraph"><p>If there is an error, a reply of the following form will be sent to the client:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>/error "/nsm/server/announce" i:error_code s:error_message</pre>
</div></div>
<div class="paragraph"><p>The following table defines possible values of <span class="monospaced">error_code</span>:</p></div>
<table class="tableblock frame-all grid-all"
style="
width:100%;
">
<caption class="title">Table 3. Response codes</caption>
<col style="width:50%;">
<col style="width:50%;">
<tbody>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Code</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Meaning</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">ERR_GENERAL</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">General Error</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">ERR_INCOMPATIBLE_API</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Incompatible API version</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" ><p class="tableblock">ERR_BLACKLISTED</p></td>
<td class="tableblock halign-left valign-top" ><p class="tableblock">Client has been blacklisted.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_server_to_client_control_messages">Server to Client Control Messages</h3>
<div class="paragraph"><p>Compliant clients MUST accept the client control messages described in this section. All client
control messages REQUIRE a response. Responses MUST be delivered back to the sender (NSM) from the
same socket used by the client in its <span class="monospaced">announce</span> message (by using <span class="monospaced">lo_send_from</span>) AFTER the action has
been completed or if an error is encountered. The required response is described in the subsection
for each message.</p></div>
<div class="paragraph"><p>If there is an error and the action cannot be completed, then <span class="monospaced">error_code</span> MUST be set to a valid
error code (see <a href="#Error Code Definitions">[Error Code Definitions]</a>) and <span class="monospaced">message</span> to a string describing the problem
(suitable for display to the user).</p></div>
<div class="paragraph"><p>The reply can take one of the following two forms, where path MUST be the <span class="monospaced">path</span> of the message being
replied to (e.g. "nsm/client/save":</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>/reply s:path s:message</pre>
</div></div>
<div class="listingblock">
<div class="content monospaced">