Commit 3a02574f authored by Simon Morlat's avatar Simon Morlat

multicall support in gtk interface

parent f2c5aab9
......@@ -221,6 +221,9 @@ static void call_accepted(SalOp *op){
}
linphone_call_set_state(call,LinphoneCallPaused,"Call paused");
}else{
if (lc->vtable.display_status){
lc->vtable.display_status(lc,_("Call answered - connected."));
}
linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
}
linphone_connect_incoming (lc,call);
......
......@@ -229,17 +229,23 @@ static void linphone_call_set_terminated(LinphoneCall *call){
void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message){
LinphoneCore *lc=call->core;
bool_t finalize_call=FALSE;
if (call->state!=cstate){
if (cstate!=LinphoneCallRefered){
/*LinphoneCallRefered is rather an event, not a state.
Indeed it does not change the state of the call (still paused or running)*/
call->state=cstate;
}
if (cstate==LinphoneCallEnd || cstate==LinphoneCallError){
finalize_call=TRUE;
linphone_call_ref(call);
linphone_call_set_terminated (call);
}
if (lc->vtable.call_state_changed)
lc->vtable.call_state_changed(lc,call,cstate,message);
if (finalize_call)
linphone_call_unref(call);
}
if (call->state==LinphoneCallEnd || call->state==LinphoneCallError)
linphone_call_set_terminated (call);
}
static void linphone_call_destroy(LinphoneCall *obj)
......@@ -369,6 +375,14 @@ bool_t linphone_call_has_transfer_pending(const LinphoneCall *call){
return call->refer_pending;
}
/**
* Returns call's duration in seconds.
**/
int linphone_call_get_duration(const LinphoneCall *call){
if (call->media_start_time==0) return 0;
return time(NULL)-call->media_start_time;
}
/**
* @}
**/
......
......@@ -300,15 +300,10 @@ bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call){
return FALSE;
}
int linphone_core_get_call_duration(LinphoneCall *call){
if (call==NULL) return 0;
if (call->media_start_time==0) return 0;
return time(NULL)-call->media_start_time;
}
int linphone_core_get_current_call_duration(const LinphoneCore *lc){
LinphoneCall *call=linphone_core_get_current_call((LinphoneCore *)lc);
return linphone_core_get_call_duration(call);
if (call) return linphone_call_get_duration(call);
return -1;
}
const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _LinphoneCore *lc){
......
......@@ -174,6 +174,7 @@ void linphone_call_unref(LinphoneCall *call);
LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
const char *linphone_call_get_refer_to(const LinphoneCall *call);
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
int linphone_call_get_duration(const LinphoneCall *call);
void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
......
......@@ -2,7 +2,6 @@ UI_FILES= about.ui \
main.ui \
password.ui \
contact.ui \
incoming_call.ui \
parameters.ui \
sip_account.ui \
chatroom.ui \
......
This diff is collapsed.
......@@ -48,6 +48,8 @@ GdkPixbuf *_gdk_pixbuf_new_from_memory_at_scale(const void *data, gint len, gint
GtkWidget *linphone_gtk_create_window(const char *window_name);
GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name);
GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name);
LinphoneCore *linphone_gtk_get_core(void);
GtkWidget *linphone_gtk_get_main_window();
void linphone_gtk_display_something(GtkMessageType type,const gchar *message);
......@@ -85,12 +87,13 @@ void linphone_gtk_show_directory_search(void);
/*functions controlling the different views*/
gboolean linphone_gtk_use_in_call_view();
void linphone_gtk_show_in_call_view(void);
void linphone_gtk_show_idle_view(void);
void linphone_gtk_in_call_view_set_calling(const char *uri);
void linphone_gtk_in_call_view_set_in_call(void);
void linphone_gtk_in_call_view_update_duration(int duration);
void linphone_gtk_in_call_view_terminate(const char *error_msg);
LinphoneCall *linphone_gtk_get_currently_displayed_call();
void linphone_gtk_create_in_call_view(LinphoneCall *call);
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call);
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call);
void linphone_gtk_in_call_view_update_duration(LinphoneCall *call);
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg);
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call);
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive);
void linphone_gtk_enable_hold_button(GtkToggleButton *button, gboolean sensitive);
......
......@@ -213,14 +213,6 @@ static void linphone_gtk_log_file(OrtpLogLevel lev, const char *msg)
}
}
static gboolean delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_widget_hide (widget);
return TRUE;
}
void linphone_gtk_log_hide(){
if (log_window)
gtk_widget_hide(log_window);
......@@ -234,7 +226,7 @@ void linphone_gtk_create_log_window(void){
gtk_text_buffer_create_tag(b,"orange","foreground","orange",NULL);
/*prevent the log window from being destroyed*/
g_signal_connect (G_OBJECT (log_window), "delete-event",
G_CALLBACK (delete_event_cb), NULL);
G_CALLBACK (gtk_widget_hide_on_delete), log_window);
}
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment