Very first implementation of peak controller

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1107 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-06-08 19:02:28 +00:00
parent 4247c93972
commit 7915537f30
18 changed files with 860 additions and 1 deletions

View File

@@ -37,6 +37,7 @@
#include "controller_dialog.h"
#include "lfo_controller.h"
#include "midi_controller.h"
#include "peak_controller.h"
unsigned int controller::s_frames = 0;
@@ -155,6 +156,10 @@ controller * controller::create( ControllerTypes _ct, model * _parent )
c = new lfoController( _parent );
break;
case PeakController:
c = new peakController( _parent );
break;
case MidiController:
c = new midiController( _parent );
break;

View File

@@ -0,0 +1,103 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* lfo_controller.cpp - implementation of class controller which handles
* remote-control of automatableModels
*
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include <math.h>
#include <Qt/QtXml>
#include <QtCore/QObject>
#include <QtCore/QVector>
#include "song.h"
#include "engine.h"
#include "mixer.h"
#include "peak_controller.h"
#include "controller_dialog.h"
#include "plugins/peak_controller_effect/peak_controller_effect.h"
peakController::peakController( model * _parent,
peakControllerEffect * _peak_effect ) :
controller( PeakController, _parent ),
m_peakEffect( _peak_effect )
{
}
peakController::~peakController()
{
// disconnects
}
float peakController::value( int _offset )
{
if( m_peakEffect )
{
return m_peakEffect->lastSample();
}
}
void peakController::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
// Probably not the best idea..
// controller::saveSettings( _doc, _this );
}
void peakController::loadSettings( const QDomElement & _this )
{
// controller::loadSettings( _this );
}
QString peakController::nodeName( void ) const
{
return( "peakcontroller" );
}
controllerDialog * peakController::createDialog( QWidget * _parent )
{
controllerDialog * d = new peakControllerDialog( this, _parent );
return d;
}
#include "peak_controller.moc"
#endif

View File

@@ -0,0 +1,114 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* lfo_controller_dialog.cpp - per-controller-specific view for changing a
* controller's settings
*
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QMdiArea>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QPainter>
#include "caption_menu.h"
#include "gui_templates.h"
#include "embed.h"
#include "engine.h"
#include "led_checkbox.h"
#include "main_window.h"
#include "tooltip.h"
#include "peak_controller.h"
#include "controller_dialog.h"
#include "mv_base.h"
#include "knob.h"
#include "tempo_sync_knob.h"
#include "pixmap_button.h"
peakControllerDialog::peakControllerDialog( controller * _model, QWidget * _parent ) :
controllerDialog( _model, _parent )
{
setWindowTitle( tr( "PEAK" ) );
setWindowIcon( embed::getIconPixmap( "controller" ) );
setFixedSize( 256, 64 );
toolTip::add( this, tr( "LFO Controller" ) );
QLabel * l = new QLabel( this );
l->setText( "Use FX's controls" );
l->move(10, 10);
setModel( _model );
}
peakControllerDialog::~peakControllerDialog()
{
}
/*
void effectView::displayHelp( void )
{
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
whatsThis() );
}
void effectView::closeEffects( void )
{
m_subWindow->hide();
m_show = TRUE;
}
*/
void peakControllerDialog::contextMenuEvent( QContextMenuEvent * )
{
}
void peakControllerDialog::paintEvent( QPaintEvent * )
{
QPainter p( this );
}
void peakControllerDialog::modelChanged( void )
{
m_peakController = castModel<peakController>();
}
#endif