Ardour  9.0-pre0-582-g084a23a80d
zeroconf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #include <cstdint>
20 #include <string>
21 
22 #ifdef __APPLE__
23 #include <dns_sd.h>
24 #include <glibmm/iochannel.h>
25 #include <glibmm/main.h>
26 #endif
27 
29 #include "ardour/system_exec.h"
30 
31 namespace ARDOUR {
32 
34 {
35 public:
36  ZeroConf (std::string const& type = "_osc._udp", uint16_t port = 3819, std::string const& host = "");
38 
39 private:
40  bool start ();
41  void stop ();
42 
43  std::string _type;
44  uint16_t _port;
45  std::string _host;
46 
47 #ifdef __APPLE__
48  static gboolean event (GIOChannel*, GIOCondition, gpointer);
49 
50  DNSServiceRef _ref;
51  guint _source_id;
52  GIOChannel* _gio_channel;
53 #else
55 #endif
56 };
57 
58 }; // namespace ARDOUR
std::string _type
Definition: zeroconf.h:43
ZeroConf(std::string const &type="_osc._udp", uint16_t port=3819, std::string const &host="")
uint16_t _port
Definition: zeroconf.h:44
SystemExec * _avahi
Definition: zeroconf.h:54
std::string _host
Definition: zeroconf.h:45
#define LIBARDOUR_API