static GtkWidget *create_speaker_page(){
	GtkWidget *vbox=gtk_table_new(3,2,FALSE);
	LinphoneCore *lc=linphone_gtk_get_core();

	GtkWidget *labelSpeakerChoice=gtk_label_new(_("Playback device"));
	GtkWidget *labelSpeakerLevel=gtk_label_new(_("Play three beeps"));
	GtkWidget *spk_button=gtk_button_new_from_stock(GTK_STOCK_MEDIA_PLAY);
	GtkWidget *playback_device=gtk_combo_box_new();
	GtkWidget *mixer_button=gtk_button_new_with_label("System sound preferences");
	GtkWidget *image;

	image=gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,GTK_ICON_SIZE_MENU);
	gtk_button_set_image(GTK_BUTTON(mixer_button),image);

	gtk_table_attach_defaults(GTK_TABLE(vbox), labelSpeakerChoice, 0, 1, 0, 1);
	gtk_table_attach(GTK_TABLE(vbox), playback_device, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0,0);
	gtk_table_attach_defaults(GTK_TABLE(vbox), labelSpeakerLevel, 0, 1, 1, 2);
	gtk_table_attach(GTK_TABLE(vbox), spk_button, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0,0);
	gtk_table_attach(GTK_TABLE(vbox), mixer_button, 0, 2, 2, 3, GTK_SHRINK, GTK_SHRINK, 0,0);

	gtk_table_set_row_spacings(GTK_TABLE(vbox),10);

	const char **sound_devices=linphone_core_get_sound_devices(lc);
	linphone_gtk_fill_combo_box(playback_device, sound_devices,
					linphone_core_get_playback_device(lc),CAP_PLAYBACK);
	gtk_widget_show_all(vbox);

	set_widget_to_assistant("speaker_page",vbox);
	g_signal_connect(G_OBJECT(playback_device),"changed",(GCallback)playback_device_changed,playback_device);
	g_signal_connect(G_OBJECT(spk_button),"clicked",(GCallback)linphone_gtk_start_sound,vbox);
	g_signal_connect(G_OBJECT(mixer_button),"clicked",(GCallback)open_mixer,vbox);

	return vbox;
}
예제 #2
0
int main(int argc, char *argv[]){
        LinphoneCoreVTable vtable={0};
        LinphoneCore *lc;
        LinphoneCall *call=NULL;

        signal(SIGINT,stop);

        printf("Version: %s\n",linphone_core_get_version());

#ifdef DEBUG
        linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
        /* 
         Fill the LinphoneCoreVTable with application callbacks.
         All are optional. Here we only use the call_state_changed callbacksestablished
         in order to get notifications about the progress of the call.
         */
        vtable.call_state_changed=call_state_changed;
        //vtable.text_received=text_received;

        /*
         Instanciate a LinphoneCore object given the LinphoneCoreVTable
        */
        //linphone_core_disable_logs();
        lc=linphone_core_new(&vtable,NULL,NULL,NULL);
        linphone_core_set_sip_port(lc, 9999);
	
	const char** devs = linphone_core_get_sound_devices(lc);
		
	printf("DEVICE: %s\n",devs[0]);
	printf("DEVICE: %s\n",devs[1]);

        //linphone_core_set_playback_device(lc,devs[1]);
        //linphone_core_set_capture_device(lc,devs[1]);

        linphone_core_iterate(lc);

        //LinphoneChatRoom* chat_room = linphone_core_create_chat_room(lc,"sip:[email protected]:9998");
        //linphone_chat_room_send_message(chat_room,"Welcome in room!\n");

        /* main loop for receiving notifications and doing background linphonecore work: */
        while(running){
                linphone_core_iterate(lc);
                ms_usleep(50000);
        }
        if (call && linphone_call_get_state(call)!=LinphoneCallEnd){
                /* terminate the call */
                printf("Terminating the call...\n");
                linphone_core_terminate_call(lc,call);
                /*at this stage we don't need the call object */
                linphone_call_unref(call);
        }

end:
        printf("Shutting down...\n");
        linphone_core_destroy(lc);
        printf("Exited\n");
        return 0;
}
static GtkWidget *create_mic_page(){
	GtkWidget *vbox=gtk_table_new(3,2,FALSE);
	LinphoneCore *lc=linphone_gtk_get_core();

	GtkWidget *labelMicChoice=gtk_label_new(_("Capture device"));
	GtkWidget *labelMicLevel=gtk_label_new(_("Recorded volume"));
	GtkWidget *mic_audiolevel=gtk_progress_bar_new();
	GtkWidget *capture_device=gtk_combo_box_new();
	GtkWidget *box = gtk_vbox_new(FALSE,0);
	GtkWidget *label_audiolevel=gtk_label_new(_("No voice"));
	GtkWidget *mixer_button=gtk_button_new_with_label("System sound preferences");
	GtkWidget *image;

	image=gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,GTK_ICON_SIZE_MENU);
	gtk_button_set_image(GTK_BUTTON(mixer_button),image);

	gtk_box_pack_start(GTK_BOX(box),mic_audiolevel,TRUE,TRUE,1);
	gtk_box_pack_start(GTK_BOX(box),label_audiolevel,FALSE,FALSE,1);

	gtk_table_attach_defaults(GTK_TABLE(vbox), labelMicChoice, 0, 1, 0, 1);
	gtk_table_attach_defaults(GTK_TABLE(vbox), capture_device, 1, 2, 0, 1);
	gtk_table_attach_defaults(GTK_TABLE(vbox), labelMicLevel, 0, 1, 1, 2);
	gtk_table_attach_defaults(GTK_TABLE(vbox), box, 1, 2, 1, 2);
	gtk_table_attach(GTK_TABLE(vbox),  mixer_button, 0, 2, 2, 3, GTK_SHRINK, GTK_SHRINK, 0,0);

	gtk_table_set_row_spacings(GTK_TABLE(vbox),10);

	set_widget_to_assistant("mic_audiolevel",mic_audiolevel);
	set_widget_to_assistant("label_audiolevel",label_audiolevel);
	
	const char **sound_devices=linphone_core_get_sound_devices(lc);
	linphone_gtk_fill_combo_box(capture_device, sound_devices,
					linphone_core_get_capture_device(lc), CAP_CAPTURE);
	gtk_widget_show_all(vbox);

	g_signal_connect(G_OBJECT(capture_device),"changed",(GCallback)capture_device_changed,capture_device);
	g_signal_connect(G_OBJECT(mixer_button),"clicked",(GCallback)open_mixer,vbox);

	return vbox;
}
예제 #4
0
int main(int argc, char* argv[])
{
    LinphoneCoreVTable vtable = {0};
    LinphoneCore* p_linphone = NULL;
    const char** devices = NULL;
    unsigned int i = 0;

    if (argc > 1 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
        printf("This program lists the soundcards piphoned does understand. It accepts no options.");
        return 0;
    }

    p_linphone = linphone_core_new(&vtable, NULL, NULL, NULL);
    devices = linphone_core_get_sound_devices(p_linphone);

    printf("--- List of detected devices ---\n");
    for(i=0; devices[i] != NULL; i++) {
        printf("Device %i: %s\n", i, devices[i]);
    }
    printf("--- End of list of detected devices ---\n");

    linphone_core_destroy(p_linphone);
    return 0;
}