Skip to content

Commit

Permalink
Rename papu to FreeBoy
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Nov 7, 2017
1 parent 871ecca commit 5e9812b
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
[submodule "plugins/zynaddsubfx/zynaddsubfx"]
path = plugins/zynaddsubfx/zynaddsubfx
url = https://github.com/lmms/zynaddsubfx.git
[submodule "plugins/papu/game-music-emu"]
path = plugins/papu/game-music-emu
[submodule "plugins/FreeBoy/game-music-emu"]
path = plugins/FreeBoy/game-music-emu
url = https://bitbucket.org/mpyne/game-music-emu.git
1 change: 1 addition & 0 deletions include/DataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class EXPORT DataFile : public QDomDocument
void upgrade_1_1_91();
void upgrade_1_2_0_rc3();
void upgrade_1_2_0_rc2_42();
void upgrade_1_3_0();

void upgrade();

Expand Down
2 changes: 1 addition & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ IF("${PLUGIN_LIST}" STREQUAL "")
nes
opl2
organic
papu
FreeBoy
patman
peak_controller_effect
GigPlayer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(game-music-emu/gme)

BUILD_PLUGIN(papu
papu_instrument.cpp
papu_instrument.h
BUILD_PLUGIN(freeboy
FreeBoy.cpp
FreeBoy.h
Gb_Apu_Buffer.cpp
Gb_Apu_Buffer.h
game-music-emu/gme/Gb_Apu.cpp
Expand All @@ -18,6 +18,6 @@ BUILD_PLUGIN(papu
game-music-emu/gme/Multi_Buffer.cpp
game-music-emu/gme/blargg_source.h
game-music-emu/gme/Multi_Buffer.h
MOCFILES papu_instrument.h
MOCFILES FreeBoy.h
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
)
76 changes: 38 additions & 38 deletions plugins/papu/papu_instrument.cpp → plugins/FreeBoy/FreeBoy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* papu_instrument.cpp - GameBoy papu based instrument
* FreeBoy.cpp - GameBoy papu based instrument
*
* Copyright (c) 2008 Attila Herman <attila589/at/gmail.com>
* Csaba Hruska <csaba.hruska/at/gmail.com>
Expand Down Expand Up @@ -27,7 +27,7 @@

#include <QPainter>
#include <QDomElement>
#include "papu_instrument.h"
#include "FreeBoy.h"
#include "Gb_Apu_Buffer.h"
#include "Multi_Buffer.h"
#include "base64.h"
Expand All @@ -44,7 +44,7 @@

extern "C"
{
Plugin::Descriptor PLUGIN_EXPORT papu_plugin_descriptor =
Plugin::Descriptor PLUGIN_EXPORT freeboy_plugin_descriptor =
{
STRINGIFY( PLUGIN_NAME ),
"FreeBoy",
Expand All @@ -61,8 +61,8 @@ Plugin::Descriptor PLUGIN_EXPORT papu_plugin_descriptor =
}


papuInstrument::papuInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &papu_plugin_descriptor ),
FreeBoyInstrument::FreeBoyInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &freeboy_plugin_descriptor ),

m_ch1SweepTimeModel( 4.0f, 0.0f, 7.0f, 1.0f, this, tr( "Sweep time" ) ),
m_ch1SweepDirModel( false, this, tr( "Sweep direction" ) ),
Expand Down Expand Up @@ -117,12 +117,12 @@ papuInstrument::papuInstrument( InstrumentTrack * _instrument_track ) :
}


papuInstrument::~papuInstrument()
FreeBoyInstrument::~FreeBoyInstrument()
{
}


void papuInstrument::saveSettings( QDomDocument & _doc,
void FreeBoyInstrument::saveSettings( QDomDocument & _doc,
QDomElement & _this )
{
m_ch1SweepTimeModel.saveSettings( _doc, _this, "st" );
Expand Down Expand Up @@ -165,7 +165,7 @@ void papuInstrument::saveSettings( QDomDocument & _doc,
_this.setAttribute( "sampleShape", sampleString );
}

void papuInstrument::loadSettings( const QDomElement & _this )
void FreeBoyInstrument::loadSettings( const QDomElement & _this )
{
m_ch1SweepTimeModel.loadSettings( _this, "st" );
m_ch1SweepDirModel.loadSettings( _this, "sd" );
Expand Down Expand Up @@ -207,15 +207,15 @@ void papuInstrument::loadSettings( const QDomElement & _this )
m_graphModel.setSamples( (float*) dst );
}

QString papuInstrument::nodeName() const
QString FreeBoyInstrument::nodeName() const
{
return( papu_plugin_descriptor.name );
return( freeboy_plugin_descriptor.name );
}




/*f_cnt_t papuInstrument::desiredReleaseFrames() const
/*f_cnt_t FreeBoyInstrument::desiredReleaseFrames() const
{
const float samplerate = Engine::mixer()->processingSampleRate();
int maxrel = 0;
Expand All @@ -228,14 +228,14 @@ QString papuInstrument::nodeName() const
return f_cnt_t( float(relTime[maxrel])*samplerate/1000.0 );
}*/

f_cnt_t papuInstrument::desiredReleaseFrames() const
f_cnt_t FreeBoyInstrument::desiredReleaseFrames() const
{
return f_cnt_t( 1000 );
}



void papuInstrument::playNote( NotePlayHandle * _n,
void FreeBoyInstrument::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
const f_cnt_t tfp = _n->totalFramesPlayed();
Expand Down Expand Up @@ -414,24 +414,24 @@ void papuInstrument::playNote( NotePlayHandle * _n,



void papuInstrument::deleteNotePluginData( NotePlayHandle * _n )
void FreeBoyInstrument::deleteNotePluginData( NotePlayHandle * _n )
{
delete static_cast<Gb_Apu_Buffer *>( _n->m_pluginData );
}




PluginView * papuInstrument::instantiateView( QWidget * _parent )
PluginView * FreeBoyInstrument::instantiateView( QWidget * _parent )
{
return( new papuInstrumentView( this, _parent ) );
return( new FreeBoyInstrumentView( this, _parent ) );
}


class papuKnob : public Knob
class FreeBoyKnob : public Knob
{
public:
papuKnob( QWidget * _parent ) :
FreeBoyKnob( QWidget * _parent ) :
Knob( knobStyled, _parent )
{
setFixedSize( 30, 30 );
Expand All @@ -447,7 +447,7 @@ class papuKnob : public Knob



papuInstrumentView::papuInstrumentView( Instrument * _instrument,
FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
{
Expand All @@ -457,22 +457,22 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
setPalette( pal );

m_ch1SweepTimeKnob = new papuKnob( this );
m_ch1SweepTimeKnob = new FreeBoyKnob( this );
m_ch1SweepTimeKnob->setHintText( tr( "Sweep Time:" ), "" );
m_ch1SweepTimeKnob->move( 5 + 4*32, 106 );
ToolTip::add( m_ch1SweepTimeKnob, tr( "Sweep Time" ) );
m_ch1SweepTimeKnob->setWhatsThis( tr( "The amount of increase or"
" decrease in frequency" ) );

m_ch1SweepRtShiftKnob = new papuKnob( this );
m_ch1SweepRtShiftKnob = new FreeBoyKnob( this );
m_ch1SweepRtShiftKnob->setHintText( tr( "Sweep RtShift amount:" )
, "" );
m_ch1SweepRtShiftKnob->move( 5 + 3*32, 106 );
ToolTip::add( m_ch1SweepRtShiftKnob, tr( "Sweep RtShift amount" ) );
m_ch1SweepRtShiftKnob->setWhatsThis( tr( "The rate at which increase or"
" decrease in frequency occurs" ) );

m_ch1WavePatternDutyKnob = new papuKnob( this );
m_ch1WavePatternDutyKnob = new FreeBoyKnob( this );
m_ch1WavePatternDutyKnob->setHintText( tr( "Wave pattern duty:" )
, "" );
m_ch1WavePatternDutyKnob->move( 5 + 2*32, 106 );
Expand All @@ -481,14 +481,14 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,
" the duration (time) that a signal is ON"
" versus the total period of the signal." ) );

m_ch1VolumeKnob = new papuKnob( this );
m_ch1VolumeKnob = new FreeBoyKnob( this );
m_ch1VolumeKnob->setHintText( tr( "Square Channel 1 Volume:" )
, "" );
m_ch1VolumeKnob->move( 5, 106 );
ToolTip::add( m_ch1VolumeKnob, tr( "Square Channel 1 Volume:" ) );
m_ch1VolumeKnob->setWhatsThis( tr( "Square Channel 1 Volume" ) );

m_ch1SweepStepLengthKnob = new papuKnob( this );
m_ch1SweepStepLengthKnob = new FreeBoyKnob( this );
m_ch1SweepStepLengthKnob->setHintText( tr( "Length of each step in sweep:" )
, "" );
m_ch1SweepStepLengthKnob->move( 5 + 32, 106 );
Expand All @@ -497,7 +497,7 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,



m_ch2WavePatternDutyKnob = new papuKnob( this );
m_ch2WavePatternDutyKnob = new FreeBoyKnob( this );
m_ch2WavePatternDutyKnob->setHintText( tr( "Wave pattern duty:" )
, "" );
m_ch2WavePatternDutyKnob->move( 5 + 2*32, 155 );
Expand All @@ -506,14 +506,14 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,
" the duration (time) that a signal is ON"
" versus the total period of the signal." ) );

m_ch2VolumeKnob = new papuKnob( this );
m_ch2VolumeKnob = new FreeBoyKnob( this );
m_ch2VolumeKnob->setHintText( tr( "Square Channel 2 Volume:" )
, "" );
m_ch2VolumeKnob->move( 5, 155 );
ToolTip::add( m_ch2VolumeKnob, tr( "Square Channel 2 Volume" ) );
m_ch2VolumeKnob->setWhatsThis( tr( "Square Channel 2 Volume" ) );

m_ch2SweepStepLengthKnob = new papuKnob( this );
m_ch2SweepStepLengthKnob = new FreeBoyKnob( this );
m_ch2SweepStepLengthKnob->setHintText( tr( "Length of each step in sweep:" )
, "" );
m_ch2SweepStepLengthKnob->move( 5 + 32, 155 );
Expand All @@ -522,21 +522,21 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,



m_ch3VolumeKnob = new papuKnob( this );
m_ch3VolumeKnob = new FreeBoyKnob( this );
m_ch3VolumeKnob->setHintText( tr( "Wave Channel Volume:" ), "" );
m_ch3VolumeKnob->move( 5, 204 );
ToolTip::add( m_ch3VolumeKnob, tr( "Wave Channel Volume" ) );
m_ch3VolumeKnob->setWhatsThis( tr( "Wave Channel Volume" ) );



m_ch4VolumeKnob = new papuKnob( this );
m_ch4VolumeKnob = new FreeBoyKnob( this );
m_ch4VolumeKnob->setHintText( tr( "Noise Channel Volume:" ), "" );
m_ch4VolumeKnob->move( 144, 155 );
ToolTip::add( m_ch4VolumeKnob, tr( "Noise Channel Volume" ) );
m_ch4VolumeKnob->setWhatsThis( tr( "Noise Channel Volume" ) );

m_ch4SweepStepLengthKnob = new papuKnob( this );
m_ch4SweepStepLengthKnob = new FreeBoyKnob( this );
m_ch4SweepStepLengthKnob->setHintText( tr( "Length of each step in sweep:" )
, "" );
m_ch4SweepStepLengthKnob->move( 144 + 32, 155 );
Expand All @@ -545,22 +545,22 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,



m_so1VolumeKnob = new papuKnob( this );
m_so1VolumeKnob = new FreeBoyKnob( this );
m_so1VolumeKnob->setHintText( tr( "SO1 Volume (Right):" ), "" );
m_so1VolumeKnob->move( 5, 58 );
ToolTip::add( m_so1VolumeKnob, tr( "SO1 Volume (Right)" ) );

m_so2VolumeKnob = new papuKnob( this );
m_so2VolumeKnob = new FreeBoyKnob( this );
m_so2VolumeKnob->setHintText( tr( "SO2 Volume (Left):" ), "" );
m_so2VolumeKnob->move( 5 + 32, 58 );
ToolTip::add( m_so2VolumeKnob, tr( "SO2 Volume (Left)" ) );

m_trebleKnob = new papuKnob( this );
m_trebleKnob = new FreeBoyKnob( this );
m_trebleKnob->setHintText( tr( "Treble:" ), "" );
m_trebleKnob->move( 5 + 2*32, 58 );
ToolTip::add( m_trebleKnob, tr( "Treble" ) );

m_bassKnob = new papuKnob( this );
m_bassKnob = new FreeBoyKnob( this );
m_bassKnob->setHintText( tr( "Bass:" ), "" );
m_bassKnob->move( 5 + 3*32, 58 );
ToolTip::add( m_bassKnob, tr( "Bass" ) );
Expand Down Expand Up @@ -689,14 +689,14 @@ papuInstrumentView::papuInstrumentView( Instrument * _instrument,
}


papuInstrumentView::~papuInstrumentView()
FreeBoyInstrumentView::~FreeBoyInstrumentView()
{
}


void papuInstrumentView::modelChanged()
void FreeBoyInstrumentView::modelChanged()
{
papuInstrument * p = castModel<papuInstrument>();
FreeBoyInstrument * p = castModel<FreeBoyInstrument>();

m_ch1SweepTimeKnob->setModel( &p->m_ch1SweepTimeModel );
m_ch1SweepDirButton->setModel( &p->m_ch1SweepDirModel );
Expand Down Expand Up @@ -740,7 +740,7 @@ extern "C"
// necessary for getting instance out of shared lib
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
{
return( new papuInstrument(
return( new FreeBoyInstrument(
static_cast<InstrumentTrack *>( _data ) ) );
}

Expand Down
22 changes: 11 additions & 11 deletions plugins/papu/papu_instrument.h → plugins/FreeBoy/FreeBoy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* papu_Instrument.h - GameBoy papu based instrument
* FreeBoyInstrument.h - GameBoy papu based instrument
*
* Copyright (c) 2008 <Attila Herman <attila589/at/gmail.com>
* Csaba Hruska <csaba.hruska/at/gmail.com>
Expand All @@ -23,26 +23,26 @@
*
*/

#ifndef _PAPU_H
#define _PAPU_H
#ifndef FREEBOY_H
#define FREEBOY_H

#include <QObject>
#include "Instrument.h"
#include "InstrumentView.h"
#include "Knob.h"
#include "Graph.h"

class papuInstrumentView;
class FreeBoyInstrumentView;
class NotePlayHandle;
class PixmapButton;

class papuInstrument : public Instrument
class FreeBoyInstrument : public Instrument
{
Q_OBJECT
public:

papuInstrument( InstrumentTrack * _instrument_track );
virtual ~papuInstrument();
FreeBoyInstrument( InstrumentTrack * _instrument_track );
virtual ~FreeBoyInstrument();

virtual void playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer );
Expand Down Expand Up @@ -102,16 +102,16 @@ class papuInstrument : public Instrument

graphModel m_graphModel;

friend class papuInstrumentView;
friend class FreeBoyInstrumentView;
} ;


class papuInstrumentView : public InstrumentView
class FreeBoyInstrumentView : public InstrumentView
{
Q_OBJECT
public:
papuInstrumentView( Instrument * _instrument, QWidget * _parent );
virtual ~papuInstrumentView();
FreeBoyInstrumentView( Instrument * _instrument, QWidget * _parent );
virtual ~FreeBoyInstrumentView();

private:
virtual void modelChanged();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Submodule game-music-emu updated from 000000 to 21a064
File renamed without changes
Loading

0 comments on commit 5e9812b

Please sign in to comment.