Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
fa162699
Commit
fa162699
authored
May 11, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app): coding style
parent
054f3907
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
70 deletions
+83
-70
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+55
-48
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+2
-0
CallsListModel.cpp
linphone-desktop/src/components/calls/CallsListModel.cpp
+24
-22
CallsListModel.hpp
linphone-desktop/src/components/calls/CallsListModel.hpp
+2
-0
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
fa162699
...
...
@@ -59,54 +59,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
QObject
::
connect
(
CoreManager
::
getInstance
()
->
getHandlers
().
get
(),
&
CoreHandlers
::
callStateChanged
,
this
,
[
this
](
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
if
(
call
!=
mCall
)
return
;
switch
(
state
)
{
case
linphone
:
:
CallStateError
:
setReason
(
call
->
getReason
());
case
linphone
:
:
CallStateEnd
:
stopAutoAnswerTimer
();
mPausedByRemote
=
false
;
break
;
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateRefered
:
case
linphone
:
:
CallStateReleased
:
case
linphone
:
:
CallStateStreamsRunning
:
mPausedByRemote
=
false
;
break
;
case
linphone
:
:
CallStatePausedByRemote
:
mPausedByRemote
=
true
;
break
;
case
linphone
:
:
CallStatePausing
:
mPausedByUser
=
true
;
break
;
case
linphone
:
:
CallStateResuming
:
mPausedByUser
=
false
;
break
;
case
linphone
:
:
CallStateUpdatedByRemote
:
if
(
!
mCall
->
getCurrentParams
()
->
videoEnabled
()
&&
mCall
->
getRemoteParams
()
->
videoEnabled
()
)
{
mCall
->
deferUpdate
();
emit
videoRequested
();
}
break
;
default:
break
;
}
emit
statusChanged
(
getStatus
());
}
this
,
&
CallModel
::
handleCallStateChanged
);
}
...
...
@@ -235,6 +188,57 @@ void CallModel::stopRecording () {
// -----------------------------------------------------------------------------
void
CallModel
::
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
if
(
call
!=
mCall
)
return
;
switch
(
state
)
{
case
linphone
:
:
CallStateError
:
setReason
(
call
->
getReason
());
case
linphone
:
:
CallStateEnd
:
stopAutoAnswerTimer
();
mPausedByRemote
=
false
;
break
;
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateRefered
:
case
linphone
:
:
CallStateReleased
:
case
linphone
:
:
CallStateStreamsRunning
:
mPausedByRemote
=
false
;
break
;
case
linphone
:
:
CallStatePausedByRemote
:
mPausedByRemote
=
true
;
break
;
case
linphone
:
:
CallStatePausing
:
mPausedByUser
=
true
;
break
;
case
linphone
:
:
CallStateResuming
:
mPausedByUser
=
false
;
break
;
case
linphone
:
:
CallStateUpdatedByRemote
:
if
(
!
mCall
->
getCurrentParams
()
->
videoEnabled
()
&&
mCall
->
getRemoteParams
()
->
videoEnabled
()
)
{
mCall
->
deferUpdate
();
emit
videoRequested
();
}
break
;
default:
break
;
}
emit
statusChanged
(
getStatus
());
}
// -----------------------------------------------------------------------------
void
CallModel
::
stopAutoAnswerTimer
()
const
{
QTimer
*
timer
=
findChild
<
QTimer
*>
(
AUTO_ANSWER_OBJECT_NAME
,
Qt
::
FindDirectChildrenOnly
);
if
(
timer
)
{
...
...
@@ -333,6 +337,9 @@ inline float computeVu (float volume) {
return
(
volume
-
VU_MIN
)
/
(
VU_MAX
-
VU_MIN
);
}
#undef VU_MIN
#undef VU_MAX
float
CallModel
::
getMicroVu
()
const
{
return
computeVu
(
mCall
->
getRecordVolume
());
}
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
fa162699
...
...
@@ -98,6 +98,8 @@ signals:
void
statsUpdated
();
private:
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
stopAutoAnswerTimer
()
const
;
QString
getSipAddress
()
const
;
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
fa162699
...
...
@@ -53,28 +53,7 @@ CallsListModel::CallsListModel (QObject *parent) : QAbstractListModel(parent) {
mCoreHandlers
=
CoreManager
::
getInstance
()
->
getHandlers
();
QObject
::
connect
(
mCoreHandlers
.
get
(),
&
CoreHandlers
::
callStateChanged
,
this
,
[
this
](
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
switch
(
state
)
{
case
linphone
:
:
CallStateIncomingReceived
:
case
linphone
:
:
CallStateOutgoingInit
:
addCall
(
call
);
break
;
case
linphone
:
:
CallStateEnd
:
case
linphone
:
:
CallStateError
:
removeCall
(
call
);
break
;
case
linphone
:
:
CallStateStreamsRunning
:
{
int
index
=
static_cast
<
int
>
(
distance
(
mList
.
begin
(),
findCallModel
(
mList
,
call
)));
emit
callRunning
(
index
,
&
call
->
getData
<
CallModel
>
(
"call-model"
));
}
break
;
default:
break
;
}
}
this
,
&
CallsListModel
::
handleCallStateChanged
);
}
...
...
@@ -148,6 +127,29 @@ void CallsListModel::terminateAllCalls () const {
// -----------------------------------------------------------------------------
void
CallsListModel
::
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
switch
(
state
)
{
case
linphone
:
:
CallStateIncomingReceived
:
case
linphone
:
:
CallStateOutgoingInit
:
addCall
(
call
);
break
;
case
linphone
:
:
CallStateEnd
:
case
linphone
:
:
CallStateError
:
removeCall
(
call
);
break
;
case
linphone
:
:
CallStateStreamsRunning
:
{
int
index
=
static_cast
<
int
>
(
distance
(
mList
.
begin
(),
findCallModel
(
mList
,
call
)));
emit
callRunning
(
index
,
&
call
->
getData
<
CallModel
>
(
"call-model"
));
}
break
;
default:
break
;
}
}
bool
CallsListModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
return
removeRows
(
row
,
1
,
parent
);
}
...
...
linphone-desktop/src/components/calls/CallsListModel.hpp
View file @
fa162699
...
...
@@ -59,6 +59,8 @@ private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
addCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
removeCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
...
...
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