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
GitLab 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
eed6f065
Commit
eed6f065
authored
Aug 28, 2019
by
Ming Rui Zhang
Committed by
Andreas Traczyk
Sep 10, 2019
Browse files
Options
Downloads
Patches
Plain Diff
videoview: add key presss and key release events to catch DTMF input for sip calls
Change-Id: I8fe7996fa90652cf24504154531eba04736fc517
parent
6edfff10
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
callwidget.cpp
+1
-0
1 addition, 0 deletions
callwidget.cpp
videoview.cpp
+24
-0
24 additions, 0 deletions
videoview.cpp
videoview.h
+5
-0
5 additions, 0 deletions
videoview.h
with
30 additions
and
0 deletions
callwidget.cpp
+
1
−
0
View file @
eed6f065
...
...
@@ -663,6 +663,7 @@ void CallWidget::slotShowCallView(const std::string& accountId,
ui
->
callStackWidget
->
setCurrentWidget
(
ui
->
videoPage
);
hideMiniSpinner
();
ui
->
videoWidget
->
pushRenderer
(
convInfo
.
callId
,
LRCInstance
::
accountModel
().
getAccountInfo
(
accountId
).
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
SIP
);
ui
->
videoWidget
->
setFocus
();
}
void
CallWidget
::
slotShowIncomingCallView
(
const
std
::
string
&
accountId
,
...
...
This diff is collapsed.
Click to expand it.
videoview.cpp
+
24
−
0
View file @
eed6f065
...
...
@@ -345,6 +345,7 @@ VideoView::showContextMenu(const QPoint& pos)
void
VideoView
::
pushRenderer
(
const
std
::
string
&
callId
,
bool
isSIP
)
{
currentCallId_
=
callId
;
auto
callModel
=
LRCInstance
::
getCurrentCallModel
();
QObject
::
disconnect
(
ui
->
videoWidget
);
...
...
@@ -464,3 +465,26 @@ VideoView::connectRendering(bool started)
ui
->
videoWidget
->
connectRendering
();
}
}
void
VideoView
::
keyPressEvent
(
QKeyEvent
*
event
)
{
// used to manage DTMF
// For "#" and "*", qt will automatically read the shift + 3 or 8
keyPressed_
=
event
->
key
();
QWidget
::
keyPressEvent
(
event
);
}
void
VideoView
::
keyReleaseEvent
(
QKeyEvent
*
event
)
{
if
(
keyPressed_
==
static_cast
<
int
>
(
Qt
::
Key_NumberSign
))
{
LRCInstance
::
getCurrentCallModel
()
->
playDTMF
(
currentCallId_
,
"#"
);
}
else
if
(
keyPressed_
==
static_cast
<
int
>
(
Qt
::
Key_Asterisk
))
{
LRCInstance
::
getCurrentCallModel
()
->
playDTMF
(
currentCallId_
,
"*"
);
}
else
if
(
keyPressed_
>=
48
&&
keyPressed_
<=
57
){
//enum Qt::Key_0 = 48, QT::Key_9 = 57
LRCInstance
::
getCurrentCallModel
()
->
playDTMF
(
currentCallId_
,
std
::
to_string
(
keyPressed_
-
48
));
}
QWidget
::
keyReleaseEvent
(
event
);
}
This diff is collapsed.
Click to expand it.
videoview.h
+
5
−
0
View file @
eed6f065
...
...
@@ -21,6 +21,7 @@
#include
<QWidget>
#include
<QTimer>
#include
<QMouseEvent>
#include
<QKeyEvent>
#include
<QPropertyAnimation>
#include
"videooverlay.h"
...
...
@@ -56,6 +57,8 @@ protected:
void
mousePressEvent
(
QMouseEvent
*
event
);
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
void
keyPressEvent
(
QKeyEvent
*
event
);
void
keyReleaseEvent
(
QKeyEvent
*
event
);
private
slots
:
void
slotCallStatusChanged
(
const
std
::
string
&
callId
);
...
...
@@ -77,6 +80,8 @@ private:
bool
draggingPreview_
=
false
;
bool
resizingPreview_
=
false
;
bool
sharingEntireScreen_
=
false
;
std
::
string
currentCallId_
;
int
keyPressed_
;
constexpr
static
int
fadeOverlayTime_
=
1000
;
//msec
constexpr
static
int
resizeGrip_
=
40
;
...
...
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