chore: RC file for windows, taglib tweaks
This commit is contained in:
parent
a910e85d97
commit
8ac558ebc6
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
@ -40,10 +40,6 @@ jobs:
|
||||
git clone --recurse-submodules -q https://github.com/taglib/taglib.git dependencies_src/taglib
|
||||
cmake .\dependencies_src\taglib -Bbuild_dependencies/taglib -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
||||
cmake --build build_dependencies/taglib --config Release --target=install -j || goto :error
|
||||
:: ===== ECM =====
|
||||
git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git dependencies_src/extra-cmake-modules
|
||||
cmake .\dependencies_src\extra-cmake-modules -Bbuild_dependencies/extra-cmake-modules -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error
|
||||
cmake --build build_dependencies/extra-cmake-modules --config Release --target=install || goto :error
|
||||
:: ------ app ------
|
||||
cmake -Bbuild . -DCMAKE_INSTALL_PREFIX="%PWD%\build\" || goto :error
|
||||
cmake --build build --config Release -j || goto :error
|
||||
|
@ -14,14 +14,8 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt6 6.5.1 COMPONENTS Widgets Multimedia Network LinguistTools REQUIRED)
|
||||
find_package(ECM 5.83.0 NO_MODULE)
|
||||
find_package(PkgConfig)
|
||||
|
||||
if (ECM_FOUND)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
include(ECMAddAppIcon)
|
||||
endif()
|
||||
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(TagLib taglib IMPORTED_TARGET)
|
||||
endif ()
|
||||
@ -51,26 +45,22 @@ set (EXE_NAME pmusic)
|
||||
file (GLOB PMUSIC_TS_FILES languages/*.ts)
|
||||
set (PMUSIC_CPP_FILES_FOR_I18N ${PMUSIC_CPP_FILES} ${PMUSIC_UI_FILES})
|
||||
|
||||
add_executable(${EXE_NAME}
|
||||
add_executable(${EXE_NAME} WIN32
|
||||
${PMUSIC_HEADER_FILES}
|
||||
${PMUSIC_CPP_FILES}
|
||||
${PMUSIC_UI_FILES}
|
||||
resources.qrc
|
||||
)
|
||||
|
||||
if(ECM_FOUND)
|
||||
ecm_add_app_icon(${EXE_NAME}
|
||||
ICONS
|
||||
dist/64-pineapple-music.png
|
||||
dist/256-pineapple-music.png
|
||||
)
|
||||
endif()
|
||||
|
||||
qt_add_translations(${EXE_NAME}
|
||||
TS_FILES
|
||||
${PMUSIC_TS_FILES}
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_sources(${EXE_NAME} PRIVATE assets/pineapple-music.rc)
|
||||
endif ()
|
||||
|
||||
if (NOT TagLib_FOUND)
|
||||
message (WARNING "TagLib not found!")
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||
@ -82,14 +72,6 @@ endif ()
|
||||
|
||||
target_link_libraries(${EXE_NAME} PRIVATE Qt::Widgets Qt::Multimedia Qt::Network)
|
||||
|
||||
# Extra build settings
|
||||
if (WIN32)
|
||||
set_property (
|
||||
TARGET ${EXE_NAME}
|
||||
PROPERTY WIN32_EXECUTABLE true
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Install settings
|
||||
if (WIN32)
|
||||
# FIXME: try to avoid install to a "bin" subfolder under windows...
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 62 KiB |
17
assets/pineapple-music.rc
Normal file
17
assets/pineapple-music.rc
Normal file
@ -0,0 +1,17 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "icons/app-icon.ico"
|
||||
1 VERSIONINFO
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "Pineapple Music - Music Player"
|
||||
VALUE "LegalCopyright", "MIT/Expat License - Copyright (C) 2024 Gary Wang"
|
||||
VALUE "ProductName", "Pineapple Music"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
BIN
dist/64-pineapple-music.png
vendored
BIN
dist/64-pineapple-music.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB |
@ -369,15 +369,27 @@ void MainWindow::initConnections()
|
||||
TagLib::AudioProperties *prop = fileRef.audioProperties();
|
||||
setAudioPropertyInfoForDisplay(prop->sampleRate(), prop->bitrate(), prop->channels(), suffix);
|
||||
}
|
||||
|
||||
if (!fileRef.isNull() && fileRef.tag()) {
|
||||
TagLib::Tag * tag = fileRef.tag();
|
||||
setAudioMetadataForDisplay(QString::fromStdString(tag->title().to8Bit(true)),
|
||||
QString::fromStdString(tag->artist().to8Bit(true)),
|
||||
QString::fromStdString(tag->album().to8Bit(true)));
|
||||
}
|
||||
#endif // NO_TAGLIB
|
||||
}
|
||||
});
|
||||
|
||||
connect(m_mediaPlayer, &QMediaPlayer::metaDataChanged, this, [=](){
|
||||
QMediaMetaData metadata(m_mediaPlayer->metaData());
|
||||
// it's known in some cases QMediaMetaData using the incorrect text codec for metadata
|
||||
// see `02 Yoiyami Hanabi.mp3`'s Title. So we don't use Qt's one if tablib is available.
|
||||
qDebug() << metadata.stringValue(QMediaMetaData::Title) << metadata.stringValue(QMediaMetaData::Author);
|
||||
#ifdef NO_TAGLIB
|
||||
setAudioMetadataForDisplay(metadata.stringValue(QMediaMetaData::Title),
|
||||
metadata.stringValue(QMediaMetaData::Author),
|
||||
metadata.stringValue(QMediaMetaData::AlbumTitle));
|
||||
#endif // NO_TAGLIB
|
||||
QVariant coverArt(metadata.value(QMediaMetaData::ThumbnailImage));
|
||||
if (!coverArt.isNull()) {
|
||||
ui->coverLabel->setPixmap(QPixmap::fromImage(coverArt.value<QImage>()));
|
||||
|
Loading…
Reference in New Issue
Block a user