Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
a493d5bf
Commit
a493d5bf
authored
6 years ago
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
ui: fix time on call overlay
Change-Id: I132f7c7aba3111d7bc1bd186bd67a6c174e0ac27
parent
1cf20c77
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
videooverlay.cpp
+17
-43
17 additions, 43 deletions
videooverlay.cpp
videooverlay.h
+3
-5
3 additions, 5 deletions
videooverlay.h
videoview.cpp
+6
-4
6 additions, 4 deletions
videoview.cpp
with
26 additions
and
52 deletions
videooverlay.cpp
+
17
−
43
View file @
a493d5bf
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include
"videooverlay.h"
#include
"videooverlay.h"
#include
"ui_videooverlay.h"
#include
"ui_videooverlay.h"
#include
<QTime>
// LRC
// LRC
#include
"callmodel.h"
#include
"callmodel.h"
#include
"contactmethod.h"
#include
"contactmethod.h"
...
@@ -45,27 +47,6 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
...
@@ -45,27 +47,6 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
ui
->
noMicButton
->
setCheckable
(
true
);
ui
->
noMicButton
->
setCheckable
(
true
);
ui
->
onHoldLabel
->
setVisible
(
false
);
ui
->
onHoldLabel
->
setVisible
(
false
);
auto
accountList
=
LRCInstance
::
accountModel
().
getAccountList
();
if
(
!
accountList
.
size
())
{
Utils
::
oneShotConnect
(
&
LRCInstance
::
accountModel
(),
&
lrc
::
api
::
NewAccountModel
::
accountAdded
,
[
this
](
const
std
::
string
&
accountId
)
{
Q_UNUSED
(
accountId
);
connect
(
LRCInstance
::
getCurrentCallModel
(),
&
lrc
::
api
::
NewCallModel
::
callStarted
,
[
this
](
const
std
::
string
&
tempCallId
)
{
callId
=
tempCallId
;
});
});
}
else
{
connect
(
LRCInstance
::
getCurrentCallModel
(),
&
lrc
::
api
::
NewCallModel
::
callStarted
,
[
this
](
const
std
::
string
&
tempCallId
)
{
callId
=
tempCallId
;
});
}
connect
(
oneSecondTimer_
,
&
QTimer
::
timeout
,
this
,
&
VideoOverlay
::
setTime
);
oneSecondTimer_
->
start
(
1000
);
}
}
VideoOverlay
::~
VideoOverlay
()
VideoOverlay
::~
VideoOverlay
()
...
@@ -73,6 +54,15 @@ VideoOverlay::~VideoOverlay()
...
@@ -73,6 +54,15 @@ VideoOverlay::~VideoOverlay()
delete
ui
;
delete
ui
;
}
}
void
VideoOverlay
::
callStarted
(
const
std
::
string
&
callId
)
{
ui
->
timerLabel
->
setText
(
"00:00"
);
callId_
=
callId
;
connect
(
oneSecondTimer_
,
&
QTimer
::
timeout
,
this
,
&
VideoOverlay
::
setTime
);
oneSecondTimer_
->
start
(
1000
);
}
void
void
VideoOverlay
::
setName
(
const
QString
&
name
)
VideoOverlay
::
setName
(
const
QString
&
name
)
{
{
...
@@ -82,32 +72,16 @@ VideoOverlay::setName(const QString& name)
...
@@ -82,32 +72,16 @@ VideoOverlay::setName(const QString& name)
void
void
VideoOverlay
::
setTime
()
VideoOverlay
::
setTime
()
{
{
if
(
callId
.
empty
())
{
return
;
}
if
(
callId_
.
empty
())
{
return
;
}
try
{
try
{
auto
callInfo
=
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
);
auto
callInfo
=
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
_
);
if
(
callInfo
.
status
==
lrc
::
api
::
call
::
Status
::
IN_PROGRESS
)
{
if
(
callInfo
.
status
==
lrc
::
api
::
call
::
Status
::
IN_PROGRESS
)
{
int
numSeconds
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
seconds
>
(
int
numSeconds
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
seconds
>
(
std
::
chrono
::
steady_clock
::
now
()
-
callInfo
.
startTime
).
count
();
std
::
chrono
::
steady_clock
::
now
()
-
callInfo
.
startTime
).
count
();
QTime
t
(
0
,
0
,
numSeconds
);
QString
labelSec
;
ui
->
timerLabel
->
setText
(
t
.
toString
(
numSeconds
>
3600
?
"hh:mm:ss"
:
"mm:ss"
));
QString
labelMin
;
int
numMinutes
=
numSeconds
/
60
;
int
remainder
=
numSeconds
-
numMinutes
*
60
;
if
(
remainder
<
10
)
{
labelSec
=
":0"
+
QString
::
number
(
remainder
);
}
else
{
labelSec
=
":"
+
QString
::
number
(
remainder
);
}
if
(
numMinutes
<
10
)
{
labelMin
=
"0"
+
QString
::
number
(
numMinutes
);
}
else
{
labelMin
=
QString
::
number
(
numMinutes
);
}
ui
->
timerLabel
->
setText
(
labelMin
+
labelSec
);
}
}
}
catch
(...)
{
}
}
catch
(...)
{
}
}
}
...
...
This diff is collapsed.
Click to expand it.
videooverlay.h
+
3
−
5
View file @
a493d5bf
...
@@ -36,6 +36,7 @@ public:
...
@@ -36,6 +36,7 @@ public:
public:
public:
void
setName
(
const
QString
&
name
);
void
setName
(
const
QString
&
name
);
void
callStarted
(
const
std
::
string
&
callId
);
inline
bool
isDialogVisible
(){
return
dialogVisible_
;
};
inline
bool
isDialogVisible
(){
return
dialogVisible_
;
};
void
toggleContextButtons
(
bool
visible
);
void
toggleContextButtons
(
bool
visible
);
void
setVideoMuteVisibility
(
bool
visible
);
void
setVideoMuteVisibility
(
bool
visible
);
...
@@ -43,11 +44,9 @@ public:
...
@@ -43,11 +44,9 @@ public:
void
simulateShowChatview
(
bool
checked
);
void
simulateShowChatview
(
bool
checked
);
bool
getShowChatView
();
bool
getShowChatView
();
public
slots
:
void
setTime
();
//UI SLOTS
//UI SLOTS
private
slots
:
private
slots
:
void
setTime
();
void
on_hangupButton_clicked
();
void
on_hangupButton_clicked
();
void
on_chatButton_toggled
(
bool
checked
);
void
on_chatButton_toggled
(
bool
checked
);
void
on_holdButton_clicked
();
void
on_holdButton_clicked
();
...
@@ -60,10 +59,9 @@ private:
...
@@ -60,10 +59,9 @@ private:
Ui
::
VideoOverlay
*
ui
;
Ui
::
VideoOverlay
*
ui
;
bool
dialogVisible_
=
false
;
bool
dialogVisible_
=
false
;
QTimer
*
oneSecondTimer_
;
QTimer
*
oneSecondTimer_
;
std
::
string
callId
;
std
::
string
callId
_
;
signals
:
signals
:
void
setChatVisibility
(
bool
visible
);
void
setChatVisibility
(
bool
visible
);
void
videoCfgBtnClicked
();
void
videoCfgBtnClicked
();
};
};
This diff is collapsed.
Click to expand it.
videoview.cpp
+
6
−
4
View file @
a493d5bf
...
@@ -324,21 +324,23 @@ VideoView::showContextMenu(const QPoint& pos)
...
@@ -324,21 +324,23 @@ VideoView::showContextMenu(const QPoint& pos)
}
}
void
void
VideoView
::
pushRenderer
(
const
std
::
string
&
call
Ui
d
)
{
VideoView
::
pushRenderer
(
const
std
::
string
&
call
I
d
)
{
auto
callModel
=
LRCInstance
::
getCurrentCallModel
();
auto
callModel
=
LRCInstance
::
getCurrentCallModel
();
QObject
::
disconnect
(
videoStartedConnection_
);
QObject
::
disconnect
(
videoStartedConnection_
);
if
(
!
callModel
->
hasCall
(
call
Ui
d
))
{
if
(
!
callModel
->
hasCall
(
call
I
d
))
{
return
;
return
;
}
}
auto
call
=
callModel
->
getCall
(
callUid
);
auto
call
=
callModel
->
getCall
(
callId
);
this
->
overlay_
->
callStarted
(
callId
);
this
->
overlay_
->
setVideoMuteVisibility
(
!
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
).
isAudioOnly
);
videoStartedConnection_
=
QObject
::
connect
(
callModel
,
&
lrc
::
api
::
NewCallModel
::
remotePreviewStarted
,
videoStartedConnection_
=
QObject
::
connect
(
callModel
,
&
lrc
::
api
::
NewCallModel
::
remotePreviewStarted
,
[
this
](
const
std
::
string
&
callId
,
Video
::
Renderer
*
renderer
)
{
[
this
](
const
std
::
string
&
callId
,
Video
::
Renderer
*
renderer
)
{
Q_UNUSED
(
callId
);
Q_UNUSED
(
callId
);
slotVideoStarted
(
renderer
);
slotVideoStarted
(
renderer
);
this
->
overlay_
->
setVideoMuteVisibility
(
!
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
).
isAudioOnly
);
});
});
ui
->
videoWidget
->
setPreviewDisplay
(
call
.
type
!=
lrc
::
api
::
call
::
Type
::
CONFERENCE
);
ui
->
videoWidget
->
setPreviewDisplay
(
call
.
type
!=
lrc
::
api
::
call
::
Type
::
CONFERENCE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment