Commit 61ebefc1 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Add methods for audio settings on server side

parent aa6641cd
......@@ -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
-----
......
......@@ -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)
{
......
......@@ -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;
}
......@@ -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 */
......
......@@ -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();
......
......@@ -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>
......
......@@ -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();
}
......
......@@ -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( );
......
......@@ -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
*/
......
......@@ -286,6 +286,7 @@ public:
*/
std::vector< ::DBus::String > getDefaultCodecList( void );
std::vector< ::DBus::String> getSampleRateList( void );
/*
* Set an account as default
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment