-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathGlobals.h
More file actions
executable file
·137 lines (107 loc) · 4.93 KB
/
Globals.h
File metadata and controls
executable file
·137 lines (107 loc) · 4.93 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
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
//
// This is the source code of Telegram for Windows Phone v. 3.x.x.
// It is licensed under GNU GPL v. 2 or later.
// You should have received a copy of the license in this archive (see LICENSE).
//
// Copyright Evgeny Nadymov, 2013-present.
//
#pragma once
#include <roapi.h>
#include "IVideoRenderer.h"
#include "IMTProtoUpdater.h"
namespace PhoneVoIPApp
{
namespace BackEnd
{
// Forward declarations
ref class CallController;
//ref class BackEndAudio;
ref class BackEndTransport;
ref class BackEndCapture;
// A singleton container that is used to hold other global singletons and background process-wide static state.
// Another purpose of this class is to start the out-of-process WinRT server, so that the UI process
// managed code can instantiate WinRT objects in this process.
public ref class Globals sealed
{
public:
// Start the out-of-process WinRT server, so that the UI process can instantiate WinRT objects in this process.
void StartServer(const Platform::Array<Platform::String^>^ outOfProcServerClassNames);
// Do some app-specific periodic tasks, to let the remote server know that this endpoint is still alive.
void DoPeriodicKeepAlive();
// Get the process id of the current process
static unsigned int GetCurrentProcessId();
// Get the name of the event that indicates if the UI is connected to the background process or not
static Platform::String^ GetUiDisconnectedEventName(unsigned int backgroundProcessId);
// Get the name of the event that indicates if the background process is ready or not
static Platform::String^ GetBackgroundProcessReadyEventName(unsigned int backgroundProcessId);
// Get the single instance of this class
static property Globals^ Instance
{
Globals^ get();
}
// Get the call controller singleton object
property PhoneVoIPApp::BackEnd::CallController^ CallController
{
PhoneVoIPApp::BackEnd::CallController^ get();
}
// The singleton video renderer object.
property IVideoRenderer^ VideoRenderer
{
IVideoRenderer^ get();
void set(IVideoRenderer^ value);
}
property IMTProtoUpdater^ MTProtoUpdater
{
IMTProtoUpdater^ get();
void set(IMTProtoUpdater^ value);
}
// The singleton audio controller object.
/*property BackEndAudio^ AudioController
{
BackEndAudio^ get();
}*/
// The singleton audio controller object.
property BackEndCapture^ CaptureController
{
BackEndCapture^ get();
}
// The singleton transport object.
property BackEndTransport^ TransportController
{
BackEndTransport^ get();
}
private:
// Default constructor
Globals();
// Destructor
~Globals();
// Name of the event that indicates if another instance of the VoIP background process exists or not
static const LPCWSTR noOtherBackgroundProcessEventName;
// Name of the event that indicates if the UI is connected to the background process or not
static const LPCWSTR uiDisconnectedEventName;
// Name of the event that indicates if the background process is ready or not
static const LPCWSTR backgroundProcessReadyEventName;
// The single instance of this class
static Globals^ singleton;
// Indicates if the out-of-process server has started or not
bool started;
// A cookie that is used to unregister remotely activatable objects in this process
RO_REGISTRATION_COOKIE serverRegistrationCookie;
// An event that indicates if another instance of the background process exists or not
HANDLE noOtherBackgroundProcessEvent;
// An event that indicates that the background process is ready
HANDLE backgroundReadyEvent;
// The call controller object
PhoneVoIPApp::BackEnd::CallController^ callController;
// The video renderer object
PhoneVoIPApp::BackEnd::IVideoRenderer^ videoRenderer;
PhoneVoIPApp::BackEnd::IMTProtoUpdater^ mtProtoUpdater;
// The audio capture/render controller
//BackEndAudio^ audioController;
// The audio capture/render controller
BackEndCapture^ captureController;
// The data transport
BackEndTransport^ transportController;
};
}
}