Skip to content

Commit

Permalink
OSX: Also update the graphics of the y splitter itself after resizing…
Browse files Browse the repository at this point in the history
… editor. (another workaround for qt bug)
  • Loading branch information
kmatheussen committed May 11, 2019
1 parent 1bc695a commit 45c18f9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
12 changes: 8 additions & 4 deletions OpenGL/Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

#include "../audio/Juce_plugins_proc.h"

#include "../api/api_gui_proc.h"

#include "GfxElements.h"
#include "T2.hpp"
#include "Timing.hpp"
Expand Down Expand Up @@ -1505,20 +1507,22 @@ class MyQtThreadedWidget
//gui_update(gui_getMainXSplitter(),-1,-1,-1,-1);
QTimer::singleShot(50, [](){
//printf(".......Updating 50\n");
gui_updateRecursively(gui_getMainXSplitter()); // Yes, it's necessary to update recursively.
updateWidgetRecursively(API_get_main_ysplitter()); // This updates everything in the main window. Do this to update the Y splitter widget itself.
//gui_updateRecursively(gui_getMainXSplitter()); // Yes, it's necessary to update recursively.
//SEQUENCER_update(SEQUPDATE_EVERYTHING);
});

QTimer::singleShot(250, [](){
//printf(".......Updating 250\n");
gui_updateRecursively(gui_getMainXSplitter());
updateWidgetRecursively(API_get_main_ysplitter()); // This updates everything in the main window. Do this to update the Y splitter widget itself.
// gui_updateRecursively(gui_getMainXSplitter());
//SEQUENCER_update(SEQUPDATE_EVERYTHING);
});

QTimer::singleShot(450, [](){
//printf(".......Updating 450\n");
gui_updateRecursively(gui_getMainXSplitter());
SEQUENCER_update(SEQUPDATE_EVERYTHING); // Must have this one though, in case the y splitter is not updated from the dragger.
updateWidgetRecursively(API_get_main_ysplitter()); // This updates everything in the main window. Do this to update the Y splitter widget itself.
//SEQUENCER_update(SEQUPDATE_EVERYTHING); // Must have this one though, in case the y splitter is not updated from the dragger. (not needed to call this when updating the y splitter)
});
#endif

Expand Down
7 changes: 7 additions & 0 deletions api/api_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4575,6 +4575,13 @@ int64_t gui_getMainXSplitter(void){
return API_get_gui_from_existing_widget(editor->xsplitter);
}

/*
int64_t gui_getMainYSplitter(void){
EditorWidget *editor = static_cast<EditorWidget*>(root->song->tracker_windows->os_visual.widget);
return API_get_gui_from_existing_widget(editor->ysplitter);
}
*/

int64_t gui_getEditorGui(void){
static int64_t guinum = -100;

Expand Down
1 change: 1 addition & 0 deletions api/protos.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,7 @@ bool gui_isEnabled | int64_t guinum
void gui_setStaticToplevelWidget | int64_t guinum | bool add ? true # These guis can be used as parent when calling setParent with argument -3. They can also be used as parent for message windows and other windows in the program. The gui must be a toplevel window, and it can not be deleted or closed while it is marked as a static toplevel widget (it can be hidden though). Note that add=false can only be used in !RELEASE mode.

int64_t gui_getMainXSplitter
#int64_t gui_getMainYSplitter
int64_t gui_getEditorGui
int64_t gui_getSequencerGui
int64_t gui_getSequencerFrameGui # returns the frame that the sequencer lives in.
Expand Down
11 changes: 6 additions & 5 deletions audio/SmoothDelay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#ifndef _RADIUM_AUDIO_SMOOTHDELAY_HPP
#define _RADIUM_AUDIO_SMOOTHDELAY_HPP

#if TEST_SMOOTHDELAY
static double g_benchmark_time = 0.0;
static double g_fade_benchmark_time = 0.0;
#endif


#include "../common/LockAsserter.hpp"
#include "Delay.hpp"
#include "Juce_plugins_proc.h"
Expand Down Expand Up @@ -51,11 +57,6 @@ enum class State{

}

#if TEST_SMOOTHDELAY
static double g_benchmark_time = 0.0;
static double g_fade_benchmark_time = 0.0;
#endif

using namespace SmoothDelayState;

#define SMOOTH_DELAY_FADE_LEN ms_to_frames(100)
Expand Down
1 change: 1 addition & 0 deletions test/test_seqautomation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "../common/nsmtracker.h"
#include "../common/SeqAutomation.hpp"

struct Root *root = NULL;


// BUILDTYPE=DEBUG ./build_linux.sh test
Expand Down
4 changes: 2 additions & 2 deletions test/test_smoothdelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

#include <QThread>

#include "../common/nsmtracker.h"

#define TEST_SMOOTHDELAY 1

#include "../common/nsmtracker.h"

#include "../audio/SmoothDelay.hpp"

static double get_ms(void){
Expand Down

0 comments on commit 45c18f9

Please sign in to comment.