diff --git a/QtVsPlayermga8wally.spec b/QtVsPlayermga8wally.spec index 1592504..e6bd521 100644 --- a/QtVsPlayermga8wally.spec +++ b/QtVsPlayermga8wally.spec @@ -1,8 +1,8 @@ Name: QtVsPlayer Summary: QtVsPlayer for Hikvision -Version: 1.0.50 +Version: 1.0.51 -%global Rel 8 +%global Rel 0 %if 0%{?mageia} Release: %mkrel %{Rel} %elif 0%{?fedora} > 36 || 0%{?rhel} > 6 @@ -136,6 +136,9 @@ chmod -R ug+rw %{_srcrpmdir} %{_libdir}/QtVsPlayer/* %changelog +* Sat Jul 29 2023 surfzoid@gmail.com ++ Config of multimedia shorcut key. + * Sat Jul 22 2023 surfzoid@gmail.com - Mageia 9 use openssl3, use openssl 1.1 libs from mga8 in /usr/lib64/QtVsPlayer. + Use release number for about box and packages built at Github. diff --git a/multimedia_shortcuts.cpp b/multimedia_shortcuts.cpp index e6bb967..ea5c3cc 100644 --- a/multimedia_shortcuts.cpp +++ b/multimedia_shortcuts.cpp @@ -27,6 +27,8 @@ void Multimedia_shortcuts::showEvent(QShowEvent *event) this->ui->LEnext->setText(settings.value("next", "0X1000083").value()); this->ui->LESeekLess->setText(settings.value("SeekLess", "0x01000062").value()); this->ui->LESeekMore->setText(settings.value("SeekMore", "0x01000061").value()); + this->ui->LEForward->setText(settings.value("Forward", "0x01000063").value()); + this->ui->LEBackward->setText(settings.value("Backward", "0x01000064").value()); settings.endGroup(); IsShown = true; @@ -47,6 +49,8 @@ void Multimedia_shortcuts::on_buttonBox_accepted() settings.setValue("next", ui->LEnext->text()); settings.setValue("SeekLess", ui->LESeekLess->text()); settings.setValue("SeekMore", ui->LESeekMore->text()); + settings.setValue("Forward", ui->LEForward->text()); + settings.setValue("Backward", ui->LEBackward->text()); settings.endGroup(); settings.sync(); @@ -78,6 +82,10 @@ bool Multimedia_shortcuts::eventFilter(QObject *obj, QEvent *event) this->ui->LESeekLess->setText(TheKey); if (this->ui->LESeekMore->hasFocus()) this->ui->LESeekMore->setText(TheKey); + if (this->ui->LEForward->hasFocus()) + this->ui->LEForward->setText(TheKey); + if (this->ui->LEBackward->hasFocus()) + this->ui->LEBackward->setText(TheKey); } return QObject::eventFilter(obj, event); } diff --git a/multimedia_shortcuts.ui b/multimedia_shortcuts.ui index 45ed963..a6425b0 100644 --- a/multimedia_shortcuts.ui +++ b/multimedia_shortcuts.ui @@ -10,7 +10,7 @@ 0 0 403 - 397 + 527 @@ -19,8 +19,8 @@ - 30 - 330 + 20 + 410 341 32 @@ -41,7 +41,7 @@ 20 20 331 - 281 + 371 @@ -188,6 +188,46 @@ + + + + true + + + Forward + + + + + + + true + + + true + + + + + + + true + + + Backward + + + + + + + true + + + true + + + diff --git a/qtvsplayer.cpp b/qtvsplayer.cpp index cf3f75e..75d50e6 100644 --- a/qtvsplayer.cpp +++ b/qtvsplayer.cpp @@ -170,7 +170,38 @@ bool QtVsPlayer::eventFilter(QObject *obj, QEvent *event) } /*printf("---Event type %i :%s\r\n", event->type(), QEvent::staticMetaObject - .enumerator(eventEnumIndex).valueToKey(event->type()));*/ + .enumerator(eventEnumIndex).valueToKey(event->type()));*/ if (event->type() == QEvent::KeyRelease || event->type() == QEvent::KeyPress) + { + QKeyEvent *key = static_cast(event); +// qDebug() << "pressed"<< key->key(); +// qDebug() << "pressed"<< key->text(); +// qDebug() << "pressed"<< key->nativeScanCode(); + QSettings settings; + settings.beginGroup("Multimedia_shortcuts"); + QString TheKey = QString::number(key->key()); + if (key->key() == settings.value("play", "0X1000080").value()) + playm4interface::Play(); + if (key->key() == settings.value("pause", "0X1000085").value()) + VideoCtrls::pause(); + if (key->key() == settings.value("stop", "0X1000081").value()) + playm4interface::Stop(); + if (key->key() == settings.value("previous", "0X1000082").value()) + { + QtVsPlayer::LastPlayIdx -= 2; + QtVsPlayer::PlayNextFile(false, 0); + } + if (key->key() == settings.value("next", "0X1000083").value()) + QtVsPlayer::PlayNextFile(false,0); + if (key->key() == settings.value("SeekLess", "0x01000062").value()) + playm4interface::Slow(); + if (key->key() == settings.value("SeekMore", "0x01000061").value()) + playm4interface::Fast(); + if (key->key() == settings.value("Forward", "0x010000631").value()) + WVideoCtrls->Forward(); + if (key->key() == settings.value("Backward", "0x010000631").value()) + WVideoCtrls->Backward(); + settings.endGroup(); + } return QObject::eventFilter(obj, event); } diff --git a/videoctrls.cpp b/videoctrls.cpp index 86c1c6d..e580c60 100644 --- a/videoctrls.cpp +++ b/videoctrls.cpp @@ -414,3 +414,18 @@ void VideoCtrls::on_Audio_released() { playm4interface::PlaySound(); } + + +void VideoCtrls::Forward() +{ + int value = ui->TimeSlider->value(); + ui->TimeSlider->setValue(value + 1); + VideoCtrls::on_TimeSlider_actionTriggered(0); +} + +void VideoCtrls::Backward() +{ + int value = ui->TimeSlider->value(); + ui->TimeSlider->setValue(value - 1); + VideoCtrls::on_TimeSlider_actionTriggered(0); +} diff --git a/videoctrls.h b/videoctrls.h index 35b8afb..4b96dd8 100644 --- a/videoctrls.h +++ b/videoctrls.h @@ -29,6 +29,8 @@ class VideoCtrls : public QWidget static void pause(); static int Duration; static bool AutoHide; + void Forward(); + void Backward(); private: Ui::VideoCtrls *ui;