24 # define WIN32_LEAN_AND_MEAN
25 # include <qt_windows.h>
26 # if defined Q_CC_MSVC
27 # pragma comment(lib, "user32.lib")
33 WindowsDesktopControl(QWidget *parent)
36 sendMessageToDesktop();
37 SetParent((HWND)m_parent->winId(), findDesktopIconWnd());
40 void sendMessageToDesktop()
42 PDWORD_PTR result =
nullptr;
43 SendMessageTimeoutW(FindWindowW(L
"Progman",
nullptr), 0x52C, 0, 0, SMTO_NORMAL, 1000, result);
46 HWND findDesktopIconWnd()
48 HWND hWorkerW = FindWindowExW(
nullptr,
nullptr, L
"WorkerW",
nullptr);
49 HWND hDefView =
nullptr;
51 while(!hDefView && hWorkerW)
53 hDefView = FindWindowExW(hWorkerW,
nullptr, L
"SHELLDLL_DefView",
nullptr);
54 hWorkerW = FindWindowExW(
nullptr, hWorkerW, L
"WorkerW",
nullptr);
57 ShowWindow(hWorkerW, 0);
58 return FindWindowW(L
"Progman",
nullptr);
66 m_animationFreshTime(0),
69 QVBoxLayout *vBoxLayout =
new QVBoxLayout(
this);
70 vBoxLayout->setContentsMargins(0, 0, 0, 0);
71 vBoxLayout->setSpacing(0);
72 setLayout(vBoxLayout);
79 bBoxLayout->setContentsMargins(0, 0, 0, 0);
80 bBoxLayout->setSpacing(0);
92 m_control =
new WindowsDesktopControl(
this);
123 w->setFixedHeight(35 + 36);
128 if(i == 0 || i == 10)
132 else if(i == 1 || i == 9)
136 else if(i == 2 || i == 8)
140 else if(i == 3 || i == 7)
144 else if(i == 4 || i == 6)
189 m_lrcManagers[MUSIC_LRC_INTERIOR_MAX_LINE / 2]->setText(text);
MusicLrcContainerForWallpaper(QWidget *parent=nullptr)
void updateBackground(const QPixmap &pix)
#define TTKStaticCast(x, y)
The class of the lrc manager base.
MusicLrcAnalysis * m_lrcAnalysis
void setPixmap(const QPixmap &pix)
AbstractDesktopControl * m_control
void setFontTransparent(int t) noexcept
virtual ~AbstractDesktopControl()=default
void setFontSize(int size) noexcept
MusicDesktopWallpaperThread * m_thread
bool isRunning() const noexcept
void changeCurrentLrcColor()
bool isValid() const noexcept
~MusicLrcContainerForWallpaper()
void render(bool immediate)
virtual void start() overridefinal
int maximum() const noexcept
void setLrcPerWidth(int width) noexcept
AbstractDesktopControl(QWidget *parent)
The class of the lrc container base.
void setTransparent(int tran) noexcept
The class of the desktop wallpaper thread.
The class of the label transition animation.
The class of the core lrc analysis.
The class of the interior lrc manager.
static constexpr int LRC_PER_WIDTH
QString text(int index) const
void setLrcFontSize(int size)
virtual void stop() overridefinal
MusicVLayoutAnimationWidget * m_layoutWidget
static constexpr const char * LRC_WALLPAPER_TPYE
MusicTransitionAnimationLabel * m_background
void setY(int y) noexcept
static constexpr int MUSIC_LRC_INTERIOR_MAX_LINE
void setItemStyleSheet(int index, int size, int transparent)
virtual void applyParameter() overridefinal
void setImagePath(const QStringList &list) noexcept
void setLrcAnalysisModel(MusicLrcAnalysis *analysis)
QList< MusicLrcManager * > m_lrcManagers
void initCurrentLrc(const QString &str)
void setLinearGradientColor(MusicLrcColor::Color color)
QList< QColor > readColorConfig(const QString &value)
void setLrcAnalysisModel(MusicLrcAnalysis *analysis) noexcept
void updateAnimationLrc()
void updateCurrentLrc(qint64 time)
#define TTKObjectCast(x, y)