#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();

signals:
    void artClicked();

protected:
    void mousePressEvent(QMouseEvent* event) override;

private slots:
    void updateRotation();

private:
    QPixmap buildRecord(const QPixmap& src, int size);
    QPixmap buildLabelMask(const QPixmap& src, int size);

    QLabel* artLabel_;
    QPixmap disc_;          // final assembled vinyl-only disc (with grooves + sheen + hole + label)
    QTimer* timer_;

    qreal rotationAngle_ = 0;
    int size_;
};
