// Copyright 2004 "Gilles Degottex" // This file is part of "fmit" // "fmit" 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. // // "fmit" is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "GLFreqStruct.h" static const unsigned char g_icon_formants[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, 0x99, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xb5, 0x97, 0xdd, 0x6f, 0x9b, 0x57, 0x1d, 0xc7, 0x3f, 0xe7, 0x3c, 0x8f, 0xed, 0x38, 0x4e, 0xec, 0xf8, 0x35, 0x4e, 0xf3, 0xd2, 0x34, 0x6b, 0xa6, 0x35, 0x81, 0x86, 0x56, 0x5b, 0xa1, 0xa0, 0x08, 0x84, 0xb8, 0x98, 0x76, 0x91, 0xb1, 0x3f, 0x81, 0x0b, 0x14, 0xb8, 0xe2, 0x1e, 0xb8, 0xed, 0x0d, 0x48, 0x20, 0xb8, 0x58, 0x15, 0x10, 0xd3, 0x98, 0x34, 0x81, 0xb6, 0xd2, 0x89, 0x44, 0x53, 0xb7, 0xc1, 0x5a, 0x90, 0xa7, 0xad, 0xa8, 0x9b, 0x96, 0x76, 0xe9, 0x92, 0x9a, 0xa6, 0x69, 0xb3, 0xbc, 0xf8, 0x35, 0x49, 0xf3, 0x66, 0x3b, 0xb6, 0xcf, 0xe1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 0x58, 0x14, 0x52, 0xdf, 0x48, 0x4c, 0x4f, 0x95, 0xea, 0x27, 0x1d, 0xf9, 0xca, 0xf8, 0xc4, 0xe4, 0xd7, 0x81, 0xeb, 0x6e, 0x97, 0xc9, 0x4b, 0x2f, 0x7c, 0x07, 0xbf, 0xdf, 0xc7, 0xc3, 0x87, 0x3b, 0xfc, 0xf5, 0x9d, 0x04, 0x9d, 0x1d, 0x3e, 0x72, 0xf9, 0x2d, 0xb4, 0x68, 0x7a, 0xa1, 0x2c, 0x83, 0x5e, 0x52, 0x82, 0x07, 0x52, 0x8b, 0xbf, 0x01, 0xb7, 0x80, 0x5b, 0x89, 0xe9, 0xa9, 0x75, 0x9e, 0xa0, 0x35, 0x3d, 0x55, 0xc6, 0x27, 0x26, 0x7f, 0x07, 0xfc, 0xb0, 0x3e, 0xa6, 0x35, 0x4e, 0x76, 0x69, 0xe0, 0xa6, 0x23, 0x62, 0xf7, 0xf9, 0xc4, 0xf4, 0xd4, 0xc1, 0x93, 0x88, 0x3d, 0x11, 0x80, 0x0d, 0x71, 0x16, 0x78, 0x01, 0x78, 0x0a, 0x98, 0x73, 0x44, 0xeb, 0xdf, 0x68, 0xfe, 0x57, 0xed, 0x3f, 0x3b, 0xa5, 0x53, 0x06, 0x63, 0xf4, 0x8e, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; #include using namespace std; #include #include #include #include using namespace Music; GLFreqStruct::GLFreqStruct(QWidget* parent) : QGLWidget(parent, "GLFreqStruct") , View("Harmonics", this) , m_components_max(1.0) { // settings QImage img; img.loadFromData(g_icon_formants, sizeof(g_icon_formants), "PNG"); setting_show->setIconSet(QIconSet(QImage(img))); setting_show->setOn(false); hide(); m_popup_menu.insertItem(new Title(tr("Number of harmonics"), &m_popup_menu)); setting_spinNumComponents = new QSpinBox(1, 128, 1, &m_popup_menu); setting_spinNumComponents->setValue(16); m_components.resize(setting_spinNumComponents->value()); QToolTip::add(setting_spinNumComponents, tr("Number of harmonics")); connect(setting_spinNumComponents, SIGNAL(valueChanged(int)), this, SLOT(spinNumComponentsChanged(int))); m_popup_menu.insertItem(setting_spinNumComponents); for(size_t i=0; iwriteEntry("spinNumComponents", setting_spinNumComponents->value()); } void GLFreqStruct::load() { setting_spinNumComponents->setValue(s_settings->readNumEntry("spinNumComponents", setting_spinNumComponents->value())); } void GLFreqStruct::clearSettings() { s_settings->removeEntry("spinNumComponents"); } void GLFreqStruct::spinNumComponentsChanged(int num) { m_components.resize(num); } void GLFreqStruct::initializeGL() { // Set the clear color to black glClearColor(1.0, 1.0, 1.0, 0.0); glShadeModel( GL_FLAT ); // glShadeModel( GL_SMOOTH ); glLoadIdentity(); } void GLFreqStruct::paintGL() { if(m_components_max==0.0) return; glClear(GL_COLOR_BUFFER_BIT); // name string str = tr("Harmonics"); glColor3f(0.75,0.75,0.75); glRasterPos2i(2, height()-20); for(size_t i = 0; i < str.size(); i++) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str[i]); int scale_height = 12; double scale_factor = 1.0; if(m_components_max>0.0) scale_factor = 1.0/m_components_max; // bars glBegin(GL_QUADS); float step = float(width())/m_components.size(); int space = (step>2)?1:0; for(size_t i=0; i0) { glVertex2i(x, scale_height); glVertex2i(x, y); glVertex2i(int((i+1)*step)-space, y); glVertex2i(int((i+1)*step)-space, scale_height); } } glEnd(); // scale glColor3f(0,0,0); for(size_t i=0; i