File indexing completed on 2025-01-05 04:25:41

0001 /****************************************************************************************
0002  * Copyright (c) 2004 Enrico Ros <eros.kde@email.it>                                    *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef DISCO_ANALYZER_H
0018 #define DISCO_ANALYZER_H
0019 
0020 
0021 #include "AnalyzerBase.h"
0022 
0023 
0024 
0025 class DiscoAnalyzer : public Analyzer::Base
0026 {
0027 public:
0028     explicit DiscoAnalyzer( QWidget * );
0029     ~DiscoAnalyzer();
0030     void analyze( const QVector<float>& );
0031 
0032 protected:
0033     void demo();
0034     void initializeGL();
0035     void resizeGL( int w, int h );
0036     void paintGL();
0037 
0038 private:
0039     struct ShowProperties
0040     {
0041         bool paused;
0042         double timeStamp;
0043         double dT;
0044         double pauseTimer;
0045         float rotDegrees;
0046     } m_show;
0047 
0048     struct FrameProperties
0049     {
0050         float energy;
0051         float dEnergy;
0052         float meanBand;
0053         float rotDegrees;
0054         bool silence;
0055     } m_frame;
0056 
0057     GLuint m_dotTexture;
0058     GLuint m_w1Texture;
0059     GLuint m_w2Texture;
0060     float m_unitX, m_unitY;
0061 
0062     void drawDot( float x, float y, float size );
0063     void drawFullDot( float r, float g, float b, float a );
0064     void setTextureMatrix( float rot, float scale );
0065 };
0066 
0067 #endif