Browse Source

Merge remote-tracking branch 'bsp2/v0.6' into v0.6-linux-lglw

pull/1639/head
Cameron Leger 6 years ago
parent
commit
36091861d3
4 changed files with 46 additions and 4 deletions
  1. +33
    -3
      other/vst2_debug_host/vst2_debug_host.cpp
  2. +7
    -0
      src/engine.cpp
  3. +1
    -1
      src/settings.cpp
  4. +5
    -0
      src/vst2_main.cpp

+ 33
- 3
other/vst2_debug_host/vst2_debug_host.cpp View File

@@ -217,6 +217,14 @@ void open_and_close(void) {
BlackPixel(d, s), WhitePixel(d, s)
);
XSelectInput(d, w, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | ButtonMotionMask | FocusChangeMask);

// see <https://stackoverflow.com/questions/1157364/intercept-wm-delete-window-on-x11>
Atom wm_delete_window;
{
wm_delete_window = XInternAtom(d, "WM_DELETE_WINDOW", False);
XSetWMProtocols(d, w, &wm_delete_window, 1);
}

XMapRaised(d, w);
XFlush(d);
#endif
@@ -248,7 +256,8 @@ void open_and_close(void) {
if(result == 0)
{
printf("xxx no XEventProc found, running effEditIdle instead\n");
for(;;)
bool bRunning = true;
while(bRunning)
{
XEvent xev;
int queued = XPending(d);
@@ -266,11 +275,25 @@ void open_and_close(void) {

queued = XPending(d);
// printf("xxx checking host queue after effEditIdle (events: %i)\n", queued);
while(queued)
while((queued > 0) && bRunning)
{
XNextEvent(d, &xev);

// printf("xxx debug_host: xev.type=%d\n", xev.type);

if(ClientMessage == xev.type)
{
printf("xxx debug_host: ClientMessage\n");
if((Atom)xev.xclient.data.l[0] == wm_delete_window)
{
printf("xxx debug_host: ClientMessage<wm_delete_window>\n");
bRunning = false;
}
}

// if(MotionNotify != xev.type)
// printf("xxx event type: %i\n", xev.type);

queued--;
}

@@ -300,6 +323,8 @@ void open_and_close(void) {
sleep(1);
printf("xxx calling effect->dispatcher<effEditClose>\n");
effect->dispatcher(effect, effEditClose, 0, 0, NULL, 0.0f);

#if 0
sleep(1);
printf("xxx calling effect->dispatcher<effEditOpen> again\n");
#ifdef YAC_WIN32
@@ -311,14 +336,19 @@ void open_and_close(void) {
printf("xxx calling effect->dispatcher<effEditIdle>\n");
effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
sleep(1);
#endif

printf("xxx call processreplacing\n");
for(int i = 0; i < 1024; i++)
{
effect->processReplacing(effect, inputBuffers, outputBuffers, (VstInt32)64);
}

#if 0
printf("xxx calling effect->dispatcher<effEditClose>\n");
effect->dispatcher(effect, effEditClose, 0, 0, NULL, 0.0f);
sleep(1);
#endif
printf("xxx calling effect->dispatcher<effClose>\n");
effect->dispatcher(effect, effClose, 0, 0, NULL, 0.0f);
sleep(1);
@@ -355,7 +385,7 @@ void open_and_close(void) {
}

int main() {
for(int i = 0; i < 5; i++)
for(int i = 0; i < 2; i++)
{
open_and_close();
}


+ 7
- 0
src/engine.cpp View File

@@ -17,6 +17,9 @@
#include "global.hpp"
#include "global_ui.hpp"

#ifdef __GNUC__
#include <fenv.h>
#endif

namespace rack {

@@ -121,6 +124,10 @@ static void engineRun() {
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
#endif // _MSC_VER

#if defined(__GNUC__) && (defined(ARCH_X64) || defined(ARCH_X86))
::fesetround(FE_TOWARDZERO);
#endif // __GNUC__

// Every time the engine waits and locks a mutex, it steps this many frames
const int mutexSteps = 64;
// Time in seconds that the engine is rushing ahead of the estimated clock time


+ 1
- 1
src/settings.cpp View File

@@ -83,7 +83,7 @@ static json_t *settingsToJson() {
json_object_set_new(rootJ, "vsync", vsyncJ);

// fbo
json_t *fboJ = json_boolean(!global_ui->b_fbo);
json_t *fboJ = json_boolean(global_ui->b_fbo);
json_object_set_new(rootJ, "fbo", fboJ);

// touchInput


+ 5
- 0
src/vst2_main.cpp View File

@@ -147,6 +147,7 @@ struct PluginMutex {
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <fenv.h> // fesetround()

// #define _GNU_SOURCE
#include <dlfcn.h>
@@ -1190,6 +1191,10 @@ void VSTPluginProcessReplacingFloat32(VSTPlugin *vstPlugin,
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
#endif // HAVE_WINDOWS

#ifdef YAC_LINUX
fesetround(FE_TOWARDZERO);
#endif // YAC_LINUX

sUI chIdx;

if(wrapper->b_idle)


Loading…
Cancel
Save