Browse Source

Fixing

tags/1.9.4
falkTX 12 years ago
parent
commit
b0f5706efe
6 changed files with 142 additions and 24 deletions
  1. +2
    -2
      source/backend/standalone/CarlaStandalone.cpp
  2. +3
    -1
      source/backend/standalone/Makefile
  3. +3
    -3
      source/carla_host.py
  4. +129
    -16
      source/modules/carla_native/vex.cpp
  5. +2
    -2
      source/modules/juce_graphics/AppConfig.h
  6. +3
    -0
      source/modules/juce_graphics/Makefile

+ 2
- 2
source/backend/standalone/CarlaStandalone.cpp View File

@@ -17,7 +17,6 @@

// TODO:
// Check carla_stderr2("Engine is not running"); <= prepend func name and args
// Check NSM args

#include "CarlaHost.hpp"
#include "CarlaEngine.hpp"
@@ -76,7 +75,7 @@ struct CarlaBackendStandalone {
void idle()
{
if (MessageManager* const mgr = MessageManager::getInstanceWithoutCreating())
mgr->runDispatchLoopUntil(0);
mgr->runDispatchLoopUntil(5);
}

void close()
@@ -454,6 +453,7 @@ void carla_engine_idle()
{
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,);

gStandalone.idle();
gStandalone.engine->idle();
}



+ 3
- 1
source/backend/standalone/Makefile View File

@@ -76,7 +76,7 @@ LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk)
endif
endif

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

ifneq ($(MACOS),true)
@@ -92,6 +92,8 @@ LIBS += ../../modules/juce_audio_basics.a
LIBS += ../../modules/juce_core.a
LIBS += ../../modules/juce_data_structures.a
LIBS += ../../modules/juce_events.a
LIBS += ../../modules/juce_graphics.a
LIBS += ../../modules/juce_gui_basics.a
LIBS += ../../modules/rtmempool.a

ifeq ($(CARLA_PLUGIN_SUPPORT),true)


+ 3
- 3
source/carla_host.py View File

@@ -380,7 +380,7 @@ class HostWindow(QMainWindow):
#self.fFirstEngineInit = False

# Peaks and TimeInfo
self.fIdleTimerFast = self.startTimer(self.fSavedSettings["Main/RefreshInterval"])
self.fIdleTimerFast = self.startTimer(30) #self.fSavedSettings["Main/RefreshInterval"])
# LEDs and edit dialog parameters
self.fIdleTimerSlow = self.startTimer(self.fSavedSettings["Main/RefreshInterval"]*2)

@@ -591,7 +591,7 @@ class HostWindow(QMainWindow):

if self.fIdleTimerFast != 0:
self.killTimer(self.fIdleTimerFast)
self.fIdleTimerFast = self.startTimer(self.fSavedSettings["Main/RefreshInterval"])
self.fIdleTimerFast = self.startTimer(30) #self.fSavedSettings["Main/RefreshInterval"])

if self.fIdleTimerSlow != 0:
self.killTimer(self.fIdleTimerSlow)
@@ -864,7 +864,7 @@ class HostWindow(QMainWindow):
self.fSampleRate = Carla.host.get_sample_rate()

if self.fIdleTimerFast == 0:
self.fIdleTimerFast = self.startTimer(self.fSavedSettings["Main/RefreshInterval"])
self.fIdleTimerFast = self.startTimer(30) #self.fSavedSettings["Main/RefreshInterval"])
if self.fIdleTimerSlow == 0:
self.fIdleTimerSlow = self.startTimer(self.fSavedSettings["Main/RefreshInterval"]*2)



+ 129
- 16
source/modules/carla_native/vex.cpp View File

@@ -27,9 +27,66 @@ using namespace juce;
#include "vex/VexReverb.h"
#include "vex/VexSyntModule.h"

#include "vex/PeggyViewComponent.h"

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

class HelperWindow : public DocumentWindow
{
public:
HelperWindow()
: DocumentWindow("PlugWindow", Colour(0, 0, 0), DocumentWindow::closeButton, false),
fClosed(false)
{
setDropShadowEnabled(false);
setOpaque(true);
setResizable(false, false);
//setUsingNativeTitleBar(true);
setVisible(false);
}

void show(Component* const comp)
{
fClosed = false;

setContentNonOwned(comp, true);
centreWithSize(comp->getWidth(), comp->getHeight());

if (! isOnDesktop())
addToDesktop();

setVisible(true);
}

void hide()
{
setVisible(false);

if (isOnDesktop())
removeFromDesktop();

clearContentComponent();
}

bool wasClosedByUser() const
{
return fClosed;
}

protected:
void closeButtonPressed() override
{
fClosed = true;
}

private:
bool fClosed;
};

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

class VexArpPlugin : public PluginClass
class VexArpPlugin : public PluginClass,
public PeggyViewComponent::Callback
{
public:
enum Params {
@@ -46,19 +103,6 @@ public:
: PluginClass(host),
fArp(&fSettings)
{
for (int i=0; i < 8; ++i)
fSettings.grid[i*10] = true;

fSettings.grid[1] = true;
fSettings.grid[2] = true;
fSettings.grid[3] = true;

fSettings.grid[41] = true;
fSettings.grid[42] = true;
fSettings.grid[43] = true;
fSettings.grid[44] = true;
fSettings.grid[45] = true;

fArp.setSampleRate(getSampleRate());
fMidiInBuffer.ensureSize(512*4);
}
@@ -285,6 +329,56 @@ protected:
}
}

// -------------------------------------------------------------------
// Plugin UI calls

void uiShow(const bool show) override
{
if (show)
{
if (fWindow == nullptr)
{
fWindow = new HelperWindow();
fWindow->setName(getUiName());
}

if (fView == nullptr)
{
fView = new PeggyViewComponent(1, fSettings, this);
fView->setSize(207, 280);
}

fWindow->show(fView);
}
else if (fWindow != nullptr)
{
fWindow->hide();

fView = nullptr;
fWindow = nullptr;
}
}

void uiIdle() override
{
if (fWindow == nullptr)
return;

if (fWindow->wasClosedByUser())
{
uiShow(false);
uiClosed();
}
}

void uiSetParameterValue(const uint32_t, const float) override
{
if (fView == nullptr)
return;

fView->update();
}

// -------------------------------------------------------------------
// Plugin dispatcher calls

@@ -293,11 +387,30 @@ protected:
fArp.setSampleRate(sampleRate);
}

void uiNameChanged(const char* const uiName) override
{
if (fWindow == nullptr)
return;

fWindow->setName(uiName);
}

// -------------------------------------------------------------------
// Peggy callback

void somethingChanged(const uint32_t id) override
{
uiParameterChanged(id, getParameterValue(id));
}

private:
VexArpSettings fSettings;
VexArp fArp;
MidiBuffer fMidiInBuffer;

ScopedPointer<PeggyViewComponent> fView;
ScopedPointer<HelperWindow> fWindow;

PluginClassEND(VexArpPlugin)
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VexArpPlugin)
};
@@ -1029,7 +1142,7 @@ protected:
}
}

if (obf->getNumSamples() != frames)
if (obf->getNumSamples() != (int)frames)
{
obf->setSize(2, frames, 0, 0, 1);
abf->setSize(2, frames, 0, 0, 1);
@@ -1110,7 +1223,7 @@ private:

static const PluginDescriptor vexArpDesc = {
/* category */ PLUGIN_CATEGORY_UTILITY,
/* hints */ static_cast<PluginHints>(PLUGIN_USES_TIME),
/* hints */ static_cast<PluginHints>(PLUGIN_HAS_GUI|PLUGIN_NEEDS_SINGLE_THREAD|PLUGIN_USES_TIME),
/* supports */ static_cast<PluginSupports>(PLUGIN_SUPPORTS_EVERYTHING),
/* audioIns */ 0,
/* audioOuts */ 0,


+ 2
- 2
source/modules/juce_graphics/AppConfig.h View File

@@ -28,9 +28,9 @@
*/
#define JUCE_USE_DIRECTWRITE 1
#define JUCE_INCLUDE_PNGLIB_CODE 0
#define JUCE_INCLUDE_PNGLIB_CODE 1
#define JUCE_INCLUDE_JPEGLIB_CODE 0
#define JUCE_INCLUDE_JPEGLIB_CODE 1
#define USE_COREGRAPHICS_RENDERING 1


+ 3
- 0
source/modules/juce_graphics/Makefile View File

@@ -19,6 +19,9 @@ else
OBJS = juce_graphics.cpp.o
OBJS_posix32 = juce_graphics.cpp.posix32.o
OBJS_posix64 = juce_graphics.cpp.posix64.o
ifneq ($(WIN32),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags freetype2)
endif
endif

OBJS_win32 = juce_graphics.cpp.win32.o


Loading…
Cancel
Save