Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #267 from teragonaudio/nik/master/platform-bits
Browse files Browse the repository at this point in the history
Re-add PLATFORM_BITS preprocessor definition
  • Loading branch information
nikreiman authored Jan 27, 2017
2 parents 299c79d + 2c95127 commit dbbd637
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ project(MrsWatson)

option(WITH_AUDIOFILE "Use libaudiofile for reading/writing audio files" ON)
option(WITH_FLAC "Support for FLAC files (requires libaudiofile)" OFF)
option(WITH_GUI "Support for showing VST GUI windows (experimental)" OFF)
option(WITH_VST_SDK "Manually specify VST SDK zipfile" "")
option(VERBOSE "Show extra build information" OFF)
option(VERSION "Set version number when building distribution package" OFF)
Expand All @@ -23,6 +24,10 @@ if(WITH_FLAC)
add_definitions(-DUSE_FLAC=1)
endif()

if(WITH_GUI)
add_definitions(-DWITH_GUI=1)
endif()

if(VERSION)
set(mw_VERSION "${VERSION}")
else()
Expand Down Expand Up @@ -268,5 +273,6 @@ if(VERBOSE)
message(STATUS "Options")
message(" WITH_AUDIOFILE: ${WITH_AUDIOFILE}")
message(" WITH_FLAC: ${WITH_FLAC}")
message(" WITH_GUI: ${WITH_GUI}")
message(STATUS "Package version: ${mw_VERSION}")
endif()
6 changes: 6 additions & 0 deletions cmake/ConfigureTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ function(configure_target target wordsize)
endif()
target_link_libraries(${target} dl)

if(WITH_GUI)
target_link_libraries(${target} x11)
endif()

elseif(APPLE)
if(${wordsize} EQUAL 32)
set_target_properties(${target} PROPERTIES OSX_ARCHITECTURES "i386")
Expand All @@ -26,4 +30,6 @@ function(configure_target target wordsize)
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/DWIN64=1")
endif()
endif()

target_compile_definitions(${target} PUBLIC PLATFORM_BITS=${wordsize})
endfunction()
4 changes: 2 additions & 2 deletions source/plugin/PluginVst2xLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extern void showVst2xEditor(AEffect *effect, const CharString pluginName,
// Bah, this stuff doesn't build so well for 32-bit Linux on a 64-bit
// machine. Since most people in the Linux audio community have been able to
// move to 64-bit, this feature is unavailable on 32-bit Linux.
#if PLATFORM_BITS == 64
#if defined(WITH_GUI) && PLATFORM_BITS == 64
Display *display;
Window window;
XEvent event;
Expand Down Expand Up @@ -161,7 +161,7 @@ extern void showVst2xEditor(AEffect *effect, const CharString pluginName,
XDestroyWindow(display, window);
XCloseDisplay(display);
#else
logUnsupportedFeature("Show plugin editor on 32-bit OS");
logUnsupportedFeature("Showing plugin editor window");
#endif
}

Expand Down
6 changes: 4 additions & 2 deletions source/plugin/PluginVst2xMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ LibraryHandle getLibraryHandleForPlugin(const CharString pluginAbsolutePath)

void showVst2xEditor(AEffect* effect, const CharString pluginName, PluginWindowSize *rect);
void showVst2xEditor(AEffect* effect, const CharString pluginName, PluginWindowSize *rect) {
#if PLATFORM_BITS == 64
#if defined(WITH_GUI) && PLATFORM_BITS == 64
NSRect frame;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
Expand All @@ -151,10 +151,12 @@ void showVst2xEditor(AEffect* effect, const CharString pluginName, PluginWindowS
frame.origin.y = (mainScreenRect.size.height - rect->height) / 2;
frame.size.width = rect->width;
frame.size.height = rect->height;
/*
NSUInteger windowStyleMask = NSTitledWindowMask |
NSResizableWindowMask |
NSClosableWindowMask |
NSMiniaturizableWindowMask;
*/
NSWindow *window = [[[NSWindow alloc] initWithContentRect:frame
styleMask:NSBackingStoreBuffered
backing:NSBackingStoreBuffered
Expand All @@ -177,7 +179,7 @@ void showVst2xEditor(AEffect* effect, const CharString pluginName, PluginWindowS
logDebug("App runloop stopped");
[pool release];
#else
logUnsupportedFeature("Showing plugin editor on 32-bit Mac OS X");
logUnsupportedFeature("Showing plugin editor window");
#endif
}

Expand Down

0 comments on commit dbbd637

Please sign in to comment.