Files
lmms/plugins/patman/patman.h
Tobias Doerffel 166701f9f3 sed: s/( void )/(), s/FALSE/false/, s/TRUE/true
Replaced remaining occurences of old constants and superfluous "void"
on empty argument list of functions.
2009-08-24 23:25:26 +02:00

149 lines
3.1 KiB
C++

/*
* patman.h - header for a GUS-compatible patch instrument plugin
*
* Copyright (c) 2007-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* 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.
*
*/
#ifndef _PATMAN_H_
#define _PATMAN_H_
#include "Instrument.h"
#include "InstrumentView.h"
#include "sample_buffer.h"
#include "AutomatableModel.h"
class pixmapButton;
#define MODES_16BIT ( 1 << 0 )
#define MODES_UNSIGNED ( 1 << 1 )
#define MODES_LOOPING ( 1 << 2 )
#define MODES_PINGPONG ( 1 << 3 )
#define MODES_REVERSE ( 1 << 4 )
#define MODES_SUSTAIN ( 1 << 5 )
#define MODES_ENVELOPE ( 1 << 6 )
#define MODES_CLAMPED ( 1 << 7 )
class patmanInstrument : public Instrument
{
Q_OBJECT
public:
patmanInstrument( InstrumentTrack * _track );
virtual ~patmanInstrument();
virtual void playNote( notePlayHandle * _n,
sampleFrame * _working_buffer );
virtual void deleteNotePluginData( notePlayHandle * _n );
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
virtual void loadSettings( const QDomElement & _this );
virtual void loadResource( const ResourceItem * _item );
virtual QString nodeName() const;
virtual f_cnt_t desiredReleaseFrames() const
{
return( 128 );
}
virtual PluginView * instantiateView( QWidget * _parent );
public slots:
void setFile( const QString & _patch_file, bool _rename = true );
private:
typedef struct
{
sampleBuffer::handleState * state;
bool tuned;
sampleBuffer * sample;
} handle_data;
QString m_patchFile;
QVector<sampleBuffer *> m_patchSamples;
BoolModel m_loopedModel;
BoolModel m_tunedModel;
enum LoadErrors
{
LoadOK,
LoadOpen,
LoadNotGUS,
LoadInstruments,
LoadLayers,
LoadIO
} ;
LoadErrors loadPatch( const QString & _filename );
void unloadCurrentPatch();
void selectSample( notePlayHandle * _n );
friend class PatmanView;
signals:
void fileChanged();
} ;
class PatmanView : public InstrumentView
{
Q_OBJECT
public:
PatmanView( Instrument * _instrument, QWidget * _parent );
virtual ~PatmanView();
public slots:
void openFile();
void updateFilename();
protected:
virtual void paintEvent( QPaintEvent * );
private:
virtual void modelChanged();
patmanInstrument * m_pi;
QString m_displayFilename;
pixmapButton * m_openFileButton;
pixmapButton * m_loopButton;
pixmapButton * m_tuneButton;
} ;
#endif