itaVA.m 61.2 KB
Newer Older
1
classdef itaVA < handle
2
3
    %ITAVA Remote network interface to VA (Virtual Acoustics), the real-time 
    %auralization software made by ITA.
4
5
6
    %
    %   This class realizes a remote connection to a VA real-time
    %   auralization server and implements the full VA core interface
7
8
9
10
11
    %   in Matlab. You can connect to to the server
    %   and control all of its features to perform real-time
    %   auralization, including live tracking if available.
    %   In order to get understand to the concepts behind VA
    %   please refer to the VA documentation or have a look at the example scripts.
12
    %
13
14
15
16
    %   See also: itaVA_example_simple, itaVA_example_tracked_listener,
    %   itaVA_example_generic_path_renderer, itaVA_example_random_numbers
    %
    %   Quick usage:
17
18
19
20
    %
    %   - Create an interface and connect to the server running on the
    %     same computer (localhost)
    %
21
22
    %     va = itaVA;
    %     va.connect;
23
24
    %
    %     If no error occurs, you can then use the interface to work with
25
    %     the VA server.
26
    %
27
    %     Now, you can call other methods. For instance create a sound
28
29
    %     source:
    %
30
    %     sourceID = va.createSoundSource( 'My Matlab virtual sound source' )
31
32
33
34
35
36
37
38
39
40
    %
    %     When everything is done, do not forget to close the connection.
    %     You can call disconnect on the instance or simply clear it:
    %
    %     clear va
    %
    %
    
    properties(Hidden = true, Access = private)
        handle = int32(0); % Connection handle
41
                
42
43
44
45
46
        % Connection defaults
        DEFAULT_SERVER_PORT = 12340;
    end
    
    methods(Static)
47
48
49
50
51
52
53
54
55
56
57
58
59
60
        
        function [ ok ] = check_for_mex_file()
            % Checks if VAMatlab executable can be found.
            if ~exist( 'VAMatlab', 'var' )
                disp( 'Matlab binding for VA not complete (missing VAMatlab executable).' )
                ok = false;
                
                % file dialog
                
            else
                ok = true;
            end
        end
        
61
62
63
64
65
66
67
68
69
70
        function [version] = getVersion()
            % Return the version of the VA Matlab interface
            %
            % Parameters:
            %
            % 	None
            %
            % Return values:
            %
            % 	version  [string]  Version string
71
72
73
74
75
            
            if ~itaVA.check_for_mex_file()
                error( 'Matlab binding for VA requires VAMatlab executable.' );
            end

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
            version = VAMatlab('getVersion');
        end
        
         function [] = setVerboseMode(mode)
            % Sets the verbose level of the VA Matlab interface
            %
            % Parameters:
            %
            % 	mode  [string]   Verbose mode ('quiet'|'normal')
            %
            % Return values:
            %
            % 	None
            %
            % Remarks:
            %
            % - If you do not want any messages from the extension
            %   set the verbose mode to 'quiet'
            %
95
96
97
98
99
            
            if ~itaVA.check_for_mex_file()
                error( 'Matlab binding for VA requires VAMatlab executable.' );
            end

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
            VAMatlab('setVerboseMode', mode);
        end
    end

    methods
        function this = itaVA(addressstring)
            % Initialization constructor. Initiiates a new connection.
            %
            % Parameters:
            %
            % 	addressstring  [string]   Hostname or IP address and port of the
            %                             server string (name:port), optional
            %
            % Return values:
            %
            % 	None
            %
            % Remarks:
            %
            % - You can leave the argument 'address' undefined, in order
            %   to create an clear, unconnected instance and connect to
            %   a server later using the method 'connect'
            % - Example: core = itaVA;
            %            core = itaVA('localhost:12340');
            %
            
126
127
128
129
            if ~itaVA.check_for_mex_file()
                error( 'Matlab binding for VA requires VAMatlab executable.' );
            end
        
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
            if (nargin > 0)
                this.connect(addressstring)
            end
        end
        
        function delete(this)
            % Destructor. Automatically disconnects an existing connection.
            this.disconnect
        end 
       
        function [connected] = isConnected(this)
            % Returns if a connection to a server is established
           connected = VAMatlab('isConnected', this.handle);
        end
        
        function connect(this, addressstring)
            % Connects to a server
            %
            % Parameters:
            %
            % 	addressstring  [string]   Hostname or IP address and port of the
            %                             server string (name:port), optional
            %
            % Return values:
            %
            % 	None
            %
            % Remarks:
            %
            % - An error occurs if the instance is already connected
            % - Example: core.connect('localhost:12340')
            %
            if this.handle~=0
				error('Already connected. Close the existing connection first.'); 
			end 
            
			if nargin == 2
				if isempty(addressstring) 
					error('Server address must not be empty.');
				end
			else
				addressstring = 'localhost';
			end
            
            this.handle = VAMatlab('connect', addressstring);
        end
        
        function disconnect(this)
            % Disconnects from a server
            VAMatlab('disconnect', this.handle)
            this.handle = int32(0);
        end
           
        function [state] = getServerState(this)
            % Returns the state of the connected server
            %
            % Use this function to check whether the server is
            % running fine and does not have any problems.
            %
            % Parameters:
            %
            % 	None
            %
            % Return values:
            %
            % 	state [integer-1x1] Server stat
            %
            % States:
            % 
            % - 0 = Connected, but server not configured. Failure.
            % - 1 = Connected and ready for usage.
            % - 2 = Connected, but server has failure.
            %
            if this.handle==0, error('Not connected.'); end; 
            state = VAMatlab('getServerState', this.handle);
        end
        
        function connectTracker( this, remote_ip, local_ip )
            % Connects to a local NatNet tracking server
            % 
            % The server will update a virtual listener for real-time 
            % sound synthesis and the real world listener position for
            % those sound reproductions that need this information, like  
            % Crosstalk-Cancellation.
            %
            % See also setTrackedListener.
            %
            % Parameters (optional):
            %
            % 	remote_ip [char]	Remote ip address
            % 	local_ip [char]		Local ip address
            %

			if( nargin == 1 )
				remote_ip = '127.0.0.1';
				local_ip = '127.0.0.1';
			end

            VAMatlab( 'ConnectTracker', this.handle, remote_ip, local_ip );
        end
        
        function [connected] = isTrackerConnected( this )
            % Returns true, if tracker is connected
            connected = VAMatlab( 'IsTrackerConnected', this.handle );
        end
        
        function setTrackedListener( this, listener_id )
            % Connects a VA listener with the tracked rigid body
            %
            % Parameters:
            %
            % 	listener_id  [integer-1x1]   VA listener id
            %
            VAMatlab( 'SetTrackedListener', this.handle, listener_id );
        end
        
        function setTrackedSource( this, source_id )
            % Connects a VA source with the tracked rigid body
            %
            % Parameters:
            %
            % 	source_id  [integer-1x1]   VA listener id
            %
            VAMatlab( 'SetTrackedSource', this.handle, source_id );
        end
        
        function disconnectTracker( this )
            % Disconnects from the NatNet tracking server
            VAMatlab( 'DisconnectTracker', this.handle )
        end
        
        function setRigidBodyIndex( this, index )
            % Sets the index of the rigid body to be tracked (default is 1)
            VAMatlab( 'SetRigidBodyIndex', this.handle, index )
        end
        
        function setRigidBodyTranslation( this, translation )
            % Sets the pivot point translation for the tracked rigid body
			%
			% Parameters:
			%
			%	translation [double-3x1]	Translation in local coordinate system of rigid body [m]
			%
            VAMatlab( 'SetRigidBodyTranslation', this.handle, translation )
        end
        
        function setRigidBodyRotation( this, rotation )
            % Sets the rotation of orientation for the tracked rigid body
			%
			% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
			%
			% Parameters:
			%
			%	rotation [quaternion]	Rotation of rigid body
			%
            VAMatlab( 'SetRigidBodyRotation', this.handle, rotation )
        end
        
        %% --= Functions =--
        
        	function [valid] = addSearchPath(this, path)
		% adds a search path at core side
		%
		% Parameters:
		%
		% 	path [string] Relative or absolute path
		%
		% Return values:
		%
		% 	valid [logical scalar] True, if path at core side valid
		%

		if this.handle==0, error('Not connected.'); end;

		[valid] = VAMatlab('addSearchPath', this.handle, path);
	end

	function [playbackID] = addSoundPlayback(this, signalSourceID,soundID,flags,timecode)
		% Adds a sound playback for a sequencer signal source
		%
		% Parameters:
		%
		% 	signalSourceID [string] Sequencer signal source ID
		% 	soundID [integer-1x1] Sound ID
		% 	flags [integer-1x1] Playback flags
		% 	timecode [double-1x1] Playback time (expressed in core clock time, 0 => instant playback)
		%
		% Return values:
		%
		% 	playbackID [integer-1x1] Playback ID
		%

		if this.handle==0, error('Not connected.'); end;

		[playbackID] = VAMatlab('addSoundPlayback', this.handle, signalSourceID,soundID,flags,timecode);
	end

	function [ret] = callModule(this, module,mstruct)
		% Calls an internal module of the VA server
		%
		% Parameters:
		%
		% 	module [string] Module name
		% 	mstruct [struct] Matlab structure with key-value content
		%
		% Return values:
		%
		% 	ret [struct-1x1] Struct containing the return values
		%

		if this.handle==0, error('Not connected.'); end;

		[ret] = VAMatlab('callModule', this.handle, module,mstruct);
	end

	function [signalSourceID] = createAudiofileSignalSource(this, filename,name)
		% Creates a signal source which plays an audiofile
		%
		% Parameters:
		%
		% 	filename [string] Filename
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	signalSourceID [string] Signal source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[signalSourceID] = VAMatlab('createAudiofileSignalSource', this.handle, filename,name);
	end

	function [signalSourceID] = createEngineSignalSource(this, name)
		% Creates an engine signal source
		%
		% Parameters:
		%
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	signalSourceID [string] Signal source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[signalSourceID] = VAMatlab('createEngineSignalSource', this.handle, name);
	end

	function [id] = createListener(this, name,auralizationMode,hrirID)
		% Creates a listener
		%
		% Parameters:
		%
		% 	name [string] Displayed name (optional, default: '')
		% 	auralizationMode [string] Auralization mode (optional, default: 'default')
		% 	hrirID [integer-1x1] HRIR dataset ID (optional, default: -1)
		%
		% Return values:
		%
		% 	id [integer-1x1] Sound source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		if ~exist('auralizationMode','var'), auralizationMode = 'default'; end
		if ~exist('hrirID','var'), hrirID = -1; end
		[id] = VAMatlab('createListener', this.handle, name,auralizationMode,hrirID);
	end

	function [signalSourceID] = createNetworkStreamSignalSource(this, address,port,name)
		% Creates a signal source which receives audio samples via network
		%
		% Parameters:
		%
		% 	address [string] Hostname or IP address of the audio streaming server
		% 	port [integer-1x1] Server port
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	signalSourceID [string] Signal source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[signalSourceID] = VAMatlab('createNetworkStreamSignalSource', this.handle, address,port,name);
	end

	function [signalSourceID] = createSequencerSignalSource(this, name)
		% Creates a sequencer signal source
		%
		% Parameters:
		%
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	signalSourceID [string] Signal source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[signalSourceID] = VAMatlab('createSequencerSignalSource', this.handle, name);
	end

	function [id] = createSoundSource(this, name,auralizationMode,volume)
		% Creates a sound source
		%
		% Parameters:
		%
		% 	name [string] Displayed name (optional, default: '')
		% 	auralizationMode [string] Auralization mode (optional, default: 'default')
		% 	volume [double-1x1] Volume [factor] (optional, default: 1)
		%
		% Return values:
		%
		% 	id [integer-1x1] Sound source ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		if ~exist('auralizationMode','var'), auralizationMode = 'default'; end
		if ~exist('volume','var'), volume = 1; end
		[id] = VAMatlab('createSoundSource', this.handle, name,auralizationMode,volume);
	end

	function [id] = createSoundSourceExplicitRenderer(this, name,renderer)
		% Creates a sound source explicitly for a certain renderer
		%
		% Parameters:
		%
		% 	name [string] Name
		% 	renderer [string] Renderer identifier
		%
		% Return values:
		%
		% 	id [integer-1x1] Sound source ID
		%

		if this.handle==0, error('Not connected.'); end;

		[id] = VAMatlab('createSoundSourceExplicitRenderer', this.handle, name,renderer);
	end

	function [] = deleteListener(this, listenerID)
		% Deletes a listener from the scene
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('deleteListener', this.handle, listenerID);
	end

	function [result] = deleteSignalSource(this, signalSourceID)
		% Deletes a signal source
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		%
		% Return values:
		%
		% 	result [logical-1x1] Signal source deleted?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('deleteSignalSource', this.handle, signalSourceID);
	end

	function [] = deleteSoundSource(this, soundSourceID)
		% Deletes an existing sound source in the scene
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('deleteSoundSource', this.handle, soundSourceID);
	end

	function [modules] = enumerateModules(this)
		% Enumerates internal modules of the VA server
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	modules [cell-array of struct-1x1] Module informations (names, descriptions, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[modules] = VAMatlab('enumerateModules', this.handle);
	end

	function [result] = freeDirectivity(this, directivityID)
		% Frees a directivity and releases its memory
		%
		% Parameters:
		%
		% 	directivityID [integer-1x1] Directivity ID
		%
		% Return values:
		%
		% 	result [logical-1x1] Directivity freed?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('freeDirectivity', this.handle, directivityID);
	end

	function [result] = freeHRIRDataset(this, hrirID)
		% Frees a loaded HRIR dataset
		%
		% Parameters:
		%
		% 	hrirID [integer-1x1] HRIR dataset ID
		%
		% Return values:
		%
		% 	result [logical-1x1] HRIR dataset freed?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('freeHRIRDataset', this.handle, hrirID);
	end

	function [result] = freeSound(this, soundID)
		% Frees a loaded sound
		%
		% Parameters:
		%
		% 	soundID [integer-1x1] Sound ID
		%
		% Return values:
		%
		% 	result [logical-1x1] Sound freed?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('freeSound', this.handle, soundID);
	end

	function [listenerID] = getActiveListener(this)
		% Returns the active listener
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	listenerID [integer-1x1] Listener ID
		%

		if this.handle==0, error('Not connected.'); end;

		[listenerID] = VAMatlab('getActiveListener', this.handle);
	end

	function [isLooping] = getAudiofileSignalSourceIsLooping(this, signalSourceID)
		% Returns the playback state of an audiofile signal source. Available modes: PLAYING, STOPPED, PAUSED
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		%
		% Return values:
		%
		% 	isLooping [logical-1x1] Looping enabled/disabled
		%

		if this.handle==0, error('Not connected.'); end;

		[isLooping] = VAMatlab('getAudiofileSignalSourceIsLooping', this.handle, signalSourceID);
	end

	function [playState] = getAudiofileSignalSourcePlaybackState(this, signalSourceID)
		% Returns the playback state of an audiofile signal source. Available modes: PLAYING, STOPPED, PAUSED
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		%
		% Return values:
		%
		% 	playState [string] Playback state
		%

		if this.handle==0, error('Not connected.'); end;

		[playState] = VAMatlab('getAudiofileSignalSourcePlaybackState', this.handle, signalSourceID);
	end

	function [clk] = getCoreClock(this)
		% Returns the current core time
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	clk [double-1x1] Core clock time (unit: seconds)
		%

		if this.handle==0, error('Not connected.'); end;

		[clk] = VAMatlab('getCoreClock', this.handle);
	end

	function [info] = getDirectivityInfo(this, directivityID)
		% Returns information on a loaded directivity
		%
		% Parameters:
		%
		% 	directivityID [integer-1x1] Directivity ID
		%
		% Return values:
		%
		% 	info [struct-1x1] Information struct (name, filename, resolution, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getDirectivityInfo', this.handle, directivityID);
	end

	function [info] = getDirectivityInfos(this)
		% Returns information on all loaded directivities
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	info [cell-array of struct-1x1] Information structs (name, filename, resolution, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getDirectivityInfos', this.handle);
	end

	function [auralizationMode] = getGlobalAuralizationMode(this)
		% Returns the global auralization mode
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	auralizationMode [string] Auralization mode
		%

		if this.handle==0, error('Not connected.'); end;

		[auralizationMode] = VAMatlab('getGlobalAuralizationMode', this.handle);
	end

	function [info] = getHRIRDatasetInfo(this, hrirID)
		% Returns information on a loaded HRIR dataset
		%
		% Parameters:
		%
		% 	hrirID [integer-1x1] HRIR dataset ID
		%
		% Return values:
		%
		% 	info [struct-1x1] Information structs (name, filename, resolution, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getHRIRDatasetInfo', this.handle, hrirID);
	end

	function [info] = getHRIRDatasetInfos(this)
		% Returns information on all loaded HRIR datasets
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	info [cell-array of struct-1x1] Information structs (name, filename, resolution, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getHRIRDatasetInfos', this.handle);
	end

	function [gain] = getInputGain(this)
		% Returns the gain the audio device input channels
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	gain [double-1x1] Input gain (amplification factor >=0)
		%

		if this.handle==0, error('Not connected.'); end;

		[gain] = VAMatlab('getInputGain', this.handle);
	end

	function [auralizationMode] = getListenerAuralizationMode(this, listenerID)
		% Returns the auralization mode of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	auralizationMode [string] Auralization mode
		%

		if this.handle==0, error('Not connected.'); end;

		[auralizationMode] = VAMatlab('getListenerAuralizationMode', this.handle, listenerID);
	end

	function [hrirID] = getListenerHRIRDataset(this, listenerID)
		% Returns for a listener the assigned HRIR dataset
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	hrirID [integer-1x1] HRIR dataset ID
		%

		if this.handle==0, error('Not connected.'); end;

		[hrirID] = VAMatlab('getListenerHRIRDataset', this.handle, listenerID);
	end

	function [ids] = getListenerIDs(this)
		% Returns the IDs of all listeners in the scene
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	ids [integer-1xN] Vector containing the IDs
		%

		if this.handle==0, error('Not connected.'); end;

		[ids] = VAMatlab('getListenerIDs', this.handle);
	end

	function [name] = getListenerName(this, listenerID)
		% Returns name of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	name [string] Displayed name
		%

		if this.handle==0, error('Not connected.'); end;

		[name] = VAMatlab('getListenerName', this.handle, listenerID);
	end

	function [view,up] = getListenerOrientationVU(this, listenerID)
		% Returns the orientation of a listener (as view- and up-vector)
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%

		if this.handle==0, error('Not connected.'); end;

		[view,up] = VAMatlab('getListenerOrientationVU', this.handle, listenerID);
	end

	function [ypr] = getListenerOrientationYPR(this, listenerID)
		% Returns the orientation of a listener (in yaw-pitch-roll angles)
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%

		if this.handle==0, error('Not connected.'); end;

		[ypr] = VAMatlab('getListenerOrientationYPR', this.handle, listenerID);
	end

	function [params] = getListenerParameters(this, ID,args)
		% Returns the current listener parameters
		%
		% Parameters:
		%
		% 	ID [integer-1x1] Listener identifier
		% 	args [mstruct] Requested parameters
		%
		% Return values:
		%
		% 	params [mstruct] Parameters
		%

		if this.handle==0, error('Not connected.'); end;

		[params] = VAMatlab('getListenerParameters', this.handle, ID,args);
	end

	function [pos] = getListenerPosition(this, listenerID)
		% Returns the position of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos] = VAMatlab('getListenerPosition', this.handle, listenerID);
	end

	function [pos,view,up,velocity] = getListenerPositionOrientationVelocityVU(this, listenerID)
		% Returns the position, orientation (as view- and up vector) and velocity of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		% 	velocity [double-3] velocity vector
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,view,up,velocity] = VAMatlab('getListenerPositionOrientationVelocityVU', this.handle, listenerID);
	end

	function [pos,ypr,velocity] = getListenerPositionOrientationVelocityYPR(this, listenerID)
		% Returns the position, orientation (in yaw-pitch-roll angles) and velocity of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		% 	velocity [double-3] velocity vector
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,ypr,velocity] = VAMatlab('getListenerPositionOrientationVelocityYPR', this.handle, listenerID);
	end

	function [pos,view,up] = getListenerPositionOrientationVU(this, listenerID)
		% Returns the position and orientation (as view- and up-vector) of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,view,up] = VAMatlab('getListenerPositionOrientationVU', this.handle, listenerID);
	end

	function [pos,ypr] = getListenerPositionOrientationYPR(this, listenerID)
		% Returns the position and orientation (in yaw-pitch-roll angles) of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,ypr] = VAMatlab('getListenerPositionOrientationYPR', this.handle, listenerID);
	end

	function [pos,view,up] = getListenerRealWorldHeadPositionOrientationVU(this, listenerID)
		% Returns the real-world position and orientation (as view- and up vector) of the listener's head
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,view,up] = VAMatlab('getListenerRealWorldHeadPositionOrientationVU', this.handle, listenerID);
	end

	function [gain] = getOutputGain(this)
		% Returns the global output gain
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	gain [double-1x1] Output gain (amplification factor >=0)
		%

		if this.handle==0, error('Not connected.'); end;

		[gain] = VAMatlab('getOutputGain', this.handle);
	end

	function [ids] = getPortalIDs(this)
		% Return the IDs of all portal in the scene
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	ids [integer-1xN] Vector containing the IDs
		%

		if this.handle==0, error('Not connected.'); end;

		[ids] = VAMatlab('getPortalIDs', this.handle);
	end

	function [name] = getPortalName(this, portalID)
		% Returns the name of a portal
		%
		% Parameters:
		%
		% 	portalID [integer-1x1] Portal ID
		%
		% Return values:
		%
		% 	name [string] Displayed name
		%

		if this.handle==0, error('Not connected.'); end;

		[name] = VAMatlab('getPortalName', this.handle, portalID);
	end

	function [name] = getPortalState(this, portalID)
		% Returns the state of a portal
		%
		% Parameters:
		%
		% 	portalID [integer-1x1] Portal ID
		%
		% Return values:
		%
		% 	name [double-1x1] Portal state (range [0,1] where 0 => fully closed, 1 => fully opened)
		%

		if this.handle==0, error('Not connected.'); end;

		[name] = VAMatlab('getPortalState', this.handle, portalID);
	end

	function [dGain] = getRenderingModuleGain(this, sModuleID)
		% Get rendering module output gain
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		%
		% Return values:
		%
		% 	dGain [double-1x1] Gain (scalar)
		%

		if this.handle==0, error('Not connected.'); end;

		[dGain] = VAMatlab('getRenderingModuleGain', this.handle, sModuleID);
	end

	function [dGain] = getReproductionModuleGain(this, sModuleID)
		% Returns the reproduction module output gain
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		%
		% Return values:
		%
		% 	dGain [double-1x1] Gain (scalar)
		%

		if this.handle==0, error('Not connected.'); end;

		[dGain] = VAMatlab('getReproductionModuleGain', this.handle, sModuleID);
	end

	function [info] = getSceneInfo(this)
		% Returns information on the loaded scene
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	info [struct-1x1] Information struct (name, filename, num polygons, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getSceneInfo', this.handle);
	end

	function [addr] = getServerAddress(this)
		% Returns for an opened connection the server it is connected to
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	addr [string] Server address
		%

		if this.handle==0, error('Not connected.'); end;

		[addr] = VAMatlab('getServerAddress', this.handle);
	end

	function [info] = getSignalSourceInfo(this, signalSourceID)
		% Returns information on signal source
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		%
		% Return values:
		%
		% 	info [struct-1x1] Information structs (id, name, type, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getSignalSourceInfo', this.handle, signalSourceID);
	end

	function [info] = getSignalSourceInfos(this)
		% Returns information on all existing signal sources
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	info [cell-array of struct-1x1] Information structs (id, name, type, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getSignalSourceInfos', this.handle);
	end

	function [info] = getSoundInfo(this, soundID)
		% Returns information on a loaded sound
		%
		% Parameters:
		%
		% 	soundID [integer-1x1] Sound ID
		%
		% Return values:
		%
		% 	info [struct-1x1] Information struct (name, filename, length, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getSoundInfo', this.handle, soundID);
	end

	function [info] = getSoundInfos(this)
		% Returns information on all loaded sounds
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	info [cell-array of struct-1x1] Information structs (name, filename, length, etc.)
		%

		if this.handle==0, error('Not connected.'); end;

		[info] = VAMatlab('getSoundInfos', this.handle);
	end

	function [auralizationMode] = getSoundSourceAuralizationMode(this, soundSourceID)
		% Returns the auralization mode of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	auralizationMode [string] Auralization mode
		%

		if this.handle==0, error('Not connected.'); end;

		[auralizationMode] = VAMatlab('getSoundSourceAuralizationMode', this.handle, soundSourceID);
	end

	function [directivityID] = getSoundSourceDirectivity(this, soundSourceID)
		% Returns the directivity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	directivityID [integer-1x1] Directivity ID
		%

		if this.handle==0, error('Not connected.'); end;

		[directivityID] = VAMatlab('getSoundSourceDirectivity', this.handle, soundSourceID);
	end

	function [ids] = getSoundSourceIDs(this)
		% Returns the IDs of all sound sources in the scene
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	ids [integer-1xN] Vector containing the IDs
		%

		if this.handle==0, error('Not connected.'); end;

		[ids] = VAMatlab('getSoundSourceIDs', this.handle);
	end

	function [name] = getSoundSourceName(this, soundSourceID)
		% Returns name of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	name [string] Displayed name
		%

		if this.handle==0, error('Not connected.'); end;

		[name] = VAMatlab('getSoundSourceName', this.handle, soundSourceID);
	end

	function [view,up] = getSoundSourceOrientationVU(this, soundSourceID)
		% Returns the orientation of a sound source as view- and up-vector
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	view [double-3] View vector (length: 1)
		% 	up [double-3] Up vector (length: 1)
		%

		if this.handle==0, error('Not connected.'); end;

		[view,up] = VAMatlab('getSoundSourceOrientationVU', this.handle, soundSourceID);
	end

	function [ypr] = getSoundSourceOrientationYPR(this, soundSourceID)
		% Returns the orientation of a sound source (in yaw-pitch-roll angles)
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%

		if this.handle==0, error('Not connected.'); end;

		[ypr] = VAMatlab('getSoundSourceOrientationYPR', this.handle, soundSourceID);
	end

	function [params] = getSoundSourceParameters(this, ID,args)
		% Returns the current sound source parameters
		%
		% Parameters:
		%
		% 	ID [integer-1x1] Sound source identifier
		% 	args [mstruct] Requested parameters
		%
		% Return values:
		%
		% 	params [mstruct] Parameters
		%

		if this.handle==0, error('Not connected.'); end;

		[params] = VAMatlab('getSoundSourceParameters', this.handle, ID,args);
	end

	function [pos] = getSoundSourcePosition(this, soundSourceID)
		% Returns the position of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos] = VAMatlab('getSoundSourcePosition', this.handle, soundSourceID);
	end

	function [pos,view,up,vel] = getSoundSourcePositionOrientationVelocityVU(this, soundSourceID)
		% Returns the position, orientation (as view- and up-vector) and velocity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	view [double-3] View vector (length: 1)
		% 	up [double-3] Up vector (length: 1)
		% 	vel [double-3] Velocity vector (vx, vy, vz) (unit: meters/second)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,view,up,vel] = VAMatlab('getSoundSourcePositionOrientationVelocityVU', this.handle, soundSourceID);
	end

	function [pos,ypr,vel] = getSoundSourcePositionOrientationVelocityYPR(this, soundSourceID)
		% Returns the position, orientation (in yaw-pitch-roll angles) and velocity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		% 	vel [double-3] Velocity vector [vx,vy,vz] (unit: meters/second)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,ypr,vel] = VAMatlab('getSoundSourcePositionOrientationVelocityYPR', this.handle, soundSourceID);
	end

	function [pos,view,up] = getSoundSourcePositionOrientationVU(this, soundSourceID)
		% Returns the position and orientation (as view- and up-vector) of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	view [double-3] View vector (length: 1)
		% 	up [double-3] Up vector (length: 1)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,view,up] = VAMatlab('getSoundSourcePositionOrientationVU', this.handle, soundSourceID);
	end

	function [pos,ypr] = getSoundSourcePositionOrientationYPR(this, soundSourceID)
		% Returns the position and orientation (in yaw-pitch-roll angles) of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%

		if this.handle==0, error('Not connected.'); end;

		[pos,ypr] = VAMatlab('getSoundSourcePositionOrientationYPR', this.handle, soundSourceID);
	end

	function [signalSourceID] = getSoundSourceSignalSource(this, soundSourceID)
		% Returns for a sound source, the attached signal source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	signalSourceID [string] Signal source ID
		%

		if this.handle==0, error('Not connected.'); end;

		[signalSourceID] = VAMatlab('getSoundSourceSignalSource', this.handle, soundSourceID);
	end

	function [volume] = getSoundSourceVolume(this, soundSourceID)
		% Returns the volume of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	volume [double-1x1] Volume
		%

		if this.handle==0, error('Not connected.'); end;

		[volume] = VAMatlab('getSoundSourceVolume', this.handle, soundSourceID);
	end

	function [result] = isInputMuted(this)
		% Returns if the audio device inputs are muted
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	result [logical-1x1] Inputs muted?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('isInputMuted', this.handle);
	end

	function [result] = isOutputMuted(this)
		% Returns if the global output is muted
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	result [logical-1x1] Output muted?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('isOutputMuted', this.handle);
	end

	function [bMuted] = isRenderingModuleMuted(this, sModuleID)
		% Is reproduction module muted?
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		%
		% Return values:
		%
		% 	bMuted [logical-1x1] true if muted, false if unmuted
		%

		if this.handle==0, error('Not connected.'); end;

		[bMuted] = VAMatlab('isRenderingModuleMuted', this.handle, sModuleID);
	end

	function [bMuted] = isReproductionModuleMuted(this, sModuleID)
		% Is reproduction module muted?
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		%
		% Return values:
		%
		% 	bMuted [logical-1x1] true if muted, false if unmuted
		%

		if this.handle==0, error('Not connected.'); end;

		[bMuted] = VAMatlab('isReproductionModuleMuted', this.handle, sModuleID);
	end

	function [result] = isSceneLoaded(this)
		% Returns if a scene is loaded
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	result [logical-1x1] Is a scene loaded?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('isSceneLoaded', this.handle);
	end

	function [result] = isSceneLocked(this)
		% Is scene locked?
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	result [logical-1x1] true, if within locked (synchronized) scene modification
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('isSceneLocked', this.handle);
	end

	function [result] = isSoundSourceMuted(this, soundSourceID)
		% Returns if a sound source is muted
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		%
		% Return values:
		%
		% 	result [logical-1x1] Muted?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('isSoundSourceMuted', this.handle, soundSourceID);
	end

	function [directivityID] = loadDirectivity(this, filename,name)
		% Loads a directivity from a file
		%
		% Parameters:
		%
		% 	filename [string] Filename
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	directivityID [integer-1x1] Directivity ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[directivityID] = VAMatlab('loadDirectivity', this.handle, filename,name);
	end

	function [id] = loadHRIRDataset(this, filename,name)
		% Loads a HRIR dataset from a file
		%
		% Parameters:
		%
		% 	filename [string] Filename
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	id [integer-1x1] HRIR dataset ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[id] = VAMatlab('loadHRIRDataset', this.handle, filename,name);
	end

	function [] = loadScene(this, filename)
		% Loads a scene from a file (e.g. RAVEN project file)
		%
		% Parameters:
		%
		% 	filename [string] Filename
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('loadScene', this.handle, filename);
	end

	function [id] = loadSound(this, filename,name)
		% Loads a sound from an audiofile
		%
		% Parameters:
		%
		% 	filename [string] Filename
		% 	name [string] Displayed name (optional, default: '')
		%
		% Return values:
		%
		% 	id [integer-1x1] Sound ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('name','var'), name = ''; end
		[id] = VAMatlab('loadSound', this.handle, filename,name);
	end

	function [] = lockScene(this)
		% Locks the scene (modifications of scene can be applied synchronously)
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('lockScene', this.handle);
	end

	function [id] = playSound(this, soundID,volume)
		% Plays a sound
		%
		% Parameters:
		%
		% 	soundID [integer-1x1] Sound ID
		% 	volume [double-1x1] Volume [factor] (optional, default: 1)
		%
		% Return values:
		%
		% 	id [integer-1x1] Playback ID
		%

		if this.handle==0, error('Not connected.'); end;

		if ~exist('volume','var'), volume = 1; end
		[id] = VAMatlab('playSound', this.handle, soundID,volume);
	end

	function [result] = removeSoundPlayback(this, playbackID)
		% Removes an existing sound playback from a sequencer signal source
		%
		% Parameters:
		%
		% 	playbackID [integer-1x1] Playback ID
		%
		% Return values:
		%
		% 	result [logical-1x1] Playback removed?
		%

		if this.handle==0, error('Not connected.'); end;

		[result] = VAMatlab('removeSoundPlayback', this.handle, playbackID);
	end

	function [] = removeSoundSourceSignalSource(this, ID)
		% Removes the signal source of a sound source
		%
		% Parameters:
		%
		% 	ID [integer-1x1] Sound source identifier
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('removeSoundSourceSignalSource', this.handle, ID);
	end

	function [] = reset(this)
		% Resets the VA server
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('reset', this.handle);
	end

	function [] = setActiveListener(this, listenerID)
		% Sets the active listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setActiveListener', this.handle, listenerID);
	end

	function [] = setAudiofileSignalSourceIsLooping(this, signalSourceID,isLooping)
		% Change the playback state of an audiofile signal source. Available actions: PLAY STOP PAUSE
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		% 	isLooping [logical] Set looping enabled/disabled
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setAudiofileSignalSourceIsLooping', this.handle, signalSourceID,isLooping);
	end

	function [] = setAudiofileSignalSourcePlaybackAction(this, signalSourceID,playAction)
		% Change the playback state of an audiofile signal source. Available actions: PLAY STOP PAUSE
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		% 	playAction [string] Playback action
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setAudiofileSignalSourcePlaybackAction', this.handle, signalSourceID,playAction);
	end

	function [] = setAudiofileSignalSourcePlayPosition(this, signalSourceID,playPosition)
		% Sets the playback position of an audiofile signal source.
		%
		% Parameters:
		%
		% 	signalSourceID [string] Signal source ID
		% 	playPosition [scalar] Playback position [s]
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setAudiofileSignalSourcePlayPosition', this.handle, signalSourceID,playPosition);
	end

	function [] = setCoreClock(this, clk)
		% Sets the core clock time
		%
		% Parameters:
		%
		% 	clk [double-1x1] New core clock time (unit: seconds)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setCoreClock', this.handle, clk);
	end

	function [] = setGlobalAuralizationMode(this, auralizationMode)
		% Sets global auralization mode
		%
		% Parameters:
		%
		% 	auralizationMode [string] Auralization mode
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setGlobalAuralizationMode', this.handle, auralizationMode);
	end

	function [] = setInputGain(this, gain)
		% Sets the gain the audio device input channels
		%
		% Parameters:
		%
		% 	gain [double-1x1] Input gain (amplification factor >=0)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setInputGain', this.handle, gain);
	end

	function [] = setInputMuted(this, muted)
		% Sets the audio device inputs muted or unmuted
		%
		% Parameters:
		%
		% 	muted [logical-1x1] Muted?
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setInputMuted', this.handle, muted);
	end

	function [] = setListenerAuralizationMode(this, listenerID,auralizationMode)
		% Sets the auralization mode of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	auralizationMode [string] Auralization mode
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerAuralizationMode', this.handle, listenerID,auralizationMode);
	end

	function [] = setListenerHRIRDataset(this, listenerID,hrirID)
		% Set the HRIR dataset of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	hrirID [integer-1x1] HRIR dataset ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerHRIRDataset', this.handle, listenerID,hrirID);
	end

	function [] = setListenerName(this, listenerID,name)
		% Sets the name of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	name [string] Displayed name
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerName', this.handle, listenerID,name);
	end

	function [] = setListenerOrientationVU(this, listenerID,view,up)
		% Sets the orientation of a listener (as view- and up-vector)
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerOrientationVU', this.handle, listenerID,view,up);
	end

	function [] = setListenerOrientationYPR(this, listenerID,ypr)
		% Sets the orientation of a listener (in yaw-pitch-roll angles)
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerOrientationYPR', this.handle, listenerID,ypr);
	end

	function [] = setListenerParameters(this, ID,params)
		% Sets listener parameters
		%
		% Parameters:
		%
		% 	ID [integer-1x1] Listener identifier
		% 	params [mstruct] Parameters
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerParameters', this.handle, ID,params);
	end

	function [] = setListenerPosition(this, listenerID,pos)
		% Sets the position of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerPosition', this.handle, listenerID,pos);
	end

	function [] = setListenerPositionOrientationVelocityVU(this, listenerID,pos,view,up,velocity)
		% Sets the position, orientation (as view- and up vector) and velocity of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	view [double-3] view vector
		% 	up [double-3] up vector
		% 	velocity [double-3] velocity vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerPositionOrientationVelocityVU', this.handle, listenerID,pos,view,up,velocity);
	end

	function [] = setListenerPositionOrientationVelocityYPR(this, listenerID,pos,ypr,velocity)
		% Sets the position, orientation (in yaw-pitch-roll angles) and velocity of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		% 	velocity [double-3] velocity vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerPositionOrientationVelocityYPR', this.handle, listenerID,pos,ypr,velocity);
	end

	function [] = setListenerPositionOrientationVU(this, listenerID,pos,view,up)
		% Sets the position and orientation (as view- and up vector) of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerPositionOrientationVU', this.handle, listenerID,pos,view,up);
	end

	function [] = setListenerPositionOrientationYPR(this, listenerID,pos,ypr)
		% Sets the position and orientation (in yaw-pitch-roll angles) of a listener
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerPositionOrientationYPR', this.handle, listenerID,pos,ypr);
	end

	function [] = setListenerRealWorldHeadPositionOrientationVU(this, listenerID,pos,view,up)
		% Updates the real-world position and orientation (as view- and up vector) of the listener's head
		%
		% Parameters:
		%
		% 	listenerID [integer-1x1] Listener ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setListenerRealWorldHeadPositionOrientationVU', this.handle, listenerID,pos,view,up);
	end

	function [] = setOutputGain(this, gain)
		% Sets global output gain
		%
		% Parameters:
		%
		% 	gain [double-1x1] Output gain (amplification factor >=0)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setOutputGain', this.handle, gain);
	end

	function [] = setOutputMuted(this, muted)
		% Sets the global output muted or unmuted
		%
		% Parameters:
		%
		% 	muted [logical-1x1] Output muted?
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setOutputMuted', this.handle, muted);
	end

	function [] = setPortalName(this, portalID,name)
		% Sets the name of a portal
		%
		% Parameters:
		%
		% 	portalID [integer-1x1] Portal ID
		% 	name [string] Displayed name
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setPortalName', this.handle, portalID,name);
	end

	function [] = setPortalState(this, portalID,state)
		% Sets the state of a portal
		%
		% Parameters:
		%
		% 	portalID [integer-1x1] Portal ID
		% 	state [double-1x1] Portal state (range [0,1] where 0 => fully closed, 1 => fully opened)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setPortalState', this.handle, portalID,state);
	end

	function [] = setRenderingModuleGain(this, sModuleID,dGain)
		% Sets the output gain of a reproduction module
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		% 	dGain [double-1x1] gain (factor)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setRenderingModuleGain', this.handle, sModuleID,dGain);
	end

	function [] = setRenderingModuleMuted(this, sModuleID,bMuted)
		% Mutes a reproduction module
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		% 	bMuted [logical-1x1] Mute (true) or unmute (false)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setRenderingModuleMuted', this.handle, sModuleID,bMuted);
	end

	function [] = setReproductionModuleGain(this, sModuleID,dGain)
		% Sets the output gain of a reproduction module
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		% 	dGain [double-1x1] gain (factor)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setReproductionModuleGain', this.handle, sModuleID,dGain);
	end

	function [] = setReproductionModuleMuted(this, sModuleID,bMuted)
		% Mutes a reproduction module
		%
		% Parameters:
		%
		% 	sModuleID [string] Module identifier
		% 	bMuted [logical-1x1] Mute (true) or unmute (false)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setReproductionModuleMuted', this.handle, sModuleID,bMuted);
	end

	function [] = setSoundSourceAuralizationMode(this, soundSourceID,auralizationMode)
		% Returns the auralization mode of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	auralizationMode [string] Auralization mode
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceAuralizationMode', this.handle, soundSourceID,auralizationMode);
	end

	function [] = setSoundSourceDirectivity(this, soundSourceID,directivityID)
		% Sets the directivity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	directivityID [integer-1x1] Directivity ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceDirectivity', this.handle, soundSourceID,directivityID);
	end

	function [] = setSoundSourceMuted(this, soundSourceID,muted)
		% Sets a sound source muted or unmuted
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	muted [logical-1x1] Muted?
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceMuted', this.handle, soundSourceID,muted);
	end

	function [] = setSoundSourceName(this, soundSourceID,name)
		% Name
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	name [string] Displayed name
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceName', this.handle, soundSourceID,name);
	end

	function [] = setSoundSourceOrientationVU(this, soundSourceID,view,up)
		% Sets the orientation of a sound source (as view- and up-vector)
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceOrientationVU', this.handle, soundSourceID,view,up);
	end

	function [] = setSoundSourceOrientationYPR(this, soundSourceID,ypr)
		% Sets the orientation of a sound source (in yaw-pitch-roll angles)
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceOrientationYPR', this.handle, soundSourceID,ypr);
	end

	function [] = setSoundSourceParameters(this, ID,params)
		% Sets sound source parameters
		%
		% Parameters:
		%
		% 	ID [integer-1x1] Sound source identifier
		% 	params [mstruct] Parameters
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceParameters', this.handle, ID,params);
	end

	function [] = setSoundSourcePosition(this, id,pos)
		% Sets the position of a sound source
		%
		% Parameters:
		%
		% 	id [integer-1x1] Sound source ID
		% 	pos [double-3] Position vector [x,y,z] (unit: meters)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourcePosition', this.handle, id,pos);
	end

	function [] = setSoundSourcePositionOrientationVelocityVU(this, soundSourceID,pos,view,up,velocity)
		% Sets the position, orientation (as view- and up vector) and velocity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		% 	velocity [double-3] Velocity vector (unit: meters/second)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourcePositionOrientationVelocityVU', this.handle, soundSourceID,pos,view,up,velocity);
	end

	function [] = setSoundSourcePositionOrientationVelocityYPR(this, soundSourceID,pos,ypr,velocity)
		% Sets the position, orientation (in yaw, pitch, roll angles) and velocity of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		% 	velocity [double-3] Velocity vector (unit: meters/second)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourcePositionOrientationVelocityYPR', this.handle, soundSourceID,pos,ypr,velocity);
	end

	function [] = setSoundSourcePositionOrientationVU(this, soundSourceID,pos,view,up)
		% Sets the position and orientation (as view- and up vector) of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	view [double-3] View vector
		% 	up [double-3] Up vector
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourcePositionOrientationVU', this.handle, soundSourceID,pos,view,up);
	end

	function [] = setSoundSourcePositionOrientationYPR(this, soundSourceID,pos,ypr)
		% Sets the position and orientation (in yaw, pitch, roll angles) of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	pos [double-3] Position vector [x, y, z] (unit: meters)
		% 	ypr [double-3] Rotation angles [yaw, pitch, roll] (unit: degrees, not radians!)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourcePositionOrientationYPR', this.handle, soundSourceID,pos,ypr);
	end

	function [] = setSoundSourceSignalSource(this, soundSourceID,signalSourceID)
		% Sets the signal source of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	signalSourceID [string] Signal Source ID
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceSignalSource', this.handle, soundSourceID,signalSourceID);
	end

	function [] = setSoundSourceVolume(this, soundSourceID,volume)
		% Sets the volume of a sound source
		%
		% Parameters:
		%
		% 	soundSourceID [integer-1x1] Sound source ID
		% 	volume [double-1x1] Volume
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setSoundSourceVolume', this.handle, soundSourceID,volume);
	end

	function [] = setTimer(this, period)
		% Sets up the high-precision timer
		%
		% Parameters:
		%
		% 	period [double-1x1] Timer period (unit: seconds)
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('setTimer', this.handle, period);
	end

	function [newStateID] = unlockScene(this)
		% Unlocks scene and applied synchronously modifications made
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	newStateID [integer-1x1] 
		%

		if this.handle==0, error('Not connected.'); end;

		[newStateID] = VAMatlab('unlockScene', this.handle);
	end

	function [] = waitForTimer(this)
		% Wait for a signal of the high-precision timer
		%
		% Parameters:
		%
		% 	None
		%
		% Return values:
		%
		% 	None
		%

		if this.handle==0, error('Not connected.'); end;

		VAMatlab('waitForTimer', this.handle);
	end


        
        function display(this)
            % TODO: Define nice behaviour
%             if this.handle
%                 fprintf('Connection established to server ''%s''\n', this.getServerAddress())
%             else
%                 fprintf('Not connected\n');
%             end
        end
        
    end

end