Move code that handles spinning album art to own class
This commit is contained in:
@@ -11,6 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/components/albumTile/albumtile.cpp \
|
src/components/albumTile/albumtile.cpp \
|
||||||
|
src/components/spinningAlbumArt/spinningalbumart.cpp \
|
||||||
src/main.cpp \
|
src/main.cpp \
|
||||||
src/windows/musicSelector/musicSelector.cpp \
|
src/windows/musicSelector/musicSelector.cpp \
|
||||||
src/windows/playerWindow/playerWindow.cpp \
|
src/windows/playerWindow/playerWindow.cpp \
|
||||||
@@ -23,6 +24,7 @@ SOURCES += \
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/components/albumTile/albumtile.h \
|
src/components/albumTile/albumtile.h \
|
||||||
|
src/components/spinningAlbumArt/spinningalbumart.h \
|
||||||
src/data/cleanerScripts.h \
|
src/data/cleanerScripts.h \
|
||||||
src/windows/musicSelector/musicSelector.h \
|
src/windows/musicSelector/musicSelector.h \
|
||||||
src/windows/playerWindow/playerWindow.h \
|
src/windows/playerWindow/playerWindow.h \
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -53,6 +53,7 @@ OBJECTS_DIR = ./
|
|||||||
####### Files
|
####### Files
|
||||||
|
|
||||||
SOURCES = ../../src/components/albumTile/albumtile.cpp \
|
SOURCES = ../../src/components/albumTile/albumtile.cpp \
|
||||||
|
../../src/components/spinningAlbumArt/spinningalbumart.cpp \
|
||||||
../../src/main.cpp \
|
../../src/main.cpp \
|
||||||
../../src/windows/musicSelector/musicSelector.cpp \
|
../../src/windows/musicSelector/musicSelector.cpp \
|
||||||
../../src/windows/playerWindow/playerWindow.cpp \
|
../../src/windows/playerWindow/playerWindow.cpp \
|
||||||
@@ -60,11 +61,13 @@ SOURCES = ../../src/components/albumTile/albumtile.cpp \
|
|||||||
../../src/components/mediaButton/mediaButton.cpp \
|
../../src/components/mediaButton/mediaButton.cpp \
|
||||||
../../src/layout/flowLayout/flowLayout.cpp qrc_qmake_qmake_qm_files.cpp \
|
../../src/layout/flowLayout/flowLayout.cpp qrc_qmake_qmake_qm_files.cpp \
|
||||||
moc_albumtile.cpp \
|
moc_albumtile.cpp \
|
||||||
|
moc_spinningalbumart.cpp \
|
||||||
moc_musicSelector.cpp \
|
moc_musicSelector.cpp \
|
||||||
moc_playerWindow.cpp \
|
moc_playerWindow.cpp \
|
||||||
moc_albumButton.cpp \
|
moc_albumButton.cpp \
|
||||||
moc_mediaButton.cpp
|
moc_mediaButton.cpp
|
||||||
OBJECTS = albumtile.o \
|
OBJECTS = albumtile.o \
|
||||||
|
spinningalbumart.o \
|
||||||
main.o \
|
main.o \
|
||||||
musicSelector.o \
|
musicSelector.o \
|
||||||
playerWindow.o \
|
playerWindow.o \
|
||||||
@@ -73,6 +76,7 @@ OBJECTS = albumtile.o \
|
|||||||
flowLayout.o \
|
flowLayout.o \
|
||||||
qrc_qmake_qmake_qm_files.o \
|
qrc_qmake_qmake_qm_files.o \
|
||||||
moc_albumtile.o \
|
moc_albumtile.o \
|
||||||
|
moc_spinningalbumart.o \
|
||||||
moc_musicSelector.o \
|
moc_musicSelector.o \
|
||||||
moc_playerWindow.o \
|
moc_playerWindow.o \
|
||||||
moc_albumButton.o \
|
moc_albumButton.o \
|
||||||
@@ -450,6 +454,7 @@ DIST = /opt/homebrew/share/qt/mkspecs/features/spec_pre.prf \
|
|||||||
/opt/homebrew/share/qt/mkspecs/features/yacc.prf \
|
/opt/homebrew/share/qt/mkspecs/features/yacc.prf \
|
||||||
/opt/homebrew/share/qt/mkspecs/features/lex.prf \
|
/opt/homebrew/share/qt/mkspecs/features/lex.prf \
|
||||||
../../../../Music-Player.pro ../../src/components/albumTile/albumtile.h \
|
../../../../Music-Player.pro ../../src/components/albumTile/albumtile.h \
|
||||||
|
../../src/components/spinningAlbumArt/spinningalbumart.h \
|
||||||
../../src/data/cleanerScripts.h \
|
../../src/data/cleanerScripts.h \
|
||||||
../../src/windows/musicSelector/musicSelector.h \
|
../../src/windows/musicSelector/musicSelector.h \
|
||||||
../../src/windows/playerWindow/playerWindow.h \
|
../../src/windows/playerWindow/playerWindow.h \
|
||||||
@@ -457,6 +462,7 @@ DIST = /opt/homebrew/share/qt/mkspecs/features/spec_pre.prf \
|
|||||||
../../src/components/mediaButton/mediaButton.h \
|
../../src/components/mediaButton/mediaButton.h \
|
||||||
../../src/data/albumInformation.h \
|
../../src/data/albumInformation.h \
|
||||||
../../src/layout/flowLayout/flowLayout.h ../../src/components/albumTile/albumtile.cpp \
|
../../src/layout/flowLayout/flowLayout.h ../../src/components/albumTile/albumtile.cpp \
|
||||||
|
../../src/components/spinningAlbumArt/spinningalbumart.cpp \
|
||||||
../../src/main.cpp \
|
../../src/main.cpp \
|
||||||
../../src/windows/musicSelector/musicSelector.cpp \
|
../../src/windows/musicSelector/musicSelector.cpp \
|
||||||
../../src/windows/playerWindow/playerWindow.cpp \
|
../../src/windows/playerWindow/playerWindow.cpp \
|
||||||
@@ -1272,8 +1278,8 @@ distdir: FORCE
|
|||||||
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
|
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
|
||||||
$(COPY_FILE) --parents qmake_qmake_qm_files.qrc $(DISTDIR)/
|
$(COPY_FILE) --parents qmake_qmake_qm_files.qrc $(DISTDIR)/
|
||||||
$(COPY_FILE) --parents /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp $(DISTDIR)/
|
$(COPY_FILE) --parents /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp $(DISTDIR)/
|
||||||
$(COPY_FILE) --parents ../../src/components/albumTile/albumtile.h ../../src/data/cleanerScripts.h ../../src/windows/musicSelector/musicSelector.h ../../src/windows/playerWindow/playerWindow.h ../../src/components/albumButton/albumButton.h ../../src/components/mediaButton/mediaButton.h ../../src/data/albumInformation.h ../../src/layout/flowLayout/flowLayout.h $(DISTDIR)/
|
$(COPY_FILE) --parents ../../src/components/albumTile/albumtile.h ../../src/components/spinningAlbumArt/spinningalbumart.h ../../src/data/cleanerScripts.h ../../src/windows/musicSelector/musicSelector.h ../../src/windows/playerWindow/playerWindow.h ../../src/components/albumButton/albumButton.h ../../src/components/mediaButton/mediaButton.h ../../src/data/albumInformation.h ../../src/layout/flowLayout/flowLayout.h $(DISTDIR)/
|
||||||
$(COPY_FILE) --parents ../../src/components/albumTile/albumtile.cpp ../../src/main.cpp ../../src/windows/musicSelector/musicSelector.cpp ../../src/windows/playerWindow/playerWindow.cpp ../../src/components/albumButton/albumButton.cpp ../../src/components/mediaButton/mediaButton.cpp ../../src/layout/flowLayout/flowLayout.cpp $(DISTDIR)/
|
$(COPY_FILE) --parents ../../src/components/albumTile/albumtile.cpp ../../src/components/spinningAlbumArt/spinningalbumart.cpp ../../src/main.cpp ../../src/windows/musicSelector/musicSelector.cpp ../../src/windows/playerWindow/playerWindow.cpp ../../src/components/albumButton/albumButton.cpp ../../src/components/mediaButton/mediaButton.cpp ../../src/layout/flowLayout/flowLayout.cpp $(DISTDIR)/
|
||||||
$(COPY_FILE) --parents ../../src/windows/musicSelector/musicSelector.ui $(DISTDIR)/
|
$(COPY_FILE) --parents ../../src/windows/musicSelector/musicSelector.ui $(DISTDIR)/
|
||||||
|
|
||||||
|
|
||||||
@@ -1316,9 +1322,9 @@ compiler_moc_predefs_clean:
|
|||||||
moc_predefs.h: /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp
|
moc_predefs.h: /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp
|
||||||
/Library/Developer/CommandLineTools/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++1z $(EXPORT_ARCH_ARGS) -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=14.0 -Wall -Wextra -dM -E -o moc_predefs.h /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp
|
/Library/Developer/CommandLineTools/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++1z $(EXPORT_ARCH_ARGS) -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=14.0 -Wall -Wextra -dM -E -o moc_predefs.h /opt/homebrew/share/qt/mkspecs/features/data/dummy.cpp
|
||||||
|
|
||||||
compiler_moc_header_make_all: moc_albumtile.cpp moc_musicSelector.cpp moc_playerWindow.cpp moc_albumButton.cpp moc_mediaButton.cpp
|
compiler_moc_header_make_all: moc_albumtile.cpp moc_spinningalbumart.cpp moc_musicSelector.cpp moc_playerWindow.cpp moc_albumButton.cpp moc_mediaButton.cpp
|
||||||
compiler_moc_header_clean:
|
compiler_moc_header_clean:
|
||||||
-$(DEL_FILE) moc_albumtile.cpp moc_musicSelector.cpp moc_playerWindow.cpp moc_albumButton.cpp moc_mediaButton.cpp
|
-$(DEL_FILE) moc_albumtile.cpp moc_spinningalbumart.cpp moc_musicSelector.cpp moc_playerWindow.cpp moc_albumButton.cpp moc_mediaButton.cpp
|
||||||
moc_albumtile.cpp: ../../src/components/albumTile/albumtile.h \
|
moc_albumtile.cpp: ../../src/components/albumTile/albumtile.h \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
||||||
@@ -1337,6 +1343,19 @@ moc_albumtile.cpp: ../../src/components/albumTile/albumtile.h \
|
|||||||
/opt/homebrew/share/qt/libexec/moc
|
/opt/homebrew/share/qt/libexec/moc
|
||||||
/opt/homebrew/share/qt/libexec/moc $(DEFINES) --include /Users/lucas/Developer/Qt-Music-Player/build/Desktop-Debug/moc_predefs.h -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/Users/lucas/Developer/Qt-Music-Player -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtMultimedia.framework/Headers -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Library/Developer/CommandLineTools/usr/lib/clang/17/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/usr/include -F/opt/homebrew/lib ../../src/components/albumTile/albumtile.h -o moc_albumtile.cpp
|
/opt/homebrew/share/qt/libexec/moc $(DEFINES) --include /Users/lucas/Developer/Qt-Music-Player/build/Desktop-Debug/moc_predefs.h -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/Users/lucas/Developer/Qt-Music-Player -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtMultimedia.framework/Headers -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Library/Developer/CommandLineTools/usr/lib/clang/17/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/usr/include -F/opt/homebrew/lib ../../src/components/albumTile/albumtile.h -o moc_albumtile.cpp
|
||||||
|
|
||||||
|
moc_spinningalbumart.cpp: ../../src/components/spinningAlbumArt/spinningalbumart.h \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QLabel \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qlabel.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPixmap \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h \
|
||||||
|
/opt/homebrew/lib/QtCore.framework/Headers/QTimer \
|
||||||
|
/opt/homebrew/lib/QtCore.framework/Headers/qtimer.h \
|
||||||
|
moc_predefs.h \
|
||||||
|
/opt/homebrew/share/qt/libexec/moc
|
||||||
|
/opt/homebrew/share/qt/libexec/moc $(DEFINES) --include /Users/lucas/Developer/Qt-Music-Player/build/Desktop-Debug/moc_predefs.h -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/Users/lucas/Developer/Qt-Music-Player -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtMultimedia.framework/Headers -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Library/Developer/CommandLineTools/usr/lib/clang/17/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/usr/include -F/opt/homebrew/lib ../../src/components/spinningAlbumArt/spinningalbumart.h -o moc_spinningalbumart.cpp
|
||||||
|
|
||||||
moc_musicSelector.cpp: ../../src/windows/musicSelector/musicSelector.h \
|
moc_musicSelector.cpp: ../../src/windows/musicSelector/musicSelector.h \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
||||||
@@ -1367,6 +1386,9 @@ moc_playerWindow.cpp: ../../src/windows/playerWindow/playerWindow.h \
|
|||||||
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h \
|
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/QStringList \
|
/opt/homebrew/lib/QtCore.framework/Headers/QStringList \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/qstringlist.h \
|
/opt/homebrew/lib/QtCore.framework/Headers/qstringlist.h \
|
||||||
|
../../src/components/spinningalbumart/spinningAlbumArt.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPixmap \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h \
|
||||||
moc_predefs.h \
|
moc_predefs.h \
|
||||||
/opt/homebrew/share/qt/libexec/moc
|
/opt/homebrew/share/qt/libexec/moc
|
||||||
/opt/homebrew/share/qt/libexec/moc $(DEFINES) --include /Users/lucas/Developer/Qt-Music-Player/build/Desktop-Debug/moc_predefs.h -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/Users/lucas/Developer/Qt-Music-Player -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtMultimedia.framework/Headers -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Library/Developer/CommandLineTools/usr/lib/clang/17/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/usr/include -F/opt/homebrew/lib ../../src/windows/playerWindow/playerWindow.h -o moc_playerWindow.cpp
|
/opt/homebrew/share/qt/libexec/moc $(DEFINES) --include /Users/lucas/Developer/Qt-Music-Player/build/Desktop-Debug/moc_predefs.h -I/opt/homebrew/share/qt/mkspecs/macx-clang -I/Users/lucas/Developer/Qt-Music-Player -I/opt/homebrew/lib/QtWidgets.framework/Headers -I/opt/homebrew/lib/QtMultimedia.framework/Headers -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtNetwork.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Library/Developer/CommandLineTools/usr/lib/clang/17/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/usr/include -F/opt/homebrew/lib ../../src/windows/playerWindow/playerWindow.h -o moc_playerWindow.cpp
|
||||||
@@ -1436,6 +1458,21 @@ albumtile.o: ../../src/components/albumTile/albumtile.cpp ../../src/components/a
|
|||||||
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o albumtile.o ../../src/components/albumTile/albumtile.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o albumtile.o ../../src/components/albumTile/albumtile.cpp
|
||||||
|
|
||||||
|
spinningalbumart.o: ../../src/components/spinningAlbumArt/spinningalbumart.cpp ../../src/components/spinningAlbumArt/spinningalbumart.h \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QLabel \
|
||||||
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qlabel.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPixmap \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h \
|
||||||
|
/opt/homebrew/lib/QtCore.framework/Headers/QTimer \
|
||||||
|
/opt/homebrew/lib/QtCore.framework/Headers/qtimer.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPainter \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpainter.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPainterPath \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpainterpath.h
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o spinningalbumart.o ../../src/components/spinningAlbumArt/spinningalbumart.cpp
|
||||||
|
|
||||||
main.o: ../../src/main.cpp ../../src/windows/musicSelector/musicSelector.h \
|
main.o: ../../src/main.cpp ../../src/windows/musicSelector/musicSelector.h \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QWidget \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qwidget.h \
|
||||||
@@ -1478,6 +1515,9 @@ musicSelector.o: ../../src/windows/musicSelector/musicSelector.cpp ../../src/win
|
|||||||
/opt/homebrew/lib/QtMultimedia.framework/Headers/qaudiooutput.h \
|
/opt/homebrew/lib/QtMultimedia.framework/Headers/qaudiooutput.h \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/QTimer \
|
/opt/homebrew/lib/QtCore.framework/Headers/QTimer \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/qtimer.h \
|
/opt/homebrew/lib/QtCore.framework/Headers/qtimer.h \
|
||||||
|
../../src/components/spinningalbumart/spinningAlbumArt.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPixmap \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h \
|
||||||
../../src/layout/flowlayout/flowLayout.h \
|
../../src/layout/flowlayout/flowLayout.h \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/QLayout \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QLayout \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/qlayout.h \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qlayout.h \
|
||||||
@@ -1509,6 +1549,9 @@ playerWindow.o: ../../src/windows/playerWindow/playerWindow.cpp ../../src/window
|
|||||||
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h \
|
/opt/homebrew/lib/QtCore.framework/Headers/qstring.h \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/QStringList \
|
/opt/homebrew/lib/QtCore.framework/Headers/QStringList \
|
||||||
/opt/homebrew/lib/QtCore.framework/Headers/qstringlist.h \
|
/opt/homebrew/lib/QtCore.framework/Headers/qstringlist.h \
|
||||||
|
../../src/components/spinningalbumart/spinningAlbumArt.h \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/QPixmap \
|
||||||
|
/opt/homebrew/lib/QtGui.framework/Headers/qpixmap.h \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/QVBoxLayout \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/QVBoxLayout \
|
||||||
/opt/homebrew/lib/QtWidgets.framework/Headers/qboxlayout.h \
|
/opt/homebrew/lib/QtWidgets.framework/Headers/qboxlayout.h \
|
||||||
/opt/homebrew/lib/QtGui.framework/Headers/QPainter \
|
/opt/homebrew/lib/QtGui.framework/Headers/QPainter \
|
||||||
@@ -1688,6 +1731,9 @@ qrc_qmake_qmake_qm_files.o: qrc_qmake_qmake_qm_files.cpp
|
|||||||
moc_albumtile.o: moc_albumtile.cpp
|
moc_albumtile.o: moc_albumtile.cpp
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_albumtile.o moc_albumtile.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_albumtile.o moc_albumtile.cpp
|
||||||
|
|
||||||
|
moc_spinningalbumart.o: moc_spinningalbumart.cpp
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_spinningalbumart.o moc_spinningalbumart.cpp
|
||||||
|
|
||||||
moc_musicSelector.o: moc_musicSelector.cpp
|
moc_musicSelector.o: moc_musicSelector.cpp
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_musicSelector.o moc_musicSelector.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_musicSelector.o moc_musicSelector.cpp
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
118
build/Desktop-Debug/moc_spinningalbumart.cpp
Normal file
118
build/Desktop-Debug/moc_spinningalbumart.cpp
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Meta object code from reading C++ file 'spinningalbumart.h'
|
||||||
|
**
|
||||||
|
** Created by: The Qt Meta Object Compiler version 69 (Qt 6.9.3)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "../../src/components/spinningAlbumArt/spinningalbumart.h"
|
||||||
|
#include <QtGui/qtextcursor.h>
|
||||||
|
#include <QtCore/qmetatype.h>
|
||||||
|
|
||||||
|
#include <QtCore/qtmochelpers.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
#include <QtCore/qxptype_traits.h>
|
||||||
|
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||||
|
#error "The header file 'spinningalbumart.h' doesn't include <QObject>."
|
||||||
|
#elif Q_MOC_OUTPUT_REVISION != 69
|
||||||
|
#error "This file was generated using the moc from 6.9.3. It"
|
||||||
|
#error "cannot be used with the include files from this version of Qt."
|
||||||
|
#error "(The moc has changed too much.)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef Q_CONSTINIT
|
||||||
|
#define Q_CONSTINIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
|
QT_WARNING_DISABLE_GCC("-Wuseless-cast")
|
||||||
|
namespace {
|
||||||
|
struct qt_meta_tag_ZN16SpinningAlbumArtE_t {};
|
||||||
|
} // unnamed namespace
|
||||||
|
|
||||||
|
template <> constexpr inline auto SpinningAlbumArt::qt_create_metaobjectdata<qt_meta_tag_ZN16SpinningAlbumArtE_t>()
|
||||||
|
{
|
||||||
|
namespace QMC = QtMocConstants;
|
||||||
|
QtMocHelpers::StringRefStorage qt_stringData {
|
||||||
|
"SpinningAlbumArt",
|
||||||
|
"start",
|
||||||
|
"",
|
||||||
|
"stop",
|
||||||
|
"updateRotation"
|
||||||
|
};
|
||||||
|
|
||||||
|
QtMocHelpers::UintData qt_methods {
|
||||||
|
// Slot 'start'
|
||||||
|
QtMocHelpers::SlotData<void()>(1, 2, QMC::AccessPublic, QMetaType::Void),
|
||||||
|
// Slot 'stop'
|
||||||
|
QtMocHelpers::SlotData<void()>(3, 2, QMC::AccessPublic, QMetaType::Void),
|
||||||
|
// Slot 'updateRotation'
|
||||||
|
QtMocHelpers::SlotData<void()>(4, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||||
|
};
|
||||||
|
QtMocHelpers::UintData qt_properties {
|
||||||
|
};
|
||||||
|
QtMocHelpers::UintData qt_enums {
|
||||||
|
};
|
||||||
|
return QtMocHelpers::metaObjectData<SpinningAlbumArt, qt_meta_tag_ZN16SpinningAlbumArtE_t>(QMC::MetaObjectFlag{}, qt_stringData,
|
||||||
|
qt_methods, qt_properties, qt_enums);
|
||||||
|
}
|
||||||
|
Q_CONSTINIT const QMetaObject SpinningAlbumArt::staticMetaObject = { {
|
||||||
|
QMetaObject::SuperData::link<QWidget::staticMetaObject>(),
|
||||||
|
qt_staticMetaObjectStaticContent<qt_meta_tag_ZN16SpinningAlbumArtE_t>.stringdata,
|
||||||
|
qt_staticMetaObjectStaticContent<qt_meta_tag_ZN16SpinningAlbumArtE_t>.data,
|
||||||
|
qt_static_metacall,
|
||||||
|
nullptr,
|
||||||
|
qt_staticMetaObjectRelocatingContent<qt_meta_tag_ZN16SpinningAlbumArtE_t>.metaTypes,
|
||||||
|
nullptr
|
||||||
|
} };
|
||||||
|
|
||||||
|
void SpinningAlbumArt::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||||
|
{
|
||||||
|
auto *_t = static_cast<SpinningAlbumArt *>(_o);
|
||||||
|
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||||
|
switch (_id) {
|
||||||
|
case 0: _t->start(); break;
|
||||||
|
case 1: _t->stop(); break;
|
||||||
|
case 2: _t->updateRotation(); break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void)_a;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QMetaObject *SpinningAlbumArt::metaObject() const
|
||||||
|
{
|
||||||
|
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *SpinningAlbumArt::qt_metacast(const char *_clname)
|
||||||
|
{
|
||||||
|
if (!_clname) return nullptr;
|
||||||
|
if (!strcmp(_clname, qt_staticMetaObjectStaticContent<qt_meta_tag_ZN16SpinningAlbumArtE_t>.strings))
|
||||||
|
return static_cast<void*>(this);
|
||||||
|
return QWidget::qt_metacast(_clname);
|
||||||
|
}
|
||||||
|
|
||||||
|
int SpinningAlbumArt::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||||
|
{
|
||||||
|
_id = QWidget::qt_metacall(_c, _id, _a);
|
||||||
|
if (_id < 0)
|
||||||
|
return _id;
|
||||||
|
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||||
|
if (_id < 3)
|
||||||
|
qt_static_metacall(this, _c, _id, _a);
|
||||||
|
_id -= 3;
|
||||||
|
}
|
||||||
|
if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||||
|
if (_id < 3)
|
||||||
|
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();
|
||||||
|
_id -= 3;
|
||||||
|
}
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
QT_WARNING_POP
|
||||||
BIN
build/Desktop-Debug/moc_spinningalbumart.o
Normal file
BIN
build/Desktop-Debug/moc_spinningalbumart.o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/Desktop-Debug/spinningalbumart.o
Normal file
BIN
build/Desktop-Debug/spinningalbumart.o
Normal file
Binary file not shown.
82
src/components/spinningAlbumArt/spinningalbumart.cpp
Normal file
82
src/components/spinningAlbumArt/spinningalbumart.cpp
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
#include "spinningalbumart.h"
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPainterPath>
|
||||||
|
|
||||||
|
SpinningAlbumArt::SpinningAlbumArt(const QString& imagePath, int size, QWidget* parent)
|
||||||
|
: QWidget(parent), size_(size)
|
||||||
|
{
|
||||||
|
artLabel_ = new QLabel(this);
|
||||||
|
artLabel_->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
|
setFixedSize(size, size);
|
||||||
|
|
||||||
|
// Load and crop square
|
||||||
|
QPixmap pix(imagePath);
|
||||||
|
QPixmap scaled = pix.scaled(size, size,
|
||||||
|
Qt::KeepAspectRatioByExpanding,
|
||||||
|
Qt::SmoothTransformation);
|
||||||
|
|
||||||
|
int side = qMin(scaled.width(), scaled.height());
|
||||||
|
QPixmap square = scaled.copy(
|
||||||
|
(scaled.width() - side) / 2,
|
||||||
|
(scaled.height() - side) / 2,
|
||||||
|
side,
|
||||||
|
side
|
||||||
|
);
|
||||||
|
|
||||||
|
// Mask into circle
|
||||||
|
discArt_ = createCircularDisc(square, size);
|
||||||
|
artLabel_->setPixmap(discArt_);
|
||||||
|
|
||||||
|
// Setup spin timer
|
||||||
|
timer_ = new QTimer(this);
|
||||||
|
timer_->setInterval(16);
|
||||||
|
connect(timer_, &QTimer::timeout, this, &SpinningAlbumArt::updateRotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
QPixmap SpinningAlbumArt::createCircularDisc(const QPixmap& src, int size)
|
||||||
|
{
|
||||||
|
QPixmap disc(size, size);
|
||||||
|
disc.fill(Qt::transparent);
|
||||||
|
|
||||||
|
QPainter p(&disc);
|
||||||
|
p.setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
|
QPainterPath path;
|
||||||
|
path.addEllipse(0, 0, size, size);
|
||||||
|
p.setClipPath(path);
|
||||||
|
|
||||||
|
p.drawPixmap(0, 0, src);
|
||||||
|
|
||||||
|
return disc;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpinningAlbumArt::start()
|
||||||
|
{
|
||||||
|
timer_->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpinningAlbumArt::stop()
|
||||||
|
{
|
||||||
|
timer_->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpinningAlbumArt::updateRotation()
|
||||||
|
{
|
||||||
|
rotationAngle_ += 0.6;
|
||||||
|
|
||||||
|
QPixmap frame(size_, size_);
|
||||||
|
frame.fill(Qt::transparent);
|
||||||
|
|
||||||
|
QPainter p(&frame);
|
||||||
|
p.setRenderHint(QPainter::Antialiasing);
|
||||||
|
p.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
|
p.translate(size_ / 2, size_ / 2);
|
||||||
|
p.rotate(rotationAngle_);
|
||||||
|
p.translate(-size_ / 2, -size_ / 2);
|
||||||
|
|
||||||
|
p.drawPixmap(0, 0, discArt_);
|
||||||
|
|
||||||
|
artLabel_->setPixmap(frame);
|
||||||
|
}
|
||||||
30
src/components/spinningAlbumArt/spinningalbumart.h
Normal file
30
src/components/spinningAlbumArt/spinningalbumart.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPixmap>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
class SpinningAlbumArt : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit SpinningAlbumArt(const QString& imagePath, int size = 250, QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void start();
|
||||||
|
void stop();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateRotation();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPixmap discArt_; // circular-masked album image
|
||||||
|
QLabel* artLabel_; // widget that displays the spinning frame
|
||||||
|
QTimer* timer_; // animation timer
|
||||||
|
qreal rotationAngle_ = 0;
|
||||||
|
int size_; // final diameter of the disc
|
||||||
|
|
||||||
|
QPixmap createCircularDisc(const QPixmap& src, int size);
|
||||||
|
};
|
||||||
@@ -14,110 +14,27 @@ PlayerWindow::PlayerWindow(const AlbumData& item, QWidget* parent)
|
|||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
// --------------------------------------
|
// SUPER SIMPLE now:
|
||||||
// 1. CREATE ALBUM ART (CIRCULAR)
|
spinningArt_ = new SpinningAlbumArt(item.imagePath, 250);
|
||||||
// --------------------------------------
|
layout->addWidget(spinningArt_);
|
||||||
artLabel_ = new QLabel;
|
|
||||||
artLabel_->setAlignment(Qt::AlignCenter);
|
|
||||||
layout->addWidget(artLabel_);
|
|
||||||
|
|
||||||
QPixmap pix(item.imagePath);
|
|
||||||
|
|
||||||
// Scale, crop square
|
|
||||||
QPixmap scaled = pix.scaled(250, 250,
|
|
||||||
Qt::KeepAspectRatioByExpanding,
|
|
||||||
Qt::SmoothTransformation);
|
|
||||||
|
|
||||||
int side = qMin(scaled.width(), scaled.height());
|
|
||||||
QPixmap square = scaled.copy(
|
|
||||||
(scaled.width() - side) / 2,
|
|
||||||
(scaled.height() - side) / 2,
|
|
||||||
side,
|
|
||||||
side
|
|
||||||
);
|
|
||||||
|
|
||||||
// Mask to circle
|
|
||||||
discArt_ = QPixmap(side, side);
|
|
||||||
discArt_.fill(Qt::transparent);
|
|
||||||
|
|
||||||
{
|
|
||||||
QPainter p(&discArt_);
|
|
||||||
p.setRenderHint(QPainter::Antialiasing);
|
|
||||||
|
|
||||||
QPainterPath path;
|
|
||||||
path.addEllipse(0, 0, side, side);
|
|
||||||
p.setClipPath(path);
|
|
||||||
|
|
||||||
p.drawPixmap(0, 0, square);
|
|
||||||
}
|
|
||||||
|
|
||||||
artLabel_->setPixmap(discArt_);
|
|
||||||
|
|
||||||
// --------------------------------------
|
|
||||||
// 2. TRACK LABEL
|
|
||||||
// --------------------------------------
|
|
||||||
trackLabel_ = new QLabel("Track 1");
|
trackLabel_ = new QLabel("Track 1");
|
||||||
trackLabel_->setAlignment(Qt::AlignCenter);
|
trackLabel_->setAlignment(Qt::AlignCenter);
|
||||||
trackLabel_->setStyleSheet("font-size: 14px; font-weight: 500;");
|
trackLabel_->setStyleSheet("font-size: 14px; font-weight: 500;");
|
||||||
layout->addWidget(trackLabel_);
|
layout->addWidget(trackLabel_);
|
||||||
|
|
||||||
// --------------------------------------
|
|
||||||
// 3. SPINNING TIMER
|
|
||||||
// --------------------------------------
|
|
||||||
spinTimer_ = new QTimer(this);
|
|
||||||
spinTimer_->setInterval(16);
|
|
||||||
|
|
||||||
connect(spinTimer_, &QTimer::timeout, this, [this]() {
|
|
||||||
rotationAngle_ += 0.6;
|
|
||||||
|
|
||||||
int side = discArt_.width();
|
|
||||||
QPixmap frame(side, side);
|
|
||||||
frame.fill(Qt::transparent);
|
|
||||||
|
|
||||||
QPainter p(&frame);
|
|
||||||
p.setRenderHint(QPainter::Antialiasing);
|
|
||||||
p.setRenderHint(QPainter::SmoothPixmapTransform);
|
|
||||||
|
|
||||||
// rotate around center
|
|
||||||
p.translate(side / 2, side / 2);
|
|
||||||
p.rotate(rotationAngle_);
|
|
||||||
p.translate(-side / 2, -side / 2);
|
|
||||||
|
|
||||||
p.drawPixmap(0, 0, discArt_);
|
|
||||||
|
|
||||||
// If you eventually add overlay:
|
|
||||||
// p.resetTransform();
|
|
||||||
// p.drawPixmap(0, 0, overlayArt_);
|
|
||||||
|
|
||||||
artLabel_->setPixmap(frame);
|
|
||||||
});
|
|
||||||
|
|
||||||
// --------------------------------------
|
|
||||||
// 4. MEDIA PLAYER SETUP
|
|
||||||
// --------------------------------------
|
|
||||||
player_ = new QMediaPlayer(this);
|
player_ = new QMediaPlayer(this);
|
||||||
audio_ = new QAudioOutput(this);
|
audio_ = new QAudioOutput(this);
|
||||||
player_->setAudioOutput(audio_);
|
player_->setAudioOutput(audio_);
|
||||||
|
|
||||||
connect(player_, &QMediaPlayer::mediaStatusChanged, this,
|
|
||||||
[this](QMediaPlayer::MediaStatus s) {
|
|
||||||
if (s == QMediaPlayer::EndOfMedia) {
|
|
||||||
spinTimer_->stop();
|
|
||||||
playNext();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(player_, &QMediaPlayer::playbackStateChanged, this,
|
connect(player_, &QMediaPlayer::playbackStateChanged, this,
|
||||||
[this](QMediaPlayer::PlaybackState st) {
|
[this](QMediaPlayer::PlaybackState st){
|
||||||
if (st == QMediaPlayer::PlayingState)
|
if (st == QMediaPlayer::PlayingState)
|
||||||
spinTimer_->start();
|
spinningArt_->start();
|
||||||
else
|
else
|
||||||
spinTimer_->stop();
|
spinningArt_->stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
// --------------------------------------
|
|
||||||
// 5. PLAY FIRST TRACK
|
|
||||||
// --------------------------------------
|
|
||||||
playNext();
|
playNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
#include <QAudioOutput>
|
#include <QAudioOutput>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "src/data/albumInformation.h"
|
#include "src/data/albumInformation.h"
|
||||||
|
#include "src/components/spinningalbumart/spinningAlbumArt.h"
|
||||||
|
|
||||||
class PlayerWindow : public QWidget {
|
class PlayerWindow : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
SpinningAlbumArt* spinningArt_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlayerWindow(const AlbumData& item, QWidget* parent = nullptr);
|
explicit PlayerWindow(const AlbumData& item, QWidget* parent = nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user