diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 4be631e4cd3c7bfccef393bcda5f3cb90e5245ec..a38bdaa792b21e5d5f08b0b64e6d7dd5eaf192de 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1384,18 +1384,24 @@ void sflphone_fill_history (void) current_entry = (gchar *)*entries; - DEBUG("============================================ entry: %s", current_entry); + DEBUG("entry: %s", current_entry); + // Parsed a conference if(g_str_has_prefix(current_entry, "9999")) { // create a conference entry create_conference_history_entry_from_serialized(current_entry, &history_conf); + // verify if this conference have been already created yet conf = conferencelist_get(history, history_conf->_confID); if(conf == NULL) { + // if this conference haven't been created yet, add it to the conference list conferencelist_add(history, history_conf); } else { + // if this conference is already created since one of the participant have already + // been unserialized, update the recordfile value conf->_recordfile = g_strdup(history_conf->_recordfile); + DEBUG("----------------- add record file: %s", conf->_recordfile); } } else { diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 1ef277a1cadf87035fec33e510a8fbe6abec52e8..8186d00e9bc1df4faa3e618dff28fc21f244f9a1 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -79,9 +79,7 @@ static GtkWidget * voicemailToolbar; static GtkWidget * imToolbar; static GtkAction * imAction; static GtkWidget * playRecordWidget; -static GtkAction * playRecordAction; static GtkWidget * stopRecordWidget; -static GtkAction * stopRecordAction; static GtkWidget * editable_num; static GtkDialog * edit_dialog; @@ -101,7 +99,7 @@ update_actions() { DEBUG ("UIManager: Update action"); - + gtk_action_set_sensitive (GTK_ACTION (newCallAction), TRUE); gtk_action_set_sensitive (GTK_ACTION (pickUpAction), FALSE); gtk_action_set_sensitive (GTK_ACTION (hangUpAction), FALSE); @@ -157,6 +155,7 @@ update_actions() gtk_action_set_sensitive (GTK_ACTION (recordAction), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (recordWidget), FALSE); gtk_action_set_sensitive (GTK_ACTION (copyAction), FALSE); + if(abookfactory_is_addressbook_loaded()) { gtk_widget_set_sensitive (GTK_WIDGET (contactButton), FALSE); } @@ -269,10 +268,6 @@ update_actions() if (active_calltree == current_calls) gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - if (active_calltree == history) { - gtk_action_set_sensitive (GTK_ACTION(playRecordAction), TRUE); - gtk_action_set_sensitive (GTK_ACTION(stopRecordAction), TRUE); - } g_object_ref (newCallWidget); gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); @@ -282,10 +277,12 @@ update_actions() gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); else if(active_calltree == history) { if(selectedCall->_recordfile && (g_strcmp0(selectedCall->_recordfile, "") != 0)) { - if(selectedCall->_record_is_playing) + if(selectedCall->_record_is_playing) { gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(stopRecordWidget), 3); - else + } + else { gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(playRecordWidget), 3); + } } } break; @@ -744,11 +741,18 @@ start_playback_record_cb(void) return; } + if(selectedCall && selectedConf) { + ERROR("UIManager: Error: Two selected object in playback record callback"); + return; + } + if(selectedCall) { + DEBUG("UIManager: Start selected call file playback %s", selectedCall->_recordfile); result = dbus_start_recorded_file_playback(selectedCall->_recordfile); selectedCall->_record_is_playing = result; } else if(selectedConf) { + DEBUG("UIMAnager: Start selected conf file playback %s", selectedConf->_recordfile); result = dbus_start_recorded_file_playback(selectedConf->_recordfile); selectedConf->_record_is_playing = result; } @@ -775,11 +779,21 @@ stop_playback_record_cb(void) } if(selectedCall) { + if(selectedCall->_recordfile == NULL) { + ERROR("UIManager: Error: Record file is NULL"); + return; + } dbus_stop_recorded_file_playback(selectedCall->_recordfile); + DEBUG("UIManager: Stop selected call file playback %s", selectedCall->_recordfile); selectedCall->_record_is_playing = FALSE; } else if(selectedConf) { + if(selectedConf->_recordfile == NULL) { + ERROR("UIManager: Error: Record file is NULL"); + return; + } dbus_stop_recorded_file_playback(selectedConf->_recordfile); + DEBUG("UIMAnager: Start selected call file playback: %s", selectedConf->_recordfile); selectedConf->_record_is_playing = FALSE; } @@ -1808,12 +1822,8 @@ create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget) "/ToolbarActions/HistoryToolbar"); playRecordWidget = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions/StartPlaybackRecordToolbar"); - playRecordAction = gtk_ui_manager_get_action(ui_manager, - "/ToolbarActions/StartPlaybackRecord"); stopRecordWidget = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions/StopPlaybackRecordToolbar"); - stopRecordAction = gtk_ui_manager_get_action(ui_manager, - "/ToolbarActions/StopPlaybackRecord"); if(abookfactory_is_addressbook_loaded()) { contactButton = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/AddressbookToolbar"); } diff --git a/sflphone-common/src/Codec.h b/sflphone-common/src/Codec.h index b903443fe70e9f45d6fe640701b8cc7f8be90edd..5afd4047072119e8f23cbc1ad880da147ab75c96 100644 --- a/sflphone-common/src/Codec.h +++ b/sflphone-common/src/Codec.h @@ -32,15 +32,13 @@ #include "MimeParameters.h" // TODO Move to some higher directory -#include <tr1/memory> - #include <cc++/digest.h> /** * Interface for both audio codecs as well as video codecs. */ namespace sfl { -class Codec : public virtual MimeParameters +class Codec : public MimeParameters { public: Codec() {}; @@ -56,16 +54,6 @@ class Codec : public virtual MimeParameters */ virtual double getBandwidth() const = 0; - /** - * @return Additional information (description) about this codec. This is meant to be shown to the user. - */ - virtual std::string getDescription() const = 0; - - /** - * @return A copy of the current codec. - */ - virtual Codec* clone() const = 0; - /** * Build a unique hash code for identifying the codec uniquely. * Note that if multiple implementations of codec are provided, diff --git a/sflphone-common/src/MimeParameters.h b/sflphone-common/src/MimeParameters.h index 1dfc6541bbf468f6163bea078fc3381288541b96..9ce67d76d679f8924105aebeb83c72eae812ca6a 100644 --- a/sflphone-common/src/MimeParameters.h +++ b/sflphone-common/src/MimeParameters.h @@ -30,65 +30,6 @@ #ifndef __SFL_MIME_PARAMETERS_H__ #define __SFL_MIME_PARAMETERS_H__ -/** - * Start a new payload format definition. - */ -#define MIME_PAYLOAD_FORMAT_DEFINITION( mime, subtype, payloadType, clock ) \ - private: \ - uint8 payload; \ - public: \ - virtual ~MimeParameters##subtype() {}; \ - std::string getMimeType() const { \ - return std::string( mime ); \ - } \ - std::string getMimeSubtype() const { \ - return std::string( #subtype ); \ - } \ - uint8 getPayloadType() const { \ - return payload; \ - } \ - void setPayloadType(uint8 pt) { \ - payload = pt; \ - } \ - uint32 getClockRate() const { \ - return clock; \ - } \ - MimeParameters##subtype() : payload(payloadType) { - -/** - * An alias for MIME_PARAMETER_OPTIONAL - */ -#define MIME_PARAMETER(name, handler) \ - addOptionalParameter( name ); \ - addHandler( name, handler ); - -/** - * Defines an optional parameter. - */ -#define MIME_PARAMETER_OPTIONAL(name, handler) \ - addOptionalParameter( name ); \ - addHandler( name, handler ); - -/** - * Defines a required parameter. The value of this parameter - * should be obtained when sending the initial SDP offer. - */ -#define MIME_PARAMETER_REQUIRED(name, handler) \ - addRequiredParameter( name ); \ - addHandler( name, handler ); - -/** - * End a payload format definition. - */ -#define MIME_PAYLOAD_FORMAT_DEFINITION_END() \ - } - -#define MIME_PARAMETER_KEEP_IF_EQUAL MimeParameters::addParameterIfEqual - -#define MIME_PARAMETER_KEEP_MINIMUM MimeParameters::addParameterMinimum - -#define MIME_PARAMETER_KEEP_REMOTE MimeParameters::addParameterRemote - #include <cstddef> using std::ptrdiff_t; @@ -97,7 +38,7 @@ using std::ptrdiff_t; #include <stdexcept> #include <vector> #include <map> -#include <errno.h> +#include <cerrno> #include "global.h" #include "sip/Fmtp.h" @@ -156,14 +97,14 @@ class MimeParameters * @param name The name that identifies the MIME parameter. * @return The value that is set for this parameter. */ - virtual std::string getParameter (const std::string& name) = 0; + virtual std::string getParameter (const std::string& name) const = 0; /** * @return A string containing the codec specific parameters, formatted by default as : * "PARAM_LIST : PARAM_NAME = VALUE SEMI_COLON PARAM_LIST | PARAM_END * PARAM_END : empty" */ - virtual std::string getParametersFormatted() { + virtual std::string getParametersFormatted() const { // TODO Instead of putting everything into the same vector, // enforce the required vs optional aspect. Unfilled required params. should // result in exception throwing. diff --git a/sflphone-common/src/audio/codecs/alaw.cpp b/sflphone-common/src/audio/codecs/alaw.cpp index f6826269eb889e1eba80029390dc86f6ce329d3a..f0ea91819d73b6ab26405d0a4d52e438f130a761 100644 --- a/sflphone-common/src/audio/codecs/alaw.cpp +++ b/sflphone-common/src/audio/codecs/alaw.cpp @@ -129,21 +129,6 @@ class Alaw : public sfl::AudioCodec return a^0x55; // A-law has alternate bits inverted for transmission } - /** - * @Override - */ - std::string getDescription() const { - return "audio/PCMA 8000 (\"alaw\") codec."; - } - - /** - * @Override - */ - Alaw* clone() const { - return new Alaw (*this); - } - - }; // the class factories diff --git a/sflphone-common/src/audio/codecs/audiocodec.cpp b/sflphone-common/src/audio/codecs/audiocodec.cpp index df7a692419b025193a03bb9a5bf0c245d62dcd60..51b29648c13513a0060fca4b3ec14d3a90ea070f 100644 --- a/sflphone-common/src/audio/codecs/audiocodec.cpp +++ b/sflphone-common/src/audio/codecs/audiocodec.cpp @@ -83,7 +83,7 @@ uint8 AudioCodec::getPayloadType (void) const return _payload; } -bool AudioCodec::hasDynamicPayload (void) +bool AudioCodec::hasDynamicPayload (void) const { return _hasDynamicPayload; } diff --git a/sflphone-common/src/audio/codecs/audiocodec.h b/sflphone-common/src/audio/codecs/audiocodec.h index 20558f0527127525c1a223cfbc272eafa5052fb9..7f97f2e1deb3e83701ffa89a1ae0e930cf01fb53 100644 --- a/sflphone-common/src/audio/codecs/audiocodec.h +++ b/sflphone-common/src/audio/codecs/audiocodec.h @@ -75,7 +75,7 @@ class AudioCodec : public Codec /** * @Override */ - std::string getParameter (const std::string& name UNUSED) { + std::string getParameter (const std::string& name UNUSED) const { return ""; }; @@ -106,7 +106,7 @@ class AudioCodec : public Codec /** * @return true if this payload is a dynamic one. */ - bool hasDynamicPayload(); + bool hasDynamicPayload() const; /** * @Override @@ -133,11 +133,6 @@ class AudioCodec : public Codec */ unsigned int getFrameSize() const; - /** - * @Override - */ - virtual AudioCodec* clone() const = 0; - protected: /** Holds SDP-compliant codec name */ std::string _codecName; // what we put inside sdp diff --git a/sflphone-common/src/audio/codecs/audiocodecfactory.cpp b/sflphone-common/src/audio/codecs/audiocodecfactory.cpp index 2dc459c41f762db96482334321b302de0886d608..51d73e2cbc1db880f70df8f4b4d572a35570c550 100644 --- a/sflphone-common/src/audio/codecs/audiocodecfactory.cpp +++ b/sflphone-common/src/audio/codecs/audiocodecfactory.cpp @@ -211,7 +211,7 @@ std::vector<sfl::Codec*> AudioCodecFactory::scanCodecDirectory (void) while ( (dirStruct = readdir (dir))) { tmp = dirStruct -> d_name ; - if (tmp == CURRENT_DIR || tmp == PARENT_DIR) {} else { + if (tmp != CURRENT_DIR and tmp != PARENT_DIR) { if (seemsValid (tmp) && !alreadyInCache (tmp)) { _Cache.push_back (tmp); audioCodec = loadCodec (dirStr.append (tmp)); @@ -421,7 +421,3 @@ std::vector <std::string> AudioCodecFactory::getCodecSpecifications (const int32 return v; } - - - - diff --git a/sflphone-common/src/audio/codecs/celtcodec.cpp b/sflphone-common/src/audio/codecs/celtcodec.cpp index 4ce2b45f201b4934343d9b51d438e797fe5ab3a4..46517825b3cea00327eefe3bcbea585eb1ac88a9 100644 --- a/sflphone-common/src/audio/codecs/celtcodec.cpp +++ b/sflphone-common/src/audio/codecs/celtcodec.cpp @@ -149,21 +149,6 @@ class Celt : public sfl::AudioCodec return len; } - /** - * @Override - */ - std::string getDescription() const { - return "audio/celt 32000 (\"HD\") codec. Based on libcelt, by Jean-Marc Valin."; - } - - /** - * @Override - */ - Celt* clone() const { - return new Celt (*this); - } - - private: CELTMode *_mode; diff --git a/sflphone-common/src/audio/codecs/g722.cpp b/sflphone-common/src/audio/codecs/g722.cpp index 41ec89a9e101dd2ec3b6b7f45566947de22444e4..ec971f760962820d41db4e7caa66e59c90ea2251 100644 --- a/sflphone-common/src/audio/codecs/g722.cpp +++ b/sflphone-common/src/audio/codecs/g722.cpp @@ -821,22 +821,6 @@ class G722 : public sfl::AudioCodec return g722_bytes; } - - /** - * @Override - */ - std::string getDescription() const { - return "G722 codec. Most of the code comes from Steve Underwood (<steveu@coppice.org>) for the Asterisk project."; - } - - /** - * @Override - */ - G722* clone() const { - return new G722 (*this); - } - - private: g722_decode_state_t *decode_s; diff --git a/sflphone-common/src/audio/codecs/gsmcodec.cpp b/sflphone-common/src/audio/codecs/gsmcodec.cpp index 8be02bc61c5a520f0a639a6a218bdac96459af04..4896bf6dfe4db03c48cf9c9a61d5b9ee7ecbb726 100644 --- a/sflphone-common/src/audio/codecs/gsmcodec.cpp +++ b/sflphone-common/src/audio/codecs/gsmcodec.cpp @@ -86,21 +86,6 @@ class Gsm : public sfl::AudioCodec return 33; } - /** - * @Override - */ - std::string getDescription() const { - return "GSM codec. Based on libgsm, (C) Jutta Degener and Carsten Bormann, Technische Universitaet Berlin."; - } - - /** - * @Override - */ - Gsm* clone() const { - return new Gsm (*this); - } - - private: gsm _decode_gsmhandle; gsm _encode_gsmhandle; diff --git a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp index e0fcd2a8150eb8e9a18d4247dbaa91953ffd4aab..cce688407fa1d541699e310da889157ca2a33de3 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp @@ -114,21 +114,6 @@ class Speex : public sfl::AudioCodec return nbBytes; } - /** - * @Override - */ - std::string getDescription() const { - return "audio/speex 8000 (\"narrow band\") codec. Based on libspeex, by Jean-Marc Valin."; - } - - /** - * @Override - */ - Speex* clone() const { - return new Speex (*this); - } - - private: const SpeexMode* _speexModePtr; SpeexBits _speex_dec_bits; diff --git a/sflphone-common/src/audio/codecs/speexcodec_ub.cpp b/sflphone-common/src/audio/codecs/speexcodec_ub.cpp index 36a8cd1f42abd4c376f316bf588fa756459e0bc9..1ea2fc90c5a48f674f5ea6b8e7151da2e4451d41 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_ub.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_ub.cpp @@ -116,21 +116,6 @@ class Speex : public sfl::AudioCodec return nbBytes; } - /** - * @Override - */ - std::string getDescription() const { - return "audio/speex 32000 (\"ultra wide band\") codec. Based on libspeex, by Jean-Marc Valin."; - } - - /** - * @Override - */ - Speex* clone() const { - return new Speex (*this); - } - - private: const SpeexMode* _speexModePtr; SpeexBits _speex_dec_bits; diff --git a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp index e4fcd4146280b5b5037ddb6797ae1e7dd7e16c29..da5fc9849cd061293a7258caa7578dd16ce660b0 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp @@ -115,20 +115,6 @@ class Speex : public sfl::AudioCodec return nbBytes; } - /** - * @Override - */ - std::string getDescription() const { - return "audio/speex 16000 (\"wide band\") codec. Based on libspeex, by Jean-Marc Valin."; - } - - /** - * @Override - */ - Speex* clone() const { - return new Speex (*this); - } - private: const SpeexMode* _speexModePtr; SpeexBits _speex_dec_bits; diff --git a/sflphone-common/src/audio/codecs/ulaw.cpp b/sflphone-common/src/audio/codecs/ulaw.cpp index 56d65717425a1537dd281ad0cf9275ea05c2359d..4aff60fe8d3bed10feb1f92da60341fab6b404ff 100644 --- a/sflphone-common/src/audio/codecs/ulaw.cpp +++ b/sflphone-common/src/audio/codecs/ulaw.cpp @@ -123,21 +123,6 @@ class Ulaw : public sfl::AudioCodec return u; } - - /** - * @Override - */ - std::string getDescription() const { - return "audio/PCMU 8000 (\"ulaw\") codec."; - } - - /** - * @Override - */ - Ulaw* clone() const { - return new Ulaw (*this); - } - }; // the class factories