Files
Renderive/YSGraphic_Core/plottable/AudioFrequent.cpp
T
2026-07-23 11:10:17 +08:00

39 lines
1.4 KiB
C++

#include "AudioFrequent_p.h"
#include "../Axis/TimeAxis.h"
namespace YSG {
Q_Ptr_cpp(AudioFrequent)
PROP_P(AudioFrequent, int, timePointSize)
PROP_P(AudioFrequent, TimeAxis*, timeAxis)
PROP_P(AudioFrequent, Axis*, valueAxis)
PROP_P(AudioFrequent, Range, keyRange)
PROP_P(AudioFrequent, QColor, color)
AudioFrequent::Builder::Builder(TimeAxis* timeAxis, Axis* valueAxis) {
ASSERT(timeAxis->mPlot != nullptr, "AudioFrequent build error! timeAxis->mPlot == nullptr");
ASSERT(timeAxis->mPlot == valueAxis->mPlot, "AudioFrequent build error! timeAxis->mPlot != valueAxis->mPlot");
plot = timeAxis->mPlot;
this->timeAxis = timeAxis;
this->valueAxis = valueAxis;
}
AudioFrequent* AudioFrequent::Builder::build() {
auto ret = new AudioFrequent();
ret->init(plot, layerName);
AudioFrequentPrivate* pd = ret->d();
AudioFrequentRenderState* sc = reinterpret_cast<AudioFrequentRenderState*>(pd->state(State_Edit));
PROP_R(int, timePointSize)
PROP_R(TimeAxis*, timeAxis)
PROP_R(Axis*, valueAxis)
PROP_R(Range, keyRange)
PROP_R(QColor, color)
return ret;
}
void AudioFrequent::giveData(int tick, double data) {
Q_UNUSED(tick)
if(!ok()) return;
INIT_SET(AudioFrequent)
td->mDataList.push_front(data);
}
}