This commit is contained in:
Gangphon 2023-04-24 15:02:08 +08:00
parent fed2665a90
commit ec7c973d18
5 changed files with 20 additions and 37 deletions

View File

@ -272,18 +272,19 @@ LIBS += -L$$PWD/ffmpeg/lib/\
-lswresample \ -lswresample \
-lswscale -lswscale
copy.path = $$OUT_PWD
copydir.path = $$OUT_PWD
copy.files += $$files(ffmpeg/bin/*.dll) copy.files += $$files(ffmpeg/bin/*.dll)
copy.files += ffmpeg/bin/ffmpeg.exe copy.files += ffmpeg/bin/ffmpeg.exe
copy.files += 7z/7z.dll copy.files += 7z/7z.dll
copy.files += 7z/7z.exe copy.files += 7z/7z.exe
# for https requests # for https requests
copy.files += $$files(OpenSSL/*.dll) copy.files += $$files(OpenSSL/*.dll)
copy.path = $$OUT_PWD
copydir.path = $$OUT_PWD
CONFIG += file_copies CONFIG += file_copies
COPIES += copy COPIES += copy
COPIES += copydir COPIES += copydir
} }
osx { osx {
INCLUDEPATH += $$PWD/ffmpeg-mac/include INCLUDEPATH += $$PWD/ffmpeg-mac/include
LIBS += -L$$PWD/ffmpeg-mac/lib/\ LIBS += -L$$PWD/ffmpeg-mac/lib/\
@ -295,6 +296,9 @@ LIBS += -L$$PWD/ffmpeg-mac/lib/\
-lswresample \ -lswresample \
-lswscale -lswscale
copy.files += $$files(ffmpeg-mac/lib/*.dylib)
copy.path = Contents/MacOS
copydir.path = Contents/MacOS copydir.path = Contents/MacOS
#QMAKE_BUNDLE_DATA += copy
QMAKE_BUNDLE_DATA += copydir QMAKE_BUNDLE_DATA += copydir
} }

View File

@ -616,12 +616,12 @@ void FFPlayer::updFrame() {
} }
auto now_epoch = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now().time_since_epoch()).count(); auto now_epoch = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now().time_since_epoch()).count();
dur = now_epoch - last_epoch; dur = now_epoch - last_epoch;
last_epoch = now_epoch;
if(dur>100000) return;
if(dur<4000) { if(dur<4000) {
qWarning()<<"FFPlayer UpdFrame Fail: dur"<<dur; qWarning()<<"FFPlayer UpdFrame Fail: dur"<<dur;
return; return;
} }
last_epoch = now_epoch;
if(dur>100000) return;
ctx->checkAndUpd(this, now_epoch); ctx->checkAndUpd(this, now_epoch);
viSize = ctx->vi_frms.size; viSize = ctx->vi_frms.size;
auSize = ctx->au_frms.size; auSize = ctx->au_frms.size;

View File

@ -56,8 +56,8 @@ ProgPanel::ProgPanel(QSettings &settings, QWidget *parent) : QWidget(parent) {
auto item = new ProgItem(mProgsDir, dlg.fdName->text(), width, dlg.fdHeight->value(), dlg.fdRemark->toPlainText(), widths, max, mProgTree, this); auto item = new ProgItem(mProgsDir, dlg.fdName->text(), width, dlg.fdHeight->value(), dlg.fdRemark->toPlainText(), widths, max, mProgTree, this);
item->save();//保存pro.json item->save();//保存pro.json
mProgTree->adjustCheckState(); mProgTree->adjustCheckState();
auto editor = new ProgEditorWin(item, gMainWin); ProgEditorWin editor(item, gMainWin);
editor->show(); editor.exec();
}); });
bnEdit = new QPushButton(tr("Edit")); bnEdit = new QPushButton(tr("Edit"));

View File

@ -2,7 +2,6 @@
#include "progpanel.h" #include "progpanel.h"
#include "base/customprogressindicator.h" #include "base/customprogressindicator.h"
#include "base/loemptydialog.h" #include "base/loemptydialog.h"
#include "base/loqtitlebar.h"
#include "cfg.h" #include "cfg.h"
#include "ebase.h" #include "ebase.h"
#include "pagelistitem.h" #include "pagelistitem.h"
@ -38,41 +37,21 @@
ProgItem *gProgItem{0}; ProgItem *gProgItem{0};
QWidget *gProgEditorWin; QWidget *gProgEditorWin;
ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : BaseWin(parent), mProgItem(progItem) { ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QDialog(parent), mProgItem(progItem) {
gProgEditorWin = this; gProgEditorWin = this;
gProgItem = progItem; gProgItem = progItem;
setWindowModality(Qt::WindowModal);
setAttribute(Qt::WA_AlwaysShowToolTips); setAttribute(Qt::WA_AlwaysShowToolTips);
if(parent && ! parent->isMaximized()) resize(parent->size()); if(parent && ! parent->isMaximized()) resize(parent->size());
else resize(1280, 720); else resize(1280, 720);
setWindowFlag(Qt::Window); // auto plt = palette();
setAttribute(Qt::WA_DeleteOnClose); // plt.setBrush(QPalette::Window, QColor(0xdddddd));
auto plt = palette(); // setPalette(plt);
plt.setBrush(QPalette::Window, QColor(0xdddddd));
setPalette(plt);
setWindowTitle(progItem->mName); setWindowTitle(progItem->mName);
icon = QPixmap(":/res/Logo.ico").scaledToHeight(16);
auto vBox = new QVBoxLayout(center); auto vBox = new QVBoxLayout(this);
vBox->setContentsMargins(0, 0, 0, 0); vBox->setContentsMargins(0, 0, 0, 0);
vBox->setSpacing(0); vBox->setSpacing(0);
auto titleBar = new LoQTitleBar(this);
titleBar->bn_Minimize->setVisible(false);
auto hBox = new QHBoxLayout(titleBar);
hBox->setContentsMargins(0, 0, 0, 0);
hBox->setSpacing(0);
hBox->addStretch();
hBox->addWidget(titleBar->bn_Minimize);
hBox->addWidget(titleBar->bn_Maximize);
hBox->addWidget(titleBar->bn_Close);
vBox->addWidget(titleBar);
auto line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vBox->addWidget(line);
auto toolBar = new QToolBar(); auto toolBar = new QToolBar();
toolBar->setFloatable(false); toolBar->setFloatable(false);
toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
@ -367,13 +346,13 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : BaseWin(pare
}); });
vBox->addWidget(toolBar); vBox->addWidget(toolBar);
line = new QFrame(); auto line = new QFrame();
line->setFrameStyle(QFrame::Sunken); line->setFrameStyle(QFrame::Sunken);
line->setFrameShape(QFrame::HLine); line->setFrameShape(QFrame::HLine);
vBox->addWidget(line); vBox->addWidget(line);
//主区域横向布局(幻灯片页列表,编辑窗,属性窗) //主区域横向布局(幻灯片页列表,编辑窗,属性窗)
hBox = new QHBoxLayout(); auto hBox = new QHBoxLayout();
hBox->setContentsMargins(0, 0, 0, 0); hBox->setContentsMargins(0, 0, 0, 0);
hBox->setSpacing(0); hBox->setSpacing(0);

View File

@ -1,16 +1,16 @@
#ifndef PROGEDITORWIN_H #ifndef PROGEDITORWIN_H
#define PROGEDITORWIN_H #define PROGEDITORWIN_H
#include "basewin.h" #include "QtWidgets/qdialog.h"
#include "program/pageeditor.h" #include "program/pageeditor.h"
#include <QListWidget> #include <QListWidget>
#include <QJsonObject> #include <QJsonObject>
class ProgPanel; class ProgPanel;
class ProgItem; class ProgItem;
class ProgEditorWin : public BaseWin { class ProgEditorWin : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit ProgEditorWin(ProgItem *progItem, QWidget *parent = nullptr); explicit ProgEditorWin(ProgItem *progItem, QWidget *parent = 0);
public slots: public slots:
void onSave(); void onSave();