2
/* Ekiga -- A VoIP and Video-Conferencing application
3
* Copyright (C) 2000-2007 Damien Sandras
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20
* Ekiga is licensed under the GPL license and as a special exception,
21
* you have permission to link or otherwise combine this program with the
22
* programs OPAL, OpenH323 and PWLIB, and distribute the combination,
23
* without applying the requirements of the GNU GPL to the OPAL, OpenH323
24
* and PWLIB programs, as long as you do follow the requirements of the
25
* GNU GPL for all the rest of the software thus combined.
30
* engine.cpp - description
31
* ------------------------------------------
32
* begin : written in 2007 by Damien Sandras
33
* copyright : (c) 2007 by Damien Sandras
34
* description : Vroom.
44
#include "presence-core.h"
45
#include "account-core.h"
46
#include "contact-core.h"
47
#include "call-core.h"
48
#include "chat-core.h"
49
#include "videooutput-core.h"
50
#include "videoinput-core.h"
51
#include "audioinput-core.h"
52
#include "audiooutput-core.h"
54
#include "history-main.h"
55
#include "local-roster-main.h"
56
#include "local-roster-bridge.h"
57
#include "gtk-core-main.h"
58
#include "gtk-frontend.h"
59
#include "gmconf-personal-details-main.h"
62
#include "videooutput-main-x.h"
66
#include "videooutput-main-dx.h"
69
#include "videoinput-main-mlogo.h"
70
#include "audioinput-main-null.h"
71
#include "audiooutput-main-null.h"
73
#include "videoinput-main-ptlib.h"
74
#include "audioinput-main-ptlib.h"
75
#include "audiooutput-main-ptlib.h"
78
#include "hal-main-dbus.h"
81
#include "opal-main.h"
84
#include "avahi-main.h"
85
#include "avahi-publisher-main.h"
89
#include "evolution-main.h"
93
#include "ldap-main.h"
98
engine_init (int argc,
100
Ekiga::Runtime *runtime,
101
Ekiga::ServiceCore * &core)
103
core = new Ekiga::ServiceCore;
105
/* VideoInputCore depends on VideoOutputCore and must this *
106
* be constructed thereafter */
108
Ekiga::AccountCore *account_core = new Ekiga::AccountCore;
109
Ekiga::PresenceCore *presence_core = NULL;
110
Ekiga::ContactCore *contact_core = new Ekiga::ContactCore;
111
Ekiga::CallCore *call_core = new Ekiga::CallCore;
112
Ekiga::ChatCore *chat_core = new Ekiga::ChatCore;
113
Ekiga::VideoOutputCore *videooutput_core = new Ekiga::VideoOutputCore;
114
Ekiga::VideoInputCore *videoinput_core = new Ekiga::VideoInputCore(*runtime, *videooutput_core);
115
Ekiga::AudioOutputCore *audiooutput_core = new Ekiga::AudioOutputCore(*runtime);
116
Ekiga::AudioInputCore *audioinput_core = new Ekiga::AudioInputCore(*runtime, *audiooutput_core);
117
Ekiga::HalCore *hal_core = new Ekiga::HalCore;
120
/* The last item in the following list will be destroyed first. *
121
* - VideoInputCore must be destroyed before VideoOutputCore since its *
122
* PreviewManager may call functions of VideoOutputCore. *
123
* - The runtime should be destroyed last since other core *
124
* components may still call runtime functions until destroyed *
125
* (e.g. VideoOutputCore). */
127
core->add (*runtime);
128
core->add (*account_core);
129
core->add (*contact_core);
130
core->add (*chat_core);
131
core->add (*videooutput_core);
132
core->add (*videoinput_core);
133
core->add (*audiooutput_core);
134
core->add (*audioinput_core);
135
core->add (*hal_core);
136
core->add (*call_core);
138
if (!gmconf_personal_details_init (*core, &argc, &argv)) {
143
presence_core = new Ekiga::PresenceCore (*core);
144
core->add (*presence_core);
147
if (!videooutput_x_init (*core, &argc, &argv)) {
154
if (!videooutput_dx_init (*core, &argc, &argv)) {
160
if (!videoinput_mlogo_init (*core, &argc, &argv)) {
165
if (!audioinput_null_init (*core, &argc, &argv)) {
170
if (!audiooutput_null_init (*core, &argc, &argv)) {
175
if (!videoinput_ptlib_init (*core, &argc, &argv)) {
180
if (!audioinput_ptlib_init (*core, &argc, &argv)) {
185
if (!audiooutput_ptlib_init (*core, &argc, &argv)) {
191
if (!hal_dbus_init (*core, &argc, &argv)) {
197
if (!opal_init (*core, &argc, &argv)) {
203
if (!avahi_init (*core, &argc, &argv)) {
208
if (!avahi_publisher_init (*core, &argc, &argv)) {
215
if (!evolution_init (*core, &argc, &argv)) {
222
if (!ldap_init (*core, &argc, &argv)) {
228
if (!history_init (*core, &argc, &argv)) {
234
if (!gtk_core_init (*core, &argc, &argv)) {
239
if (!gtk_frontend_init (*core, &argc, &argv)) {
244
if (!local_roster_init (*core, &argc, &argv)) {
249
if (!local_roster_bridge_init (*core, &argc, &argv)) {
254
videooutput_core->setup_conf_bridge();
255
videoinput_core->setup_conf_bridge();
256
audiooutput_core->setup_conf_bridge();
257
audioinput_core->setup_conf_bridge();
259
sigc::connection conn;
260
conn = hal_core->videoinput_device_added.connect (sigc::mem_fun (videoinput_core, &Ekiga::VideoInputCore::add_device));
261
conn = hal_core->videoinput_device_removed.connect (sigc::mem_fun (videoinput_core, &Ekiga::VideoInputCore::remove_device));
262
conn = hal_core->audiooutput_device_added.connect (sigc::mem_fun (audiooutput_core, &Ekiga::AudioOutputCore::add_device));
263
conn = hal_core->audiooutput_device_removed.connect (sigc::mem_fun (audiooutput_core, &Ekiga::AudioOutputCore::remove_device));
264
conn = hal_core->audioinput_device_added.connect (sigc::mem_fun (audioinput_core, &Ekiga::AudioInputCore::add_device));
265
conn = hal_core->audioinput_device_removed.connect (sigc::mem_fun (audioinput_core, &Ekiga::AudioInputCore::remove_device));
266
// std::vector<sigc::connection> connections;
267
//connections.push_back (conn);