-
-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathSyphonOutput.h
More file actions
76 lines (62 loc) · 2.29 KB
/
Copy pathSyphonOutput.h
File metadata and controls
76 lines (62 loc) · 2.29 KB
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
/*
* SyphonOutput.h
*
* (c) 2026 Alexandre Quessy -- alexandre(@)quessy(.)net
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SYPHON_OUTPUT_H_
#define SYPHON_OUTPUT_H_
#include <QtGlobal>
// Syphon is a macOS-only inter-application video-sharing framework.
#ifdef HAVE_SYPHON
#include <QString>
namespace mmp {
// Objective-C++ implementation (SyphonOpenGLServer wrapper), defined in
// SyphonServerImpl.mm. Kept opaque so this header stays pure C++.
class SyphonServerImpl;
/**
* Publishes MapMap's rendered output composition as a Syphon server, so other
* macOS applications can receive it (a "virtual projector"). Opt-in: nothing is
* published until setEnabled(true).
*
* publishCurrentFramebuffer() must be called from the output canvas's GL
* context while it is current (e.g. inside QPainter::beginNativePainting()),
* right after the clean composition has been rendered.
*/
class SyphonOutput
{
public:
SyphonOutput();
~SyphonOutput();
void setEnabled(bool on);
bool isEnabled() const { return _enabled; }
/// Human-readable server name shown to Syphon clients (default "MapMap").
void setServerName(const QString& name);
QString serverName() const { return _serverName; }
/**
* Publishes the contents of the currently-bound framebuffer (queried from GL,
* along with the viewport size). Must be called from the output canvas's GL
* context while current — inside QPainter::beginNativePainting() — right after
* the composition is rendered. No-op unless enabled. Safe to call every frame.
*/
void publishCurrentFramebuffer();
private:
bool _enabled;
QString _serverName;
SyphonServerImpl* _impl;
};
}
#endif // HAVE_SYPHON
#endif /* SYPHON_OUTPUT_H_ */