Skip to content

Commit

Permalink
Merge pull request #7 from izwb003/fixes
Browse files Browse the repository at this point in the history
Finalized for 0.3.0.
  • Loading branch information
izwb003 authored May 10, 2024
2 parents a5e1d6c + 5005c44 commit 1bad39d
Show file tree
Hide file tree
Showing 15 changed files with 656 additions and 167 deletions.
42 changes: 26 additions & 16 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.2 LANGUAGES CXX)
project(AVPStudio VERSION 0.3.0 LANGUAGES CXX)

# Link ffmpeg
if(WIN32)
Expand Down Expand Up @@ -92,18 +92,11 @@ add_definitions(
)

# Set Qt executables
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(AVPStudio
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})
else()
add_executable(AVPStudio
${PROJECT_SOURCES}
)
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})
endif()
qt_add_executable(AVPStudio
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})

# Configure executable include rules
target_include_directories(AVPStudio PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
Expand Down Expand Up @@ -151,6 +144,23 @@ install(TARGETS AVPStudio wavgenerator imageorganizer mxlplayer
)

# Qt finalize executable
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(AVPStudio)
endif()
qt_finalize_executable(AVPStudio)

# Copy windows installer script
option(BUILD_WINDOWS_INSTALLER "Build Windows Inno Setup installer script or not" ON)

if(WIN32 AND BUILD_WINDOWS_INSTALLER)
set(INNOSETUP_APPID "{C3203E73-539C-40AE-9075-2AE99E78AB59}")
set(WINDOWS_INSTALLER_GENERATE_PATH ${CMAKE_CURRENT_BINARY_DIR}/../AVPStudio-installer)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/setup/windows/LICENSE_zh_CN.txt.in
${WINDOWS_INSTALLER_GENERATE_PATH}/LICENSE_zh_CN.txt
COPYONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/setup/windows/winsetup.iss.in
${WINDOWS_INSTALLER_GENERATE_PATH}/winsetup.iss
@ONLY
)
endif(WIN32 AND BUILD_WINDOWS_INSTALLER)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ AVPStudio的诞生离不开[@筱理_Rize](https://space.bilibili.com/3848521/)

AVPStudio需要致谢[@冷小鸢aque](https://space.bilibili.com/27063907/)[@讓晚風温暖各位的心](https://space.bilibili.com/122957742/)在实践中得出的测试结论。

更多致谢信息,请参阅软件的“关于”页面。
更多致谢信息,请参阅软件的[“关于”](res/texts/aboutinfo_zh_CN.md)页面。

杜比®、杜比影院®、Dolby®、Dolby Cinema®是杜比实验室国际有限公司的注册商标。

Expand All @@ -102,4 +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)下开放源代码的软件。
AVPStudio是在[GNU GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC1)下开放源代码的软件。
4 changes: 2 additions & 2 deletions res/texts/aboutinfo_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

### 测试

[@冷小鸢aque](https://space.bilibili.com/27063907/) [@讓晚風温暖各位的心](https://space.bilibili.com/122957742/)
[@冷小鸢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) @一个复杂精密的好名字 [@努力拉普的寒](https://space.bilibili.com/8295822) @还有这种事? @茶. @R.M.Dolby @Schon @WuChangXD @妙木山蛤蟆仙人
[@神奇的红毛丹](https://space.bilibili.com/364856318/) [@多真燐](https://space.bilibili.com/8275564) @一个复杂精密的好名字 [@努力Rap的寒](https://space.bilibili.com/8295822) [@zmisgod](https://space.bilibili.com/5355691) @还有这种事? @茶. @R.M.Dolby @Schon @WuChangXD @妙木山蛤蟆仙人

(以上排名不分先后)

Expand Down
355 changes: 355 additions & 0 deletions setup/windows/LICENSE_zh_CN.txt.in

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions setup/windows/winsetup.iss.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#define MyAppName "AVPStudio"
#define MyAppVersion "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@"
#define MyAppPublisher "izwb003 Productions"
#define MyAppURL "https://github.com/izwb003/AVPStudio"
#define MyAppExeName "AVPStudio.exe"

[Setup]
AppId={@INNOSETUP_APPID@
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ArchitecturesAllowed=x64 ia64
ArchitecturesInstallIn64BitMode=x64 ia64
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableWelcomePage=no
LicenseFile=./LICENSE_zh_CN.txt
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=commandline
OutputDir=@CMAKE_CURRENT_BINARY_DIR@\..\AVPStudio-installer
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Windows_x64_Setup
SetupIconFile=@CMAKE_SOURCE_DIR@\res\icons\icon256.ico
Compression=lzma
SolidCompression=yes
Uninstallable=yes
UninstallDisplayIcon=@CMAKE_SOURCE_DIR@\res\icons\icon256.ico
UninstallDisplayName={#MyAppName}
VersionInfoCompany={#MyAppPublisher}
VersionInfoCopyright=Copyright (C) {#MyAppPublisher}. Licensed Under GNU GPLv2.
VersionInfoProductVersion={#MyAppVersion}
VersionInfoVersion=@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0
WizardStyle=modern

[Languages]
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

[CustomMessages]
WebsiteWord=%1 开放源代码
AssociateMXLWord=关联.mxl文件到MXLPlayer

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "associateMXL"; Description: "{cm:AssociateMXLWord}"; Flags: checkedonce

[Files]
Source: "@CMAKE_CURRENT_BINARY_DIR@\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_CURRENT_BINARY_DIR@\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Registry]
Root: HKA; Subkey: "Software\Classes\Applications\mxlplayer.exe"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "AVPStudio MXLPlayer"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\Applications\mxlplayer.exe\SupportedTypes"; ValueType: string; ValueName: ".mxl"; ValueData: ""; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Clients\Media\MXLPlayer\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "Dolby Cinema AVP MXL file player"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Clients\Media\MXLPlayer\Capabilities"; ValueType: string; ValueName: "ApplicationName"; ValueData: "AVPStudio MXLPlayer"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Clients\Media\MXLPlayer\Capabilities\FileAssociations"; ValueType: string; ValueName: ".mxl"; ValueData: "MXLPlayer.mxl"; Flags: uninsdeletekey; Tasks: associateMXL
Root: HKA; Subkey: "Software\RegisteredApplications"; ValueType: string; ValueName: "MXLPlayer"; ValueData: "Software\Clients\Media\MXLPlayer\Capabilities"; Flags: uninsdeletekey
Root: HKCR; Subkey: ".mxl"; ValueType: string; ValueName: ""; ValueData: "MXLPlayer.mxl"; Tasks: associateMXL
Root: HKCR; Subkey: "MXLPlayer.mxl"; ValueType: string; ValueName: ""; ValueData: "Christie PandorasBox MPEG Video"; Flags: uninsdeletekey
Root: HKCR; Subkey: "MXLPlayer.mxl\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\mxlplayer.ico, 0"; Flags: uninsdeletekey
Root: HKCR; Subkey: "MXLPlayer.mxl\shell\Open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mxlplayer.exe"" ""%1"""; Flags: uninsdeletekey

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\WAVGenerator"; Filename: "{app}\wavgenerator.exe"
Name: "{group}\ImageOrganizer"; Filename: "{app}\imageorganizer.exe"
Name: "{group}\MXLPlayer"; Filename: "{app}\mxlplayer.exe"
Name: "{group}\{cm:WebsiteWord,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{autodesktop}\WAVGenerator"; Filename: "{app}\wavgenerator.exe"; Tasks: desktopicon
Name: "{autodesktop}\ImageOrganizer"; Filename: "{app}\imageorganizer.exe"; Tasks: desktopicon
Name: "{autodesktop}\MXLPlayer"; Filename: "{app}\mxlplayer.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

17 changes: 17 additions & 0 deletions src/forms/mainwindow/pagecreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "settings.h"

#include <QFileDialog>
#include <QMessageBox>
#include <QMimeData>

void PageCreate::dragEnterEvent(QDragEnterEvent *event)
Expand Down Expand Up @@ -63,6 +64,22 @@ void PageCreate::dropEvent(QDropEvent *event)
QFileInfo fileInfo(fileName);
if(fileInfo.isFile())
{
QStringList supportedFormat = {"mp4", "mpg", "avi", "mkv", "mov", "flv"};
bool isFormatSupported = false;
for(QString format : supportedFormat)
{
if(fileInfo.suffix().compare(format) == 0)
{
isFormatSupported = true;
break;
}
}
if(!isFormatSupported)
{
QMessageBox::critical(this, tr("错误"), tr("不支持的文件格式。"));
rewriteLabelDragText();
return;
}
settings.inputVideoPath = fileName;
settings.inputVideoInfo = fileInfo;
emit editContent();
Expand Down
21 changes: 6 additions & 15 deletions tools/imageorganizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@ if(WIN32)
endif(WIN32)

# Set Qt executables
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(imageorganizer
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
add_executable(imageorganizer
${PROJECT_SOURCES}
)
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()
qt_add_executable(imageorganizer
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})

# Link libraries
target_link_libraries(imageorganizer PRIVATE
Expand All @@ -61,6 +54,4 @@ set_target_properties(imageorganizer PROPERTIES
)

# Qt finalize executable
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(imageorganizer)
endif()
qt_finalize_executable(imageorganizer)
28 changes: 13 additions & 15 deletions tools/mxlplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ if(WIN32)
)
endif(WIN32)

# Copy icon
configure_file(
${CMAKE_SOURCE_DIR}/res/icons/mxlplayer_icon256.ico
${CMAKE_BINARY_DIR}/mxlplayer.ico
COPYONLY
)

# Set Qt executables
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(mxlplayer
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
add_executable(mxlplayer
${PROJECT_SOURCES}
)
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()
qt_add_executable(mxlplayer
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})

# Link libraries
target_link_libraries(mxlplayer PRIVATE
Expand Down Expand Up @@ -63,6 +63,4 @@ set_target_properties(mxlplayer PROPERTIES
)

# Qt finalize executable
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(mxlplayer)
endif()
qt_finalize_executable(mxlplayer)
2 changes: 1 addition & 1 deletion tools/mxlplayer/res/resources_win.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "izwb003 Productions\0"
// VALUE "FileDescription", "AVPStudio MXLPlayer, Dolby Cinema signature entrance (AVP) display content player.\0"
VALUE "FileDescription", "AVPStudio MXLPlayer\0"
VALUE "FileVersion", FILE_VERSION_STR
VALUE "InternalName", "mxlplayer.exe\0"
VALUE "LegalCopyright", "Copyright (C) 2024 Steven Song (izwb003)\0"
Expand Down
8 changes: 8 additions & 0 deletions tools/mxlplayer/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ int main(int argc, char *argv[])
styleSheetFile.close();

MainWindow w;

// If turned on with a MXL file specified, fill the MXL Path.
if(argc == 2)
{
QString mxlPath = QString(argv[1]);
w.setMXLPath(mxlPath);
}

w.show();
return a.exec();
}
5 changes: 5 additions & 0 deletions tools/mxlplayer/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ MainWindow::~MainWindow()
delete ui;
}

void MainWindow::setMXLPath(QString mxlPath)
{
ui->lineEditMXLPath->setText(mxlPath);
}

void MainWindow::do_showError(QString errorTitle, QString errorMsg)
{
progressDialog -> close();
Expand Down
2 changes: 2 additions & 0 deletions tools/mxlplayer/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class MainWindow : public QMainWindow
MainWindow(QWidget *parent = nullptr);
~MainWindow();

void setMXLPath(QString mxlPath);

private slots:
void do_showError(QString errorTitle, QString errorMsg);

Expand Down
Loading

0 comments on commit 1bad39d

Please sign in to comment.