Move spectrum before volume element.
Tweak new analyzer.
This commit is contained in:
parent
9ca0870268
commit
2db2354e0b
@ -2,6 +2,10 @@
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QColor>
|
||||
#include <QPalette>
|
||||
|
||||
const char* GLBlockAnalyzer::kName = "GL Block Analyzer";
|
||||
|
||||
GLBlockAnalyzer::GLBlockAnalyzer(QWidget* parent)
|
||||
@ -12,13 +16,16 @@ GLBlockAnalyzer::GLBlockAnalyzer(QWidget* parent)
|
||||
}
|
||||
|
||||
void GLBlockAnalyzer::SpectrumAvailable(const QVector<float>& spectrum) {
|
||||
updateGL();
|
||||
current_spectrum_ = spectrum;
|
||||
updateGL();
|
||||
}
|
||||
|
||||
void GLBlockAnalyzer::initializeGL() {
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
QColor background_color = QApplication::palette().color(QPalette::Window);
|
||||
|
||||
glClearColor(background_color.redF(), background_color.greenF(), background_color.blueF(), 1.0);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
shader_.addShaderFromSourceFile(QGLShader::Vertex, ":shaders/glblock_vert.glsl");
|
||||
|
@ -29,7 +29,7 @@ const int GstEnginePipeline::kEqBandFrequencies[] = {
|
||||
60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000};
|
||||
|
||||
const quint32 GstEnginePipeline::kSpectrumBands = 200;
|
||||
const int GstEnginePipeline::kSpectrumThreshold = -80;
|
||||
const int GstEnginePipeline::kSpectrumThreshold = -100;
|
||||
const quint64 GstEnginePipeline::kSpectrumIntervalns = 16666666;
|
||||
|
||||
GstEnginePipeline::GstEnginePipeline(GstEngine* engine)
|
||||
@ -213,7 +213,7 @@ bool GstEnginePipeline::Init() {
|
||||
if (!convert) { return false; }
|
||||
if (rg_enabled_)
|
||||
gst_element_link_many(audioconvert_, rgvolume_, rglimiter_, audioconvert2_, NULL);
|
||||
gst_element_link_many(equalizer_preamp_, equalizer_, volume_, audioscale_, convert, spectrum_, audiosink_, NULL);
|
||||
gst_element_link_many(equalizer_preamp_, equalizer_, spectrum_, volume_, audioscale_, convert, audiosink_, NULL);
|
||||
|
||||
gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), BusCallbackSync, this);
|
||||
bus_cb_id_ = gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), BusCallback, this);
|
||||
|
@ -175,7 +175,7 @@ class GstEnginePipeline : public QObject {
|
||||
|
||||
// Elements in the audiobin
|
||||
// audioconvert ! rgvolume ! rglimiter ! audioconvert ! equalizer_preamp !
|
||||
// equalizer ! volume ! audioresample ! audioconvert ! spectrum ! audiosink
|
||||
// equalizer ! spectrum ! volume ! audioresample ! audioconvert ! audiosink
|
||||
GstElement* audioconvert_;
|
||||
GstElement* rgvolume_;
|
||||
GstElement* rglimiter_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user