Browse Source

Add bigmeter plugin to test fast pipe send/recv; Misc fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
8163ad9fb9
25 changed files with 1017 additions and 68 deletions
  1. +9
    -5
      source/backend/plugin/NativePlugin.cpp
  2. +2
    -2
      source/backend/standalone/Makefile
  3. +1
    -1
      source/carla-mini
  4. +2
    -2
      source/carla_database.py
  5. +2
    -2
      source/carla_settings.py
  6. +2
    -2
      source/carla_shared.py
  7. +8
    -0
      source/modules/carla_native/Makefile
  8. +147
    -0
      source/modules/carla_native/bigmeter/DistrhoPluginBigMeter.cpp
  9. +89
    -0
      source/modules/carla_native/bigmeter/DistrhoPluginBigMeter.hpp
  10. +38
    -0
      source/modules/carla_native/bigmeter/DistrhoPluginInfo.h
  11. +38
    -0
      source/modules/carla_native/bigmeter/DistrhoUIBigMeter.cpp
  12. +46
    -0
      source/modules/carla_native/bigmeter/DistrhoUIBigMeter.hpp
  13. +125
    -0
      source/modules/carla_native/bigmeterM/DistrhoPluginBigMeter.cpp
  14. +89
    -0
      source/modules/carla_native/bigmeterM/DistrhoPluginBigMeter.hpp
  15. +38
    -0
      source/modules/carla_native/bigmeterM/DistrhoPluginInfo.h
  16. +38
    -0
      source/modules/carla_native/bigmeterM/DistrhoUIBigMeter.cpp
  17. +46
    -0
      source/modules/carla_native/bigmeterM/DistrhoUIBigMeter.hpp
  18. +59
    -0
      source/modules/carla_native/distrho-bigmeter.cpp
  19. +59
    -0
      source/modules/carla_native/distrho-bigmeterM.cpp
  20. +0
    -0
      source/modules/carla_native/notes/DistrhoUINotes.cpp.old
  21. +108
    -0
      source/modules/carla_native/resources/bigmeter-ui
  22. +1
    -0
      source/modules/carla_native/resources/bigmeterM-ui
  23. +1
    -0
      source/modules/carla_native/resources/digitalpeakmeter.py
  24. +64
    -51
      source/modules/carla_native/resources/externalui.py
  25. +5
    -3
      source/modules/carla_native/resources/notes-ui

+ 9
- 5
source/backend/plugin/NativePlugin.cpp View File

@@ -26,7 +26,7 @@ extern "C" {
// Simple plugins // Simple plugins
void carla_register_native_plugin_bypass(); void carla_register_native_plugin_bypass();
void carla_register_native_plugin_lfo(); void carla_register_native_plugin_lfo();
void carla_register_native_plugin_midiSequencer();
void carla_register_native_plugin_midiGain();
void carla_register_native_plugin_midiSplit(); void carla_register_native_plugin_midiSplit();
void carla_register_native_plugin_midiThrough(); void carla_register_native_plugin_midiThrough();
void carla_register_native_plugin_midiTranspose(); void carla_register_native_plugin_midiTranspose();
@@ -58,7 +58,9 @@ void carla_register_native_plugin_PingPongPan();
//void carla_register_native_plugin_StereoEnhancer(); //void carla_register_native_plugin_StereoEnhancer();
#endif #endif


// DISTRHO plugins (Qt)
// DISTRHO plugins (PyQt)
void carla_register_native_plugin_BigMeter();
void carla_register_native_plugin_BigMeterM();
void carla_register_native_plugin_Notes(); void carla_register_native_plugin_Notes();


#ifdef WANT_ZYNADDSUBFX #ifdef WANT_ZYNADDSUBFX
@@ -72,7 +74,7 @@ void carla_register_all_plugins()
// Simple plugins // Simple plugins
carla_register_native_plugin_bypass(); carla_register_native_plugin_bypass();
carla_register_native_plugin_lfo(); carla_register_native_plugin_lfo();
//carla_register_native_plugin_midiSequencer(); // unfinished
carla_register_native_plugin_midiGain();
carla_register_native_plugin_midiSplit(); carla_register_native_plugin_midiSplit();
carla_register_native_plugin_midiThrough(); carla_register_native_plugin_midiThrough();
carla_register_native_plugin_midiTranspose(); carla_register_native_plugin_midiTranspose();
@@ -104,8 +106,10 @@ void carla_register_all_plugins()
//carla_register_native_plugin_StereoEnhancer(); // unfinished //carla_register_native_plugin_StereoEnhancer(); // unfinished
#endif #endif


// DISTRHO plugins (Qt)
carla_register_native_plugin_Notes(); // unfinished
// DISTRHO plugins (PyQt)
carla_register_native_plugin_BigMeter();
carla_register_native_plugin_BigMeterM();
carla_register_native_plugin_Notes();


#ifdef WANT_ZYNADDSUBFX #ifdef WANT_ZYNADDSUBFX
// ZynAddSubFX // ZynAddSubFX


+ 2
- 2
source/backend/standalone/Makefile View File

@@ -72,11 +72,11 @@ endif
ifeq ($(HAVE_ZYN_DEPS),true) ifeq ($(HAVE_ZYN_DEPS),true)
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib) LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
ifeq ($(HAVE_ZYN_UI_DEPS),true) ifeq ($(HAVE_ZYN_UI_DEPS),true)
LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images)
LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk)
endif endif
endif endif


EXTRA_LIBS = -ldl
EXTRA_LIBS = -ldl -lfreetype
LINK_FLAGS += $(EXTRA_LIBS) LINK_FLAGS += $(EXTRA_LIBS)


ifneq ($(MACOS),true) ifneq ($(MACOS),true)


+ 1
- 1
source/carla-mini View File

@@ -84,7 +84,7 @@ if __name__ == '__main__':
app.setWindowIcon(QIcon(":/scalable/carla.svg")) app.setWindowIcon(QIcon(":/scalable/carla.svg"))


libName = carla_library_filename libName = carla_library_filename
libPath = carla_library_filename.replace(carla_libname, "")
libPath = os.path.join(carla_library_filename.replace(carla_libname, ""), "..", "modules", "carla_native", "resources")


# Init backend # Init backend
print("libName:", libName, ":", carla_libname) print("libName:", libName, ":", carla_libname)


+ 2
- 2
source/carla_database.py View File

@@ -23,10 +23,10 @@ from copy import deepcopy
from subprocess import Popen, PIPE from subprocess import Popen, PIPE


try: try:
from PyQt5.QtCore import Qt, QThread, QSettings
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings
from PyQt5.QtWidgets import QDialog, QTableWidgetItem from PyQt5.QtWidgets import QDialog, QTableWidgetItem
except: except:
from PyQt4.QtCore import Qt, QThread, QSettings
from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings
from PyQt4.QtGui import QDialog, QTableWidgetItem from PyQt4.QtGui import QDialog, QTableWidgetItem


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------


+ 2
- 2
source/carla_settings.py View File

@@ -20,11 +20,11 @@
# Imports (Global) # Imports (Global)


try: try:
from PyQt5.QtCore import QByteArray, QSettings
from PyQt5.QtCore import pyqtSlot, QByteArray, QSettings
from PyQt5.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath from PyQt5.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath
from PyQt5.QtWidgets import QDialog, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget from PyQt5.QtWidgets import QDialog, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget
except: except:
from PyQt4.QtCore import QByteArray, QSettings
from PyQt4.QtCore import pyqtSlot, QByteArray, QSettings
from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath
from PyQt4.QtGui import QDialog, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget from PyQt4.QtGui import QDialog, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget




+ 2
- 2
source/carla_shared.py View File

@@ -23,11 +23,11 @@ import os
import sys import sys


try: try:
from PyQt5.QtCore import pyqtSignal, pyqtSlot, qCritical, qFatal, qWarning
from PyQt5.QtCore import qFatal, qWarning
from PyQt5.QtGui import QIcon from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QFileDialog, QMessageBox from PyQt5.QtWidgets import QFileDialog, QMessageBox
except: except:
from PyQt4.QtCore import pyqtSignal, pyqtSlot, qCritical, qFatal, qWarning
from PyQt4.QtCore import qFatal, qWarning
from PyQt4.QtGui import QIcon from PyQt4.QtGui import QIcon
from PyQt4.QtGui import QFileDialog, QMessageBox from PyQt4.QtGui import QFileDialog, QMessageBox




+ 8
- 0
source/modules/carla_native/Makefile View File

@@ -84,6 +84,8 @@ endif


# DISTRHO plugins (PyQt) # DISTRHO plugins (PyQt)
OBJS += \ OBJS += \
distrho-bigmeter.cpp.o \
distrho-bigmeterM.cpp.o \
distrho-notes.cpp.o distrho-notes.cpp.o


ifeq ($(HAVE_ZYN_DEPS),true) ifeq ($(HAVE_ZYN_DEPS),true)
@@ -178,6 +180,12 @@ distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp pingpongpan/*.cpp pingpongpan
distrho-stereoenhancer.cpp.o: distrho-stereoenhancer.cpp stereoenhancer/*.cpp stereoenhancer/*.h stereoenhancer/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) distrho-stereoenhancer.cpp.o: distrho-stereoenhancer.cpp stereoenhancer/*.cpp stereoenhancer/*.h stereoenhancer/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS)
$(CXX) $< $(GL_CXX_FLAGS) -Istereoenhancer -DDISTRHO_NAMESPACE=DISTRHO_StereoEnhancer -c -o $@ $(CXX) $< $(GL_CXX_FLAGS) -Istereoenhancer -DDISTRHO_NAMESPACE=DISTRHO_StereoEnhancer -c -o $@


distrho-bigmeter.cpp.o: distrho-bigmeter.cpp bigmeter/*.cpp bigmeter/*.h bigmeter/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -Ibigmeter -DDISTRHO_NAMESPACE=DISTRHO_BigMeter -c -o $@

distrho-bigmeterM.cpp.o: distrho-bigmeterM.cpp bigmeterM/*.cpp bigmeterM/*.h bigmeterM/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -IbigmeterM -DDISTRHO_NAMESPACE=DISTRHO_BigMeterM -c -o $@

distrho-notes.cpp.o: distrho-notes.cpp notes/*.cpp notes/*.h notes/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS) distrho-notes.cpp.o: distrho-notes.cpp notes/*.cpp notes/*.h notes/*.hpp distrho/DistrhoPluginCarla.cpp $(CXXDEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ $(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@




+ 147
- 0
source/modules/carla_native/bigmeter/DistrhoPluginBigMeter.cpp View File

@@ -0,0 +1,147 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/
#include "DistrhoPluginBigMeter.hpp"
#include <cmath>
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
DistrhoPluginBigMeter::DistrhoPluginBigMeter()
: Plugin(3, 0, 0), // 3 parameters, 0 programs, 0 states
fColor(0),
fOutLeft(0.0f),
fOutRight(0.0f)
{
}
DistrhoPluginBigMeter::~DistrhoPluginBigMeter()
{
}
// -----------------------------------------------------------------------
// Init
void DistrhoPluginBigMeter::d_initParameter(uint32_t index, Parameter& parameter)
{
switch (index)
{
case 0:
parameter.hints = PARAMETER_IS_AUTOMABLE | PARAMETER_IS_INTEGER;
parameter.name = "Color";
parameter.symbol = "color";
parameter.ranges.def = 0;
parameter.ranges.min = 0;
parameter.ranges.max = 1;
parameter.ranges.step = 1;
parameter.ranges.stepSmall = 1;
parameter.ranges.stepLarge = 1;
break;
case 1:
parameter.hints = PARAMETER_IS_AUTOMABLE | PARAMETER_IS_OUTPUT;
parameter.name = "Out Left";
parameter.symbol = "outleft";
parameter.ranges.def = 0.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
break;
case 2:
parameter.hints = PARAMETER_IS_AUTOMABLE | PARAMETER_IS_OUTPUT;
parameter.name = "Out Right";
parameter.symbol = "outright";
parameter.ranges.def = 0.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
break;
default:
break;
}
}
// -----------------------------------------------------------------------
// Internal data
float DistrhoPluginBigMeter::d_getParameterValue(uint32_t index) const
{
switch (index)
{
case 0:
return (float)fColor;
case 1:
return fOutLeft;
case 2:
return fOutRight;
default:
return 0.0f;
}
}
void DistrhoPluginBigMeter::d_setParameterValue(uint32_t index, float value)
{
switch (index)
{
case 0:
fColor = (int)value;
break;
case 1:
fOutLeft = value;
break;
case 2:
fOutRight = value;
break;
default:
break;
}
}
// -----------------------------------------------------------------------
// Process
void DistrhoPluginBigMeter::d_run(float** inputs, float**, uint32_t frames, const MidiEvent*, uint32_t)
{
float tmp, tmpLeft, tmpRight;
tmpLeft = tmpRight = 0.0f;
for (uint32_t i=0; i < frames; ++i)
{
tmp = std::abs(inputs[0][i]);
if (tmp > tmpLeft)
tmpLeft = tmp;
tmp = std::abs(inputs[1][i]);
if (tmp > tmpRight)
tmpRight = tmp;
}
fOutLeft = tmpLeft;
fOutRight = tmpRight;
}
// -----------------------------------------------------------------------
Plugin* createPlugin()
{
return new DistrhoPluginBigMeter();
}
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO

+ 89
- 0
source/modules/carla_native/bigmeter/DistrhoPluginBigMeter.hpp View File

@@ -0,0 +1,89 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/
#ifndef DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED
#define DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED
#include "DistrhoPlugin.hpp"
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
class DistrhoPluginBigMeter : public Plugin
{
public:
DistrhoPluginBigMeter();
~DistrhoPluginBigMeter() override;
protected:
// -------------------------------------------------------------------
// Information
const char* d_getLabel() const noexcept override
{
return "BigMeter";
}
const char* d_getMaker() const noexcept override
{
return "DISTRHO";
}
const char* d_getLicense() const noexcept override
{
return "GPL v2+";
}
uint32_t d_getVersion() const noexcept override
{
return 0x1000;
}
long d_getUniqueId() const noexcept override
{
return d_cconst('D', 'B', 'M', 't');
}
// -------------------------------------------------------------------
// Init
void d_initParameter(uint32_t index, Parameter& parameter) override;
// -------------------------------------------------------------------
// Internal data
float d_getParameterValue(uint32_t index) const override;
void d_setParameterValue(uint32_t index, float value) override;
// -------------------------------------------------------------------
// Process
void d_run(float** inputs, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
// -------------------------------------------------------------------
private:
int fColor;
float fOutLeft, fOutRight;
};
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
#endif // DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED

+ 38
- 0
source/modules/carla_native/bigmeter/DistrhoPluginInfo.h View File

@@ -0,0 +1,38 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED
#define DISTRHO_PLUGIN_INFO_H_INCLUDED

#define DISTRHO_PLUGIN_NAME "BigMeter"

#define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_IS_SYNTH 0

#define DISTRHO_PLUGIN_NUM_INPUTS 2
#define DISTRHO_PLUGIN_NUM_OUTPUTS 0

#define DISTRHO_PLUGIN_WANT_LATENCY 0
#define DISTRHO_PLUGIN_WANT_PROGRAMS 0
#define DISTRHO_PLUGIN_WANT_STATE 0
#define DISTRHO_PLUGIN_WANT_TIMEPOS 0

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

#define DISTRHO_UI_EXTERNAL

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 38
- 0
source/modules/carla_native/bigmeter/DistrhoUIBigMeter.cpp View File

@@ -0,0 +1,38 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#include "DistrhoUIBigMeter.hpp"

START_NAMESPACE_DISTRHO

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

DistrhoUIBigMeter::DistrhoUIBigMeter()
: ExternalUI()
{
}

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

UI* createUI()
{
return new DistrhoUIBigMeter();
}

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

END_NAMESPACE_DISTRHO

+ 46
- 0
source/modules/carla_native/bigmeter/DistrhoUIBigMeter.hpp View File

@@ -0,0 +1,46 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#ifndef DISTRHO_UI_BIGMETER_HPP_INCLUDED
#define DISTRHO_UI_BIGMETER_HPP_INCLUDED

#include "DistrhoUIExternal.hpp"

START_NAMESPACE_DISTRHO

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

class DistrhoUIBigMeter : public ExternalUI
{
public:
DistrhoUIBigMeter();

protected:
// -------------------------------------------------------------------
// Information (External)

const char* d_getExternalFilename() const override
{
return "bigmeter-ui";
}
};

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

END_NAMESPACE_DISTRHO

#endif // DISTRHO_UI_BIGMETER_HPP_INCLUDED

+ 125
- 0
source/modules/carla_native/bigmeterM/DistrhoPluginBigMeter.cpp View File

@@ -0,0 +1,125 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/
#include "DistrhoPluginBigMeter.hpp"
#include <cmath>
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
DistrhoPluginBigMeter::DistrhoPluginBigMeter()
: Plugin(1+DISTRHO_PLUGIN_NUM_INPUTS, 0, 0), // many parameters, 0 programs, 0 states
fColor(0)
{
std::memset(fOuts, 0, sizeof(float)*DISTRHO_PLUGIN_NUM_INPUTS);
}
DistrhoPluginBigMeter::~DistrhoPluginBigMeter()
{
}
// -----------------------------------------------------------------------
// Init
void DistrhoPluginBigMeter::d_initParameter(uint32_t index, Parameter& parameter)
{
switch (index)
{
case 0:
parameter.hints = PARAMETER_IS_AUTOMABLE | PARAMETER_IS_INTEGER;
parameter.name = "Color";
parameter.symbol = "color";
parameter.ranges.def = 0;
parameter.ranges.min = 0;
parameter.ranges.max = 1;
parameter.ranges.step = 1;
parameter.ranges.stepSmall = 1;
parameter.ranges.stepLarge = 1;
break;
default:
parameter.hints = PARAMETER_IS_AUTOMABLE | PARAMETER_IS_OUTPUT;
parameter.name = "Out " + d_string(index);
parameter.symbol = "out" + d_string(index);
parameter.ranges.def = 0.0f;
parameter.ranges.min = 0.0f;
parameter.ranges.max = 1.0f;
break;
}
}
// -----------------------------------------------------------------------
// Internal data
float DistrhoPluginBigMeter::d_getParameterValue(uint32_t index) const
{
switch (index)
{
case 0:
return (float)fColor;
default:
return fOuts[index-1];
}
}
void DistrhoPluginBigMeter::d_setParameterValue(uint32_t index, float value)
{
switch (index)
{
case 0:
fColor = (int)value;
break;
default:
fOuts[index-1] = value;
break;
}
}
// -----------------------------------------------------------------------
// Process
void DistrhoPluginBigMeter::d_run(float** inputs, float**, uint32_t frames, const MidiEvent*, uint32_t)
{
float tmp, tmp32[DISTRHO_PLUGIN_NUM_INPUTS];
std::memset(tmp32, 0, sizeof(float)*DISTRHO_PLUGIN_NUM_INPUTS);
for (uint32_t i=0; i < frames; ++i)
{
for (int j=0; j < DISTRHO_PLUGIN_NUM_INPUTS; ++j)
{
tmp = std::abs(inputs[j][i]);
if (tmp > tmp32[j])
tmp32[j] = tmp;
}
}
std::memcpy(fOuts, tmp32, sizeof(float)*DISTRHO_PLUGIN_NUM_INPUTS);
}
// -----------------------------------------------------------------------
Plugin* createPlugin()
{
return new DistrhoPluginBigMeter();
}
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO

+ 89
- 0
source/modules/carla_native/bigmeterM/DistrhoPluginBigMeter.hpp View File

@@ -0,0 +1,89 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/
#ifndef DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED
#define DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED
#include "DistrhoPlugin.hpp"
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
class DistrhoPluginBigMeter : public Plugin
{
public:
DistrhoPluginBigMeter();
~DistrhoPluginBigMeter() override;
protected:
// -------------------------------------------------------------------
// Information
const char* d_getLabel() const noexcept override
{
return "BigMeterM";
}
const char* d_getMaker() const noexcept override
{
return "DISTRHO";
}
const char* d_getLicense() const noexcept override
{
return "GPL v2+";
}
uint32_t d_getVersion() const noexcept override
{
return 0x1000;
}
long d_getUniqueId() const noexcept override
{
return d_cconst('D', 'B', 'M', 'M');
}
// -------------------------------------------------------------------
// Init
void d_initParameter(uint32_t index, Parameter& parameter) override;
// -------------------------------------------------------------------
// Internal data
float d_getParameterValue(uint32_t index) const override;
void d_setParameterValue(uint32_t index, float value) override;
// -------------------------------------------------------------------
// Process
void d_run(float** inputs, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
// -------------------------------------------------------------------
private:
int fColor;
float fOuts[DISTRHO_PLUGIN_NUM_INPUTS];
};
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
#endif // DISTRHO_PLUGIN_BIGMETER_HPP_INCLUDED

+ 38
- 0
source/modules/carla_native/bigmeterM/DistrhoPluginInfo.h View File

@@ -0,0 +1,38 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED
#define DISTRHO_PLUGIN_INFO_H_INCLUDED

#define DISTRHO_PLUGIN_NAME "BigMeter (many)"

#define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_IS_SYNTH 0

#define DISTRHO_PLUGIN_NUM_INPUTS 6
#define DISTRHO_PLUGIN_NUM_OUTPUTS 0

#define DISTRHO_PLUGIN_WANT_LATENCY 0
#define DISTRHO_PLUGIN_WANT_PROGRAMS 0
#define DISTRHO_PLUGIN_WANT_STATE 0
#define DISTRHO_PLUGIN_WANT_TIMEPOS 0

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

#define DISTRHO_UI_EXTERNAL

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 38
- 0
source/modules/carla_native/bigmeterM/DistrhoUIBigMeter.cpp View File

@@ -0,0 +1,38 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#include "DistrhoUIBigMeter.hpp"

START_NAMESPACE_DISTRHO

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

DistrhoUIBigMeter::DistrhoUIBigMeter()
: ExternalUI()
{
}

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

UI* createUI()
{
return new DistrhoUIBigMeter();
}

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

END_NAMESPACE_DISTRHO

+ 46
- 0
source/modules/carla_native/bigmeterM/DistrhoUIBigMeter.hpp View File

@@ -0,0 +1,46 @@
/*
* DISTRHO BigMeter Plugin
* Copyright (C) 2013 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 doc/GPL.txt file.
*/

#ifndef DISTRHO_UI_BIGMETER_HPP_INCLUDED
#define DISTRHO_UI_BIGMETER_HPP_INCLUDED

#include "DistrhoUIExternal.hpp"

START_NAMESPACE_DISTRHO

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

class DistrhoUIBigMeter : public ExternalUI
{
public:
DistrhoUIBigMeter();

protected:
// -------------------------------------------------------------------
// Information (External)

const char* d_getExternalFilename() const override
{
return "bigmeterM-ui";
}
};

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

END_NAMESPACE_DISTRHO

#endif // DISTRHO_UI_BIGMETER_HPP_INCLUDED

+ 59
- 0
source/modules/carla_native/distrho-bigmeter.cpp View File

@@ -0,0 +1,59 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2013 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 doc/GPL.txt file.
*/

#include "CarlaNative.hpp"

// Plugin Code
#include "bigmeter/DistrhoPluginBigMeter.cpp"
#include "bigmeter/DistrhoUIBigMeter.cpp"

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

START_NAMESPACE_DISTRHO

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

static const PluginDescriptor bigMeterDesc = {
/* category */ PLUGIN_CATEGORY_UTILITY,
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI),
/* supports */ static_cast<PluginSupports>(0x0),
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS,
/* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 1,
/* paramOuts */ 2,
/* name */ DISTRHO_PLUGIN_NAME,
/* label */ "BigMeter",
/* maker */ "falkTX",
/* copyright */ "GPL v2+",
PluginDescriptorFILL(PluginCarla)
};

END_NAMESPACE_DISTRHO

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

CARLA_EXPORT
void carla_register_native_plugin_BigMeter()
{
USE_NAMESPACE_DISTRHO
carla_register_native_plugin(&bigMeterDesc);
}

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

+ 59
- 0
source/modules/carla_native/distrho-bigmeterM.cpp View File

@@ -0,0 +1,59 @@
/*
* Carla Native Plugins
* Copyright (C) 2012-2013 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 doc/GPL.txt file.
*/

#include "CarlaNative.hpp"

// Plugin Code
#include "bigmeterM/DistrhoPluginBigMeter.cpp"
#include "bigmeterM/DistrhoUIBigMeter.cpp"

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

START_NAMESPACE_DISTRHO

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

static const PluginDescriptor bigMeterMDesc = {
/* category */ PLUGIN_CATEGORY_UTILITY,
/* hints */ static_cast<PluginHints>(PLUGIN_IS_RTSAFE|PLUGIN_HAS_GUI),
/* supports */ static_cast<PluginSupports>(0x0),
/* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS,
/* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS,
/* midiIns */ 0,
/* midiOuts */ 0,
/* paramIns */ 1,
/* paramOuts */ DISTRHO_PLUGIN_NUM_INPUTS,
/* name */ DISTRHO_PLUGIN_NAME,
/* label */ "BigMeter (many)",
/* maker */ "falkTX",
/* copyright */ "GPL v2+",
PluginDescriptorFILL(PluginCarla)
};

END_NAMESPACE_DISTRHO

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

CARLA_EXPORT
void carla_register_native_plugin_BigMeterM()
{
USE_NAMESPACE_DISTRHO
carla_register_native_plugin(&bigMeterMDesc);
}

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

+ 0
- 0
source/modules/carla_native/notes/DistrhoUINotes.cpp.old View File


+ 108
- 0
source/modules/carla_native/resources/bigmeter-ui View File

@@ -0,0 +1,108 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# DISTRHO BigMeter Plugin
# Copyright (C) 2013 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 GPL.txt file

# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from numpy import rint
from sys import argv, exit

try:
from PyQt5.QtWidgets import QApplication
except:
from PyQt4.QtGui import QApplication

# -----------------------------------------------------------------------
# Imports (ExternalUI)

from externalui import ExternalUI
from digitalpeakmeter import DigitalPeakMeter

# -----------------------------------------------------------------------
# External UI

class DistrhoUIBigMeter(DigitalPeakMeter, ExternalUI):
def __init__(self):
DigitalPeakMeter.__init__(self, None)
ExternalUI.__init__(self)

channels = 6 if argv[0].endswith("bigmeterM-ui") else 2

self.setChannels(channels)
self.setColor(self.GREEN)
self.setOrientation(self.VERTICAL)

#self.setSmoothRelease(0) # till 5

self.resize(30, 400)
self.setWindowTitle(self.fUiName)

self.fIdleTimer = self.startTimer(30)

self.showUiIfTesting()

# -------------------------------------------------------------------
# DSP Callbacks

def d_parameterChanged(self, index, value):
if index == 0:
color = rint(value)+1

if not color in (self.GREEN, self.BLUE):
return

self.setColor(color)

else:
self.displayMeter(index, value)

# -------------------------------------------------------------------
# ExternalUI Callbacks

def d_uiShow(self):
self.show()

def d_uiHide(self):
self.hide()

def d_uiQuit(self):
self.close()
app.quit()

def d_uiTitleChanged(self, uiTitle):
self.setWindowTitle(uiTitle)

# -------------------------------------------------------------------
# Qt events

def timerEvent(self, event):
if event.timerId() == self.fIdleTimer and not self.idleExternalUI():
self.d_uiQuit()

DigitalPeakMeter.timerEvent(self, event)

def closeEvent(self, event):
self.closeExternalUI()
DigitalPeakMeter.closeEvent(self, event)

#--------------- main ------------------
if __name__ == '__main__':
app = QApplication(argv)
#app...
gui = DistrhoUIBigMeter()
exit(app.exec_())

+ 1
- 0
source/modules/carla_native/resources/bigmeterM-ui View File

@@ -0,0 +1 @@
bigmeter-ui

+ 1
- 0
source/modules/carla_native/resources/digitalpeakmeter.py View File

@@ -0,0 +1 @@
../../../widgets/digitalpeakmeter.py

+ 64
- 51
source/modules/carla_native/resources/externalui.py View File

@@ -33,19 +33,31 @@ class ExternalUI(object):
self.fPipeSend = None self.fPipeSend = None
self.fQuitReceived = False self.fQuitReceived = False


self.fSampleRate = float(argv[1])
self.fUiName = argv[2]
self.fPipeRecvFd = int(argv[3])
self.fPipeSendFd = int(argv[4])
if len(argv) > 1:
self.fSampleRate = float(argv[1])
self.fUiName = argv[2]
self.fPipeRecvFd = int(argv[3])
self.fPipeSendFd = int(argv[4])


fcntl(self.fPipeRecvFd, F_SETFL, fcntl(self.fPipeRecvFd, F_GETFL) | O_NONBLOCK)
fcntl(self.fPipeRecvFd, F_SETFL, fcntl(self.fPipeRecvFd, F_GETFL) | O_NONBLOCK)


self.fPipeRecv = fdopen(self.fPipeRecvFd, 'r')
self.fPipeSend = fdopen(self.fPipeSendFd, 'w')
self.fPipeRecv = fdopen(self.fPipeRecvFd, 'r')
self.fPipeSend = fdopen(self.fPipeSendFd, 'w')

else:
self.fSampleRate = 44100.0
self.fUiName = "TestUI"

self.fPipeRecv = None
self.fPipeSend = None


# send empty line (just newline char) # send empty line (just newline char)
self.send([""]) self.send([""])


def showUiIfTesting(self):
if self.fPipeRecv is None:
self.d_uiShow()

# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Host DSP State # Host DSP State


@@ -110,54 +122,55 @@ class ExternalUI(object):
self.fPipeSend = None self.fPipeSend = None


def idleExternalUI(self): def idleExternalUI(self):
if self.fPipeRecv is None:
return False

try:
msg = self.fPipeRecv.readline().strip()
except IOError:
return False

if not msg:
return True

elif msg == "control":
index = int(self.fPipeRecv.readline())
value = float(self.fPipeRecv.readline())
self.d_parameterChanged(index, value)

elif msg == "program":
index = int(self.fPipeRecv.readline())
self.d_programChanged(index)

elif msg == "configure":
key = self.fPipeRecv.readline().strip().replace("\r", "\n")
value = self.fPipeRecv.readline().strip().replace("\r", "\n")
self.d_stateChanged(key, value)

elif msg == "note":
onOff = bool(self.fPipeRecv.readline().strip() == "true")
channel = int(self.fPipeRecv.readline())
note = int(self.fPipeRecv.readline())
velocity = int(self.fPipeRecv.readline())
self.d_noteReceived(onOff, channel, note, velocity)

elif msg == "show":
self.d_uiShow()
while True:
if self.fPipeRecv is None:
return True


elif msg == "hide":
self.d_uiHide()
try:
msg = self.fPipeRecv.readline().strip()
except IOError:
return False


elif msg == "quit":
self.fQuitReceived = True
self.d_uiQuit()
if not msg:
return True


elif msg == "uiTitle":
uiTitle = self.fPipeRecv.readline().strip().replace("\r", "\n")
self.d_uiTitleChanged(uiTitle)
elif msg == "control":
index = int(self.fPipeRecv.readline())
value = float(self.fPipeRecv.readline())
self.d_parameterChanged(index, value)


else:
print("unknown message: \"" + msg + "\"")
elif msg == "program":
index = int(self.fPipeRecv.readline())
self.d_programChanged(index)

elif msg == "configure":
key = self.fPipeRecv.readline().strip().replace("\r", "\n")
value = self.fPipeRecv.readline().strip().replace("\r", "\n")
self.d_stateChanged(key, value)

elif msg == "note":
onOff = bool(self.fPipeRecv.readline().strip() == "true")
channel = int(self.fPipeRecv.readline())
note = int(self.fPipeRecv.readline())
velocity = int(self.fPipeRecv.readline())
self.d_noteReceived(onOff, channel, note, velocity)

elif msg == "show":
self.d_uiShow()

elif msg == "hide":
self.d_uiHide()

elif msg == "quit":
self.fQuitReceived = True
self.d_uiQuit()

elif msg == "uiTitle":
uiTitle = self.fPipeRecv.readline().strip().replace("\r", "\n")
self.d_uiTitleChanged(uiTitle)

else:
print("unknown message: \"" + msg + "\"")


return True return True




+ 5
- 3
source/modules/carla_native/resources/notes-ui View File

@@ -78,15 +78,17 @@ class DistrhoUINotes(QWidget, ExternalUI):
self.fGridLayout.addWidget(self.fSpacer, 1, 2, 1, 1) self.fGridLayout.addWidget(self.fSpacer, 1, 2, 1, 1)
self.fGridLayout.setContentsMargins(0, 0, 0, 0) self.fGridLayout.setContentsMargins(0, 0, 0, 0)


self.resize(300, 200)
self.setWindowTitle(self.fUiName)

self.fButton.clicked.connect(self.slot_buttonClicked) self.fButton.clicked.connect(self.slot_buttonClicked)
self.fProgressBar.valueChanged.connect(self.slot_progressBarValueChanged) self.fProgressBar.valueChanged.connect(self.slot_progressBarValueChanged)
self.fTextEdit.textChanged.connect(self.slot_textChanged) self.fTextEdit.textChanged.connect(self.slot_textChanged)


self.resize(300, 200)
self.setWindowTitle(self.fUiName)

self.fIdleTimer = self.startTimer(50) self.fIdleTimer = self.startTimer(50)


self.showUiIfTesting()

def saveCurrentTextState(self): def saveCurrentTextState(self):
pageKey = "pageText %i" % self.fCurPage pageKey = "pageText %i" % self.fCurPage
pageValue = self.fTextEdit.toPlainText() pageValue = self.fTextEdit.toPlainText()


Loading…
Cancel
Save