2#include <Media/Sound/WaveformComputer.hpp>
9#include <nano_observer.hpp>
10#include <score_plugin_media_export.h>
33 ,
public Nano::Observer
39 explicit WaveformRenderer(QSizeF size,
bool threaded =
true, QObject* parent =
nullptr);
44 void setFile(
const QString& path);
45 const QString& path()
const noexcept {
return m_path; }
46 const std::shared_ptr<AudioFile>& file()
const noexcept {
return m_file; }
49 void setRange(
double begin,
double end);
50 void setSize(QSizeF size,
double devicePixelRatio);
53 bool hasWaveform() const noexcept {
return !m_images.empty(); }
57 void paint(QPainter& painter,
const QRectF& rect,
double devicePixelRatio);
59 void updated() E_SIGNAL(SCORE_PLUGIN_MEDIA_EXPORT, updated);
62 void on_finishedDecoding();
70 QVector<QImage*> m_images;
71 ComputedWaveform m_wf{};
72 std::optional<WaveformRequest> m_lastRequest;
80 double m_layerWidth{};