Commit d9dadde7 authored by Yang Wang's avatar Yang Wang Committed by Andreas Traczyk

videoview: use audio only overlay

- add avatar view for audio only overlay, in which the avatar photo,
  id and name of the contact are displayed

Change-Id: I507ed064208eeb12a735897a7540caa1547c0aed
Gitlab: #495
parent eed6f065
/**************************************************************************
* Copyright (C) 2015-2019 by Savoir-faire Linux *
* Author: Yang Wang <yang.wang@savoirfairelinux.com> *
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
// directly related to this file
#include "callaudioonlyavataroverlay.h"
#include "ui_callaudioonlyavataroverlay.h"
CallAudioOnlyAvatarOverlay::CallAudioOnlyAvatarOverlay(QWidget *parent) :
QWidget(parent),
ui(new Ui::CallAudioOnlyAvatarOverlay)
{
ui->setupUi(this);
}
CallAudioOnlyAvatarOverlay::~CallAudioOnlyAvatarOverlay()
{
delete ui;
}
void
CallAudioOnlyAvatarOverlay::setAvatarVisible(bool visible)
{
this->setVisible(visible);
ui->avatarLabel->setVisible(visible);
ui->nameLabel->setVisible(visible);
}
void
CallAudioOnlyAvatarOverlay::writeAvatarOverlay(const std::string& accountId, const lrc::api::conversation::Info& convInfo)
{
Q_UNUSED(accountId);
auto contact = LRCInstance::getCurrentAccountInfo().contactModel->getContact(convInfo.participants.at(0));
ui->avatarLabel->setPixmap(QPixmap::fromImage(Utils::conversationPhoto(convInfo.uid, LRCInstance::getCurrentAccountInfo())));
if (contact.profileInfo.type == lrc::api::profile::Type::SIP) {
ui->nameLabel->setText(QString::fromStdString(contact.profileInfo.uri));
} else {
std::string name = contact.profileInfo.alias;
std::string id = contact.registeredName;
ui->nameLabel->setText(QString::fromStdString(name + "\n" + id));
}
}
void
CallAudioOnlyAvatarOverlay::respondToPauseLabel(bool pauseButtonDisplayed)
{
setAvatarVisible(!pauseButtonDisplayed);
}
/**************************************************************************
* Copyright (C) 2015-2019 by Savoir-faire Linux *
* Author: Yang Wang <yang.wang@savoirfairelinux.com> *
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#pragma once
// qt
#include <QWidget>
// project
#include "lrcinstance.h"
#include "utils.h"
namespace Ui {
class CallAudioOnlyAvatarOverlay;
}
class CallAudioOnlyAvatarOverlay : public QWidget
{
Q_OBJECT
public:
explicit CallAudioOnlyAvatarOverlay(QWidget *parent = nullptr);
~CallAudioOnlyAvatarOverlay();
void setAvatarVisible(bool visible);
void writeAvatarOverlay(const std::string& accountId, const lrc::api::conversation::Info& convInfo);
void respondToPauseLabel(bool pauseButtonDisplayed);
private:
Ui::CallAudioOnlyAvatarOverlay *ui;
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CallAudioOnlyAvatarOverlay</class>
<widget class="QWidget" name="CallAudioOnlyAvatarOverlay">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1821</width>
<height>1231</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item alignment="Qt::AlignHCenter|Qt::AlignBottom">
<widget class="QLabel" name="avatarLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="ressources.qrc">:/images/jami.ico</pixmap>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignTop">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="ressources.qrc"/>
</resources>
<connections/>
</ui>
......@@ -653,12 +653,19 @@ void CallWidget::slotShowCallView(const std::string& accountId,
if (callModel->hasCall(convInfo.callId)) {
auto call = callModel->getCall(convInfo.callId);
ui->videoWidget->resetVideoOverlay(call.audioMuted && (call.status != lrc::api::call::Status::PAUSED),
call.videoMuted && (call.status != lrc::api::call::Status::PAUSED) && (!call.isAudioOnly),
callModel->isRecording(convInfo.callId),
call.status == lrc::api::call::Status::PAUSED);
bool isAudioMuted = call.audioMuted && (call.status != lrc::api::call::Status::PAUSED);
bool isVideoMuted = call.videoMuted && (call.status != lrc::api::call::Status::PAUSED) && (!call.isAudioOnly);
bool isRecording = callModel->isRecording(convInfo.callId);
bool isPaused = call.status == lrc::api::call::Status::PAUSED;
ui->videoWidget->resetVideoOverlay(isAudioMuted,
isVideoMuted,
isRecording,
isPaused,
call.isAudioOnly && call.status != lrc::api::call::Status::PAUSED,
accountId,
convInfo);
} else {
ui->videoWidget->resetVideoOverlay(false, false, false, false);
ui->videoWidget->resetVideoOverlay(false, false, false, false, false, accountId, convInfo);
}
ui->callStackWidget->setCurrentWidget(ui->videoPage);
hideMiniSpinner();
......
......@@ -71,7 +71,8 @@ HEADERS += ./aboutdialog.h \
./pixbufmanipulator.h \
./settingswidget.h \
./updatedownloaddialog.h \
./sipinputpanel.h
./sipinputpanel.h \
./callaudioonlyavataroverlay.h
SOURCES += ./aboutdialog.cpp \
./banneditemwidget.cpp \
./conversationsfilterwidget.cpp \
......@@ -124,7 +125,8 @@ SOURCES += ./aboutdialog.cpp \
./pixbufmanipulator.cpp \
./smartlistselectorbuttonnotifier.cpp \
./videooverlay.cpp \
./sipinputpanel.cpp
./sipinputpanel.cpp \
./callaudioonlyavataroverlay.cpp
FORMS += ./aboutdialog.ui \
./advancedsipsettingwidget.ui \
./callwidget.ui \
......@@ -148,5 +150,6 @@ FORMS += ./aboutdialog.ui \
./photoboothwidget.ui \
./updateconfirmdialog.ui \
./videoview.ui \
./sipkeypad.ui
./sipkeypad.ui \
./callaudioonlyavataroverlay.ui
RESOURCES += ressources.qrc
......@@ -236,6 +236,7 @@ del /s /q $(OutDir)\Jami.exp</Command>
<ClCompile Include="banneditemwidget.cpp" />
<ClCompile Include="bannedlistmodel.cpp" />
<ClCompile Include="animationhelpers.cpp" />
<ClCompile Include="callaudioonlyavataroverlay.cpp" />
<ClCompile Include="contactpicker.cpp" />
<ClCompile Include="contactpickeritemdelegate.cpp" />
<ClCompile Include="currentaccountcombobox.cpp" />
......@@ -453,6 +454,10 @@ del /s /q $(OutDir)\Jami.exp</Command>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath>
</QtMoc>
<QtMoc Include="callaudioonlyavataroverlay.h">
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath>
</QtMoc>
<ClInclude Include="pixbufmanipulator.h" />
<QtMoc Include="ringbutton.h">
</QtMoc>
......@@ -634,6 +639,7 @@ del /s /q $(OutDir)\Jami.exp</Command>
<SubType>Designer</SubType>
</QtUic>
<QtUic Include="banneditemwidget.ui" />
<QtUic Include="callaudioonlyavataroverlay.ui" />
<QtUic Include="callwidget.ui">
<SubType>Designer</SubType>
</QtUic>
......@@ -734,4 +740,4 @@ del /s /q $(OutDir)\Jami.exp</Command>
<UserProperties UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" Qt5Version_x0020_x64="$(DefaultQtVersion)" />
</VisualStudio>
</ProjectExtensions>
</Project>
\ No newline at end of file
</Project>
......@@ -219,6 +219,9 @@
<ClCompile Include="levelmeter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="callaudioonlyavataroverlay.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sipinputpanel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
......@@ -380,6 +383,9 @@
<QtMoc Include="levelmeter.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="callaudioonlyavataroverlay.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="splashscreen.h">
<Filter>Generated Files</Filter>
</QtMoc>
......@@ -671,6 +677,9 @@
<QtUic Include="contactpicker.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="callaudioonlyavataroverlay.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="sipkeypad.ui">
<Filter>Form Files</Filter>
</QtUic>
......@@ -828,4 +837,4 @@
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -210,10 +210,10 @@ QPushButton#sipInputPanelButton:checked {
background-color: rgba(0, 192, 213, 0.8);
}
QPushButton#hangupButton{
background-color: rgba(200, 0, 0, 0.6);
QPushButton#hangupButton {
background-color: rgba(0, 0, 0, 140);
border-radius: 18px;
border:solid 1px;
border: solid 1px;
}
QPushButton#hangupButton:hover{
......@@ -788,4 +788,11 @@ QProgressBar#audioInputMeter {
QProgressBar#audioInputMeter::chunk {
background-color: #0c79aa;
margin: 2px;
}
\ No newline at end of file
}
QLabel#nameLabel {
font-size: 20px;
font-style: initial;
qproperty-alignment: AlignCenter;
color: white;
}
......@@ -20,14 +20,15 @@
#include "videooverlay.h"
#include "ui_videooverlay.h"
#include <QTime>
#include <QMouseEvent>
#include "videoview.h"
#include "lrcinstance.h"
#include "contactpicker.h"
#include "sipinputpanel.h"
#include "utils.h"
#include <QTime>
#include <QMouseEvent>
VideoOverlay::VideoOverlay(QWidget* parent) :
QWidget(parent),
ui(new Ui::VideoOverlay),
......@@ -149,15 +150,17 @@ VideoOverlay::on_chatButton_toggled(bool checked)
}
void
VideoOverlay::on_holdButton_clicked()
VideoOverlay::on_holdButton_toggled(bool checked)
{
auto callModel = LRCInstance::getCurrentCallModel();
if (callModel->hasCall(callId_)) {
callModel->togglePause(callId_);
auto onHold = callModel->getCall(callId_).status == lrc::api::call::Status::PAUSED;
ui->holdButton->setChecked(!onHold);
ui->onHoldLabel->setVisible(!onHold);
bool onHold = callModel->getCall(callId_).status == lrc::api::call::Status::PAUSED;
}
//emit that the hold button status changed
emit HoldStatusChanged(checked);
ui->onHoldLabel->setVisible(checked);
}
void
......@@ -265,8 +268,10 @@ VideoOverlay::setCurrentSelectedCalleeDisplayName(const QString& CalleeDisplayNa
}
void
VideoOverlay::resetOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding)
VideoOverlay::resetOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding, bool isAudioOnly)
{
//Set irrelevant buttons invisible
ui->noVideoButton->setVisible(!isAudioOnly);
// Block the signals of buttons
Utils::whileBlocking(ui->noMicButton)->setChecked(isAudioMuted);
Utils::whileBlocking(ui->noVideoButton)->setChecked(isVideoMuted);
......
......@@ -48,14 +48,14 @@ public:
bool getShowChatView();
void setTransferCallAndSIPPanelAvailability(bool visible);
void setCurrentSelectedCalleeDisplayName(const QString& CalleeDisplayName);
void resetOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding);
void resetOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding, bool isAudioOnly);
//UI SLOTS
private slots:
void setTime();
void on_hangupButton_clicked();
void on_chatButton_toggled(bool checked);
void on_holdButton_clicked();
void on_holdButton_toggled(bool checked);
void on_noMicButton_toggled(bool checked);
void on_noVideoButton_toggled(bool checked);
void on_recButton_clicked();
......@@ -74,4 +74,6 @@ private:
signals:
void setChatVisibility(bool visible);
void HoldStatusChanged(bool pauseLabelStatus);
};
......@@ -20,27 +20,27 @@
#include "videoview.h"
#include "ui_videoview.h"
#include "utils.h"
#include "lrcinstance.h"
#include "utils.h"
#include <QGraphicsOpacityEffect>
#include <QPropertyAnimation>
#include <QDesktopWidget>
#include <QMenu>
#include <QFileDialog>
#include <QGraphicsOpacityEffect>
#include <QMenu>
#include <QMimeData>
#include <QSplitter>
#include <QPropertyAnimation>
#include <QScreen>
#include <QSplitter>
#include <QWindow>
#include <memory>
#include "videooverlay.h"
#include "selectareadialog.h"
#include "videooverlay.h"
VideoView::VideoView(QWidget* parent) :
QWidget(parent),
ui(new Ui::VideoView)
VideoView::VideoView(QWidget* parent)
: QWidget(parent)
, ui(new Ui::VideoView)
{
ui->setupUi(this);
......@@ -67,9 +67,9 @@ VideoView::VideoView(QWidget* parent) :
this, SLOT(showContextMenu(const QPoint&)));
connect(overlay_, &VideoOverlay::setChatVisibility, [=](bool visible) {
emit this->setChatVisibility(visible);
connect(this, SIGNAL(toggleFullScreenClicked()), ui->videoWidget, SLOT(slotToggleFullScreenClicked()));
connect(this, SIGNAL(toggleFullScreenClicked()), ui->videoWidget, SLOT(slotToggleFullScreenClicked()));
});
audioOnlyAvatar_ = new CallAudioOnlyAvatarOverlay(this);
}
VideoView::~VideoView()
......@@ -119,6 +119,8 @@ VideoView::resizeEvent(QResizeEvent* event)
ui->videoWidget->resetPreview();
audioOnlyAvatar_->resize(this->size());
overlay_->resize(this->size());
overlay_->show();
overlay_->raise();
......@@ -187,7 +189,8 @@ VideoView::simulateShowChatview(bool checked)
}
void
VideoView::mouseDoubleClickEvent(QMouseEvent* e) {
VideoView::mouseDoubleClickEvent(QMouseEvent* e)
{
QWidget::mouseDoubleClickEvent(e);
toggleFullScreen();
}
......@@ -328,9 +331,7 @@ VideoView::showContextMenu(const QPoint& pos)
// possibly select the alternative video sharing device
switch (activeDevice.type) {
case lrc::api::video::DeviceType::DISPLAY:
sharingEntireScreen_ ?
shareAction->setChecked(true) :
shareAreaAction->setChecked(true);
sharingEntireScreen_ ? shareAction->setChecked(true) : shareAreaAction->setChecked(true);
break;
case lrc::api::video::DeviceType::FILE:
shareFileAction->setChecked(true);
......@@ -344,7 +345,8 @@ VideoView::showContextMenu(const QPoint& pos)
}
void
VideoView::pushRenderer(const std::string& callId, bool isSIP) {
VideoView::pushRenderer(const std::string& callId, bool isSIP)
{
currentCallId_ = callId;
auto callModel = LRCInstance::getCurrentCallModel();
......@@ -406,12 +408,12 @@ VideoView::mouseMoveEvent(QMouseEvent* event)
fadeTimer_.start(startfadeOverlayTime_);
}
QRect& previewRect = ui->videoWidget->getPreviewRect();
QRect& previewRect = ui->videoWidget->getPreviewRect();
if (draggingPreview_) {
if (previewRect.left() > 0
&& previewRect.top() > 0
&& previewRect.right() < width()
&& previewRect.bottom() < height()) {
&& previewRect.top() > 0
&& previewRect.right() < width()
&& previewRect.bottom() < height()) {
previewRect.moveTo(event->pos() - originMouseDisplacement_);
if (previewRect.left() <= 0)
......@@ -431,9 +433,9 @@ VideoView::mouseMoveEvent(QMouseEvent* event)
QLine distance = QLine(previewRect.topLeft(), event->pos());
if (resizingPreview_
and distance.dx() > minimalSize_
and distance.dy() > minimalSize_
and geometry().contains(event->pos()))
and distance.dx() > minimalSize_
and distance.dy() > minimalSize_
and geometry().contains(event->pos()))
previewRect.setBottomRight(event->pos());
}
......@@ -444,10 +446,38 @@ VideoView::setCurrentCalleeName(const QString& CalleeDisplayName)
}
void
VideoView::resetVideoOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding)
VideoView::resetVideoOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding, bool isAudioOnly, const std::string& accountId, const lrc::api::conversation::Info& convInfo)
{
resetAvatarOverlay(isAudioOnly);
if (isAudioOnly) {
writeAvatarOverlay(accountId, convInfo);
}
emit overlay_->setChatVisibility(false);
overlay_->resetOverlay(isAudioMuted, isVideoMuted, isRecording, isHolding);
overlay_->resetOverlay(isAudioMuted, isVideoMuted, isRecording, isHolding, isAudioOnly);
}
void
VideoView::resetAvatarOverlay(bool isAudioOnly)
{
audioOnlyAvatar_->setAvatarVisible(isAudioOnly);
if (isAudioOnly) {
disconnect(coordinateOverlays_);
coordinateOverlays_ = connect(overlay_, SIGNAL(HoldStatusChanged(bool)), this, SLOT(slotHoldStatusChanged(bool)));
} else {
disconnect(coordinateOverlays_);
}
}
void
VideoView::writeAvatarOverlay(const std::string& accountId, const lrc::api::conversation::Info& convInfo)
{
audioOnlyAvatar_->writeAvatarOverlay(accountId, convInfo);
}
void
VideoView::slotHoldStatusChanged(bool pauseLabelStatus)
{
audioOnlyAvatar_->respondToPauseLabel(pauseLabelStatus);
}
void
......@@ -467,7 +497,7 @@ VideoView::connectRendering(bool started)
}
void
VideoView::keyPressEvent(QKeyEvent *event)
VideoView::keyPressEvent(QKeyEvent* event)
{
// used to manage DTMF
// For "#" and "*", qt will automatically read the shift + 3 or 8
......@@ -476,13 +506,13 @@ VideoView::keyPressEvent(QKeyEvent *event)
}
void
VideoView::keyReleaseEvent(QKeyEvent *event)
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){
} else if (keyPressed_ >= 48 && keyPressed_ <= 57) {
//enum Qt::Key_0 = 48, QT::Key_9 = 57
LRCInstance::getCurrentCallModel()->playDTMF(currentCallId_, std::to_string(keyPressed_ - 48));
}
......
......@@ -18,20 +18,22 @@
#pragma once
#include <QWidget>
#include <QTimer>
#include "callaudioonlyavataroverlay.h"
#include "videooverlay.h"
#include "api/conversationmodel.h"
#include <QMouseEvent>
#include <QKeyEvent>
#include <QPropertyAnimation>
#include "videooverlay.h"
#include <QTimer>
#include <QWidget>
namespace Ui {
class VideoView;
}
class VideoView : public QWidget
{
class VideoView : public QWidget {
Q_OBJECT
public:
......@@ -41,7 +43,7 @@ public:
void showChatviewIfToggled();
void simulateShowChatview(bool checked);
void setCurrentCalleeName(const QString& CalleeDisplayName);
void resetVideoOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding);
void resetVideoOverlay(bool isAudioMuted, bool isVideoMuted, bool isRecording, bool isHolding, bool isAudioOnly, const std::string& accountId, const lrc::api::conversation::Info& convInfo);
void disconnectRendering();
void connectRendering(bool started = false);
......@@ -65,16 +67,19 @@ private slots:
void showContextMenu(const QPoint& pos);
void fadeOverlayOut();
void showOverlay();
void slotHoldStatusChanged(bool pauseLabelStatus);
private:
Ui::VideoView* ui;
VideoOverlay* overlay_;
CallAudioOnlyAvatarOverlay* audioOnlyAvatar_;
QPropertyAnimation* fadeAnim_;
QTimer fadeTimer_;
QWidget* oldParent_;
QSize oldSize_;
QMetaObject::Connection timerConnection_;
QMetaObject::Connection callStatusChangedConnection_;
QMetaObject::Connection coordinateOverlays_;
QPoint origin_;
QPoint originMouseDisplacement_;
bool draggingPreview_ = false;
......@@ -101,9 +106,12 @@ private:
private:
void toggleFullScreen();
void resetAvatarOverlay(bool isAudioOnly);
void writeAvatarOverlay(const std::string& accountId, const lrc::api::conversation::Info& convInfo);
signals:
void setChatVisibility(bool visible);
void videoSettingsClicked();
void toggleFullScreenClicked();
void closing(const std::string& callid);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment