Esempio n. 1
0
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
	gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call));	

	if (error_msg==NULL)
		gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
	else{
		char *msg=g_markup_printf_escaped("<span color=\"red\"><b>%s</b></span>",error_msg);
		gtk_label_set_markup(GTK_LABEL(status),msg);
		g_free(msg);
	}
	linphone_gtk_in_call_set_animation_image(callview,
	           linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"),FALSE);
	
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_widget_hide(linphone_gtk_get_widget(callview,"incall_audioview"));
	linphone_gtk_enable_mute_button(
		GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
	linphone_gtk_enable_hold_button(call,FALSE,TRUE);
	
	if (taskid!=0) g_source_remove(taskid);
	g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
	if (in_conf)
		linphone_gtk_terminate_conference_participant(call);
}
Esempio n. 2
0
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
	GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
	gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call));
	
	display_peer_name_in_label(callee,linphone_call_get_remote_address (call));

	gtk_widget_set_visible(linphone_gtk_get_widget(callview,"mute_pause_buttons"),!in_conf);
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("<b>In call</b>"));

	gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
	linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_MEDIA_PLAY,TRUE);
	linphone_gtk_enable_mute_button(
					GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),!in_conf);
	if (taskid==0){
		taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
		g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
	}
	linphone_gtk_in_call_view_enable_audio_view(call, !in_conf);
	linphone_gtk_in_call_view_show_encryption(call);
	if (in_conf) linphone_gtk_set_in_conference(call);
}
Esempio n. 3
0
void linphone_gtk_create_in_call_view(LinphoneCall *call){
	GtkWidget *call_view=linphone_gtk_create_widget("main","in_call_frame");
	GtkWidget *main_window=linphone_gtk_get_main_window ();
	GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
	static int call_index=1;
	int idx;

	if (ms_list_size(linphone_core_get_calls(linphone_gtk_get_core()))==1){
		/*this is the only call at this time */
		call_index=1;
	}
	g_object_set_data(G_OBJECT(call_view),"call",call);
	g_object_set_data(G_OBJECT(call_view),"call_index",GINT_TO_POINTER(call_index));

	linphone_call_set_user_pointer (call,call_view);
	linphone_call_ref(call);
	gtk_notebook_append_page (notebook,call_view,make_tab_header(call_index));
	gtk_widget_show(call_view);
	idx = gtk_notebook_page_num(notebook, call_view);
	gtk_notebook_set_current_page(notebook, idx);
	call_index++;
	linphone_gtk_enable_hold_button (call,FALSE,TRUE);
	linphone_gtk_enable_mute_button(
					GTK_BUTTON(linphone_gtk_get_widget(call_view,"incall_mute")),FALSE);
}
Esempio n. 4
0
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));

	if (error_msg==NULL)
		gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
	else{
		char *msg=g_markup_printf_escaped("<span color=\"red\"><b>%s</b></span>",error_msg);
		gtk_label_set_markup(GTK_LABEL(status),msg);
		g_free(msg);
	}
	if (pbuf!=NULL){
		gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
		g_object_unref(G_OBJECT(pbuf));
	}
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	linphone_gtk_enable_mute_button(
		GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
	linphone_gtk_enable_hold_button(call,FALSE,TRUE);
	if (taskid!=0) g_source_remove(taskid);
	g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
}
Esempio n. 5
0
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
	GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
	
	display_peer_name_in_label(callee,linphone_call_get_remote_address (call));

	gtk_widget_show(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_label_set_markup(GTK_LABEL(status),_("<b>In call</b>"));

	gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
	if (pbuf!=NULL){
		gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
		g_object_unref(G_OBJECT(pbuf));
	}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
	linphone_gtk_enable_mute_button(
					GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
	if (taskid==0){
		taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
		g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
	}
}
Esempio n. 6
0
static void init_local_participant(GtkWidget *participant){
	GtkWidget *sound_meter;
	GtkWidget *button=linphone_gtk_get_widget(participant,"conference_control");
	gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(participant,"callee_name_label")),_("Me"));
	sound_meter=linphone_gtk_get_widget(participant,"sound_indicator");
	linphone_gtk_enable_mute_button(GTK_BUTTON(button),TRUE);
	g_signal_connect(G_OBJECT(button),"clicked",(GCallback)linphone_gtk_mute_clicked,NULL);
	gtk_widget_show(button);
	linphone_gtk_init_audio_meter(sound_meter, (get_volume_t) linphone_core_get_conference_local_input_volume, linphone_gtk_get_core());
}
Esempio n. 7
0
void linphone_gtk_create_in_call_view(LinphoneCall *call){
	GtkWidget *call_view=linphone_gtk_create_widget("main","in_call_frame");
	GtkWidget *main_window=linphone_gtk_get_main_window ();
	GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
	static int call_index=1;
	int idx;
	GtkWidget *transfer;
	GtkWidget *conf;
	GtkWidget *button;
	GtkWidget *image;


	if (ms_list_size(linphone_core_get_calls(linphone_gtk_get_core()))==1){
		/*this is the only call at this time */
		call_index=1;
	}
	g_object_set_data(G_OBJECT(call_view),"call",call);
	g_object_set_data(G_OBJECT(call_view),"call_index",GINT_TO_POINTER(call_index));

	linphone_call_set_user_pointer (call,call_view);
	linphone_call_ref(call);
	gtk_notebook_append_page (notebook,call_view,make_tab_header(call_index));
	gtk_widget_show(call_view);
	idx = gtk_notebook_page_num(notebook, call_view);
	gtk_notebook_set_current_page(notebook, idx);
	call_index++;
	linphone_gtk_enable_hold_button (call,FALSE,TRUE);
	linphone_gtk_enable_video_button (call,FALSE,TRUE);
	linphone_gtk_enable_mute_button(
					GTK_BUTTON(linphone_gtk_get_widget(call_view,"incall_mute")),FALSE);

	transfer = linphone_gtk_get_widget(call_view,"transfer_button");
	gtk_button_set_image(GTK_BUTTON(transfer),gtk_image_new_from_stock
							 (GTK_STOCK_GO_FORWARD,GTK_ICON_SIZE_BUTTON));
	g_signal_connect(G_OBJECT(transfer),"clicked",(GCallback)transfer_button_clicked,call);
	gtk_widget_hide(transfer);

	conf = linphone_gtk_get_widget(call_view,"conference_button");
	gtk_button_set_image(GTK_BUTTON(conf),gtk_image_new_from_stock (GTK_STOCK_ADD,GTK_ICON_SIZE_BUTTON));
	g_signal_connect(G_OBJECT(conf),"clicked",(GCallback)conference_button_clicked,call);
	gtk_widget_hide(conf);

	button=linphone_gtk_get_widget(call_view,"terminate_call");
	image=create_pixmap (linphone_gtk_get_ui_config("stop_call_icon","stopcall-small.png"));
	gtk_button_set_label(GTK_BUTTON(button),_("Hang up"));
	gtk_button_set_image(GTK_BUTTON(button),image);
	gtk_widget_show(image);
	g_signal_connect_swapped(G_OBJECT(linphone_gtk_get_widget(call_view,"quality_indicator")),"button-press-event",(GCallback)linphone_gtk_show_call_stats,call);
}
Esempio n. 8
0
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call) {
    GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
    GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
    GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
    GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
    guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
    gboolean in_conf=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
    GtkWidget *call_stats=(GtkWidget*)g_object_get_data(G_OBJECT(callview),"call_stats");

    linphone_gtk_in_call_show_video(call);

    display_peer_name_in_label(callee,linphone_call_get_remote_address (call));

    gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
    gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("<b>In call</b>"));

    gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"conference_button"),!in_conf);
    gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"transfer_button"),!in_conf);

    gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
    linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_MEDIA_PLAY,TRUE);
    linphone_gtk_call_update_tab_header(call,FALSE);
    linphone_gtk_enable_mute_button(
        GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);

    if (taskid==0) {
        taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
        g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
    }
    linphone_gtk_in_call_view_enable_audio_view(call, !in_conf);
    linphone_gtk_in_call_view_show_encryption(call);
    if (in_conf) {
        linphone_gtk_set_in_conference(call);
        gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"incall_mute"),FALSE);
        gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"hold_call"),FALSE);
    } else {
        linphone_gtk_unset_from_conference(call); /*in case it was previously*/
        gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"incall_mute"),TRUE);
        gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"hold_call"),TRUE);
    }
    gtk_widget_show_all(linphone_gtk_get_widget(callview,"buttons_panel"));
    if (!in_conf) gtk_widget_show_all(linphone_gtk_get_widget(callview,"record_hbox"));
    else gtk_widget_hide(linphone_gtk_get_widget(callview,"record_hbox"));
    if (call_stats) show_used_codecs(call_stats,call);
}