cmake build system: visiblity support for clang
[supercollider.git] / SCClassLibrary / Common / Control / OSCService.sc
blob98bef4b676359f13af4e2e8372c09254b6e388d9
1 OSCService {
2         var <name, <hostname, <port, <protocol;
4 // the way OSCServers should be created
5         *knownServices {
6                 var services, numberOfKnownServices;
7                 numberOfKnownServices = this.numberOfKnownServices;
8                 services = Array.new(numberOfKnownServices);
9                 numberOfKnownServices.do({arg index;
10                         var service;
11                         service = OSCService.new;
12                         this.prInitOSCService(service, index);
13                         services.add(service);
14                 });
16                 ^services;
17         }
19         *knownAddresses { arg applicationType="SuperCollider", protocol=\udp;
20                 var addr;
21                 this.knownServices.do { arg item;
22                         if(applicationType.isNil or: { item.name == applicationType }
23                            and: { protocol.isNil or: { item.protocol == protocol } }, {
24                                 addr = addr.add(item.netAddr);
25                         });
26                 };
27                 ^addr
28         }
30 // accessors
31         *numberOfKnownServices {
32                 _NumOSCServices
33         }
35         netAddr {
36                 ^NetAddr.new(hostname, port);
37         }
39 // private methods
40         *prInitOSCService { arg server, index;
41                 _InitOSCService
42         }
44         printOn { arg stream;
45                 stream << this.class.name << "(" <<* [name, hostname, port, protocol ? \unknown]  <<")"
46         }