diff --git a/.gitignore b/.gitignore index 6c16ccfeee2ba7a992f26776dcceec93e7900c60..a80993a56d6799c99f1445a3ec3e03d687ac4450 100644 --- a/.gitignore +++ b/.gitignore @@ -17,10 +17,9 @@ Makefile.in *.mo # Ignore rendered docs -doc/doxygen/html-everything -doc/doxygen/html-sflphoned +doc/doxygen/core-doc +doc/doxygen/gtk-gui-doc doc/*.html -sflphone-gtk/doc/html/* # Ignore buildsys stuff /autom4te.cache diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 343942f4f75ca432d9c4d9b7ae3642c4bac3490b..82ef1dd6ef2b56aac65bab093c91fb3eede88e45 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -10,7 +10,6 @@ sflphone_gtk_SOURCES = \ dialpad.c \ menus.c \ calltree.c \ - screen.c \ actions.c \ configwindow.c \ accountlist.c \ @@ -23,7 +22,7 @@ sflphone_gtk_SOURCES = \ MemManager.c noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h codeclist.h\ - callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltree.h screen.h configwindow.h \ + callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltree.h configwindow.h \ accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h EXTRA_DIST = marshaller.list sflphone_gtk_LDADD = $(DEPS_LIBS) -lnotify diff --git a/sflphone-gtk/src/accountlist.c b/sflphone-gtk/src/accountlist.c index 447b10486f5aa8550075370acd695f7fb5f00659..a075d5799041cb9e60932ccf1d88aab4bef86608 100644 --- a/sflphone-gtk/src/accountlist.c +++ b/sflphone-gtk/src/accountlist.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -147,6 +147,7 @@ account_list_set_current_pos( guint n) __CURRENT_ACCOUNT_ID = account_list_get_nth(n)->accountID; } + const gchar * account_state_name(account_state_t s) { gchar * state; @@ -169,8 +170,7 @@ const gchar * account_state_name(account_state_t s) break; case ACCOUNT_STATE_ERROR_NETWORK: state = _("Network unreachable"); - break; - case ACCOUNT_STATE_ERROR_HOST: + state = _("Host unreachable"); break; default: diff --git a/sflphone-gtk/src/accountlist.h b/sflphone-gtk/src/accountlist.h index b4f13aeb926e8535262c8519d2125444754c6e34..a618a4bbf7318a51315656955558d3e24977bc63 100644 --- a/sflphone-gtk/src/accountlist.h +++ b/sflphone-gtk/src/accountlist.h @@ -31,13 +31,21 @@ */ typedef enum { + /** Invalid state */ ACCOUNT_STATE_INVALID = 0, + /** The account is registered */ ACCOUNT_STATE_REGISTERED, + /** The account is not registered */ ACCOUNT_STATE_UNREGISTERED, + /** The account is trying to register */ ACCOUNT_STATE_TRYING, + /** Error state. The account is not registered */ ACCOUNT_STATE_ERROR, + /** An authentification error occured. Wrong password or wrong username. The account is not registered */ ACCOUNT_STATE_ERROR_AUTH, + /** The network is unreachable. The account is not registered */ ACCOUNT_STATE_ERROR_NETWORK, + /** Host is unreachable. The account is not registered */ ACCOUNT_STATE_ERROR_HOST } account_state_t; @@ -57,63 +65,95 @@ typedef struct { -/** This function initialize the account list. */ +/** + * This function initialize the account list. + */ void account_list_init (); -/** This function empty and free the account list. */ +/** + * This function empty and free the account list. + */ void account_list_clean (); -/** This function append an account to list. - * @param a The account you want to add */ +/** + * This function append an account to list. + * @param a The account you want to add + */ void account_list_add (account_t * a); -/** This function remove an account from list. - * @param accountID The accountID of the account you want to remove - */ +/** + * This function remove an account from list. + * @param accountID The accountID of the account you want to remove + */ void account_list_remove (const gchar * accountID); -/** Return the first account that corresponds to the state - * @param s The state - * @return An account or NULL */ +/** + * Return the first account that corresponds to the state + * @param s The state + * @return account_t* An account or NULL + */ account_t * account_list_get_by_state ( account_state_t state); -/** Return the number of accounts in the list - * @return The number of accounts in the list */ +/** + * Return the number of accounts in the list + * @return guint The number of accounts in the list + */ guint account_list_get_size ( ); -/** Return the account at the nth position in the list - * @param n The position of the account you want - * @return An account or NULL */ +/** + * Return the account at the nth position in the list + * @param n The position of the account you want + * @return An account or NULL + */ account_t * account_list_get_nth ( guint n ); -/** Return the current account struct +/** + * Return the current account struct * @return The current account struct */ account_t * account_list_get_current( ); -/** This function sets an account as the current one +/** + * This function sets an account as the current one * @param accountID The ID of the current account */ void account_list_set_current_id(const gchar * accountID); -/** This function sets an account as the current one +/** + * This function sets an account as the current one * @param n the position of the account you want to use */ void account_list_set_current_pos( guint n ); -/** This function maps account_state_t enums to a description. - * @param s The state - * @return The full text description of the state */ +/** + * This function maps account_state_t enums to a description. + * @param s The state + * @return The full text description of the state + */ const gchar * account_state_name(account_state_t s); +/** + * This function clear the list + */ void account_list_clear ( ); -/** Return the account associated with an ID +/** + * Return the account associated with an ID * @param accountID The ID of the account - * @return An account or NULL */ + * @return An account or NULL + */ account_t * account_list_get_by_id(gchar * accountID); +/** + * Move the account from an unit up in the account_list + * @param index The current index in the list + */ void account_list_move_up( guint index ); + +/** + * Move the account from an unit down in the account_list + * @param index The current index in the list + */ void account_list_move_down( guint index ); #endif diff --git a/sflphone-gtk/src/accountwindow.c b/sflphone-gtk/src/accountwindow.c index 23b295b14b08851d813b80c1f28c2716d71600a1..728faedd1a0991aecc93149a3a59c5a4ffc53dc7 100644 --- a/sflphone-gtk/src/accountwindow.c +++ b/sflphone-gtk/src/accountwindow.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/accountwindow.h b/sflphone-gtk/src/accountwindow.h index 1b88788f5deaad5ea7f2c2db40596409d38ffe2d..d0bcb0e6724f12439f6e4ea6b34c7da5ba14a0f9 100644 --- a/sflphone-gtk/src/accountwindow.h +++ b/sflphone-gtk/src/accountwindow.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +23,11 @@ /** @file accountwindow.h * @brief The window to edit account details. */ - + +/** + * Display the main account widget + * @param a The account you want to edit or null for a new account + */ void show_account_window ( account_t * a ); #endif diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 9aa08e127a33a65ad3717717c56e6bb5e6259450..e9fe7fd98de929a4e3e5a435e08f32ad4cd717b8 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -476,7 +476,7 @@ sflphone_keypad( guint keyval, gchar * key) case 65307: /* ESCAPE */ dbus_hang_up(c); break; - default: // TODO should this be here? + default: // To play the dtmf when calling mail box for instance dbus_play_dtmf(key); if (keyval < 255 || (keyval >65453 && keyval < 65466)) diff --git a/sflphone-gtk/src/actions.h b/sflphone-gtk/src/actions.h index 74143f0c380eb276ba5723dc87b90bcc52bfcef3..8a80a5cd11e69f6000e433750fed85a2b1358f8f 100644 --- a/sflphone-gtk/src/actions.h +++ b/sflphone-gtk/src/actions.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -54,12 +54,40 @@ gboolean sflphone_quit ( ) ; */ void sflphone_hang_up (); +/** + * Put the selected call on hold + */ void sflphone_on_hold (); + +/** + * Put the selected call off hold + */ void sflphone_off_hold (); + +/** + * Open a new call + * @return call_t* A pointer on the call structure + */ call_t * sflphone_new_call(); + +/** + * Notify voice mails to the application + * @param accountID The account the voice mails are for + * @param count The number of voice mails + */ void sflphone_notify_voice_mail ( const gchar* accountID , guint count ); + +/** + * Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to + * Put the selected call in Transfer state + */ void sflphone_set_transfert(); + +/** + * Cancel the transfer and puts back the selected call to Current state + */ void sflphone_unset_transfert(); + /** * Accept / dial the current call */ @@ -67,36 +95,49 @@ void sflphone_pick_up (); /** * Put the call on hold state + * @param call_t* The current call */ void sflphone_hold ( call_t * c); /** * Put the call in Ringing state + * @param call_t* The current call */ void sflphone_ringing(call_t * c ); +/** + * Put the call in Busy state + * @param call_t* The current call + */ void sflphone_busy( call_t * c ); + +/** + * Put the call in Failure state + * @param call_t* The current call + */ void sflphone_fail( call_t * c ); /** * Put the call in Current state + * @param call_t* The current call */ void sflphone_current ( call_t * c); /** * The callee has hung up + * @param call_t* The current call */ void sflphone_hung_up( call_t * c); /** * Incoming call + * @param call_t* The incoming call */ void sflphone_incoming_call ( call_t * c); /** * Dial the number * If the call is in DIALING state, the char will be append to the number - * @TODO If the call is in CURRENT state, the char will be also sent to the server * @param keyval The unique int representing the key * @param keyval The char value of the key */ @@ -108,8 +149,20 @@ void sflphone_keypad ( guint keyval, gchar * key); */ void sflphone_place_call ( call_t * c ); +/** + * Initialize the accounts data structure + */ void sflphone_fill_account_list(); + +/** + * Set an account as current. The current account is to one used to place calls with by default + * The current account is the first in the account list ( index 0 ) + */ void sflphone_set_current_account(); +/** + * Initialialize the codecs data structure + */ void sflphone_fill_codec_list(); + #endif diff --git a/sflphone-gtk/src/calllist.c b/sflphone-gtk/src/calllist.c index 1d5411e3dfc68ade338b63ee476387de8b1c54e6..dfcfadc12f9da04791bceb130e959c8f76183e34 100644 --- a/sflphone-gtk/src/calllist.c +++ b/sflphone-gtk/src/calllist.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/calllist.h b/sflphone-gtk/src/calllist.h index cf7d21bbc2bddf3b3f687b9e77c6618047ae61f1..24aa570fd99d7c484cc5f2061595bbda719ca541 100644 --- a/sflphone-gtk/src/calllist.h +++ b/sflphone-gtk/src/calllist.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,57 +68,81 @@ typedef struct { call_state_t state; } call_t; -/** This function initialize the call list. */ +/** + * This function initialize the call list. + */ void call_list_init (); -/** This function empty and free the call list. */ +/** + * This function empty and free the call list. + */ void call_list_clean (); -/** This function append a call to list. - * @param c The call you want to add */ +/** + * This function append a call to list. + * @param c The call you want to add + */ void call_list_add (call_t * c); -/** This function remove a call from list. - * @param callID The callID of the call you want to remove - */ +/** + * This function remove a call from list. + * @param callID The callID of the call you want to remove + */ void call_list_remove (const gchar * callID); -/** Return the first call that corresponds to the state. - * This is usefull for unique states as DIALING and CURRENT. - * @param state The state - * @return A call or NULL */ +/** + * Return the first call that corresponds to the state. + * This is usefull for unique states as DIALING and CURRENT. + * @param state The state + * @return A call or NULL + */ call_t * call_list_get_by_state ( call_state_t state); -/** Return the number of calls in the list - * @return The number of calls in the list */ +/** + * Return the number of calls in the list + * @return The number of calls in the list + */ guint call_list_get_size ( ); -/** Return the call at the nth position in the list - * @param n The position of the call you want - * @return A call or NULL */ +/** + * Return the call at the nth position in the list + * @param n The position of the call you want + * @return A call or NULL + */ call_t * call_list_get_nth ( guint n ); -/** Return the call corresponding to the callID - * @param n The callID of the call you want - * @return A call or NULL */ +/** + * Return the call corresponding to the callID + * @param n The callID of the call you want + * @return A call or NULL + */ call_t * call_list_get ( const gchar * callID ); -/** This function parse the call_t.from field to return the name - * @param c The call - * @return The full name of the caller or an empty string */ +/** + * This function parse the call_t.from field to return the name + * @param c The call + * @return The full name of the caller or an empty string + */ gchar * call_get_name (const call_t * c); -/** This function parse the call_t.from field to return the number - * @param c The call - * @return The number of the caller */ +/** + * This function parse the call_t.from field to return the number + * @param c The call + * @return The number of the caller + */ gchar * call_get_number (const call_t * c); -/** Mark a call as selected. There can be only one selected call. This call - * is the currently highlighted one in the list. - * @param c The call */ +/** + * Mark a call as selected. There can be only one selected call. This call + * is the currently highlighted one in the list. + * @param c The call + */ void call_select ( call_t * c ); -/** Return the selected call. - * @return The number of the caller */ +/** + * Return the selected call. + * @return The number of the caller + */ call_t * call_get_selected (); + #endif diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index 6be55acdbcada94352c14451608cb97257548d31..8e259282de6e9d3d36aee4333cf5db15e90e7d8a 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/sflphone-gtk/src/calltree.h b/sflphone-gtk/src/calltree.h index 8d64507ac2c4f8590e3a7997574625cd2481e311..4a8d827f9a1515b9a7c9fcdf0676f742b5c198f5 100644 --- a/sflphone-gtk/src/calltree.h +++ b/sflphone-gtk/src/calltree.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,40 @@ /** @file calltree.h * @brief The GtkTreeView that list calls in the main window. */ + +/** + * Create a new widget calltree + * @return GtkWidget* A new widget + */ GtkWidget * create_call_tree(); +/** + * Update the toolbar's buttons state, according to the call state + */ void toolbar_update_buttons(); +/** + * Add a call in the calltree + * @param c The call to add + */ void update_call_tree_add (call_t * c); + +/** + * Update the call tree if the call state changes + * @param c The call to update + */ void update_call_tree (call_t * c); + +/** + * Remove a call from the call tree + * @param c The call to remove + */ void update_call_tree_remove (call_t * c); +/** + * Build the toolbar + * @return GtkWidget* The toolbar + */ GtkWidget * create_toolbar(); #endif diff --git a/sflphone-gtk/src/codeclist.h b/sflphone-gtk/src/codeclist.h index ce5a806ac1676862da59547d07b67472ad066a4d..c00739328f248f18320175811299e4d787cab183 100644 --- a/sflphone-gtk/src/codeclist.h +++ b/sflphone-gtk/src/codeclist.h @@ -26,22 +26,72 @@ */ typedef struct { + /** Payload of the codec */ int _payload; + /** Tells if the codec has been activated */ gboolean is_active; + /** String description */ gchar * name; + /** Sample rate */ int sample_rate; + /** Bitrate */ gdouble _bitrate; + /** Bandwidth */ gdouble _bandwidth; }codec_t; +/** @struct codec_t + * @brief Codec information. + * This struct holds information about a codec. + * This match how the server internally works and the dbus API to save and retrieve the codecs details. + */ + +/** + * This function initialize the codec list. + */ void codec_list_init(); + +/** + * This function empty and free the codec list. + */ void codec_list_clear(); + +/** + * This function append an codec to list. + * @param a The codec you want to add + */ void codec_list_add(codec_t * c); + +/** + * Set a codec active. An active codec will be used for codec negociation + * @param name The string description of the codec + */ void codec_set_active(gchar* name); + +/** + * Set a codec inactive. An active codec won't be used for codec negociation + * @param name The string description of the codec + */ void codec_set_inactive(gchar* name); + +/** + * Return the number of codecs in the list + * @return guint The number of codecs in the list + */ guint codec_list_get_size(); + +/** + * Return the codec structure that corresponds to the string description + * @param name The string description of the codec + * @return codec_t* A codec or NULL + */ codec_t * codec_list_get(const gchar * name); -//codec_t * codec_list_get(const int payload); + +/** + * Return the codec at the nth position in the list + * @param index The position of the codec you want + * @return codec_t* A codec or NULL + */ codec_t* codec_list_get_nth(guint index); /** @@ -49,11 +99,22 @@ codec_t* codec_list_get_nth(guint index); * @param index The position in the list of the prefered codec */ void codec_set_prefered_order(guint index); -//gchar * codec_get_name(codec_t * c); -//guint codec_get_rate(gchar * codec_name); +/** + * Move the codec from an unit up in the codec_list + * @param index The current index in the list + */ void codec_list_move_codec_up(guint index); + +/** + * Move the codec from an unit down in the codec_list + * @param index The current index in the list + */ void codec_list_move_codec_down(guint index); + +/** + * Notify modifications on codecs to the server + */ void codec_list_update_to_daemon(); #endif diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c index a1ec38a159a1592288e18ce4728b7df58bc4419e..d43ec5b6e5330fb2beb57f769b38668cb963c225 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/configwindow.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com> * @@ -948,7 +948,6 @@ create_accounts_tab() "markup", COLUMN_ACCOUNT_ALIAS, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - //gtk_tree_view_column_set_cell_data_func(treeViewColumn, renderer, bold_if_default_account, NULL,NULL); // A double click on the account line opens the window to edit the account g_signal_connect( G_OBJECT( treeView ) , "row-activated" , G_CALLBACK( edit_account ) , NULL ); @@ -959,7 +958,6 @@ create_accounts_tab() "markup", COLUMN_ACCOUNT_TYPE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - //gtk_tree_view_column_set_cell_data_func(treeViewColumn, renderer, bold_if_default_account, NULL,NULL); renderer = gtk_cell_renderer_text_new(); treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Status"), @@ -967,7 +965,6 @@ create_accounts_tab() "markup", COLUMN_ACCOUNT_STATUS, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - //gtk_tree_view_column_set_cell_data_func(treeViewColumn, renderer, bold_if_default_account, NULL,NULL); renderer = gtk_cell_renderer_toggle_new(); treeViewColumn = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_ACCOUNT_ACTIVE , NULL); @@ -1017,14 +1014,6 @@ create_accounts_tab() gtk_box_pack_start(GTK_BOX(buttonBox), deleteButton, FALSE, FALSE, 0); gtk_widget_show(deleteButton); - /*defaultButton = gtk_button_new_with_mnemonic(_("Default")); - gtk_widget_set_tooltip_text( GTK_WIDGET( defaultButton ) , _("Set the selected account as the default one to make calls")); - g_signal_connect_swapped(G_OBJECT(defaultButton), "clicked", - G_CALLBACK(default_account), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), defaultButton, FALSE, FALSE, 0); - gtk_widget_show(defaultButton); - */ - gtk_widget_show_all(ret); config_window_fill_account_list(); diff --git a/sflphone-gtk/src/configwindow.h b/sflphone-gtk/src/configwindow.h index 778ed81d962ceb7232801730b7cdcc2ae9666be0..a954d77ffe4a55e2d9662a884f3048ff1a5ee11c 100644 --- a/sflphone-gtk/src/configwindow.h +++ b/sflphone-gtk/src/configwindow.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,23 +26,87 @@ * @file configwindow.h * @brief The Preferences window. */ + +/** + * Fill the account list widget with the data the server send + */ void config_window_fill_account_list(); + +/** + * Fill the codec list widget with the data the server send + */ void config_window_fill_codec_list(); + +/** + * Fill the input audio plugin list widget with the data the server send + * Currently not used + */ void config_window_fill_input_audio_plugin_list(); + +/** + * Fill the output audio plugin list widget with the data the server send + */ void config_window_fill_output_audio_plugin_list(); + +/** + * Fill the output audio device list widget with the data the server send + */ void config_window_fill_output_audio_device_list(); + +/** + * Select an output audio device + */ void select_active_output_audio_device(); + +/** + * Fill the input audio device list widget with the data the server send + */ void config_window_fill_input_audio_device_list(); + +/** + * Select an input audio device + */ void select_active_input_audio_device(); + +/** + * Select an output audio plugin + */ void select_active_output_audio_plugin(); + +/** + * Update the combo box state. + * If the default plugin has been selected, the audio devices have to been unsensitive + * because the default plugin always use default audio device + * @param plugin The description of the selected plugin + */ void update_combo_box( gchar* plugin ); -void default_account(GtkWidget *widget, gpointer data); -void bold_if_default_account(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); -void default_codecs(GtkWidget* widget, gpointer data); + +/** + * Build the widget to display codec list + * @return GtkWidget* The widget created + */ GtkWidget * create_codec_table(); + +/** + * Create the main account window in a new window + * @return GtkWidget* The widget created + */ GtkWidget * create_accounts_tab(); + +/** + * Create the audio configuration tab and add it to the main configuration window + * @return GtkWidget* The widget created + */ GtkWidget * create_audio_tab(); + +/** + * Display the main configuration window + */ void show_config_window(); + +/** + * Display the main account window + */ void show_accounts_window(); #endif diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index c48476be4590180f8e7b8068a52a70c970d0ba32..4ab7444e86b130ac3e39691139d8c08a44bd0b41 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com> * @@ -472,49 +472,6 @@ dbus_send_register ( gchar* accountID , int expire) } } -gchar * -dbus_get_default_account( ) -{ - GError *error = NULL; - char * accountID; - org_sflphone_SFLphone_ConfigurationManager_get_default_account ( - configurationManagerProxy, - &accountID, - &error); - if (error) - { - g_printerr("Failed to call get_default_account() on ConfigurationManager: %s\n",error->message); - g_error_free (error); - } - else - { - g_print ("DBus called get_default_account() on ConfigurationManager\n"); - } - - return accountID; - -} - - -void -dbus_set_default_account(gchar * accountID) -{ - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_default_account ( - configurationManagerProxy, - accountID, - &error); - if (error) - { - g_printerr("Failed to call set_default_account() on ConfigurationManager: %s\n",error->message); - g_error_free (error); - } - else - { - g_print ("DBus called set_default_account() on ConfigurationManager\n"); - } - -} void dbus_remove_account(gchar * accountID) { @@ -723,30 +680,6 @@ dbus_unregister(int pid) } } -int -dbus_get_registration_count( void ) -{ - GError *error = NULL; - int n; - - org_sflphone_SFLphone_Instance_get_registration_count( - instanceProxy, - &n, - &error); - - if (error) - { - g_printerr ("Failed to call get_registration_count() on instanceProxy: %s\n", - error->message); - g_error_free (error); - } - else - { - g_print ("DBus called get_registration_count() on instanceProxy\n"); - } - return n; -} - gchar** dbus_codec_list() { diff --git a/sflphone-gtk/src/dbus.h b/sflphone-gtk/src/dbus.h index 6b9ada699595204be49392e9d81cf4dabaf6701d..f5d682b0070b8248bff5dca3d7dd802f0f2745c7 100644 --- a/sflphone-gtk/src/dbus.h +++ b/sflphone-gtk/src/dbus.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com> * @@ -30,69 +30,315 @@ /** @file dbus.h * @brief General DBus functions wrappers. */ -/** @return TRUE if connection succeeded, FALSE otherwise */ + +/** + * Try to connect to DBus services + * @return TRUE if connection succeeded, FALSE otherwise + */ gboolean dbus_connect (); + +/** + * Unreferences the proxies + */ void dbus_clean (); -/* CallManager */ +/** + * CallManager - Hold a call + * @param c The call to hold + */ void dbus_hold (const call_t * c ); + +/** + * CallManager - Unhold a call + * @param c The call to unhold + */ void dbus_unhold (const call_t * c ); + +/** + * CallManager - Hang up a call + * @param c The call to hang up + */ void dbus_hang_up (const call_t * c ); + +/** + * CallManager - Transfer a call + * @param c The call to transfer + */ void dbus_transfert (const call_t * c); + +/** + * CallManager - Accept a call + * @param c The call to accept + */ void dbus_accept (const call_t * c); + +/** + * CallManager - Refuse a call + * @param c The call to refuse + */ void dbus_refuse (const call_t * c); + +/** + * CallManager - Place a call + * @param c The call to place + */ void dbus_place_call (const call_t * c); -/* ConfigurationManager */ -/** Returns a NULL terminated array of gchar pointers */ + +/** + * ConfigurationManager - Get the list of the setup accounts + * @return gchar** The list of accounts + */ gchar ** dbus_account_list(); + +/** + * ConfigurationManager - Get the details of a specific account + * @param accountID The unique of the account + * @return GHashTable* The details of the account + */ GHashTable * dbus_account_details(gchar * accountID); + +/** + * ConfigurationManager - Set the details of a specific account + * @param a The account to update + */ void dbus_set_account_details(account_t *a); + +/** + * ConfigurationManager - Send registration request + * @param accountID The account to register/unregister + * @param expire The flag for the type of registration + * 0 for unregistration request + * 1 for registration request + */ void dbus_send_register( gchar* accountID , int expire ); + +/** + * ConfigurationManager - Add an account to the list + * @param a The account to add + */ void dbus_add_account(account_t *a); + +/** + * ConfigurationManager - Remove an account from the list + * @param accountID The account to remove + */ void dbus_remove_account(gchar * accountID); + +/** + * ConfigurationManager - Set volume for speaker/mic + * @param device The speaker or the mic + * @param value The new value + */ void dbus_set_volume(const gchar * device, gdouble value); + +/** + * ConfigurationManager - Get the volume of a device + * @param device The speaker or the mic + */ gdouble dbus_get_volume(const gchar * device); + +/** + * ConfigurationManager - Play DTMF + * @param key The DTMF to send + */ void dbus_play_dtmf(const gchar * key); -gchar* dbus_get_default_account(); -void dbus_set_default_account(gchar * accountID); + +/** + * ConfigurationManager - Get the codecs list + * @return gchar** The list of codecs + */ gchar** dbus_codec_list(); + +/** + * ConfigurationManager - Get the codec details + * @param payload The payload of the codec + * @return gchar** The codec details + */ gchar** dbus_codec_details(int payload); + +/** + * ConfigurationManager - Get the default codec list + * The default codec list are the codecs selected by the server if the user hasn't made any changes + * @return gchar** The default codec list + */ gchar** dbus_default_codec_list(); + +/** + * ConfigurationManager - Get the list of the codecs used for media negociation + * @return gchar** The list of codecs + */ gchar** dbus_get_active_codec_list( void ); + +/** + * ConfigurationManager - Set the list of codecs used for media negociation + * @param list The list of codecs + */ void dbus_set_active_codec_list( const gchar** list ); -// Audio devices related methods +/** + * ConfigurationManager - Get the list of available input audio plugins + * @return gchar** The list of plugins + */ gchar** dbus_get_input_audio_plugin_list(); + +/** + * ConfigurationManager - Get the list of available output audio plugins + * @return gchar** The list of plugins + */ gchar** dbus_get_output_audio_plugin_list(); + +/** + * ConfigurationManager - Select an input audio plugin + * @param gchar* The string description of the plugin + */ void dbus_set_input_audio_plugin(gchar* audioPlugin); + +/** + * ConfigurationManager - Select an output audio plugin + * @param gchar* The string description of the plugin + */ void dbus_set_output_audio_plugin(gchar* audioPlugin); + +/** + * ConfigurationManager - Get the list of available output audio devices + * @return gchar** The list of devices + */ gchar** dbus_get_audio_output_device_list(); + +/** + * ConfigurationManager - Select an output audio device + * @param index The index of the soundcard + */ void dbus_set_audio_output_device(const int index); + +/** + * ConfigurationManager - Get the list of available input audio devices + * @return gchar** The list of devices + */ gchar** dbus_get_audio_input_device_list(); + +/** + * ConfigurationManager - Select an input audio device + * @param index The index of the soundcard + */ void dbus_set_audio_input_device(const int index); -// Output and input current devices + +/** + * ConfigurationManager - Get the current audio devices + * @return gchar** The index of the current soundcard + */ gchar** dbus_get_current_audio_devices_index(); + +/** + * ConfigurationManager - Get the index of the specified audio device + * @param name The string description of the audio device + * @return int The index of the device + */ int dbus_get_audio_device_index(const gchar* name); + +/** + * ConfigurationManager - Get the current output audio plugin + * @return gchar* The current plugin + * default + * plughw + * dmix + */ gchar* dbus_get_current_audio_output_plugin(); + +/** + * ConfigurationManager - Tells the GUI if IAX2 support is enabled + * @return int 1 if IAX2 is enabled + * 0 otherwise + */ int dbus_is_iax2_enabled( void ); + +/** + * ConfigurationManager - Query the server about the ringtone option. + * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. + * @return int 1 if enabled + * 0 otherwise + */ int dbus_is_ringtone_enabled( void ); + +/** + * ConfigurationManager - Set the ringtone option + * Inverse current value + */ void dbus_ringtone_enabled( void ); + +/** + * ConfigurationManager - Get the ringtone + * @return gchar* The file name selected as a ringtone + */ gchar* dbus_get_ringtone_choice( void ); + +/** + * ConfigurationManager - Set a ringtone + * @param tone The file name of the ringtone + */ void dbus_set_ringtone_choice( const gchar* tone ); + +/** + * ConfigurationManager - Set the dialpad visible or not + */ void dbus_set_dialpad( ); + +/** + * ConfigurationManager - Tells if the user wants to display the dialpad or not + * @return int 1 if dialpad has to be displayed + * 0 otherwise + */ int dbus_get_dialpad( void ); + +/** + * ConfigurationManager - Configure the start-up option + * At startup, SFLphone can be displayed or start hidden in the system tray + */ void dbus_start_hidden( void ); + +/** + * ConfigurationManager - Configure the start-up option + * @return int 1 if SFLphone should start in the system tray + * 0 otherwise + */ int dbus_is_start_hidden( void ); + +/** + * ConfigurationManager - Configure the popup behaviour + * When SFLphone is in the system tray, you can configure when it popups + * Never or only on incoming calls + */ void dbus_switch_popup_mode( void ); + +/** + * ConfigurationManager - Configure the popup behaviour + * @return int 1 if it should popup on incoming calls + * 0 if it should never popups + */ int dbus_popup_mode( void ); + +/** + * ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed + * @param start 1 to start + * 0 to stop + * @param type TONE_WITH_MESSAGE + * TONE_WITHOUT_MESSAGE + */ void dbus_start_tone(const int start , const guint type); -/* Instance */ +/** + * Instance - Send registration request to dbus service. + * Manage the instances of clients connected to the server + * @param pid The pid of the processus client + * @param name The string description of the client. Here : GTK+ Client + */ void dbus_register( int pid, gchar * name); -void dbus_unregister(int pid); -int dbus_get_registration_count( void ); - +/** + * Instance - Send unregistration request to dbus services + * @param pid The pid of the processus + */ +void dbus_unregister(int pid); #endif diff --git a/sflphone-gtk/src/dialpad.c b/sflphone-gtk/src/dialpad.c index e6345cb1d2092a0eacce8933f69e97966586d7c8..71bee58bd5da51b955c8033834ba95e700fc9a1e 100644 --- a/sflphone-gtk/src/dialpad.c +++ b/sflphone-gtk/src/dialpad.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/dialpad.h b/sflphone-gtk/src/dialpad.h index 58ee975e89649ea1806dd0cd8d933203f009e80f..2a87148b3b9f12efb53c8865b557d151d4d1b005 100644 --- a/sflphone-gtk/src/dialpad.h +++ b/sflphone-gtk/src/dialpad.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +24,11 @@ /** @file dialpad.h * @brief The dialpad widgets. */ + +/** + * Build the dialpad + * @return GtkWidget* The widge representing the dialpad + */ GtkWidget * create_dialpad(); #endif diff --git a/sflphone-gtk/src/errors.h b/sflphone-gtk/src/errors.h index 19cb349f7aef3f283a03f4526d32b8d240ca8f48..4f3a9c32ecdcf18a65f3d3510c392dbc3959301e 100644 --- a/sflphone-gtk/src/errors.h +++ b/sflphone-gtk/src/errors.h @@ -20,8 +20,18 @@ #ifndef __ERRORS_H #define __ERRORS_H +/** @file errors.h + * @brief Implements internal errors notifications to the client. + */ + #include <sflphone_const.h> +/** + * Display an internal error. + * @param err The error code + * ALSA_PLAYBACK_ERROR + * ALSA_CAPTURE_ERROR + */ void sflphone_throw_exception( int err ); #endif diff --git a/sflphone-gtk/src/main.c b/sflphone-gtk/src/main.c index fc08122d9ab539b6a6cb9ead5e03bc93473aad53..5d7509ac7890cd8436e6a0f7ec26e2d2f4f33b79 100644 --- a/sflphone-gtk/src/main.c +++ b/sflphone-gtk/src/main.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index 396193abd83d41208c18b2961072122dada0dec6..526d507ec78de1ffdabfd6ce18d25eadeb7df649 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,6 @@ #include <dialpad.h> #include <mainwindow.h> #include <menus.h> -#include <screen.h> #include <sliders.h> #include <gtk/gtk.h> @@ -38,7 +37,6 @@ GtkWidget * dialpad = NULL; GtkWidget * statusBar = NULL; GtkWidget * infoScreen = NULL; gboolean showDialpad = FALSE; // true if the dialpad have been shown -gboolean showInfoScreen = FALSE; // true if the info screen have been shown /** * Terminate the main loop. diff --git a/sflphone-gtk/src/mainwindow.h b/sflphone-gtk/src/mainwindow.h index a138a70b494bdefe10f8de97d85049513ec674ca..0f3e7db65db11298da1c182db1256fe2a861f4c2 100644 --- a/sflphone-gtk/src/mainwindow.h +++ b/sflphone-gtk/src/mainwindow.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,24 +26,61 @@ * @brief The main window of the client. */ GtkAccelGroup * get_accel_group(); + +/** + * Display the main window + * @return GtkWidget* The main window + */ GtkWidget * get_main_window(); +/** + * Build the main window + */ void create_main_window ( ); +/** + * Display a dialog window + * Ask the user if he wants to hangup current calls before quiting + * @return gboolean TRUE if the user wants to hang up + * FALSE otherwise + */ gboolean main_window_ask_quit() ; + /** * Shows the dialpad on the mainwindow * @param show TRUE if you want to show the dialpad, FALSE to hide it */ void main_window_dialpad(gboolean show); +/** + * Display an error message + * @param markup The error message + */ void main_window_error_message(gchar * markup); +/** + * Display a warning message + * @param markup The warning message + */ void main_window_warning_message(gchar * markup); +/** + * Display an info message + * @param markup The info message + */ void main_window_info_message(gchar * markup); +/** + * Push a message on the statusbar stack + * @param message The message to display + * @param id The identifier of the message + */ void statusbar_push_message( const gchar* message , guint id ); + +/** + * Pop a message from the statusbar stack + * @param id The identifier of the message + */ void statusbar_pop_message( guint id ); #endif diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index 7680f587ff1fc3fe73d657a462de518f56c005c0..2e7b85b9a1761bb2d40ca86f629e2e198b7d5d9c 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,6 @@ #include <configwindow.h> #include <dbus.h> #include <mainwindow.h> -#include <screen.h> #include <gtk/gtk.h> #include <string.h> // for strlen @@ -105,13 +104,13 @@ help_about ( void * foo) "Jérôme Oufella <jerome.oufella@savoirfairelinux.com>", "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", - "Pierre-Luc Beaudoin <pierre-luc@squidy.info>", + "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>" "Jean-Philippe Barrette-LaPierre", "Laurielle Lea", NULL}; gchar *artists[] = { - "Pierre-Luc Beaudoin <pierre-luc@squidy.info>", + "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", NULL}; gtk_show_about_dialog( GTK_WINDOW(get_main_window()), @@ -357,7 +356,6 @@ edit_paste ( void * foo) g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); } - screen_set_call(selectedCall); update_call_tree(selectedCall); } break; @@ -377,7 +375,6 @@ edit_paste ( void * foo) g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); - screen_set_call(selectedCall); update_call_tree(selectedCall); } break; @@ -396,7 +393,6 @@ edit_paste ( void * foo) selectedCall->from = g_strconcat("\"",call_get_name(selectedCall) ,"\" <", temp, ">", NULL); g_free(before); g_free(temp); - screen_set_call(selectedCall); update_call_tree(selectedCall); } @@ -417,7 +413,6 @@ edit_paste ( void * foo) g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); - screen_set_call(selectedCall); update_call_tree(selectedCall); } diff --git a/sflphone-gtk/src/menus.h b/sflphone-gtk/src/menus.h index 18d7fcb9d675c1d905cef7266a247b020b55aac0..cdc8bbbddda3c473895d98858e4ad4baf4aea35d 100644 --- a/sflphone-gtk/src/menus.h +++ b/sflphone-gtk/src/menus.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,8 +24,23 @@ /** @file menus.h * @brief The menus of the main window. */ + +/** + * Build the menus bar + * @return GtkWidget* The menu bar + */ GtkWidget * create_menus(); + +/** + * Update the menu state + */ void update_menus(); + +/** + * Create a menu on right-click + * @param mywidget The widget you click on + * @param event The mouse event + */ void show_popup_menu (GtkWidget *my_widget, GdkEventButton *event); #endif diff --git a/sflphone-gtk/src/screen.c b/sflphone-gtk/src/screen.c deleted file mode 100644 index c4a89c37c1a898886481de26bda677c913566975..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/screen.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <dialpad.h> -#include <screen.h> -#include <codeclist.h> - -GtkWidget * label; -GtkWidget * hbox; - -GtkWidget * -create_screen() -{ - GtkWidget * event; - GtkWidget * sw; - GtkWidget *subvbox; - - GdkColor color; - gdk_color_parse ("white", &color); - - subvbox = gtk_vbox_new ( FALSE /*homogeneous*/, 10 /*spacing*/); - - sw = gtk_scrolled_window_new( NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); - - event = gtk_event_box_new (); - gtk_widget_modify_bg (event, GTK_STATE_NORMAL, &color); - - //label = gtk_label_new ("test"); - label = gtk_label_new(""); - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); - gtk_misc_set_padding(GTK_MISC(label), 5, 5); - gtk_misc_set_alignment(GTK_MISC(label), 0,0); - gtk_container_add (GTK_CONTAINER (event), label); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), event); - - gtk_box_pack_start (GTK_BOX (subvbox), sw, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - - //screen_clear(); - - return subvbox; -} - -void -screen_clear() -{ - gtk_label_set_markup(GTK_LABEL(label), "<b>CALL INFOS</b>\n"); -} - -void -screen_set_call(const call_t * c) -{ - printf("accountID = %s\ncall to = %s\n", c->from, c->to); - gchar * markup = g_strconcat("<b><i>Calling to:</i></b>", "\t", call_get_number(c), - "\n<b><i>Codec:</i></b>", "\t", codec_list_get_nth(0)->name, NULL); - gtk_label_set_markup(GTK_LABEL(label), markup); - g_free(markup); -} diff --git a/sflphone-gtk/src/screen.h b/sflphone-gtk/src/screen.h deleted file mode 100644 index 9d78edc164e2e96966665cfea543adf1d15e8249..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/screen.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __SCREEN_H__ -#define __SCREEN_H__ - -#include <gtk/gtk.h> -#include <calllist.h> - -/** @file screen.h - * @brief The screen at the top of the main window. - */ -GtkWidget * create_screen(); - -void screen_clear(); - -void screen_set_call(const call_t * c); - -#endif diff --git a/sflphone-gtk/src/sflnotify.c b/sflphone-gtk/src/sflnotify.c index b6a44fb76835a8ef615ff193c6653d88a8bf9dd3..14b17ff8af1588d3a0aa611fc29bb5bb1a5d28bb 100644 --- a/sflphone-gtk/src/sflnotify.c +++ b/sflphone-gtk/src/sflnotify.c @@ -57,7 +57,7 @@ notify_incoming_call( call_t* c ) } void -answer_call_cb( NotifyNotification *notification, gchar *action, gpointer data ) +answer_call_cb( NotifyNotification *notification, gpointer data ) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); dbus_accept(c); @@ -67,7 +67,7 @@ answer_call_cb( NotifyNotification *notification, gchar *action, gpointer data } void -refuse_call_cb( NotifyNotification *notification, gchar *action, gpointer data ) +refuse_call_cb( NotifyNotification *notification, gpointer data ) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); dbus_refuse(c); @@ -75,7 +75,7 @@ refuse_call_cb( NotifyNotification *notification, gchar *action, gpointer data ) } void -ignore_call_cb( NotifyNotification *notification, gchar *action, gpointer data ) +ignore_call_cb( NotifyNotification *notification, gpointer data ) { g_object_unref( notification ); } @@ -173,7 +173,7 @@ notify_no_accounts( ) } void -setup_accounts_cb( NotifyNotification *notification, gchar *action, gpointer data ) +setup_accounts_cb( NotifyNotification *notification, gpointer data ) { show_accounts_window(); //g_object_unref( notification ); diff --git a/sflphone-gtk/src/sflnotify.h b/sflphone-gtk/src/sflnotify.h index c451f553b739ec376b524fdb85d73366fce73df4..5f3bf3130404bc6fc677d037f63f126a8f94e346 100644 --- a/sflphone-gtk/src/sflnotify.h +++ b/sflphone-gtk/src/sflnotify.h @@ -21,8 +21,11 @@ #ifndef __SFL_NOTIFY_H__ #define __SFL_NOTIFY_H__ -#include <libnotify/notify.h> +/** @file sflnotify.h + * @brief Implements desktop notification for incoming events. + */ +#include <libnotify/notify.h> #include <accountlist.h> #include <calllist.h> #include <dbus.h> @@ -31,41 +34,67 @@ #include <configwindow.h> #include <sflphone_const.h> -/* - * Notify an incoming call with the libnotify notification library - * A dialog box appears near the status icon +/** + * Notify an incoming call + * A dialog box is attached to the status icon * @param c The incoming call */ void notify_incoming_call( call_t* c); +/** + * Notify voice mails count + * An info box is attached to the status icon + * @param count The number of voice mails + * @param acc The account that received the notification + */ void notify_voice_mails( guint count , account_t* acc ); +/** + * Notify the current account used to make calls with + * @param acc The current account + */ void notify_current_account( account_t* acc ); + +/** + * Notify that no accounts have been setup + */ void notify_no_accounts( ); + +/** + * Notify that there is no registered account + */ void notify_no_registered_accounts( ); -/* + +/** * Callback when answer button is pressed. - * Action: Pick up the incoming call + * Action associated: Pick up the incoming call * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ -void answer_call_cb( NotifyNotification *notification, gchar *action, gpointer data ); +void answer_call_cb( NotifyNotification *notification, gpointer data ); -/* +/** * Callback when refuse button is pressed - * Action: hang up the incoming call + * Action associated: Hang up the incoming call * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ -void refuse_call_cb( NotifyNotification *notification, gchar *action, gpointer data ); +void refuse_call_cb( NotifyNotification *notification, gpointer data ); -/* +/** * Callback when ignore button is pressed - * Action: nothing - The call continues ringing + * Action associated: Nothing - The call continues ringing * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ -void ignore_call_cb( NotifyNotification *notification, gchar *action, gpointer data ); +void ignore_call_cb( NotifyNotification *notification, gpointer data ); + +/** + * Callback when you try to make a call without accounts setup and 'setup account' button is clicked. + * Action associated: Open the account window + * @param notification The pointer on the notification structure + * @param data The data associated. Here: account_t* + */ +void setup_accounts_cb(NotifyNotification *notification, gpointer data); -void setup_accounts_cb(NotifyNotification *notification, gchar *action, gpointer data); #endif diff --git a/sflphone-gtk/src/sflphone_const.h b/sflphone-gtk/src/sflphone_const.h index 7587d5af0f57ce8e12e0a19c241877538a749c95..2d90b5885a9c3e64498c406e8bb9658098beccc7 100644 --- a/sflphone-gtk/src/sflphone_const.h +++ b/sflphone-gtk/src/sflphone_const.h @@ -20,50 +20,72 @@ #ifndef __SFLPHONE_CONST_H #define __SFLPHONE_CONST_H +/* @file sflphone_const.h + * @brief Contains the global variables for the client code + */ #include <libintl.h> #include "dbus.h" -// Locale +/** Locale */ #define _(STRING) gettext( STRING ) -// Generic parameters for accounts registration +/** Account type : SIP / IAX */ #define ACCOUNT_TYPE "Account.type" -#define ACCOUNT_ALIAS "Account.alias" +/** Account alias */ +#define ACCOUNT_ALIAS "Account.alias" +/** Tells if account is enabled or not */ #define ACCOUNT_ENABLED "Account.enable" -// SIP specific parameters +/** SIP parameter: full name */ #define ACCOUNT_SIP_FULL_NAME "SIP.fullName" +/** SIP parameter: host name */ #define ACCOUNT_SIP_HOST_PART "SIP.hostPart" +/** SIP parameter: user name */ #define ACCOUNT_SIP_USER_PART "SIP.userPart" +/** SIP parameter: authentification name */ #define ACCOUNT_SIP_AUTH_NAME "SIP.username" +/** SIP parameter: password */ #define ACCOUNT_SIP_PASSWORD "SIP.password" +/** SIP parameter: proxy address */ #define ACCOUNT_SIP_PROXY "SIP.proxy" +/** SIP parameter: stun server address */ #define ACCOUNT_SIP_STUN_SERVER "STUN.server" +/** SIP parameter: tells if stun is enabled or not */ #define ACCOUNT_SIP_STUN_ENABLED "STUN.enable" -// IAX2 specific parameters +/** IAX2 parameter: full name */ #define ACCOUNT_IAX_FULL_NAME "IAX.fullName" +/** IAX2 parameter: host name */ #define ACCOUNT_IAX_HOST "IAX.host" +/** IAX2 parameter: user name */ #define ACCOUNT_IAX_USER "IAX.user" +/** IAX2 parameter: password name */ #define ACCOUNT_IAX_PASS "IAX.pass" -// Error codes for error handling +/** Error while opening capture device */ #define ALSA_CAPTURE_DEVICE 0x0001 +/** Error while opening playback device */ #define ALSA_PLAYBACK_DEVICE 0x0010 -#define NETWORK_UNREACHABLE 0x0011 -// Customizing-related parameters +/** Tone to play when no voice mails */ #define TONE_WITHOUT_MESSAGE 0 +/** Tone to play when voice mails */ #define TONE_WITH_MESSAGE 1 +/** Tells if the main window is reduced to the system tray or not */ #define MINIMIZED TRUE +/** Behaviour of the main window on incoming calls */ #define __POPUP_WINDOW ( dbus_popup_mode() ) -// Messages ID for status bar +/** Messages ID for the status bar - Incoming calls */ #define __MSG_INCOMING_CALL 0 +/** Messages ID for the status bar - Calling */ #define __MSG_CALLING 1 +/** Messages ID for the status bar - Voice mails notification */ #define __MSG_VOICE_MAILS 2 +/** Messages ID for the status bar - Current account */ #define __MSG_ACCOUNT_DEFAULT 3 -// Desktop notifications +/** Desktop notifications - Time before to close the notification*/ #define __TIMEOUT_MODE "default" +/** Desktop notifications - Time before to close the notification*/ #define __TIMEOUT_TIME 30000 // 30 secondes #endif diff --git a/sflphone-gtk/src/sliders.c b/sflphone-gtk/src/sliders.c index bd5ab25b8bf2ef9becffcd24f5a8bc5c63eeef49..d68eb780d3a0cfecd9e2ef9e42dffa0c4a3ad0b8 100644 --- a/sflphone-gtk/src/sliders.c +++ b/sflphone-gtk/src/sliders.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/sliders.h b/sflphone-gtk/src/sliders.h index 5a6622a293d90f2e85740c7bdbbf7413c576f66e..1d4877018a9d889af1517a3af3e3a82d4754cf42 100644 --- a/sflphone-gtk/src/sliders.h +++ b/sflphone-gtk/src/sliders.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,10 +24,19 @@ /** @file sliders.h * @brief Volume sliders at the bottom of the main window. */ -GtkWidget * create_mic_slider(); +/** + * Build the sliders widget + * @param device Mic or speaker + * @return GtkWidget* The slider + */ GtkWidget * create_slider(const gchar * device); +/** + * Change the value of the specified device + * @param device Mic or speaker + * @param value The new value + */ void set_slider(const gchar * device, gdouble value); #endif diff --git a/sflphone-gtk/src/statusicon.c b/sflphone-gtk/src/statusicon.c index 01b1eb82776de16c5cbb97762508f600a1abae45..b43bfce38be898678b1624e251e791a544e009f9 100644 --- a/sflphone-gtk/src/statusicon.c +++ b/sflphone-gtk/src/statusicon.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/statusicon.h b/sflphone-gtk/src/statusicon.h index 2dc55b8db418085ba6a1769d9666c5fd78dd8625..da0c53426d197e2201f35ccb25add7cb39aaaaf3 100644 --- a/sflphone-gtk/src/statusicon.h +++ b/sflphone-gtk/src/statusicon.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,15 +24,46 @@ #include <gtk/gtk.h> #include <sflphone_const.h> -/** @file statusicon.h - * @brief The status icon. - */ +/** + * @file statusicon.h + * @brief The status icon in the system tray. + */ +/** + * Create the status icon + */ void show_status_icon(); + +/** + * Set the menu active + */ void status_icon_unminimize(); + +/** + * Tells if the main window if minimized or not + * @return gboolean TRUE if the main window is minimized + * FALSE otherwise + */ gboolean main_widget_minimized(); + +/** + * Change the menu status + * @param state TRUE if the main window is minimized + * FALSE otherwise + */ void set_minimized( gboolean state ); + +/** + * Make the system tray icon blink on incoming call + * @return active TRUE to make it blink + * FALSE to make it stop + */ void status_tray_icon_blink( gboolean active ); + +/** + * Accessor + * @return GtkStatusIcon* The status icon + */ GtkStatusIcon* get_status_icon( void ); #endif diff --git a/src/audio/audiolayer.h b/src/audio/audiolayer.h index 97b1ff83107a347edb9a9115fe5a3171aa240f02..18426aa57af21daf3008ee15b9f0bea541fdc8b6 100644 --- a/src/audio/audiolayer.h +++ b/src/audio/audiolayer.h @@ -48,7 +48,7 @@ class AudioLayer { AudioLayer(ManagerImpl* manager); ~AudioLayer(void); - /* + /** * Check if no devices are opened, otherwise close them. * Then open the specified devices by calling the private functions open_device * @param indexIn The number of the card choosen for capture @@ -63,49 +63,49 @@ class AudioLayer { */ bool openDevice(int, int, int, int, int, std::string); - /* + /** * Start the capture stream and prepare the playback stream. * The playback starts accordingly to its threshold * ALSA Library API */ void startStream(void); - /* + /** * Stop the playback and capture streams. * Drops the pending frames and put the capture and playback handles to PREPARED state * ALSA Library API */ void stopStream(void); - /* + /** * Check if the playback is running * @return true if the state of the playback handle equals SND_PCM_STATE_RUNNING * false otherwise */ bool isPlaybackActive( void ); - /* + /** * Check if the capture is running * @return true if the state of the capture handle equals SND_PCM_STATE_RUNNING * false otherwise */ bool isCaptureActive( void ); - /* + /** * Check if both capture and playback are running * @return true if capture and playback are running * false otherwise */ bool isStreamActive(void); - /* + /** * Check if both capture and playback are stopped * @return true if capture and playback are stopped * false otherwise */ bool isStreamStopped(void); - /* + /** * Send samples to the audio device. * @params buffer The buffer containing the data to be played ( voice and DTMF ) * @params toCopy The number of samples, in bytes @@ -113,7 +113,7 @@ class AudioLayer { */ int playSamples(void* buffer, int toCopy, bool isTalking); - /* + /** * Send a chunk of data to the hardware buffer to start the playback * Copy data in the urgent buffer. * @params buffer The buffer containing the data to be played ( ringtones ) @@ -122,13 +122,13 @@ class AudioLayer { */ int putUrgent(void* buffer, int toCopy); - /* + /** * Query the capture device for number of bytes available in the hardware ring buffer * @return int The number of bytes available */ int canGetMic(); - /* + /** * Get data from the capture device * @param buffer The buffer for data * @param toCopy The number of bytes to get @@ -136,7 +136,7 @@ class AudioLayer { */ int getMic(void * buffer, int toCopy); - /* + /** * Concatenate two strings. Used to build a valid pcm device name. * @param plugin the alsa PCM name * @param card the sound card number @@ -145,7 +145,7 @@ class AudioLayer { */ std::string buildDeviceTopo( std::string plugin, int card, int subdevice ); - /* + /** * Scan the sound card available on the system * @param flag To indicate whether we are looking for capture devices or playback devices * SFL_PCM_CAPTURE @@ -160,41 +160,41 @@ class AudioLayer { void setErrorMessage(const int& error) { _errorMessage = error; } int getErrorMessage() { return _errorMessage; } - /* + /** * Get the index of the audio card for capture * @return _indexIn The index of the card used for capture * 0 for the first available card on the system, 1 ... */ int getIndexIn() { return _indexIn; } - /* + /** * Get the index of the audio card for playback * @return _indexOut The index of the card used for playback * 0 for the first available card on the system, 1 ... */ int getIndexOut() { return _indexOut; } - /* + /** * Get the sample rate of the audio layer * @return unsigned int The sample rate * default: 44100 HZ */ unsigned int getSampleRate() { return _sampleRate; } - /* + /** * Get the frame size of the audio layer * @return unsigned int The frame size * default: 20 ms */ unsigned int getFrameSize() { return _frameSize; } - /* + /** * Get the current audio plugin. * @return std::string The name of the audio plugin */ std::string getAudioPlugin( void ) { return _audioPlugin; } std::ofstream _fstream; - /* + /** * Get the current state. Conversation or not * @return bool true if playSamples has been called * false otherwise @@ -211,36 +211,36 @@ class AudioLayer { private: - /* + /** * Drop the pending frames and close the capture device * ALSA Library API */ void closeCaptureStream( void ); - /* + /** * Drop the pending frames and close the playback device * ALSA Library API */ void closePlaybackStream( void ); - /* + /** * Fill the alsa internal ring buffer with chunks of data */ void fillHWBuffer( void) ; - /* + /** * Callback used for asynchronous playback. * Called when a certain amount of data is written ot the device */ static void AlsaCallBack( snd_async_handler_t* ); - /* + /** * Callback used for asynchronous playback. * Write tones buffer to the alsa internal ring buffer. */ void playTones( void ); - /* + /** * Open the specified device. * ALSA Library API * @param pcm_p The string name for the playback device @@ -254,7 +254,7 @@ class AudioLayer { */ bool open_device( std::string pcm_p, std::string pcm_c, int flag); - /* + /** * Copy a data buffer in the internal ring buffer * ALSA Library API * @param buffer The data to be copied @@ -263,7 +263,7 @@ class AudioLayer { */ int write( void* buffer, int length); - /* + /** * Read data from the internal ring buffer * ALSA Library API * @param buffer The buffer to stock the read data @@ -272,7 +272,7 @@ class AudioLayer { */ int read( void* buffer, int toCopy); - /* + /** * Recover from XRUN state for capture * ALSA Library API */ @@ -281,7 +281,7 @@ class AudioLayer { ManagerImpl* _manager; // augment coupling, reduce indirect access - /* + /** * Handles to manipulate capture and playback streams * ALSA Library API */ @@ -289,26 +289,26 @@ class AudioLayer { snd_pcm_t* _CaptureHandle; snd_pcm_uframes_t _periodSize; - /* + /** * Handle on asynchronous event */ snd_async_handler_t *_AsyncHandler; - /* + /** * Urgent ring buffer used for ringtones */ RingBuffer _urgentBuffer; void * adjustVolume( void * , int , int); - /* + /** * Determine if both endpoints hang up. * true if conversation is running * false otherwise */ bool _talk; - /* + /** * Enable to determine if the devices are opened or not * true if the devices are closed * false otherwise @@ -333,7 +333,7 @@ class AudioLayer { */ unsigned int _frameSize; - /* + /** * name of the alsa audio plugin used */ std::string _audioPlugin; diff --git a/src/audio/codecDescriptor.h b/src/audio/codecDescriptor.h index 8a8be6eddc3d3a5f86649ea4d9a020bfa81f5f24..fd5775fa8d52fb7392b60ca5753b4bfa2a9d009a 100644 --- a/src/audio/codecDescriptor.h +++ b/src/audio/codecDescriptor.h @@ -57,9 +57,9 @@ typedef enum { #include "codecs/audiocodec.h" -/* A codec is identified by its payload. A payload is associated with a name. */ +/** A codec is identified by its payload. A payload is associated with a name. */ typedef std::map<AudioCodecType, std::string> CodecMap; -/* The struct to reflect the order the user wants to use the codecs */ +/** The struct to reflect the order the user wants to use the codecs */ typedef std::vector<AudioCodecType> CodecOrder; typedef std::pair<AudioCodec* , void*> CodecHandlePointer; @@ -73,7 +73,7 @@ public: CodecDescriptor(); ~CodecDescriptor(); - /* + /** * Accessor to data structures */ CodecsMap& getCodecsMap() { return _CodecsMap; } @@ -87,7 +87,7 @@ public: */ std::string getCodecName(AudioCodecType payload); - /* + /** * Get the codec object associated with the payload * @param payload The payload looked for * @return AudioCodec* A pointer on a AudioCodec object @@ -148,7 +148,7 @@ public: */ int getSampleRate(AudioCodecType payload); - /* + /** * Get the number of channels * @param payload The payload of the codec * @return int Number of channels @@ -163,17 +163,17 @@ public: std::string getDescription( std::string ); - /* + /** * Get the number of codecs loaded in dynamic memory */ int getCodecsNumber( void ) { return _nbCodecs; } - /* + /** * Unreferences the codecs loaded in memory */ void deleteHandlePointer( void ); - /* + /** * Get the first element of the CodecsMap struct. * i.e the one with the lowest payload * @return AudioCodec The pointer on the codec object @@ -182,27 +182,27 @@ public: private: - /* + /** * Scan the installation directory ( --prefix configure option ) * And load the dynamic library * @return std::vector<AudioCodec*> The list of the codec object successfully loaded in memory */ std::vector<AudioCodec *> scanCodecDirectory( void ); - /* + /** * Load a codec * @param std::string The path of the shared ( dynamic ) library. * @return AudioCodec* the pointer of the object loaded. */ AudioCodec* loadCodec( std::string ); - /* + /** * Unload a codec * @param CodecHandlePointer The map containing the pointer on the object and the pointer on the handle function */ void unloadCodec( CodecHandlePointer ); - /* + /** * Check if the files found in searched directories seems valid * @param std::string The name of the file * @return true if the file name begins with libcodec_ and ends with .so @@ -210,7 +210,7 @@ private: */ bool seemsValid( std::string ); - /* + /** * Check if the codecs shared library has already been scanned during the session * Useful not to load twice the same codec saved in the different directory * @param std::string The complete name of the shared directory ( without the path ) @@ -219,7 +219,7 @@ private: */ bool alreadyInCache( std::string ); - /* + /** * Check if the audiocodec object has been successfully created * @param payload The payload of the codec * @return true if the audiocodec has been created @@ -227,27 +227,27 @@ private: */ bool isCodecLoaded( int payload ); - /* + /** * Map the payload of a codec and the object associated ( AudioCodec * ) */ CodecsMap _CodecsMap; - /* + /** * Vector containing the order of the codecs */ CodecOrder _codecOrder; - /* + /** * Vector containing the complete name of the codec shared library scanned */ std::vector<std::string> _Cache; - /* + /** * Number of codecs loaded */ int _nbCodecs; - /* + /** * Vector containing pairs * Pair between pointer on function handle and pointer on audiocodec object */ diff --git a/src/audio/codecs/audiocodec.h b/src/audio/codecs/audiocodec.h index 5604efe64ff94d204e8f159eeec43178a66aa7cb..378e52a5e757b353fd70d717b23fd26205055692 100644 --- a/src/audio/codecs/audiocodec.h +++ b/src/audio/codecs/audiocodec.h @@ -16,7 +16,9 @@ protected: /** Number of channel 1 = mono, 2 = stereo */ unsigned int _channel; + /** Bitrate */ double _bitrate; + /** Bandwidth */ double _bandwidth; private: @@ -38,9 +40,15 @@ public: virtual ~AudioCodec() { } /** + * Decode an input buffer and fill the output buffer with the decoded data * @return the number of bytes decoded */ virtual int codecDecode(short *, unsigned char *, unsigned int) = 0; + + /** + * Encode an input buffer and fill the output buffer with the encoded data + * @return the number of bytes encoded + */ virtual int codecEncode(unsigned char *, short *, unsigned int) = 0; diff --git a/src/call.h b/src/call.h index 0b3b7c9b5dbbdb8d771d85ef5bd1d1336348288c..fbac5779970d39c6347c85f38f0b639ab4c4fe84 100644 --- a/src/call.h +++ b/src/call.h @@ -20,17 +20,15 @@ #ifndef CALL_H #define CALL_H +/* @file call.h + * @brief A call is the base class for protocol-based calls + */ #include <string> #include <cc++/thread.h> // for mutex #include "audio/codecDescriptor.h" typedef std::string CallID; -/** - * A call is the base class for protocol-based calls - * - * @author Yan Morin <yan.morin@gmail.com> - */ class Call{ public: /** @@ -170,7 +168,6 @@ protected: CodecDescriptor _codecMap; /** Codec pointer */ - //AudioCodec* _audioCodec; AudioCodecType _audioCodec; bool _audioStarted; diff --git a/src/dbus/callmanager.cpp b/src/dbus/callmanager.cpp index 064f87f400cc2b4a1afcc8994a5e68f8c0ca0c1d..9152b558ab016533ec4238704ac299d2c4283325 100644 --- a/src/dbus/callmanager.cpp +++ b/src/dbus/callmanager.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/dbus/callmanager.h b/src/dbus/callmanager.h index ccabd95f6793236fddf7d5310edc81d49a2c76fd..ae74f857a356c507164d92a8529ddbbbcab60282 100644 --- a/src/dbus/callmanager.h +++ b/src/dbus/callmanager.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index 52da6fc0f55cf864810f215c627486c2e26bea30..c09f62858bfaad80885e50377406d90b64aeeb42 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com> * diff --git a/src/dbus/configurationmanager.h b/src/dbus/configurationmanager.h index 0ff6f162669696bc50064e3f9773c23e58a0bb56..f5979b1b86705d517c350594e03ae2be1e4e676d 100644 --- a/src/dbus/configurationmanager.h +++ b/src/dbus/configurationmanager.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com> diff --git a/src/dbus/dbusmanager.h b/src/dbus/dbusmanager.h index d1f4f411c4ca241695ef045efbd61fc84cf68d5a..e8beb6cebf623256d2a33ffaacf4539e0ea87be8 100644 --- a/src/dbus/dbusmanager.h +++ b/src/dbus/dbusmanager.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/dbusmanagerimpl.cpp b/src/dbus/dbusmanagerimpl.cpp index f829d89aca739d2b9f7a91dc67ad89207a682b4b..6972e8faa627070e320f3bfc4bec3e4b28dac55d 100644 --- a/src/dbus/dbusmanagerimpl.cpp +++ b/src/dbus/dbusmanagerimpl.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/dbusmanagerimpl.h b/src/dbus/dbusmanagerimpl.h index 37aa35e73b5fd4251e6117353dca02adfb7d8720..9addfeb32b7b2c9cb8d4f2766c33f5e2d8d292b9 100644 --- a/src/dbus/dbusmanagerimpl.h +++ b/src/dbus/dbusmanagerimpl.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/instance.cpp b/src/dbus/instance.cpp index c075cc04f8b3f4bc68cfdb975a2503fb16ec69b4..c573817129bb40d1e80f5caf3240c23911782ce7 100644 --- a/src/dbus/instance.cpp +++ b/src/dbus/instance.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/instance.h b/src/dbus/instance.h index 8339308f263a369c00d2d399c4f7e77b2d216930..d11ba3a045f385f52b21b28ad5b610a9ef6bd842 100644 --- a/src/dbus/instance.h +++ b/src/dbus/instance.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by