2009-12-24 20:16:07 +01:00
|
|
|
/***************************************************************************
|
|
|
|
gloscope.h - description
|
|
|
|
-------------------
|
|
|
|
begin : Jan 17 2004
|
|
|
|
copyright : (C) 2004 by Adam Pigg
|
|
|
|
email : adam@piggz.co.uk
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef GLOSCOPE_H
|
|
|
|
#define GLOSCOPE_H
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef HAVE_QGLWIDGET
|
|
|
|
|
|
|
|
#include "analyzerbase.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
*@author piggz
|
|
|
|
*/
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
typedef struct {
|
2009-12-24 20:16:07 +01:00
|
|
|
float level;
|
|
|
|
uint delay;
|
2014-02-07 16:34:20 +01:00
|
|
|
} peak_tx;
|
2009-12-24 20:16:07 +01:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
class GLAnalyzer : public Analyzer::Base3D {
|
|
|
|
private:
|
2009-12-24 20:16:07 +01:00
|
|
|
std::vector<float> m_oldy;
|
|
|
|
std::vector<peak_tx> m_peaks;
|
|
|
|
|
|
|
|
void drawCube();
|
|
|
|
void drawFrame();
|
|
|
|
void drawBar(float xPos, float height);
|
|
|
|
void drawPeak(float xPos, float ypos);
|
|
|
|
void drawFloor();
|
|
|
|
|
|
|
|
GLfloat x, y;
|
2014-02-07 16:34:20 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
GLAnalyzer(QWidget*);
|
2009-12-24 20:16:07 +01:00
|
|
|
~GLAnalyzer();
|
2014-02-07 16:34:20 +01:00
|
|
|
void analyze(const Scope&);
|
|
|
|
|
|
|
|
protected:
|
2009-12-24 20:16:07 +01:00
|
|
|
void initializeGL();
|
2014-02-07 16:34:20 +01:00
|
|
|
void resizeGL(int w, int h);
|
2009-12-24 20:16:07 +01:00
|
|
|
void paintGL();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|