Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
cf652d4a
Commit
cf652d4a
authored
Feb 10, 2009
by
alexandresavard
Browse files
Set / get recording path, still need some GTK for client
parent
753e316d
Changes
10
Show whitespace changes
Inline
Side-by-side
sflphone-gtk/src/configurationmanager-glue.h
View file @
cf652d4a
...
...
@@ -615,6 +615,44 @@ static
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_record_path
(
DBusGProxy
*
proxy
,
char
**
OUT_rec
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getRecordPath"
,
error
,
G_TYPE_INVALID
,
G_TYPE_STRING
,
OUT_rec
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_record_path_reply
)
(
DBusGProxy
*
proxy
,
char
*
OUT_rec
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_record_path_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
*
OUT_rec
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRING
,
&
OUT_rec
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_record_path_reply
)
data
->
cb
)
(
proxy
,
OUT_rec
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_record_path_async
(
DBusGProxy
*
proxy
,
org_sflphone_SFLphone_ConfigurationManager_get_record_path_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
,
"getRecordPath"
,
org_sflphone_SFLphone_ConfigurationManager_get_record_path_async_callback
,
stuff
,
g_free
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager
(
DBusGProxy
*
proxy
,
const
gint
IN_api
,
GError
**
error
)
{
...
...
@@ -652,6 +690,43 @@ static
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_record_path
(
DBusGProxy
*
proxy
,
const
char
*
IN_rec
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"setRecordPath"
,
error
,
G_TYPE_STRING
,
IN_rec
,
G_TYPE_INVALID
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_set_record_path_reply
)
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_set_record_path_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_set_record_path_reply
)
data
->
cb
)
(
proxy
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_set_record_path_async
(
DBusGProxy
*
proxy
,
const
char
*
IN_rec
,
org_sflphone_SFLphone_ConfigurationManager_set_record_path_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
,
"setRecordPath"
,
org_sflphone_SFLphone_ConfigurationManager_set_record_path_async_callback
,
stuff
,
g_free
,
G_TYPE_STRING
,
IN_rec
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_codec_list
(
DBusGProxy
*
proxy
,
char
***
OUT_list
,
GError
**
error
)
{
...
...
sflphone-gtk/src/configwindow.c
View file @
cf652d4a
...
...
@@ -673,6 +673,67 @@ create_general_settings ()
}
void
record_path_changed
(
GtkFileChooser
*
chooser
,
GtkLabel
*
label
UNUSED
)
{
// gchar* tone = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser ));
// dbus_set_ringtone_choice( tone );
}
GtkWidget
*
create_recording_settings
()
{
int
curPort
;
int
n
;
gchar
*
defaultSavePath
=
"/home/alexandresavard/"
;
GtkWidget
*
ret
;
GtkWidget
*
label
;
GtkWidget
*
table
;
GtkWidget
*
savePathFrame
;
GtkWidget
*
savePathText
;
GtkWidget
*
folderChooser
;
// Main widget
ret
=
gtk_vbox_new
(
FALSE
,
10
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
ret
),
10
);
// Recorded file saving path
savePathFrame
=
gtk_frame_new
(
_
(
"Recorded File Saving Path"
));
gtk_box_pack_start
(
GTK_BOX
(
ret
),
savePathFrame
,
FALSE
,
FALSE
,
0
);
gtk_widget_show
(
savePathFrame
);
table
=
gtk_table_new
(
1
,
2
,
FALSE
);
gtk_table_set_row_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_table_set_col_spacings
(
GTK_TABLE
(
table
),
10
);
gtk_widget_show
(
table
);
gtk_container_add
(
GTK_CONTAINER
(
savePathFrame
),
table
);
// label
label
=
gtk_label_new_with_mnemonic
(
_
(
"_Save Path"
));
gtk_table_attach
(
GTK_TABLE
(
table
),
label
,
0
,
1
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
gtk_misc_set_alignment
(
GTK_MISC
(
label
),
0
,
0
.
5
);
savePathText
=
gtk_entry_new
();
gtk_label_set_mnemonic_idget
(
GTK_LABEL
(
label
),
savePathText
);
gtk_entry_set_text
(
GTK_ENTRY
(
savePathText
),
defaultSavePath
);
gtk_table_attach
(
GTK_TABLE
(
table
),
savePathText
,
1
,
2
,
3
,
4
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
0
,
0
);
// folder chooser button
folderChooser
=
gtk_file_chooser_button_new
(
_
(
"Choose a path"
),
GTK_FILE_CHOOSER_ACTION_OPEN
);
gtk_file_chooser_set_current_folder
(
GTK_FILE_CHOOSER
(
folderChooser
)
,
g_get_home_dir
());
g_signal_connect
(
G_OBJECT
(
folderChooser
)
,
"recordPath_changed"
,
G_CALLBACK
(
record_path_changed
)
,
NULL
);
gtk_box_pack_start
(
GTK_BOX
(
ret
)
,
folderChooser
,
TRUE
,
TRUE
,
1
);
// gtk_container_add(GTK_CONTAINER(savePathFrame), folder);
gtk_widget_show_all
(
ret
);
return
ret
;
}
/**
* Show configuration window with tabs
*/
...
...
@@ -713,6 +774,11 @@ show_config_window ()
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
notebook
),
tab
,
gtk_label_new
(
_
(
"Audio Settings"
)));
gtk_notebook_page_num
(
GTK_NOTEBOOK
(
notebook
),
tab
);
// Recording tab
tab
=
create_recording_settings
();
gtk_notebook_append_page
(
GTK_NOTEBOOK
(
notebook
),
tab
,
gtk_label_new
(
_
(
"Recording Settings"
)));
gtk_notebook_page_num
(
GTK_NOTEBOOK
(
notebook
),
tab
);
gtk_notebook_set_current_page
(
GTK_NOTEBOOK
(
notebook
)
,
1
);
gtk_dialog_run
(
dialog
);
...
...
sflphone-gtk/src/configwindow.h
View file @
cf652d4a
...
...
@@ -99,6 +99,11 @@ GtkWidget * create_accounts_tab();
*/
GtkWidget
*
create_audio_tab
();
/**
* Create the recording configuration tab and add it to the main configuration window
*/
GtkWidget
*
create_recording_settings
();
/**
* Display the main configuration window
*/
...
...
src/dbus/configurationmanager-glue.h
View file @
cf652d4a
...
...
@@ -36,7 +36,9 @@ public:
register_method
(
ConfigurationManager_adaptor
,
getRingtoneChoice
,
_getRingtoneChoice_stub
);
register_method
(
ConfigurationManager_adaptor
,
setRingtoneChoice
,
_setRingtoneChoice_stub
);
register_method
(
ConfigurationManager_adaptor
,
getAudioManager
,
_getAudioManager_stub
);
register_method
(
ConfigurationManager_adaptor
,
getRecordPath
,
_getRecordPath_stub
);
register_method
(
ConfigurationManager_adaptor
,
setAudioManager
,
_setAudioManager_stub
);
register_method
(
ConfigurationManager_adaptor
,
setRecordPath
,
_setRecordPath_stub
);
register_method
(
ConfigurationManager_adaptor
,
getCodecList
,
_getCodecList_stub
);
register_method
(
ConfigurationManager_adaptor
,
getCodecDetails
,
_getCodecDetails_stub
);
register_method
(
ConfigurationManager_adaptor
,
getActiveCodecList
,
_getActiveCodecList_stub
);
...
...
@@ -163,11 +165,21 @@ public:
{
"api"
,
"i"
,
false
},
{
0
,
0
,
0
}
};
static
::
DBus
::
IntrospectedArgument
getRecordPath_args
[]
=
{
{
"rec"
,
"s"
,
false
},
{
0
,
0
,
0
}
};
static
::
DBus
::
IntrospectedArgument
setAudioManager_args
[]
=
{
{
"api"
,
"i"
,
true
},
{
0
,
0
,
0
}
};
static
::
DBus
::
IntrospectedArgument
setRecordPath_args
[]
=
{
{
"rec"
,
"s"
,
true
},
{
0
,
0
,
0
}
};
static
::
DBus
::
IntrospectedArgument
getCodecList_args
[]
=
{
{
"list"
,
"as"
,
false
},
...
...
@@ -393,7 +405,9 @@ public:
{
"getRingtoneChoice"
,
getRingtoneChoice_args
},
{
"setRingtoneChoice"
,
setRingtoneChoice_args
},
{
"getAudioManager"
,
getAudioManager_args
},
{
"getRecordPath"
,
getRecordPath_args
},
{
"setAudioManager"
,
setAudioManager_args
},
{
"setRecordPath"
,
setRecordPath_args
},
{
"getCodecList"
,
getCodecList_args
},
{
"getCodecDetails"
,
getCodecDetails_args
},
{
"getActiveCodecList"
,
getActiveCodecList_args
},
...
...
@@ -484,7 +498,9 @@ public:
virtual
std
::
string
getRingtoneChoice
()
=
0
;
virtual
void
setRingtoneChoice
(
const
std
::
string
&
tone
)
=
0
;
virtual
int32_t
getAudioManager
()
=
0
;
virtual
std
::
string
getRecordPath
()
=
0
;
virtual
void
setAudioManager
(
const
int32_t
&
api
)
=
0
;
virtual
void
setRecordPath
(
const
std
::
string
&
rec
)
=
0
;
virtual
std
::
vector
<
std
::
string
>
getCodecList
()
=
0
;
virtual
std
::
vector
<
std
::
string
>
getCodecDetails
(
const
int32_t
&
payload
)
=
0
;
virtual
std
::
vector
<
std
::
string
>
getActiveCodecList
()
=
0
;
...
...
@@ -710,6 +726,16 @@ private:
wi
<<
argout1
;
return
reply
;
}
::
DBus
::
Message
_getRecordPath_stub
(
const
::
DBus
::
CallMessage
&
call
)
{
::
DBus
::
MessageIter
ri
=
call
.
reader
();
std
::
string
argout1
=
getRecordPath
();
::
DBus
::
ReturnMessage
reply
(
call
);
::
DBus
::
MessageIter
wi
=
reply
.
writer
();
wi
<<
argout1
;
return
reply
;
}
::
DBus
::
Message
_setAudioManager_stub
(
const
::
DBus
::
CallMessage
&
call
)
{
::
DBus
::
MessageIter
ri
=
call
.
reader
();
...
...
@@ -719,6 +745,15 @@ private:
::
DBus
::
ReturnMessage
reply
(
call
);
return
reply
;
}
::
DBus
::
Message
_setRecordPath_stub
(
const
::
DBus
::
CallMessage
&
call
)
{
::
DBus
::
MessageIter
ri
=
call
.
reader
();
std
::
string
argin1
;
ri
>>
argin1
;
setRecordPath
(
argin1
);
::
DBus
::
ReturnMessage
reply
(
call
);
return
reply
;
}
::
DBus
::
Message
_getCodecList_stub
(
const
::
DBus
::
CallMessage
&
call
)
{
::
DBus
::
MessageIter
ri
=
call
.
reader
();
...
...
src/dbus/configurationmanager-introspec.xml
View file @
cf652d4a
...
...
@@ -73,10 +73,19 @@
<arg
type=
"i"
name=
"api"
direction=
"out"
/>
</method>
<method
name=
"getRecordPath"
>
<arg
type=
"s"
name=
"rec"
direction=
"out"
/>
</method>
<method
name=
"setAudioManager"
>
<arg
type=
"i"
name=
"api"
direction=
"in"
/>
</method>
<method
name=
"setRecordPath"
>
<arg
type=
"s"
name=
"rec"
direction=
"in"
/>
</method>
<!-- /////////////////////// -->
<!-- Codecs-related methods -->
...
...
src/dbus/configurationmanager.cpp
View file @
cf652d4a
...
...
@@ -256,6 +256,18 @@ ConfigurationManager::setRingtoneChoice( const std::string& tone )
Manager
::
instance
().
setRingtoneChoice
(
tone
);
}
std
::
string
ConfigurationManager
::
getRecordPath
(
void
)
{
return
Manager
::
instance
().
getRecordPath
(
);
}
void
ConfigurationManager
::
setRecordPath
(
const
std
::
string
&
recPath
)
{
Manager
::
instance
().
setRecordPath
(
recPath
);
}
int32_t
ConfigurationManager
::
getDialpad
(
void
)
{
...
...
src/dbus/configurationmanager.h
View file @
cf652d4a
...
...
@@ -77,6 +77,8 @@ public:
void
ringtoneEnabled
(
void
);
std
::
string
getRingtoneChoice
(
void
);
void
setRingtoneChoice
(
const
std
::
string
&
tone
);
std
::
string
getRecordPath
(
void
);
void
setRecordPath
(
const
std
::
string
&
recPath
);
int32_t
getDialpad
(
void
);
void
setDialpad
(
void
);
int32_t
getSearchbar
(
void
);
...
...
src/managerimpl.cpp
View file @
cf652d4a
...
...
@@ -1401,6 +1401,18 @@ ManagerImpl::setRingtoneChoice( const std::string& tone )
setConfig
(
AUDIO
,
RING_CHOICE
,
tone
);
}
std
::
string
ManagerImpl
::
getRecordPath
(
void
)
{
return
getConfigString
(
AUDIO
,
RECORD_PATH
);
}
void
ManagerImpl
::
setRecordPath
(
const
std
::
string
&
recPath
)
{
setConfig
(
AUDIO
,
RECORD_PATH
,
recPath
);
}
int
ManagerImpl
::
getDialpad
(
void
)
{
...
...
src/managerimpl.h
View file @
cf652d4a
...
...
@@ -433,6 +433,18 @@ class ManagerImpl {
*/
void
setRingtoneChoice
(
const
std
::
string
&
);
/**
* Get the recording path from configuration tree
* @return the string correspoding to the path
*/
std
::
string
getRecordPath
(
void
);
/**
* Set the recoding path in the configuration tree
* @param a string reresenting the path
*/
std
::
string
setRecordingPath
(
const
std
::
string
);
/**
* Tells if the user wants to display the dialpad or not
* @return int 1 if dialpad has to be displayed
...
...
src/user_cfg.h
View file @
cf652d4a
...
...
@@ -43,6 +43,7 @@
#define RING_CHOICE "Rings.ringChoice"
/** Ringtone */
#define VOLUME_SPKR "Volume.speakers"
/** Speaker volume */
#define VOLUME_MICRO "Volume.micro"
/** Mic volume */
#define RECORD_PATH "Record.path
/** Recording path */
#define VIDEO "Video"
/** Section Video */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment