Skip to content

Commit

Permalink
No more wine
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Jul 3, 2021
1 parent 3285850 commit a74b4e8
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 365 deletions.
7 changes: 0 additions & 7 deletions gtk2_ardour/ardour_ui_session.cc
Expand Up @@ -514,18 +514,11 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s
_session->set_clean ();
}

#ifdef WINDOWS_VST_SUPPORT
fst_stop_threading();
#endif

{
Timers::TimerSuspender t;
flush_pending (10);
}

#ifdef WINDOWS_VST_SUPPORT
fst_start_threading();
#endif
retval = 0;

if (!mix_template.empty ()) {
Expand Down
25 changes: 0 additions & 25 deletions gtk2_ardour/windows_vst_plugin_ui.cc
Expand Up @@ -169,34 +169,9 @@ WindowsVSTPluginUI::get_XID ()
return _vst->state()->xid;
}

#ifdef GDK_WINDOWING_X11
typedef int (*error_handler_t)( Display *, XErrorEvent *);
static Display *the_gtk_display;
static error_handler_t wine_error_handler;
static error_handler_t gtk_error_handler;

static int
fst_xerror_handler (Display* disp, XErrorEvent* ev)
{
if (disp == the_gtk_display) {
printf ("relaying error to gtk\n");
return gtk_error_handler (disp, ev);
} else {
printf( "relaying error to wine\n" );
return wine_error_handler (disp, ev);
}
}
#endif

void
windows_vst_gui_init (int *argc, char **argv[])
{
gtk_init (argc, argv);

#ifdef GDK_WINDOWING_X11
wine_error_handler = XSetErrorHandler (NULL);
the_gtk_display = gdk_x11_display_get_xdisplay (gdk_display_get_default());
gtk_error_handler = XSetErrorHandler (fst_xerror_handler);
#endif
}

81 changes: 11 additions & 70 deletions gtk2_ardour/wscript
Expand Up @@ -455,13 +455,6 @@ def configure(conf):
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')

# Add a waf `feature' to allow compilation of things using winegcc
from waflib.TaskGen import feature
@feature("wine")
def set_winegcc(self):
self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
self.env.CC = 'winegcc'

def _doPyp(infileName, deps = False):
outStr = ''
out = []
Expand Down Expand Up @@ -604,60 +597,19 @@ def build(bld):
# obj.source += [ 'toolbar_test.cc', 'enums.cc']


if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
# Windows VST support w/wine
# If we require VST support we build a stub main() and the FST library
# here using winegcc, and link it to the GTK front-end library
obj = bld (features = 'cxx c cxxprogram wine')
obj.source = ( '../libs/fst/vstwin.c', '../vst/winmain.c' )
#
# XXX do we really need to explicitly link to all of these for the wine executable?
#
obj.use = [ 'libpbd',
'libmidipp',
'libardour',
'libardour_cp',
'libtemporal',
'libmidipp',
'libgtk2_ardour',
'libgtkmm2ext',
'libcanvas',
'libwaveview',
'libwidgets',
'libptformat',
]
obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so'
obj.includes = [ '../libs/fst', '.' ]
obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
obj.linkflags += bld.env['LDFLAGS']
obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
obj.uselib = 'GLIB'
obj.install_path = bld.env['DLLDIR']
# end of the wine executable

# now the shared library containing the GTK GUI for ardour
obj = bld (features = 'cxx c cxxshlib')
# operate on copy to avoid adding sources twice
obj.source = list(gtk2_ardour_sources)
obj.includes = [ '../libs/fst', '.' ]
obj.name = 'libgtk2_ardour'
obj.target = 'gtk2_ardour'
obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]

# executable version of the GTK GUI
if bld.env['build_target'] == 'mingw':
obj = bld (features = 'cxx c cxxprogram winres')
else:
# just the normal executable version of the GTK GUI
if bld.env['build_target'] == 'mingw':
obj = bld (features = 'cxx c cxxprogram winres')
else:
obj = bld (features = 'cxx c cxxprogram')
# operate on copy to avoid adding sources twice
obj.source = list(gtk2_ardour_sources)
obj.target = 'ardour-' + str (bld.env['VERSION'])
obj.includes = ['.']
obj = bld (features = 'cxx c cxxprogram')

if bld.is_defined('WINDOWS_VST_SUPPORT'):
# Windows VST support mingw
obj.includes += [ '../libs/fst' ]
# operate on copy to avoid adding sources twice
obj.source = list(gtk2_ardour_sources)
obj.target = 'ardour-' + str (bld.env['VERSION'])
obj.includes = ['.']

if bld.is_defined('WINDOWS_VST_SUPPORT'):
obj.includes += [ '../libs/fst' ]

# at this point, "obj" refers to either the normal native executable
# OR the shared library built for use with wine on linux.
Expand Down Expand Up @@ -716,8 +668,6 @@ def build(bld):
if bld.is_defined('WINDOWS_VST_SUPPORT'):
obj.source += [ 'windows_vst_plugin_ui.cc' ]
obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
if bld.env['build_target'] != 'mingw':
obj.use += [ 'X11' ]

if bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
Expand Down Expand Up @@ -781,15 +731,6 @@ def build(bld):
obj.install_path = bld.env['BINDIR']
set_subst_dict(obj, wrapper_subst_dict)

if bld.is_defined('WINDOWS_VST_SUPPORT'):
obj = bld(features = 'subst')
obj.source = '../vst/ardourvst.in'
obj.target = 'ardourvst' + str (bld.env['MAJOR'])
obj.chmod = Utils.O755
obj.dict = wrapper_subst_dict
obj.install_path = bld.env['BINDIR']
set_subst_dict(obj, wrapper_subst_dict)

# Font configuration

font_subst_dict = {}
Expand Down
6 changes: 0 additions & 6 deletions headless/wscript
Expand Up @@ -30,8 +30,6 @@ def configure(conf):
def build(bld):

VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
return

# just the normal executable version of the GTK GUI
obj = bld (features = 'cxx c cxxprogram')
Expand All @@ -40,10 +38,6 @@ def build(bld):
obj.source = hardour_sources
obj.target = 'hardour-' + str (bld.env['VERSION'])
obj.includes = ['.']

# at this point, "obj" refers to either the normal native executable
# OR the shared library built for use with wine on linux.

obj.use = [ 'libpbd',
'libardour',
'libardour_cp',
Expand Down
15 changes: 6 additions & 9 deletions libs/ardour/wscript
Expand Up @@ -371,11 +371,9 @@ def configure(conf):
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
conf.check(compiler='cxx',
lib='gdi32',
mandatory=True,
uselib_store='GDI32')

if conf.env['WINDOWS_VST_SUPPORT'] == True:
conf.check(compiler='cxx', lib='gdi32', mandatory=True, uselib_store='GDI32')


def build(bld):
Expand Down Expand Up @@ -450,11 +448,10 @@ def build(bld):

if bld.is_defined('WINDOWS_VST_SUPPORT'):
obj.source += [ 'windows_vst_plugin.cc']
obj.includes += [ '../fst' ]
obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
if bld.env['build_target'] == 'mingw':
obj.use += [ 'vstwin' ]
obj.uselib += ['GDI32']
obj.includes += [ '../fst' ]
obj.use += [ 'vstwin' ]
obj.uselib += ['GDI32']

if bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc' ]
Expand Down
8 changes: 0 additions & 8 deletions libs/fluidsynth/wscript
Expand Up @@ -73,13 +73,5 @@ def build(bld):
defines = [ 'HAVE_CONFIG_H', 'DEFAULT_SOUNDFONT=""' ]
)

# wine-gcc hacks:
# defining __MINGW32__ for wine-gcc is a workaround for fluidsynth's include
# strategy (which is made for mingw or windows) without it
# winsock2.h will complain about undeclared "u_short"
# we also need to explicitly define _WIN32
if bld.is_defined('WINDOWS_VST_SUPPORT') and not bld.env['build_target'] == 'mingw':
obj.defines += [ '_WIN32', '__MINGW32__' ]

def shutdown():
autowaf.shutdown()
2 changes: 0 additions & 2 deletions libs/fst/fst.h
Expand Up @@ -47,8 +47,6 @@ LIBARDOUR_API void fst_destroy_editor (VSTState *);
LIBARDOUR_API void fst_move_window_into_view (VSTState *);

LIBARDOUR_API void fst_event_loop_remove_plugin (VSTState* fst);
LIBARDOUR_API void fst_start_threading(void);
LIBARDOUR_API void fst_stop_threading(void);
LIBARDOUR_API void fst_audio_master_idle(void);

#ifdef __cplusplus
Expand Down
2 changes: 0 additions & 2 deletions libs/fst/scanner.wine

This file was deleted.

0 comments on commit a74b4e8

Please sign in to comment.