aboutsummaryrefslogblamecommitdiff
path: root/src/plugins/Output/oss4/outputoss4factory.cpp
blob: c6459935e978fac3884ab4582233552bfe58abed (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                            
                                                                            

                                                                             
                      





                              
                                   
 
                            

 
                                                      








                                        
                                         
 
                          











                                                               
                                                                         
 




                                              
/***************************************************************************
 *   Copyright (C) 2007 by Zhuravlev Uriy                                  *
 *   stalkerg@gmail.com                                                    *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   This program 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.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#include <QMessageBox>
#include <qmmp/qmmp.h>
#include "settingsdialog.h"
#include "outputoss4.h"
#include "outputoss4factory.h"


Output* OutputOSS4Factory::create()
{
    return new OutputOSS4();
}

OutputProperties OutputOSS4Factory::properties() const
{
    OutputProperties properties;
    properties.name = tr("OSS4 Plugin");
    properties.shortName = "oss4";
    properties.hasAbout = true;
    properties.hasSettings = true;
    return properties;
}

Volume *OutputOSS4Factory::createVolume()
{
    return new VolumeOSS4;
}

void OutputOSS4Factory::showSettings(QWidget* parent)
{
    SettingsDialog *s = new SettingsDialog(parent);
    s->show();
}

void OutputOSS4Factory::showAbout(QWidget *parent)
{
    QMessageBox::about (parent, tr("About OSS4 Output Plugin"),
                        tr("Qmmp OSS4 Output Plugin")+"\n"+
                        tr("Written by: Ilya Kotov <forkotov02@ya.ru>"));
}

QString OutputOSS4Factory::translation() const
{
    return QLatin1String(":/oss4_plugin_");
}
="hl opt">- a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0); } void EQGraph::draw() { QPixmap pixmap = m_skin->getEqPart (Skin::EQ_GRAPH); if (pixmap.isNull()) pixmap = QPixmap(113*m_ratio,19*m_ratio); if (m_values.size()!=10) { setPixmap (pixmap); return; } int i, y; double x[] = { 0, 11, 23, 35, 47, 59, 71, 83, 97, 109 }, yf[10]; double *bands = new double[10]; for (int i = 0; i < 10; ++i) { bands[i] = m_values.at (i); } init_spline (x, bands, 10, yf); for (i = 0; i < 113; i++) { y = 9 - (int) ((eval_spline (x, bands, yf, 10, i) * 9.0) / 20.0); if (y < 0) y = 0; if (y > 18) y = 18; QPainter paint (&pixmap); paint.drawPixmap (i*m_ratio, y*m_ratio, m_skin->getEqSpline (y)); } setPixmap (pixmap); delete [] bands; } void EQGraph::updateSkin() { m_ratio = m_skin->ratio(); draw(); setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); }