diff --git a/doc/SFLvideo.txt b/doc/SFLvideo.txt index c2741788054e36509cb7ba28ce51a4ca3b8d1e28..90c38105e85d7f18141436a8138ea7f1aeed0823 100644 --- a/doc/SFLvideo.txt +++ b/doc/SFLvideo.txt @@ -3,9 +3,9 @@ Partnership ----------- -A working partnership between SavoirFaire-Linux and Polytechnic school of Montreal will begin in January 2008. +A partnership between Savoir-Faire Linux and the Polytechnic school of Montreal will begin in January 2008. -5 students of Polytechnic school will work part-time on the project. +Five students from Polytechnic school will be working part-time on the project for four months. Goals ----- diff --git a/sflphone-gtk/src/configurationmanager-glue.h b/sflphone-gtk/src/configurationmanager-glue.h index f4b3d0133ea07eec9b37b4433738c3f6ec7a451a..4769afbf9cf2c18fcb91a7a58f779772ee262dde 100644 --- a/sflphone-gtk/src/configurationmanager-glue.h +++ b/sflphone-gtk/src/configurationmanager-glue.h @@ -315,6 +315,44 @@ static inline #endif gboolean +org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list (DBusGProxy *proxy, char *** OUT_list, GError **error) + +{ + return dbus_g_proxy_call (proxy, "getDefaultCodecList", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_list, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply) (DBusGProxy *proxy, char * *OUT_list, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + char ** OUT_list; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_list, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply)data->cb) (proxy, OUT_list, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "getDefaultCodecList", org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async_callback, stuff, g_free, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean org_sflphone_SFLphone_ConfigurationManager_get_tone_locale_list (DBusGProxy *proxy, char *** OUT_list, GError **error) { diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index 53a335762034330d8055ef30cfe91e8766beab9c..b549e190f79fe0ceea40e23eaa7300e3ac0b098f 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -688,6 +688,33 @@ dbus_codec_list() return array; } +gchar ** +dbus_default_codec_list() +{ + g_print("Before"); + + GError *error = NULL; + char ** array; + org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list ( + configurationManagerProxy, + &array, + &error); + + g_print("After"); + if (error) + { + g_printerr ("Failed to call get_default_codec_list() on ConfigurationManager: %s\n", + error->message); + g_error_free (error); + } + else + { + g_print ("DBus called get_default_codec_list() on ConfigurationManager\n"); + + } + return array; +} + void dbus_set_prefered_codec(const gchar* codec) { @@ -711,6 +738,32 @@ dbus_set_prefered_codec(const gchar* codec) g_print ("DBus called set_prefered_codec() on ConfigurationManager\n"); } - +} + + +gchar** +dbus_get_sample_rate_list() +{ + g_print("Before"); + + gchar ** array; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list ( + configurationManagerProxy, + &array, + &error); + g_print("After"); + if (error) + { + g_printerr ("Failed to call get_sample_rate_list() on ConfigurationManager: %s\n", + error->message); + g_error_free (error); + } + else + { + g_print ("DBus called get_sample_rate_list() on ConfigurationManager\n"); + + } + return array; } diff --git a/sflphone-gtk/src/dbus.h b/sflphone-gtk/src/dbus.h index f71a3a40e1e9d3fb26a1acfecedf2d6fd7822c8d..e3f34e631b733c86d0e31b6280a94906e713fffb 100644 --- a/sflphone-gtk/src/dbus.h +++ b/sflphone-gtk/src/dbus.h @@ -54,6 +54,8 @@ void dbus_play_dtmf(const gchar * key); gchar* dbus_get_default_account(); void dbus_set_default_account(gchar * accountID); gchar** dbus_codec_list(); +gchar** dbus_default_codec_list(); +gchar** dbus_get_sample_rate_list(); /* Instance */ diff --git a/src/dbus/configurationmanager-glue.h b/src/dbus/configurationmanager-glue.h index 621f9593f2c692c909c73244adb12b8626bc94fb..3c6f92d5cd95d482b8fa5666e428d155bff3a85e 100644 --- a/src/dbus/configurationmanager-glue.h +++ b/src/dbus/configurationmanager-glue.h @@ -28,6 +28,7 @@ public: register_method(ConfigurationManager, getVersion, _getVersion_stub); register_method(ConfigurationManager, getRingtoneList, _getRingtoneList_stub); register_method(ConfigurationManager, getCodecList, _getCodecList_stub); + register_method(ConfigurationManager, getDefaultCodecList, _getDefaultCodecList_stub); register_method(ConfigurationManager, getToneLocaleList, _getToneLocaleList_stub); register_method(ConfigurationManager, setCodecPreferedOrder, _setCodecPreferedOrder_stub); register_method(ConfigurationManager, getCodecPreferedOrder, _getCodecPreferedOrder_stub); @@ -82,6 +83,11 @@ public: { "list", "as", false }, { 0, 0, 0 } }; + static ::DBus::IntrospectedArgument getDefaultCodecList_args[] = + { + { "list", "as", false }, + { 0, 0, 0 } + }; static ::DBus::IntrospectedArgument getToneLocaleList_args[] = { { "list", "as", false }, @@ -141,6 +147,7 @@ public: { "getVersion", getVersion_args }, { "getRingtoneList", getRingtoneList_args }, { "getCodecList", getCodecList_args }, + { "getDefaultCodecList", getDefaultCodecList_args }, { "getToneLocaleList", getToneLocaleList_args }, { "setCodecPreferedOrder", setCodecPreferedOrder_args }, { "getCodecPreferedOrder", getCodecPreferedOrder_args }, @@ -190,6 +197,7 @@ public: virtual ::DBus::String getVersion( ) = 0; virtual std::vector< ::DBus::String > getRingtoneList( ) = 0; virtual std::vector< ::DBus::String > getCodecList( ) = 0; + virtual std::vector< ::DBus::String > getDefaultCodecList( ) = 0; virtual std::vector< ::DBus::String > getToneLocaleList( ) = 0; virtual void setCodecPreferedOrder( const ::DBus::String& codec_name ) = 0; virtual ::DBus::String getCodecPreferedOrder( ) = 0; @@ -299,6 +307,16 @@ private: wi << argout1; return reply; } + ::DBus::Message _getDefaultCodecList_stub( const ::DBus::CallMessage& call ) + { + ::DBus::MessageIter ri = call.reader(); + + std::vector< ::DBus::String > argout1 = getDefaultCodecList(); + ::DBus::ReturnMessage reply(call); + ::DBus::MessageIter wi = reply.writer(); + wi << argout1; + return reply; + } ::DBus::Message _getToneLocaleList_stub( const ::DBus::CallMessage& call ) { ::DBus::MessageIter ri = call.reader(); diff --git a/src/dbus/configurationmanager-introspec.xml b/src/dbus/configurationmanager-introspec.xml index fd7c9171be3a667d523e4f0d765c20c4370a185c..4102085477b163979c2a3a215587bbce617c2906 100644 --- a/src/dbus/configurationmanager-introspec.xml +++ b/src/dbus/configurationmanager-introspec.xml @@ -36,6 +36,10 @@ <arg type="as" name="list" direction="out"/> </method> + <method name="getDefaultCodecList"> + <arg type="as" name="list" direction="out"/> + </method> + <method name="getToneLocaleList"> <arg type="as" name="list" direction="out"/> </method> diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index af0573ae1d3d201f84e4c6fbd1336cba5a14faee..f80991218770ba45edbf3055c803e237ffe0f341 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -101,9 +101,14 @@ ConfigurationManager::getCodecList( ) { _debug("ConfigurationManager::getCodecList received\n"); return Manager::instance().getCodecList(); - } + std::vector< ::DBus::String > +ConfigurationManager::getDefaultCodecList( ) +{ + _debug("ConfigurationManager::getDefaultCodecList received\n"); + return Manager::instance().getDefaultCodecList(); +} void ConfigurationManager::setCodecPreferedOrder( const ::DBus::String& codec_name ) @@ -140,6 +145,7 @@ ConfigurationManager::getRecordDeviceList( ) ConfigurationManager::getSampleRateList( ) { _debug("ConfigurationManager::getSampleRateList received\n"); + return Manager::instance().getSampleRateList(); } diff --git a/src/dbus/configurationmanager.h b/src/dbus/configurationmanager.h index 510ff52e585a6af51ce3650a810c11bdec2bf680..6b49c01390d4d739b157187d7abccd164f928442 100644 --- a/src/dbus/configurationmanager.h +++ b/src/dbus/configurationmanager.h @@ -46,6 +46,7 @@ public: ::DBus::String getVersion( ); std::vector< ::DBus::String > getRingtoneList( ); std::vector< ::DBus::String > getCodecList( ); + std::vector< ::DBus::String > getDefaultCodecList( ); std::vector< ::DBus::String > getToneLocaleList( ); void setCodecPreferedOrder( const ::DBus::String& codec_name ); ::DBus::String getCodecPreferedOrder( ); diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index f4188f6b9532832e355592b89cd00afe38de5ed0..ffed542c61d67487ec1a53ed6e67d5fb50261eb5 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -1149,6 +1149,17 @@ ManagerImpl::getCodecList( void ) return v; } + +std::vector< std::string > +ManagerImpl::getSampleRateList( void ) +{ + std::vector< std::string > v; + v.push_back(SAMPLE_RATE1); + v.push_back(SAMPLE_RATE2); + v.push_back(SAMPLE_RATE3); + return v; +} + /** * Initialization: Main Thread */ diff --git a/src/managerimpl.h b/src/managerimpl.h index 7c14f207001d4536938da58617451dee09ab8891..00acd9f9a4ad775e9824a83167a966e1d0cfb8df 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -286,6 +286,7 @@ public: */ std::vector< ::DBus::String > getDefaultCodecList( void ); + std::vector< ::DBus::String> getSampleRateList( void ); /* * Set an account as default diff --git a/src/user_cfg.h b/src/user_cfg.h index 2f757faa0311d02fcca1b4064c9306a0f950052b..497674b9140c5c448271dc10358c6075ad07ee3d 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -106,6 +106,9 @@ #define DFT_VOICEMAIL "888" #define DFT_FRAME_SIZE "20" #define DFT_SAMPLE_RATE "44100" +#define SAMPLE_RATE1 "44100" +#define SAMPLE_RATE2 "48000" +#define SAMPLE_RATE3 "96000" // zeroconfig default value #ifdef USE_ZEROCONF #define CONFIG_ZEROCONF_DEFAULT_STR "1"