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
af60c28e
Commit
af60c28e
authored
Jan 20, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): calls in progress
parent
2d4e1d9f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
7 deletions
+71
-7
CallModel.cpp
tests/src/components/call/CallModel.cpp
+52
-2
CallModel.hpp
tests/src/components/call/CallModel.hpp
+11
-3
CoreManager.hpp
tests/src/components/core/CoreManager.hpp
+2
-2
Calls.qml
tests/ui/modules/Linphone/Calls/Calls.qml
+6
-0
No files found.
tests/src/components/call/CallModel.cpp
View file @
af60c28e
...
@@ -7,6 +7,36 @@
...
@@ -7,6 +7,36 @@
CallModel
::
CallModel
(
shared_ptr
<
linphone
::
Call
>
linphone_call
)
{
CallModel
::
CallModel
(
shared_ptr
<
linphone
::
Call
>
linphone_call
)
{
m_linphone_call
=
linphone_call
;
m_linphone_call
=
linphone_call
;
QObject
::
connect
(
&
(
*
CoreManager
::
getInstance
()
->
getHandlers
()),
&
CoreHandlers
::
callStateChanged
,
this
,
[
this
](
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
if
(
call
!=
m_linphone_call
)
return
;
switch
(
state
)
{
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateEnd
:
case
linphone
:
:
CallStateError
:
case
linphone
:
:
CallStatePaused
:
case
linphone
:
:
CallStateRefered
:
case
linphone
:
:
CallStateReleased
:
case
linphone
:
:
CallStateStreamsRunning
:
m_linphone_call_status
=
state
;
break
;
case
linphone
:
:
CallStatePausedByRemote
:
if
(
m_linphone_call_status
!=
linphone
::
CallStatePaused
)
m_linphone_call_status
=
state
;
break
;
default:
break
;
}
emit
statusChanged
(
getStatus
());
}
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -19,6 +49,10 @@ void CallModel::terminateCall () {
...
@@ -19,6 +49,10 @@ void CallModel::terminateCall () {
CoreManager
::
getInstance
()
->
getCore
()
->
terminateCall
(
m_linphone_call
);
CoreManager
::
getInstance
()
->
getCore
()
->
terminateCall
(
m_linphone_call
);
}
}
void
CallModel
::
transferCall
()
{
// TODO
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
CallModel
::
getSipAddress
()
const
{
QString
CallModel
::
getSipAddress
()
const
{
...
@@ -26,7 +60,7 @@ QString CallModel::getSipAddress () const {
...
@@ -26,7 +60,7 @@ QString CallModel::getSipAddress () const {
}
}
CallModel
::
CallStatus
CallModel
::
getStatus
()
const
{
CallModel
::
CallStatus
CallModel
::
getStatus
()
const
{
switch
(
m_linphone_call
->
getState
()
)
{
switch
(
m_linphone_call
_status
)
{
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateStreamsRunning
:
case
linphone
:
:
CallStateStreamsRunning
:
return
CallStatusConnected
;
return
CallStatusConnected
;
...
@@ -48,8 +82,24 @@ CallModel::CallStatus CallModel::getStatus () const {
...
@@ -48,8 +82,24 @@ CallModel::CallStatus CallModel::getStatus () const {
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirIncoming
?
CallStatusIncoming
:
CallStatusOutgoing
;
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirIncoming
?
CallStatusIncoming
:
CallStatusOutgoing
;
}
}
bool
CallModel
::
getMicroMuted
()
const
{
return
m_micro_muted
;
}
void
CallModel
::
setMicroMuted
(
bool
status
)
{
if
(
m_micro_muted
!=
status
)
{
m_micro_muted
=
status
;
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
if
(
m_micro_muted
==
core
->
micEnabled
())
core
->
enableMic
(
!
m_micro_muted
);
emit
microMutedChanged
(
m_micro_muted
);
}
}
bool
CallModel
::
getPausedByUser
()
const
{
bool
CallModel
::
getPausedByUser
()
const
{
return
m_linphone_call
->
getState
()
==
linphone
::
CallStatePaused
;
return
m_linphone_call
_status
==
linphone
::
CallStatePaused
;
}
}
void
CallModel
::
setPausedByUser
(
bool
status
)
{
void
CallModel
::
setPausedByUser
(
bool
status
)
{
...
...
tests/src/components/call/CallModel.hpp
View file @
af60c28e
...
@@ -10,16 +10,16 @@ class CallModel : public QObject {
...
@@ -10,16 +10,16 @@ class CallModel : public QObject {
Q_OBJECT
;
Q_OBJECT
;
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
CONSTANT
);
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
CONSTANT
);
Q_PROPERTY
(
CallStatus
status
READ
getStatus
NOTIFY
statusChanged
);
Q_PROPERTY
(
CallStatus
status
READ
getStatus
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
isOutgoing
READ
isOutgoing
CONSTANT
);
Q_PROPERTY
(
bool
isOutgoing
READ
isOutgoing
CONSTANT
);
Q_PROPERTY
(
bool
microMuted
READ
getMicroMuted
WRITE
setMicroMuted
NOTIFY
microMutedChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
pausedByUserChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
pausedByUserChanged
);
public:
public:
enum
CallStatus
{
enum
CallStatus
{
CallStatusConnected
,
CallStatusConnected
,
CallStatusEnded
,
CallStatusEnded
,
CallStatusIdle
,
CallStatusIncoming
,
CallStatusIncoming
,
CallStatusOutgoing
,
CallStatusOutgoing
,
CallStatusPaused
CallStatusPaused
...
@@ -32,23 +32,31 @@ public:
...
@@ -32,23 +32,31 @@ public:
Q_INVOKABLE
void
acceptAudioCall
();
Q_INVOKABLE
void
acceptAudioCall
();
Q_INVOKABLE
void
terminateCall
();
Q_INVOKABLE
void
terminateCall
();
Q_INVOKABLE
void
transferCall
();
signals:
signals:
void
statusChanged
(
CallStatus
status
);
void
statusChanged
(
CallStatus
status
);
void
pausedByUserChanged
(
bool
status
);
void
pausedByUserChanged
(
bool
status
);
void
microMutedChanged
(
bool
status
);
private:
private:
QString
getSipAddress
()
const
;
QString
getSipAddress
()
const
;
CallStatus
getStatus
()
const
;
CallStatus
getStatus
()
const
;
bool
isOutgoing
()
const
{
bool
isOutgoing
()
const
{
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirOutgoing
;
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirOutgoing
;
}
}
bool
getMicroMuted
()
const
;
void
setMicroMuted
(
bool
status
);
bool
getPausedByUser
()
const
;
bool
getPausedByUser
()
const
;
void
setPausedByUser
(
bool
status
);
void
setPausedByUser
(
bool
status
);
bool
m_micro_muted
=
false
;
linphone
::
CallState
m_linphone_call_status
=
linphone
::
CallStateIdle
;
std
::
shared_ptr
<
linphone
::
Call
>
m_linphone_call
;
std
::
shared_ptr
<
linphone
::
Call
>
m_linphone_call
;
};
};
...
...
tests/src/components/core/CoreManager.hpp
View file @
af60c28e
...
@@ -29,11 +29,11 @@ public:
...
@@ -29,11 +29,11 @@ public:
// Singleton models.
// Singleton models.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
ContactsListModel
*
getContactsListModel
()
{
ContactsListModel
*
getContactsListModel
()
const
{
return
m_contacts_list_model
;
return
m_contacts_list_model
;
}
}
SipAddressesModel
*
getSipAddressesModel
()
{
SipAddressesModel
*
getSipAddressesModel
()
const
{
return
m_sip_addresses_model
;
return
m_sip_addresses_model
;
}
}
...
...
tests/ui/modules/Linphone/Calls/Calls.qml
View file @
af60c28e
...
@@ -9,10 +9,16 @@ import Linphone.Styles 1.0
...
@@ -9,10 +9,16 @@ import Linphone.Styles 1.0
ListView
{
ListView
{
id
:
calls
id
:
calls
// ---------------------------------------------------------------------------
property
var
_mapStatusToParams
property
var
_mapStatusToParams
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
signal
entrySelected
(
var
entry
)
// ---------------------------------------------------------------------------
function
_getSignIcon
(
call
)
{
function
_getSignIcon
(
call
)
{
if
(
call
)
{
if
(
call
)
{
var
string
=
_mapStatusToParams
[
call
.
status
].
string
var
string
=
_mapStatusToParams
[
call
.
status
].
string
...
...
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