Skip to content

Commit

Permalink
Merge pull request #5 from izwb003/finalize
Browse files Browse the repository at this point in the history
Finalize for release-ready.
  • Loading branch information
izwb003 authored Mar 30, 2024
2 parents a98ec7c + bfafe84 commit a5e1d6c
Show file tree
Hide file tree
Showing 21 changed files with 449 additions and 76 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.18)

project(AVPStudio VERSION 0.2.0 LANGUAGES CXX)
project(AVPStudio VERSION 0.2.2 LANGUAGES CXX)

# Link ffmpeg
if(WIN32)
Expand Down Expand Up @@ -39,6 +39,13 @@ include_directories(${FFMPEG_PATH}/include)
add_subdirectory(external/SDL)
include_directories(external/SDL/include)

# Copy cinema list
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cinemalist.xml
${CMAKE_CURRENT_BINARY_DIR}/cinemalist.xml
@ONLY
)

# Necessary Qt settings
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
Expand All @@ -48,8 +55,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Add Qt packages
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools Multimedia MultimediaWidgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools Multimedia MultimediaWidgets)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools Multimedia MultimediaWidgets Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools Multimedia MultimediaWidgets NetWork)

# Set multi-language TS files
set(TS_FILES ts/AVPStudio_zh_CN.ts)
Expand Down Expand Up @@ -124,6 +131,7 @@ target_link_libraries(AVPStudio PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Multimedia
Qt${QT_VERSION_MAJOR}::MultimediaWidgets
Qt${QT_VERSION_MAJOR}::Network
${LIBAVUTIL_PATH}
${LIBAVCODEC_PATH}
${LIBAVFORMAT_PATH}
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ MXL播放器。

CMake脚本已被调整为默认从互联网下载预构建ffmpeg。请确保构建时互联网连接畅通。您也可以参阅CMakeLists.txt自行配置外部库。

构建需要完整的Qt6环境。项目必须使用以下Qt库:Qt6Core, Qt6Widgets, Qt6Multimedia, Qt6MultimediaWidgets。
构建需要完整的Qt6环境。项目必须使用以下Qt库:Qt6Core, Qt6Widgets, Qt6Multimedia, Qt6MultimediaWidgets, Qt6Network

## 致谢与声明

Expand Down Expand Up @@ -102,10 +102,4 @@ AVPStudio基于LGPLv2.1及GPLv2使用来自[FFmpeg](https://ffmpeg.org/)的软

AVPStudio MXLPlayer基于zlib license使用来自[SDL](https://www.libsdl.org/)的软件。

AVPStudio是在[GNU GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC1)下开放源代码的软件。

## 附表 中华人民共和国大陆地区Dolby Cinema部分参数表(2023年7月)

***网友制表,出处见水印。信息仅供参考。***

![](images/cn_dbyc_list_202307.jpg)
AVPStudio是在[GNU GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC1)下开放源代码的软件。
135 changes: 135 additions & 0 deletions cinemalist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--This file is a part of AVPStudio.-->
<!--Data source: @步平凡x-->
<!--Ref: @izwb003-->

<cinemalist version="1" updatetime="2023/06/15">
<location name="中华人民共和国">
<province name="北京">
<cinema name="北京耀莱成龙影城(五棵松万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="北京万达影城(丰台万达广场店)">
<avpsize>Large</avpsize>
</cinema>
<cinema name="北京寰映影城(合生汇店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="北京耀莱成龙影城(丽泽桥店)">
<avpsize>Large</avpsize>
</cinema>
<cinema name="北京万达影城(通州万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="上海">
<cinema name="上海万达影城(颛桥万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="上海寰映影城(静安大融城店)">
<avpsize>Large</avpsize>
</cinema>
<cinema name="上海万达影城(中信泰富万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="上海华谊兄弟电影中心(长风大悦城店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="上海万达影城(五角场万达广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="辽宁">
<cinema name="大连万达影城(凯德和平广场奥纳店)">
<avpsize>Small</avpsize>
</cinema>
<cinema name="沈阳万象影城(长白万象汇店)">
<avpsize>Small</avpsize>
</cinema>
</province>
<province name="重庆">
<cinema name="重庆万达影城(南坪万达广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="山东">
<cinema name="济南万达影城(世茂广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="广东">
<cinema name="东莞万达影城(南城蜂汇店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="广州唐德国际影城(白云汇店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="深圳万象影城(深圳湾万象城店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="深圳万象影城(罗湖万象城店)">
<avpsize>Small</avpsize>
</cinema>
</province>
<province name="江苏">
<cinema name="南京万达影城(江宁太阳城店)">
<avpsize>Large</avpsize>
</cinema>
<cinema name="南京万达影城(新街口万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="四川">
<cinema name="成都万达影城(青羊万达广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="福建">
<cinema name="厦门华谊兄弟电影中心(集美市民广场店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="福州万达影城(金融街万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
<cinema name="泉州万达影城(城东万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="宁夏">
<cinema name="银川BHG华联国际影城(悦海新天地店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="陕西">
<cinema name="西安万达影城(高新万达广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="天津">
<cinema name="天津万达影城(塘沽万达广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
<province name="广西">
<cinema name="南宁万达影城(青秀万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="河南">
<cinema name="郑州万达影城(公园茂店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="浙江">
<cinema name="杭州万达影城(未来科技城余杭万达广场店)">
<avpsize>Medium</avpsize>
</cinema>
</province>
<province name="内蒙古">
<cinema name="呼和浩特寰映影城(振华购物广场店)">
<avpsize>Large</avpsize>
</cinema>
</province>
</location>
</cinemalist>
File renamed without changes
Binary file removed res/images/AVP_Large.jpg
Binary file not shown.
Binary file removed res/images/AVP_Medium.jpg
Binary file not shown.
Binary file removed res/images/AVP_Small.jpg
Binary file not shown.
3 changes: 0 additions & 3 deletions res/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<file>styles/mainstyle.qss</file>
</qresource>
<qresource prefix="/images">
<file>images/AVP_Large.jpg</file>
<file>images/AVP_Medium.jpg</file>
<file>images/AVP_Small.jpg</file>
<file>images/drag-drop.png</file>
<file>images/down.png</file>
<file>images/up.png</file>
Expand Down
41 changes: 40 additions & 1 deletion res/styles/mainstyle.qss
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,16 @@ QCheckBox::indicator:checked {
height: 32px
}

QSlider {
height: 10px
}

QSlider::handle {
background-color: white;
border: 1px solid white;
width: 10px;
margin: -15px 0px -15px 0px;
height: 10px;
margin: 0px 0px 0px 0px;
border-radius: 5px
}

Expand Down Expand Up @@ -172,3 +177,37 @@ QProgressBar::chunk {
QStatusBar {
color: white;
}

QTreeView {
color:white
}

QHeaderView::section {
background-color: #3d3d3d;
color: white
}

QScrollBar {
width: 8px;
background-color: #3d3d3d;
margin: 0px, 0px, 0px, 0px;
padding-top: 9px;
padding-bottom: 9px
}

QScrollBar::add-page, QScrollBar::sub-page {
background-color: #1b1b1b
}

QScrollBar::handle {
width: 8px;
border: none
}

QScrollBar::sub-line {
image: url(:/images/images/up.png)
}

QScrollBar::add-line {
image: url(:/images/images/down.png)
}
6 changes: 5 additions & 1 deletion res/texts/aboutinfo_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

[@冷小鸢aque](https://space.bilibili.com/27063907/) [@讓晚風温暖各位的心](https://space.bilibili.com/122957742/)

### 影城信息数据

[@步平凡x](https://weibo.com/n/%E6%AD%A5%E5%B9%B3%E5%87%A1x)

### 同时提供支持

[@神奇的红毛丹](https://space.bilibili.com/364856318/) [@多真燐](https://space.bilibili.com/8275564) @一个复杂精密的好名字 @寒 @还有这种事? @茶. @R.M.Dolby @Schon @WuChangXD @妙木山蛤蟆仙人
[@神奇的红毛丹](https://space.bilibili.com/364856318/) [@多真燐](https://space.bilibili.com/8275564) @一个复杂精密的好名字 [@努力拉普的寒](https://space.bilibili.com/8295822) @还有这种事? @茶. @R.M.Dolby @Schon @WuChangXD @妙木山蛤蟆仙人

(以上排名不分先后)

Expand Down
71 changes: 70 additions & 1 deletion src/forms/mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@

#include "settings.h"

#include <QDebug>
#include <QDesktopServices>
#include <QJsonDocument>
#include <QJsonObject>
#include <QMessageBox>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QProcess>
#include <QRegularExpression>

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
Expand Down Expand Up @@ -62,13 +67,23 @@ MainWindow::MainWindow(QWidget *parent)
connect(pageCompleted, SIGNAL(reInit()), this, SLOT(on_actionNewContent_triggered()));
connect(this, SIGNAL(toProcess()), pageProcess, SLOT(do_proc()));
connect(this, SIGNAL(openFile(QString)), pageCreate, SLOT(on_labelDragText_linkActivated(QString)));

checkUpdate();
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::checkUpdate()
{
updateChecker = new QNetworkAccessManager(this);
connect(updateChecker, SIGNAL(finished(QNetworkReply*)), this, SLOT(do_checkUpdateFinished(QNetworkReply*)));

updateChecker->get(QNetworkRequest(QUrl("https://api.github.com/repos/izwb003/AVPStudio/releases/latest")));
}

void MainWindow::do_createContent()
{
this->setWindowTitle("AVPStudio - Create (" + settings.getSizeString() + ")");
Expand Down Expand Up @@ -97,6 +112,60 @@ void MainWindow::do_toCompleted(bool isError, QString errorStr)
ui->stackedWidget->setCurrentIndex(4);
}

bool compareVersion(QString newVersionStr)
{
static const QRegularExpression newVersionRegex("v(\\d+)\\.(\\d+)\\.(\\d+)");
QRegularExpressionMatch newVersionMatch = newVersionRegex.match(newVersionStr);
if(newVersionMatch.hasMatch())
{
int newMajor = newVersionMatch.captured(1).toInt();
int newMinor = newVersionMatch.captured(2).toInt();
int newPatch = newVersionMatch.captured(3).toInt();

if(newMajor > PROJECT_VERSION_MAJOR)
return true;
else if(newMajor == PROJECT_VERSION_MAJOR)
{
if(newMinor > PROJECT_VERSION_MINOR)
return true;
else if(newMinor == PROJECT_VERSION_MINOR)
return newPatch > PROJECT_VERSION_PATCH;
}
}
return false;
}

void MainWindow::do_checkUpdateFinished(QNetworkReply *reply)
{
if(reply->error() == QNetworkReply::NoError)
{
QString newVersionStr;
QString newVersionUrl;

QByteArray data = reply->readAll();

QJsonDocument jsonDoc = QJsonDocument::fromJson(data);
if(!jsonDoc.isObject())
return;
QJsonObject jsonObj = jsonDoc.object();

QStringList jsonKeys = jsonObj.keys();
for(QString jsonKey : jsonKeys)
{
if(jsonKey == "tag_name")
newVersionStr = jsonObj.value(jsonKey).toString();
if(jsonKey == "html_url")
newVersionUrl = jsonObj.value(jsonKey).toString();
}

if(compareVersion(newVersionStr))
{
if(QMessageBox::question(this, tr("版本更新"), tr("有新版本的AVPStudio可用。要下载吗?")) == QMessageBox::Yes)
QDesktopServices::openUrl(QUrl(newVersionUrl));
}
}
}

void MainWindow::on_actionAbout_triggered()
{
AboutWindow *aboutWindow = new AboutWindow();
Expand Down
Loading

0 comments on commit a5e1d6c

Please sign in to comment.