100
GnomeMeeting::Connect (PString url)
102
/* If incoming connection, then answer it */
103
if (endpoint->GetCallingState () == GMManager::Called) {
105
gm_history_window_insert (history_window, _("Answering incoming call"));
107
url_handler = new GMURLHandler ("", FALSE);
109
else if (endpoint->GetCallingState () == GMManager::Standby
110
&& !GMURL (url).IsEmpty ()) {
113
gm_main_window_set_call_url (main_window, url);
115
/* if we call somebody, and if the URL is not empty */
116
url_handler = new GMURLHandler (url);
122
GnomeMeeting::Disconnect (H323Connection::CallEndReason reason)
126
call_token = endpoint->GetCurrentCallToken ();
128
/* if we are trying to call somebody */
129
if (endpoint->GetCallingState () == GMManager::Calling) {
131
endpoint->ClearCall (call_token, reason);
135
/* if we are in call with somebody */
136
if (endpoint->GetCallingState () == GMManager::Connected) {
138
endpoint->ClearAllCalls (OpalConnection::EndedByLocalUser, FALSE);
140
else if (endpoint->GetCallingState () == GMManager::Called) {
142
endpoint->ClearCall (call_token,
143
OpalConnection::EndedByAnswerDenied);
146
endpoint->ClearCall (call_token,
147
OpalConnection::EndedByAnswerDenied);
154
GnomeMeeting::Init ()
156
/* Init the endpoint */
162
88
GnomeMeeting::Exit ()
90
PWaitAndSignal m(ep_var_mutex);
166
if (addressbook_window)
167
gtk_widget_destroy (addressbook_window);
168
addressbook_window = NULL;
171
93
gtk_widget_destroy (prefs_window);
172
94
prefs_window = NULL;
175
gtk_widget_destroy (pc2phone_window);
176
pc2phone_window = NULL;
179
gtk_widget_destroy (history_window);
180
history_window = NULL;
183
97
gtk_widget_destroy (main_window);
184
98
main_window = NULL;
187
gtk_widget_destroy (druid_window);
100
if (assistant_window)
101
gtk_widget_destroy (assistant_window);
102
assistant_window = NULL;
190
104
if (accounts_window)
191
105
gtk_widget_destroy (accounts_window);
192
106
accounts_window = NULL;
195
gtk_widget_destroy (chat_window);
199
gtk_widget_destroy (statusicon);
109
g_object_unref (statusicon);
200
110
statusicon = NULL;
203
113
if (dbus_component)
204
114
g_object_unref (dbus_component);
205
115
dbus_component = NULL;
211
125
GnomeMeeting::DetectInterfaces ()
213
128
PString config_interface;
214
129
PString iface_noip;
222
137
gchar *conf_interface = NULL;
224
139
PWaitAndSignal m(iface_access_mutex);
226
141
/* Detect the valid interfaces */
227
142
res = PIPSocket::GetInterfaceTable (ifaces);
228
143
interfaces.RemoveAll ();
230
145
conf_interface = gm_conf_get_string (PROTOCOLS_KEY "interface");
231
146
config_interface = conf_interface;
232
147
g_free (conf_interface);
234
149
pos = config_interface.Find("[");
235
150
if (pos != P_MAX_INDEX)
236
151
iface_noip = config_interface.Left (pos).Trim ();
237
152
while (i < ifaces.GetSize ()) {
239
154
ip = " [" + ifaces [i].GetAddress ().AsString () + "]";
241
156
if (ifaces [i].GetName () + ip == config_interface || ifaces [i].GetName () == iface_noip)
274
189
interfaces += interfaces [0];
275
190
interfaces [0] = ifaces [pos].GetName () + ip;
282
/* Update the GUI, if it is already there */
284
gm_prefs_window_update_interfaces_list (prefs_window,
292
GnomeMeeting::DetectDevices ()
294
gchar *audio_plugin = NULL;
295
gchar *video_plugin = NULL;
299
audio_plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
300
video_plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin");
302
PWaitAndSignal m(dev_access_mutex);
305
/* Detect the devices */
306
gnomemeeting_sound_daemons_suspend ();
309
/* Detect the plugins */
310
audio_managers = PSoundChannel::GetDriverNames ();
311
video_managers = PVideoInputDevice::GetDriverNames ();
313
fake_idx = video_managers.GetValuesIndex (PString ("FakeVideo"));
314
if (fake_idx != P_MAX_INDEX)
315
video_managers.RemoveAt (fake_idx);
317
PTRACE (1, "Detected audio plugins: " << setfill (',') << audio_managers
319
PTRACE (1, "Detected video plugins: " << setfill (',') << video_managers
323
audio_managers += PString ("Quicknet");
326
PTRACE (1, "Detected audio plugins: " << setfill (',') << audio_managers
328
PTRACE (1, "Detected video plugins: " << setfill (',') << video_managers
332
fake_idx = video_managers.GetValuesIndex (PString ("Picture"));
333
if (fake_idx == P_MAX_INDEX)
336
/* No audio plugin => Exit */
337
if (audio_managers.GetSize () == 0)
341
/* Detect the devices */
342
video_input_devices = PVideoInputDevice::GetDriversDeviceNames (video_plugin);
344
audio_input_devices =
345
PSoundChannel::GetDeviceNames (audio_plugin, PSoundChannel::Recorder);
346
audio_output_devices =
347
PSoundChannel::GetDeviceNames (audio_plugin, PSoundChannel::Player);
350
if (audio_input_devices.GetSize () == 0)
351
audio_input_devices += PString (_("No device found"));
352
if (audio_output_devices.GetSize () == 0)
353
audio_output_devices += PString (_("No device found"));
354
if (video_input_devices.GetSize () == 0)
355
video_input_devices += PString (_("No device found"));
358
PTRACE (1, "Detected the following audio input devices: "
359
<< setfill (',') << audio_input_devices << setfill (' ')
360
<< " with plugin " << audio_plugin);
361
PTRACE (1, "Detected the following audio output devices: "
362
<< setfill (',') << audio_output_devices << setfill (' ')
363
<< " with plugin " << audio_plugin);
364
PTRACE (1, "Detected the following video input devices: "
365
<< setfill (',') << video_input_devices << setfill (' ')
366
<< " with plugin " << video_plugin);
368
PTRACE (1, "Detected the following audio input devices: "
369
<< setfill (',') << audio_input_devices << setfill (' ')
370
<< " with plugin " << audio_plugin);
371
PTRACE (1, "Detected the following audio output devices: "
372
<< setfill (',') << audio_output_devices << setfill (' ')
373
<< " with plugin " << audio_plugin);
374
PTRACE (1, "Detected the following video input devices: "
375
<< setfill (',') << video_input_devices << setfill (' ')
376
<< " with plugin " << video_plugin);
378
g_free (audio_plugin);
379
g_free (video_plugin);
381
gnomemeeting_sound_daemons_resume ();
383
/* Update the GUI, if it is already there */
385
gm_prefs_window_update_devices_list (prefs_window,
387
audio_output_devices,
388
video_input_devices);
394
GnomeMeeting::GetManager ()
396
GMManager *ep = NULL;
201
GnomeMeeting::GetServiceCore ()
397
203
PWaitAndSignal m(ep_var_mutex);
420
GnomeMeeting::GetPrefsWindow ()
224
GnomeMeeting::GetPrefsWindow (bool create)
226
if (!prefs_window && create)
227
prefs_window = gm_prefs_window_new (service_core);
422
228
return prefs_window;
427
GnomeMeeting::GetChatWindow ()
434
GnomeMeeting::GetDruidWindow ()
441
GnomeMeeting::GetCallsHistoryWindow ()
443
return calls_history_window;
448
GnomeMeeting::GetAddressbookWindow ()
450
return addressbook_window;
455
GnomeMeeting::GetHistoryWindow ()
457
return history_window;
462
GnomeMeeting::GetPC2PhoneWindow ()
464
return pc2phone_window;
233
GnomeMeeting::GetAssistantWindow (bool create)
235
if (!assistant_window && create)
236
assistant_window = ekiga_assistant_new (service_core);
238
return assistant_window;
494
260
void GnomeMeeting::BuildGUI ()
496
IncomingCallMode icm = AVAILABLE;
497
BOOL forward_on_busy = FALSE;
499
/* Init the address book */
500
gnomemeeting_addressbook_init (_("On This Computer"), _("Personal"));
502
262
/* Init the stock icons */
503
263
gnomemeeting_stock_icons_init ();
505
265
/* Build the GUI */
506
pc2phone_window = gm_pc2phone_window_new ();
507
prefs_window = gm_prefs_window_new ();
508
calls_history_window = gm_calls_history_window_new ();
509
history_window = gm_history_window_new ();
510
chat_window = gm_text_chat_window_new ();
511
addressbook_window = gm_addressbook_window_new ();
512
druid_window = gm_druid_window_new ();
513
accounts_window = gm_accounts_window_new ();
514
main_window = gm_main_window_new ();
516
dbus_component = gnomemeeting_dbus_component_new ();
518
statusicon = gm_statusicon_new (); /* must come last (uses the windows) */
520
/* we must put the statusicon in the right state */
521
icm = (IncomingCallMode)
522
gm_conf_get_int (CALL_OPTIONS_KEY "incoming_call_mode");
523
forward_on_busy = gm_conf_get_bool (CALL_FORWARDING_KEY "forward_on_busy");
524
gm_statusicon_update_full (statusicon,
525
GMManager::Standby, icm, forward_on_busy);
266
gtk_window_set_default_icon_name (GM_ICON_LOGO);
267
accounts_window = gm_accounts_window_new (*service_core);
269
statusicon = statusicon_new (*service_core);
270
main_window = gm_main_window_new (*service_core);
527
272
/* GM is started */
528
gm_history_window_insert (history_window,
529
_("Started Ekiga %d.%d.%d for user %s"),
530
MAJOR_VERSION, MINOR_VERSION, BUILD_NUMBER,
533
273
PTRACE (1, "Ekiga version "
534
274
<< MAJOR_VERSION << "." << MINOR_VERSION << "." << BUILD_NUMBER);
535
275
PTRACE (1, "OPAL version " << OPAL_VERSION);
536
PTRACE (1, "PWLIB version " << PWLIB_VERSION);
537
#ifndef DISABLE_GNOME
276
PTRACE (1, "PTLIB version " << PTLIB_VERSION);
538
278
PTRACE (1, "GNOME support enabled");
540
280
PTRACE (1, "GNOME support disabled");
543
PTRACE (1, "Fullscreen support enabled");
282
#if defined HAVE_XV || defined HAVE_DX
283
PTRACE (1, "Accelerated rendering support enabled");
545
PTRACE (1, "Fullscreen support disabled");
285
PTRACE (1, "Accelerated rendering support disabled");
548
288
PTRACE (1, "DBUS support enabled");
550
290
PTRACE (1, "DBUS support disabled");
555
void GnomeMeeting::RemoveManager ()
557
PWaitAndSignal m(ep_var_mutex);
293
PTRACE (1, "GConf support enabled");
295
PTRACE (1, "GConf support disabled");
298
PTRACE (1, "ESound support enabled");
300
PTRACE (1, "ESound support disabled");
570
305
GnomeMeeting::GetInterfaces ()
579
GnomeMeeting::GetVideoInputDevices ()
581
PWaitAndSignal m(dev_access_mutex);
583
return video_input_devices;
588
GnomeMeeting::GetAudioInputDevices ()
590
PWaitAndSignal m(dev_access_mutex);
592
return audio_input_devices;
598
GnomeMeeting::GetAudioOutpoutDevices ()
600
PWaitAndSignal m(dev_access_mutex);
602
return audio_output_devices;
607
GnomeMeeting::GetAudioPlugins ()
609
PWaitAndSignal m(dev_access_mutex);
611
return audio_managers;
616
GnomeMeeting::GetVideoPlugins ()
618
PWaitAndSignal m(dev_access_mutex);
620
return video_managers;
314
GnomeMeeting::InitEngine ()
316
PWaitAndSignal m(ep_var_mutex);
318
Ekiga::Runtime *runtime = new Ekiga::GlibRuntime;
319
engine_init (1, NULL, runtime, service_core);
322
std::cout << "engine couldn't init!" << std::endl;