Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
122
Issues
122
List
Boards
Labels
Milestones
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
1d7d0580
Commit
1d7d0580
authored
Nov 05, 2008
by
Emmanuel Milou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ticket #113 - handle cases when pulseaudio is not running
parent
d2f9c009
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
13 deletions
+64
-13
autogen.sh
autogen.sh
+1
-2
sflphone-gtk/autogen.sh
sflphone-gtk/autogen.sh
+1
-1
sflphone-gtk/src/errors.c
sflphone-gtk/src/errors.c
+3
-0
sflphone-gtk/src/sflphone_const.h
sflphone-gtk/src/sflphone_const.h
+4
-0
src/global.h
src/global.h
+1
-0
src/managerimpl.cpp
src/managerimpl.cpp
+46
-10
src/managerimpl.h
src/managerimpl.h
+8
-0
No files found.
autogen.sh
View file @
1d7d0580
...
...
@@ -6,5 +6,4 @@ libtoolize --force
autoheader
autoconf
-f
automake
-a
echo
"
\n
Done! Now you can ./configure.
\n
"
./configure
$@
sflphone-gtk/autogen.sh
View file @
1d7d0580
...
...
@@ -6,6 +6,6 @@ libtoolize --force
autoheader
autoconf
-f
automake
-a
./configure
$@
echo
"
\n
Done! Now you can ./configure."
sflphone-gtk/src/errors.c
View file @
1d7d0580
...
...
@@ -30,6 +30,9 @@ sflphone_throw_exception( int err )
case
ALSA_CAPTURE_DEVICE
:
markup
=
g_markup_printf_escaped
(
_
(
"<b>ALSA notification</b>
\n\n
Error while opening capture device"
));
break
;
case
PULSEAUDIO_NOT_RUNNING
:
markup
=
g_markup_printf_escaped
(
_
(
"<b>Pulseaudio notification</b>
\n\n
Pulseaudio is not running"
));
break
;
}
main_window_error_message
(
markup
);
free
(
markup
);
...
...
sflphone-gtk/src/sflphone_const.h
View file @
1d7d0580
...
...
@@ -66,6 +66,10 @@
#define ALSA_CAPTURE_DEVICE 0x0001
/** Error while opening playback device */
#define ALSA_PLAYBACK_DEVICE 0x0010
/** Error pulseaudio */
#define PULSEAUDIO_NOT_RUNNING 0x0100
/** Tone to play when no voice mails */
#define TONE_WITHOUT_MESSAGE 0
...
...
src/global.h
View file @
1d7d0580
...
...
@@ -126,6 +126,7 @@ typedef short int16;
#define ALSA_CAPTURE_DEVICE 0x0001
/** Error while opening capture device */
#define ALSA_PLAYBACK_DEVICE 0x0010
/** Error while opening playback device */
#define NETWORK_UNREACHABLE 0x0011
/** Network unreachable */
#define PULSEAUDIO_NOT_RUNNING 0x0100
/** Pulseaudio is not running */
#define ALSA 0
#define PULSEAUDIO 1
...
...
src/managerimpl.cpp
View file @
1d7d0580
...
...
@@ -1522,11 +1522,27 @@ ManagerImpl::setPulseAppVolumeControl( void )
(
getConfigInt
(
PREFERENCES
,
CONFIG_PA_VOLUME_CTRL
)
==
1
)
?
setConfig
(
PREFERENCES
,
CONFIG_PA_VOLUME_CTRL
,
NO_STR
)
:
setConfig
(
PREFERENCES
,
CONFIG_PA_VOLUME_CTRL
,
YES_STR
)
;
}
void
ManagerImpl
::
setAudioManager
(
const
int32_t
&
api
)
void
ManagerImpl
::
setAudioManager
(
const
int32_t
&
api
)
{
setConfig
(
PREFERENCES
,
CONFIG_AUDIO
,
api
)
;
switchAudioManager
();
int
manager
;
manager
=
api
;
if
(
manager
==
PULSEAUDIO
)
{
if
(
app_is_running
(
"pulseaudio"
)
!=
0
)
{
// The pulseaudio daemon is not running
manager
=
ALSA
;
notifyErrClient
(
PULSEAUDIO_NOT_RUNNING
);
}
}
if
(
manager
==
api
)
{
// it means that we can change the audio manager
setConfig
(
PREFERENCES
,
CONFIG_AUDIO
,
api
)
;
switchAudioManager
();
}
}
int32_t
...
...
@@ -1571,6 +1587,14 @@ ManagerImpl::getCurrentAudioOutputPlugin( void )
return
_audiodriver
->
getAudioPlugin
();
}
int
ManagerImpl
::
app_is_running
(
std
::
string
process
)
{
std
::
ostringstream
cmd
;
cmd
<<
"ps -C "
<<
process
;
return
system
(
cmd
.
str
().
c_str
());
}
/**
* Initialization: Main Thread
...
...
@@ -1583,12 +1607,23 @@ ManagerImpl::initAudioDriver(void)
_debugInit
(
"AudioLayer Creation"
);
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
ALSA
)
_audiodriver
=
new
AlsaLayer
(
this
);
else
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
PULSEAUDIO
)
_audiodriver
=
new
PulseLayer
(
this
);
else
_debug
(
"Error - Audio API unknown
\n
"
);
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
ALSA
)
{
_audiodriver
=
new
AlsaLayer
(
this
);
}
else
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
PULSEAUDIO
)
{
if
(
app_is_running
(
"pulseaudio"
)
==
0
)
{
_audiodriver
=
new
PulseLayer
(
this
);
}
else
{
_audiodriver
=
new
AlsaLayer
(
this
);
setConfig
(
PREFERENCES
,
CONFIG_AUDIO
,
ALSA
);
}
}
else
_debug
(
"Error - Audio API unknown
\n
"
);
if
(
_audiodriver
==
0
)
{
_debug
(
"Init audio driver error
\n
"
);
...
...
@@ -1632,6 +1667,7 @@ ManagerImpl::selectAudioDriver (void)
setConfig
(
AUDIO
,
ALSA_CARD_ID_OUT
,
ALSA_DFT_CARD_ID
);
}
if
(
CHECK_INTERFACE
(
layer
,
ALSA
))
{
delete
_audiodriver
;
...
...
src/managerimpl.h
View file @
1d7d0580
...
...
@@ -829,6 +829,14 @@ class ManagerImpl {
private:
/**
* Check if a process is running with the system command
*
* @return 0 on success
* 1 otherelse
*/
int
app_is_running
(
std
::
string
process
);
/**
* Create .PROGNAME directory in home user and create
* configuration tree from the settings file if this file exists.
...
...
Write
Preview
Markdown
is supported
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