Browse Source

Add PingPongPan files

tags/v0.9.0
falkTX 12 years ago
parent
commit
06ceeebcc7
14 changed files with 14833 additions and 0 deletions
  1. +18
    -0
      .gitignore
  2. +58
    -0
      c++/carla-native/distrho-pingpongpan.cpp
  3. +14223
    -0
      c++/carla-native/pingpongpan/DistrhoArtworkPingPongPan.cpp
  4. +35
    -0
      c++/carla-native/pingpongpan/DistrhoArtworkPingPongPan.hpp
  5. +34
    -0
      c++/carla-native/pingpongpan/DistrhoPluginInfo.h
  6. +165
    -0
      c++/carla-native/pingpongpan/DistrhoPluginPingPongPan.cpp
  7. +93
    -0
      c++/carla-native/pingpongpan/DistrhoPluginPingPongPan.hpp
  8. +138
    -0
      c++/carla-native/pingpongpan/DistrhoUIPingPongPan.cpp
  9. +69
    -0
      c++/carla-native/pingpongpan/DistrhoUIPingPongPan.hpp
  10. BIN
      c++/carla-native/pingpongpan/artwork/about.png
  11. BIN
      c++/carla-native/pingpongpan/artwork/aboutButtonHover.png
  12. BIN
      c++/carla-native/pingpongpan/artwork/aboutButtonNormal.png
  13. BIN
      c++/carla-native/pingpongpan/artwork/background.png
  14. BIN
      c++/carla-native/pingpongpan/artwork/knob.png

+ 18
- 0
.gitignore View File

@@ -36,6 +36,7 @@ qrc_resources*.cpp

# Binaries
carla-bridge-qtcreator
carla-bridge-native
carla-bridge-posix32
carla-bridge-posix64
carla-bridge-lv2-cocoa
@@ -127,3 +128,20 @@ c++/widgets/paramspinbox.*
data/templates/energyXT.xt
src/old/
src/ui/carla_driver.ui

# Other
c++/carla-backend/carla_backend.kdev4
c++/carla-bridge/carla_bridge_plugin.cpp,bak
c++/carla-bridge/carla_bridge_toolkit-plugin.cpp
c++/carla/CarlaAbout.cpp
c++/carla/CarlaAbout.hpp
c++/carla/PluginParameter.cpp
c++/carla/PluginParameter.hpp
c++/carla/carla.cpp
c++/carla/carla.h
c++/carla/carla.pro
c++/carla/carla_misc.h
data/cadence-cpufreq
data/cpufreq/
src/cadence_cpufreq.py
src/cpufreq.py

+ 58
- 0
c++/carla-native/distrho-pingpongpan.cpp View File

@@ -0,0 +1,58 @@
/*
* Carla Native Plugins
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.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
* 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.
*
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_native.hpp"

// Plugin Code
#include "pingpongpan/DistrhoArtworkPingPongPan.cpp"
#include "pingpongpan/DistrhoPluginPingPongPan.cpp"
#include "pingpongpan/DistrhoUIPingPongPan.cpp"

// Carla DISTRHO Plugin
#include "distrho/DistrhoPluginCarla.cpp"

START_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

static PluginDescriptor tBandEqDesc = {
/* category */ ::PLUGIN_CATEGORY_UTILITY,
/* hints */ ::PLUGIN_HAS_GUI,
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS,
/* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ DistrhoPluginPingPongPan::paramCount,
/* paramOuts */ 0,
/* name */ DISTRHO_PLUGIN_NAME,
/* label */ "PingPongPan",
/* maker */ "falkTX",
/* copyright */ "LGPL",
PluginDescriptorFILL(PluginCarla)
};

END_NAMESPACE_DISTRHO

// -----------------------------------------------------------------------

void carla_register_native_plugin_PingPongPan()
{
USE_NAMESPACE_DISTRHO
carla_register_native_plugin(&tBandEqDesc);
}

// -----------------------------------------------------------------------

+ 14223
- 0
c++/carla-native/pingpongpan/DistrhoArtworkPingPongPan.cpp
File diff suppressed because it is too large
View File


+ 35
- 0
c++/carla-native/pingpongpan/DistrhoArtworkPingPongPan.hpp View File

@@ -0,0 +1,35 @@
/* (Auto-generated binary data file). */

#ifndef BINARY_DISTRHOARTWORKPINGPONGPAN_HPP
#define BINARY_DISTRHOARTWORKPINGPONGPAN_HPP

namespace DistrhoArtworkPingPongPan
{
extern const char* aboutData;
const unsigned int aboutDataSize = 230280;
const unsigned int aboutWidth = 303;
const unsigned int aboutHeight = 190;

extern const char* aboutButtonHoverData;
const unsigned int aboutButtonHoverDataSize = 9600;
const unsigned int aboutButtonHoverWidth = 96;
const unsigned int aboutButtonHoverHeight = 25;

extern const char* aboutButtonNormalData;
const unsigned int aboutButtonNormalDataSize = 9600;
const unsigned int aboutButtonNormalWidth = 96;
const unsigned int aboutButtonNormalHeight = 25;

extern const char* backgroundData;
const unsigned int backgroundDataSize = 200736;
const unsigned int backgroundWidth = 369;
const unsigned int backgroundHeight = 136;

extern const char* knobData;
const unsigned int knobDataSize = 742716;
const unsigned int knobWidth = 69;
const unsigned int knobHeight = 2691;
}

#endif // BINARY_DISTRHOARTWORKPINGPONGPAN_HPP


+ 34
- 0
c++/carla-native/pingpongpan/DistrhoPluginInfo.h View File

@@ -0,0 +1,34 @@
/*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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 Lesser General Public License for more details.
*
* For a full copy of the license see the LGPL.txt file
*/

#ifndef __DISTRHO_PLUGIN_INFO_H__
#define __DISTRHO_PLUGIN_INFO_H__

#define DISTRHO_PLUGIN_NAME "Ping Pong Pan"

#define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_IS_SYNTH 0

#define DISTRHO_PLUGIN_NUM_INPUTS 2
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2

#define DISTRHO_PLUGIN_WANT_LATENCY 0
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1
#define DISTRHO_PLUGIN_WANT_STATE 0

#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/PingPongPan"

#endif // __DISTRHO_PLUGIN_INFO_H__

+ 165
- 0
c++/carla-native/pingpongpan/DistrhoPluginPingPongPan.cpp View File

@@ -0,0 +1,165 @@
/*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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 Lesser General Public License for more details.
*
* For a full copy of the license see the LGPL.txt file
*/
#include "DistrhoPluginPingPongPan.hpp"
#include <cmath>
static const float cf2PI = 6.283185307f;
START_NAMESPACE_DISTRHO
// -------------------------------------------------
DistrhoPluginPingPongPan::DistrhoPluginPingPongPan()
: Plugin(paramCount, 1, 0) // 1 program, 0 states
{
// set default values
d_setProgram(0);
// reset
d_deactivate();
}
DistrhoPluginPingPongPan::~DistrhoPluginPingPongPan()
{
}
// -------------------------------------------------
// Init
void DistrhoPluginPingPongPan::d_initParameter(uint32_t index, Parameter& parameter)
{
switch (index)
{
case paramFreq:
parameter.hints = PARAMETER_IS_AUTOMABLE;
parameter.name = "Frequency";
parameter.symbol = "freq";
parameter.ranges.def = 50.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 100.0f;
break;
case paramWidth:
parameter.hints = PARAMETER_IS_AUTOMABLE;
parameter.name = "Width";
parameter.symbol = "with";
parameter.unit = "%";
parameter.ranges.def = 75.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 100.0f;
break;
}
}
void DistrhoPluginPingPongPan::d_initProgramName(uint32_t index, d_string& programName)
{
if (index != 0)
return;
programName = "Default";
}
// -------------------------------------------------
// Internal data
float DistrhoPluginPingPongPan::d_parameterValue(uint32_t index)
{
switch (index)
{
case paramFreq:
return fFreq;
case paramWidth:
return fWidth;
default:
return 0.0f;
}
}
void DistrhoPluginPingPongPan::d_setParameterValue(uint32_t index, float value)
{
if (d_sampleRate() <= 0.0)
return;
switch (index)
{
case paramFreq:
fFreq = value;
waveSpeed = (cf2PI * fFreq / 100.0f)/d_sampleRate();
break;
case paramWidth:
fWidth = value;
break;
}
}
void DistrhoPluginPingPongPan::d_setProgram(uint32_t index)
{
if (index != 0)
return;
// Default values
fFreq = 50.0f;
fWidth = 75.0f;
// reset filter values
d_activate();
}
// -------------------------------------------------
// Process
void DistrhoPluginPingPongPan::d_activate()
{
waveSpeed = (cf2PI * fFreq / 100.0f)/d_sampleRate();
}
void DistrhoPluginPingPongPan::d_deactivate()
{
wavePos = 0.0f;
}
void DistrhoPluginPingPongPan::d_run(float** inputs, float** outputs, uint32_t frames, uint32_t, const MidiEvent*)
{
const float* in1 = inputs[0];
const float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
for (uint32_t i=0; i < frames; i++)
{
pan = d_minf(d_maxf(sin(wavePos) * (fWidth/100.0f), -1.0f), 1.0f);
if ((wavePos += waveSpeed) >= cf2PI)
wavePos -= cf2PI;
out1[i] = in1[i] * (pan > 0.0f ? 1.0f-pan : 1.0f);
out2[i] = in2[i] * (pan < 0.0f ? 1.0f+pan : 1.0f);
}
}
// -------------------------------------------------
Plugin* createPlugin()
{
return new DistrhoPluginPingPongPan();
}
// -------------------------------------------------
END_NAMESPACE_DISTRHO

+ 93
- 0
c++/carla-native/pingpongpan/DistrhoPluginPingPongPan.hpp View File

@@ -0,0 +1,93 @@
/*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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 Lesser General Public License for more details.
*
* For a full copy of the license see the LGPL.txt file
*/
#ifndef __DISTRHO_PLUGIN_PINGPONGPAN_HPP__
#define __DISTRHO_PLUGIN_PINGPONGPAN_HPP__
#include "DistrhoPlugin.h"
START_NAMESPACE_DISTRHO
class DistrhoPluginPingPongPan : public Plugin
{
public:
enum Parameters
{
paramFreq = 0,
paramWidth,
paramCount
};
DistrhoPluginPingPongPan();
~DistrhoPluginPingPongPan();
// ---------------------------------------------
protected:
// Information
const char* d_label()
{
return "PingPongPan";
}
const char* d_maker()
{
return "DISTRHO";
}
const char* d_license()
{
return "LGPL";
}
uint32_t d_version()
{
return 0x1000;
}
long d_uniqueId()
{
return d_cconst('D', 'P', 'P', 'P');
}
// Init
void d_initParameter(uint32_t index, Parameter& parameter);
void d_initProgramName(uint32_t index, d_string& programName);
// Internal data
float d_parameterValue(uint32_t index);
void d_setParameterValue(uint32_t index, float value);
void d_setProgram(uint32_t index);
// Process
void d_activate();
void d_deactivate();
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents);
// ---------------------------------------------
private:
float fFreq;
float fWidth;
float waveSpeed;
float pan, wavePos;
};
END_NAMESPACE_DISTRHO
#endif // __DISTRHO_PLUGIN_PINGPONGPAN_HPP__

+ 138
- 0
c++/carla-native/pingpongpan/DistrhoUIPingPongPan.cpp View File

@@ -0,0 +1,138 @@
/*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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 Lesser General Public License for more details.
*
* For a full copy of the license see the LGPL.txt file
*/

#include "DistrhoUIPingPongPan.hpp"

START_NAMESPACE_DISTRHO

// -------------------------------------------------

DistrhoUIPingPongPan::DistrhoUIPingPongPan()
: OpenGLExtUI()
{
// background
Image bgImage(DistrhoArtworkPingPongPan::backgroundData, DistrhoArtworkPingPongPan::backgroundWidth, DistrhoArtworkPingPongPan::backgroundHeight, GL_BGRA);
setBackgroundImage(bgImage);

// knobs
Image knobImage(DistrhoArtworkPingPongPan::knobData, DistrhoArtworkPingPongPan::knobWidth, DistrhoArtworkPingPongPan::knobHeight);
Point knobPos(136, 30);

// knob Low-Mid
knobFreq = new ImageKnob(knobImage, knobPos);
knobFreq->setRange(0.0f, 100.0f);
knobFreq->setValue(50.0f);
addImageKnob(knobFreq);

// knob Mid-High
knobPos.setX(258);
knobWidth = new ImageKnob(knobImage, knobPos);
knobWidth->setRange(0.0f, 100.0f);
knobWidth->setValue(75.0f);
addImageKnob(knobWidth);

// about button
Image aboutImageNormal(DistrhoArtworkPingPongPan::aboutButtonNormalData, DistrhoArtworkPingPongPan::aboutButtonNormalWidth, DistrhoArtworkPingPongPan::aboutButtonNormalHeight);
Image aboutImageHover(DistrhoArtworkPingPongPan::aboutButtonHoverData, DistrhoArtworkPingPongPan::aboutButtonHoverWidth, DistrhoArtworkPingPongPan::aboutButtonHoverHeight);
Point aboutPos(25, 23);
buttonAbout = new ImageButton(aboutImageNormal, aboutImageHover, aboutImageHover, aboutPos);
addImageButton(buttonAbout);
}

DistrhoUIPingPongPan::~DistrhoUIPingPongPan()
{
delete knobFreq;
delete knobWidth;
delete buttonAbout;
}

// -------------------------------------------------
// DSP Callbacks

void DistrhoUIPingPongPan::d_parameterChanged(uint32_t index, float value)
{
switch (index)
{
case DistrhoPluginPingPongPan::paramFreq:
knobFreq->setValue(value);
break;
case DistrhoPluginPingPongPan::paramWidth:
knobWidth->setValue(value);
break;
}

d_uiRepaint();
}

void DistrhoUIPingPongPan::d_programChanged(uint32_t index)
{
if (index != 0)
return;

// Default values
knobFreq->setValue(50.0f);
knobWidth->setValue(75.0f);

d_uiRepaint();
}

// -------------------------------------------------
// Extended Callbacks

void DistrhoUIPingPongPan::imageButtonClicked(ImageButton* button)
{
if (button != buttonAbout)
return;

Image imageAbout(DistrhoArtworkPingPongPan::aboutData, DistrhoArtworkPingPongPan::aboutWidth, DistrhoArtworkPingPongPan::aboutHeight, GL_BGRA);
showImageModalDialog(imageAbout, "About");
}

void DistrhoUIPingPongPan::imageKnobDragStarted(ImageKnob* knob)
{
if (knob == knobFreq)
d_uiEditParameter(DistrhoPluginPingPongPan::paramFreq, true);
else if (knob == knobWidth)
d_uiEditParameter(DistrhoPluginPingPongPan::paramWidth, true);
}

void DistrhoUIPingPongPan::imageKnobDragFinished(ImageKnob* knob)
{
if (knob == knobFreq)
d_uiEditParameter(DistrhoPluginPingPongPan::paramFreq, false);
else if (knob == knobWidth)
d_uiEditParameter(DistrhoPluginPingPongPan::paramWidth, false);
}


void DistrhoUIPingPongPan::imageKnobValueChanged(ImageKnob* knob, float value)
{
if (knob == knobFreq)
d_setParameterValue(DistrhoPluginPingPongPan::paramFreq, value);
else if (knob == knobWidth)
d_setParameterValue(DistrhoPluginPingPongPan::paramWidth, value);
}

// -------------------------------------------------

UI* createUI()
{
return new DistrhoUIPingPongPan;
}

// -------------------------------------------------

END_NAMESPACE_DISTRHO

+ 69
- 0
c++/carla-native/pingpongpan/DistrhoUIPingPongPan.hpp View File

@@ -0,0 +1,69 @@
/*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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 Lesser General Public License for more details.
*
* For a full copy of the license see the LGPL.txt file
*/

#ifndef __DISTRHO_UI_PINGPONGPAN_HPP__
#define __DISTRHO_UI_PINGPONGPAN_HPP__

#include "DistrhoUIOpenGLExt.h"

#include "DistrhoArtworkPingPongPan.hpp"
#include "DistrhoPluginPingPongPan.hpp"

START_NAMESPACE_DISTRHO

// -------------------------------------------------

class DistrhoUIPingPongPan : public OpenGLExtUI
{
public:
DistrhoUIPingPongPan();
~DistrhoUIPingPongPan();

// ---------------------------------------------
protected:

// Information
unsigned int d_width()
{
return DistrhoArtworkPingPongPan::backgroundWidth;
}

unsigned int d_height()
{
return DistrhoArtworkPingPongPan::backgroundHeight;
}

// DSP Callbacks
void d_parameterChanged(uint32_t index, float value);
void d_programChanged(uint32_t index);

// Extended Callbacks
void imageButtonClicked(ImageButton* button);
void imageKnobDragStarted(ImageKnob* knob);
void imageKnobDragFinished(ImageKnob* knob);
void imageKnobValueChanged(ImageKnob* knob, float value);

private:
ImageKnob* knobFreq;
ImageKnob* knobWidth;
ImageButton* buttonAbout;
};

// -------------------------------------------------

END_NAMESPACE_DISTRHO

#endif // __DISTRHO_UI_PINGPONGPAN_HPP__

BIN
c++/carla-native/pingpongpan/artwork/about.png View File

Before After
Width: 303  |  Height: 190  |  Size: 269KB

BIN
c++/carla-native/pingpongpan/artwork/aboutButtonHover.png View File

Before After
Width: 96  |  Height: 25  |  Size: 4.5KB

BIN
c++/carla-native/pingpongpan/artwork/aboutButtonNormal.png View File

Before After
Width: 96  |  Height: 25  |  Size: 4.5KB

BIN
c++/carla-native/pingpongpan/artwork/background.png View File

Before After
Width: 369  |  Height: 136  |  Size: 51KB

BIN
c++/carla-native/pingpongpan/artwork/knob.png View File

Before After
Width: 69  |  Height: 2691  |  Size: 176KB

Loading…
Cancel
Save