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
c813022b
Commit
c813022b
authored
Aug 16, 2010
by
Alexandre Savard
Browse files
[#3757] Dynamic allocation of AudioFile (RawFile)
parent
8b457045
Changes
2
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/managerimpl.cpp
View file @
c813022b
...
...
@@ -79,7 +79,7 @@ ManagerImpl::ManagerImpl (void) :
_hasTriedToRegister
(
false
),
_config
(),
_currentCallId2
(),
_currentCallMutex
(),
_codecBuilder
(
NULL
),
_audiodriver
(
NULL
),
_dtmfKey
(
NULL
),
_codecDescriptorMap
(),
_toneMutex
(),
_telephoneTone
(
NULL
),
_audiofile
(),
_spkr_volume
(
0
),
_telephoneTone
(
NULL
),
_audiofile
(
NULL
),
_spkr_volume
(
0
),
_mic_volume
(
0
),
_mutex
(),
_dbus
(
NULL
),
_waitingCall
(),
_waitingCallMutex
(),
_nbIncomingWaitingCall
(
0
),
_path
(
""
),
_exist
(
0
),
_setupLoaded
(
false
),
_callAccountMap
(),
...
...
@@ -1925,7 +1925,9 @@ void ManagerImpl::stopTone ()
_telephoneTone
->
setCurrentTone
(
Tone
::
TONE_NULL
);
}
_audiofile
.
stop
();
if
(
_audiofile
)
_audiofile
.
stop
();
_toneMutex
.
leaveMutex
();
}
...
...
@@ -2006,14 +2008,17 @@ void ManagerImpl::ringtone (const AccountID& accountID)
}
layer
=
audiolayer
->
getLayerType
();
samplerate
=
audiolayer
->
getSampleRate
();
codecForTone
=
_codecDescriptorMap
.
getFirstCodecAvailable
();
_audiofile
=
new
RawFile
();
_toneMutex
.
enterMutex
();
loadFile
=
_audiofile
.
loadFile
(
ringchoice
,
codecForTone
,
samplerate
);
loadFile
=
false
;
if
(
_audiofile
)
loadFile
=
_audiofile
->
loadFile
(
ringchoice
,
codecForTone
,
samplerate
);
_toneMutex
.
leaveMutex
();
...
...
@@ -2053,10 +2058,13 @@ ManagerImpl::getTelephoneFile ()
// _debug("ManagerImpl::getTelephoneFile()");
ost
::
MutexLock
m
(
_toneMutex
);
if
(
_audiofile
.
isStarted
())
{
return
&
_audiofile
;
if
(
!
_audiofile
)
return
NULL
;
if
(
_audiofile
->
isStarted
())
{
return
_audiofile
;
}
else
{
return
0
;
return
NULL
;
}
}
...
...
sflphone-common/src/managerimpl.h
View file @
c813022b
...
...
@@ -50,7 +50,7 @@
#include
"numbercleaner.h"
#include
"audio/sound/tonelist.h"
// for Tone::TONEID declaration
#include
"audio/sound/audiofile.h"
// AudioFile class contained by value here
#include
"audio/sound/audiofile.h"
#include
"audio/sound/dtmf.h"
// DTMF class contained by value here
#include
"audio/codecs/codecDescriptor.h"
// CodecDescriptor class contained by value here
...
...
@@ -1188,7 +1188,7 @@ class ManagerImpl
/////////////////////
ost
::
Mutex
_toneMutex
;
TelephoneTone
*
_telephoneTone
;
AudioFile
_audiofile
;
AudioFile
*
_audiofile
;
// To handle volume control
short
_spkr_volume
;
...
...
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