-
-
Save redtide/11dedb7689fe60efe1ffeea61b3e12fd to your computer and use it in GitHub Desktop.
sfizz standalone: changes applied against sample code from vst3sdk 3.7.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -urN vst3sdk_v3.7.2_build_28/media/audioclient.h jpcima/media/audioclient.h | |
--- vst3sdk_v3.7.2_build_28/media/audioclient.h 2023-10-22 20:43:53.565944813 +0200 | |
+++ jpcima/media/audioclient.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -37,8 +37,8 @@ | |
#pragma once | |
-#include "public.sdk/samples/vst-hosting/audiohost/source/media/imediaserver.h" | |
-#include "public.sdk/samples/vst-hosting/audiohost/source/media/iparameterclient.h" | |
+#include "media/imediaserver.h" | |
+#include "media/iparameterclient.h" | |
#include "public.sdk/source/vst/hosting/eventlist.h" | |
#include "public.sdk/source/vst/hosting/parameterchanges.h" | |
#include "public.sdk/source/vst/hosting/processdata.h" | |
diff -urN vst3sdk_v3.7.2_build_28/media/jack/jackclient.cpp jpcima/media/jack/jackclient.cpp | |
--- vst3sdk_v3.7.2_build_28/media/jack/jackclient.cpp 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/media/jack/jackclient.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -35,7 +35,7 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#include "public.sdk/samples/vst-hosting/audiohost/source/media/imediaserver.h" | |
+#include "media/imediaserver.h" | |
#include <cassert> | |
@@ -333,8 +333,8 @@ | |
auto midiData = in_event.buffer; | |
Steinberg::Vst::IMidiClient::MidiData channel = midiData[0] & kChannelMask; | |
Steinberg::Vst::IMidiClient::MidiData status = midiData[0] & kStatusMask; | |
- Steinberg::Vst::IMidiClient::MidiData data0 = midiData[1]; | |
- Steinberg::Vst::IMidiClient::MidiData data1 = midiData[2]; | |
+ Steinberg::Vst::IMidiClient::MidiData data0 = midiData[1] & kDataMask; | |
+ Steinberg::Vst::IMidiClient::MidiData data1 = midiData[2] & kDataMask; | |
midiClient->onEvent ({status, channel, data0, data1, in_event.time}, portIndex); | |
} | |
} | |
diff -urN vst3sdk_v3.7.2_build_28/platform/appinit.h jpcima/platform/appinit.h | |
--- vst3sdk_v3.7.2_build_28/platform/appinit.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/appinit.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/appinit.h | |
// Created by : Steinberg, 04/2005 | |
// Description : Editor Host Example for VST SDK 3 | |
@@ -37,13 +37,13 @@ | |
#pragma once | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iapplication.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iplatform.h" | |
+#include "platform/iapplication.h" | |
+#include "platform/iplatform.h" | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
struct AppInit | |
@@ -55,6 +55,6 @@ | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/iapplication.h jpcima/platform/iapplication.h | |
--- vst3sdk_v3.7.2_build_28/platform/iapplication.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/iapplication.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/iapplication.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -44,7 +44,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class IApplication | |
@@ -59,6 +59,6 @@ | |
using ApplicationPtr = std::unique_ptr<IApplication>; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/iplatform.h jpcima/platform/iplatform.h | |
--- vst3sdk_v3.7.2_build_28/platform/iplatform.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/iplatform.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/iplatform.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -37,14 +37,14 @@ | |
#pragma once | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iapplication.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iwindow.h" | |
+#include "platform/iapplication.h" | |
+#include "platform/iwindow.h" | |
#include <functional> | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class IPlatform | |
@@ -63,7 +63,7 @@ | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/iwindow.h jpcima/platform/iwindow.h | |
--- vst3sdk_v3.7.2_build_28/platform/iwindow.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/iwindow.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/iwindow.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -44,7 +44,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
using Coord = int32_t; | |
@@ -135,6 +135,6 @@ | |
using WindowPtr = std::shared_ptr<IWindow>; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/linux/platform.cpp jpcima/platform/linux/platform.cpp | |
--- vst3sdk_v3.7.2_build_28/platform/linux/platform.cpp 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/linux/platform.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/linux/platform.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,10 +35,10 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iplatform.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/linux/window.h" | |
+#include "platform/iplatform.h" | |
+#include "platform/linux/window.h" | |
#ifndef EDITORHOST_GTK | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/linux/runloop.h" | |
+#include "platform/linux/runloop.h" | |
#endif | |
#ifdef EDITORHOST_GTK | |
@@ -53,7 +53,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
using namespace std::chrono; | |
using clock = high_resolution_clock; | |
@@ -235,7 +235,7 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
@@ -248,10 +248,10 @@ | |
#endif | |
std::vector<std::string> cmdArgs; | |
- for (int i = 1; i < argc; ++i) | |
+ for (int i = 0; i < argc; ++i) | |
cmdArgs.push_back (argv[i]); | |
- Steinberg::Vst::EditorHost::Platform::instance ().run (cmdArgs); | |
+ Steinberg::Vst::StandaloneHost::Platform::instance ().run (cmdArgs); | |
return 0; | |
} | |
diff -urN vst3sdk_v3.7.2_build_28/platform/linux/runloop.cpp jpcima/platform/linux/runloop.cpp | |
--- vst3sdk_v3.7.2_build_28/platform/linux/runloop.cpp 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/linux/runloop.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/linux/runloop.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,14 +35,14 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/linux/runloop.h" | |
+#include "platform/linux/runloop.h" | |
#include <algorithm> | |
#include <iostream> | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
using LockGuard = std::lock_guard<std::recursive_mutex>; | |
@@ -295,6 +295,6 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/linux/runloop.h jpcima/platform/linux/runloop.h | |
--- vst3sdk_v3.7.2_build_28/platform/linux/runloop.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/linux/runloop.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/linux/runloop.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -48,7 +48,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
using TimerID = uint64_t; | |
@@ -125,6 +125,6 @@ | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/linux/window.cpp jpcima/platform/linux/window.cpp | |
--- vst3sdk_v3.7.2_build_28/platform/linux/window.cpp 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/linux/window.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/linux/window.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -51,14 +51,14 @@ | |
#include <gdk/gdkx.h> | |
#include <gtkmm/socket.h> | |
#else | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/linux/runloop.h" | |
+#include "platform/linux/runloop.h" | |
#include <X11/Xlib.h> | |
#endif | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
#ifdef EDITORHOST_GTK | |
@@ -1018,6 +1018,6 @@ | |
#endif | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/linux/window.h jpcima/platform/linux/window.h | |
--- vst3sdk_v3.7.2_build_28/platform/linux/window.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/platform/linux/window.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/linux/window.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -40,7 +40,7 @@ | |
// Use X11 instead of GTK | |
// #define EDITORHOST_GTK | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iwindow.h" | |
+#include "platform/iwindow.h" | |
#include <functional> | |
struct _XDisplay; | |
@@ -49,7 +49,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class X11Window : public IWindow | |
@@ -87,6 +87,6 @@ | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/mac/platform.mm jpcima/platform/mac/platform.mm | |
--- vst3sdk_v3.7.2_build_28/platform/mac/platform.mm 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/mac/platform.mm 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/mac/platform.mm | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,14 +35,14 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#import "public.sdk/samples/vst-hosting/editorhost/source/platform/iplatform.h" | |
-#import "public.sdk/samples/vst-hosting/editorhost/source/platform/mac/window.h" | |
+#import "platform/iplatform.h" | |
+#import "platform/mac/window.h" | |
#import <iostream> | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class Platform : public IPlatform | |
@@ -126,7 +126,7 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
@@ -202,14 +202,14 @@ | |
- (void)applicationDidFinishLaunching:(NSNotification*)notification | |
{ | |
[self setupMenubar]; | |
- Steinberg::Vst::EditorHost::Platform::instance ().application->init (cmdArgs); | |
+ Steinberg::Vst::StandaloneHost::Platform::instance ().application->init (cmdArgs); | |
cmdArgs.clear (); | |
} | |
//------------------------------------------------------------------------ | |
- (void)applicationWillTerminate:(NSNotification*)notification | |
{ | |
- if (auto& app = Steinberg::Vst::EditorHost::Platform::instance ().application) | |
+ if (auto& app = Steinberg::Vst::StandaloneHost::Platform::instance ().application) | |
app->terminate (); | |
} | |
@@ -220,7 +220,7 @@ | |
{ | |
auto delegate = [VSTSDK_AppDelegate new]; | |
std::vector<std::string> cmdArgs; | |
- for (int i = 1; i < argc; ++i) | |
+ for (int i = 0; i < argc; ++i) | |
cmdArgs.push_back (argv[i]); | |
[delegate setCmdArgs:std::move (cmdArgs)]; | |
[NSApplication sharedApplication].delegate = delegate; | |
diff -urN vst3sdk_v3.7.2_build_28/platform/mac/window.h jpcima/platform/mac/window.h | |
--- vst3sdk_v3.7.2_build_28/platform/mac/window.h 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/mac/window.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/mac/window.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,13 +35,13 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#import "public.sdk/samples/vst-hosting/editorhost/source/platform/iwindow.h" | |
+#import "platform/iwindow.h" | |
#import <Cocoa/Cocoa.h> | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class Window : public IWindow, public std::enable_shared_from_this<Window> | |
@@ -73,6 +73,6 @@ | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/mac/window.mm jpcima/platform/mac/window.mm | |
--- vst3sdk_v3.7.2_build_28/platform/mac/window.mm 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/mac/window.mm 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/mac/window.mm | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,7 +35,7 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#import "public.sdk/samples/vst-hosting/editorhost/source/platform/mac/window.h" | |
+#import "platform/mac/window.h" | |
using namespace Steinberg::Vst; | |
@@ -43,18 +43,18 @@ | |
@interface VSTSDK_WindowDelegate : NSObject <NSWindowDelegate> | |
#if __i386__ | |
{ | |
- std::shared_ptr<EditorHost::Window> _window; | |
+ std::shared_ptr<StandaloneHost::Window> _window; | |
} | |
#endif | |
-@property (readonly) std::shared_ptr<EditorHost::Window> window; | |
+@property (readonly) std::shared_ptr<StandaloneHost::Window> window; | |
-- (id)initWithWindow:(std::shared_ptr<EditorHost::Window>)window; | |
+- (id)initWithWindow:(std::shared_ptr<StandaloneHost::Window>)window; | |
@end | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
WindowPtr Window::make (const std::string& name, Size size, bool resizeable, | |
@@ -130,7 +130,7 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
@@ -141,7 +141,7 @@ | |
#endif | |
//------------------------------------------------------------------------ | |
-- (id)initWithWindow:(std::shared_ptr<EditorHost::Window>)window | |
+- (id)initWithWindow:(std::shared_ptr<StandaloneHost::Window>)window | |
{ | |
if (self = [super init]) | |
{ | |
@@ -156,8 +156,8 @@ | |
NSRect r {}; | |
r.size = frameSize; | |
r = [sender contentRectForFrameRect:r]; | |
- EditorHost::Size size {static_cast<EditorHost::Coord> (r.size.width), | |
- static_cast<EditorHost::Coord> (r.size.height)}; | |
+ StandaloneHost::Size size {static_cast<StandaloneHost::Coord> (r.size.width), | |
+ static_cast<StandaloneHost::Coord> (r.size.height)}; | |
size = self.window->getController ()->constrainSize (*self.window, size); | |
r.size.width = size.width; | |
r.size.height = size.height; | |
@@ -171,8 +171,8 @@ | |
NSWindow* window = [notification object]; | |
NSRect r = window.frame; | |
r = [window contentRectForFrameRect:r]; | |
- EditorHost::Size size {static_cast<EditorHost::Coord> (r.size.width), | |
- static_cast<EditorHost::Coord> (r.size.height)}; | |
+ StandaloneHost::Size size {static_cast<StandaloneHost::Coord> (r.size.width), | |
+ static_cast<StandaloneHost::Coord> (r.size.height)}; | |
self.window->getController ()->onResize (*self.window, size); | |
} | |
diff -urN vst3sdk_v3.7.2_build_28/platform/win32/platform.cpp jpcima/platform/win32/platform.cpp | |
--- vst3sdk_v3.7.2_build_28/platform/win32/platform.cpp 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/win32/platform.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/win32/platform.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -36,8 +36,8 @@ | |
//----------------------------------------------------------------------------- | |
#include "pluginterfaces/base/ftypes.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iplatform.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/win32/window.h" | |
+#include "platform/iplatform.h" | |
+#include "platform/win32/window.h" | |
#include "public.sdk/source/vst/utility/stringconvert.h" | |
#include <windows.h> | |
@@ -48,7 +48,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class Platform : public IPlatform | |
@@ -122,13 +122,10 @@ | |
{ | |
hInstance = _hInstance; | |
std::vector<std::string> cmdArgStrings; | |
- int numArgs = 0; | |
- auto cmdArgsArray = CommandLineToArgvW (lpCmdLine, &numArgs); | |
- for (int i = 0; i < numArgs; ++i) | |
+ for (int i = 0; i < __argc; ++i) | |
{ | |
- cmdArgStrings.push_back (VST3::StringConvert::convert (cmdArgsArray[i])); | |
+ cmdArgStrings.push_back (VST3::StringConvert::convert (__wargv[i])); | |
} | |
- LocalFree (cmdArgsArray); | |
auto noHIDPI = std::find (cmdArgStrings.begin (), cmdArgStrings.end (), "-noHIDPI"); | |
if (noHIDPI == cmdArgStrings.end ()) | |
@@ -145,7 +142,7 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
@@ -166,7 +163,7 @@ | |
return FALSE; | |
#endif | |
- Steinberg::Vst::EditorHost::Platform::instance ().run (lpCmdLine, instance); | |
+ Steinberg::Vst::StandaloneHost::Platform::instance ().run (lpCmdLine, instance); | |
#if !SMTG_OS_WINDOWS_ARM | |
CoUninitialize (); | |
diff -urN vst3sdk_v3.7.2_build_28/platform/win32/window.cpp jpcima/platform/win32/window.cpp | |
--- vst3sdk_v3.7.2_build_28/platform/win32/window.cpp 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/win32/window.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/win32/window.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -46,7 +46,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
namespace { | |
@@ -276,6 +276,6 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/platform/win32/window.h jpcima/platform/win32/window.h | |
--- vst3sdk_v3.7.2_build_28/platform/win32/window.h 2023-10-22 20:43:53.579278739 +0200 | |
+++ jpcima/platform/win32/window.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/platform/win32/window.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -37,7 +37,7 @@ | |
#pragma once | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iwindow.h" | |
+#include "platform/iwindow.h" | |
#include "public.sdk/source/vst/utility/optional.h" | |
#include <windows.h> | |
#include <vector> | |
@@ -45,7 +45,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
//------------------------------------------------------------------------ | |
class Window : public IWindow, public std::enable_shared_from_this<Window> | |
@@ -168,6 +168,6 @@ | |
#endif // (DPI_ENUMS_DECLARED) | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/standalonehost.cpp jpcima/standalonehost.cpp | |
--- vst3sdk_v3.7.2_build_28/standalonehost.cpp 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/standalonehost.cpp 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/editorhost.cpp | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a plug-in editor | |
@@ -35,8 +35,8 @@ | |
// OF THE POSSIBILITY OF SUCH DAMAGE. | |
//----------------------------------------------------------------------------- | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/editorhost.h" | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/appinit.h" | |
+#include "standalonehost.h" | |
+#include "platform/appinit.h" | |
#include "base/source/fcommandline.h" | |
#include "pluginterfaces/base/funknown.h" | |
#include "pluginterfaces/gui/iplugview.h" | |
@@ -44,9 +44,12 @@ | |
#include "pluginterfaces/vst/ivstaudioprocessor.h" | |
#include "pluginterfaces/vst/ivsteditcontroller.h" | |
#include "pluginterfaces/vst/vsttypes.h" | |
+#include <ghc/fs_std.hpp> | |
#include <cstdio> | |
#include <iostream> | |
+#include "VstPluginDefs.h" | |
+ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
@@ -63,7 +66,7 @@ | |
} | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
static AppInit gInit (std::make_unique<App> ()); | |
@@ -188,13 +191,19 @@ | |
IPlatform::instance ().kill (-1, error); | |
} | |
- auto editController = plugProvider->getController (); | |
+ OPtr<IComponent> component = plugProvider->getComponent (); | |
+ if (!component) | |
+ { | |
+ error = "No Component found in file " + path; | |
+ IPlatform::instance ().kill (-1, error); | |
+ } | |
+ | |
+ OPtr<IEditController> editController = plugProvider->getController (); | |
if (!editController) | |
{ | |
error = "No EditController found (needed for allowing editor) in file " + path; | |
IPlatform::instance ().kill (-1, error); | |
} | |
- editController->release (); // plugProvider does an addRef | |
if (flags & kSetComponentHandler) | |
{ | |
@@ -210,6 +219,11 @@ | |
SMTG_DBPRT0 ("Open 2cd Editor...\n"); | |
createViewAndShow (editController); | |
} | |
+ | |
+ FUnknownPtr<IMidiMapping> midiMapping (editController); | |
+ | |
+ //! TODO: Query the plugProvider for a proper name which gets displayed in JACK. | |
+ vst3Processor = AudioClient::create (VSTPLUGIN_NAME, component, midiMapping); | |
} | |
//------------------------------------------------------------------------ | |
@@ -244,10 +258,8 @@ | |
//------------------------------------------------------------------------ | |
void App::init (const std::vector<std::string>& cmdArgs) | |
{ | |
- if (cmdArgs.empty ()) | |
- { | |
- auto helpText = R"( | |
-usage: EditorHost [options] pluginPath | |
+ auto helpText = R"( | |
+usage: StandaloneHost [options] [pluginPath] | |
options: | |
@@ -261,29 +273,66 @@ | |
use effect class with unique class ID==UID | |
)"; | |
- IPlatform::instance ().kill (0, helpText); | |
- } | |
+ fs::path vstBundlePath; | |
VST3::Optional<VST3::UID> uid; | |
uint32 flags {}; | |
- for (auto it = cmdArgs.begin (), end = cmdArgs.end (); it != end; ++it) | |
+ uint32 positionalArgNumber = 0; | |
+ for (size_t argNumber = 1, argCount = cmdArgs.size (); argNumber < argCount; ++argNumber) | |
{ | |
- if (*it == "--componentHandler") | |
+ const std::string& arg = cmdArgs[argNumber]; | |
+ if (arg == "-h" || arg == "--help") | |
+ IPlatform::instance ().kill (0, helpText); | |
+ else if (arg == "--componentHandler") | |
flags |= kSetComponentHandler; | |
- else if (*it == "--secondWindow") | |
+ else if (arg == "--secondWindow") | |
flags |= kSecondWindow; | |
- else if (*it == "--uid") | |
+ else if (arg == "--uid") | |
{ | |
- if (++it != end) | |
- uid = VST3::UID::fromString (*it); | |
+ if (++argNumber != argCount) | |
+ uid = VST3::UID::fromString (arg); | |
if (!uid) | |
IPlatform::instance ().kill (-1, "wrong argument to --uid"); | |
} | |
+ else | |
+ { | |
+ if (positionalArgNumber == 0) | |
+ vstBundlePath = fs::u8path (arg); | |
+ else | |
+ IPlatform::instance ().kill (-1, helpText); | |
+ ++positionalArgNumber; | |
+ } | |
} | |
PluginContextFactory::instance ().setPluginContext (&pluginContext); | |
- openEditor (cmdArgs.back (), std::move (uid), flags); | |
+ if (vstBundlePath.empty () && !cmdArgs.empty ()) | |
+ { | |
+ fs::path modulePath = fs::u8path (cmdArgs.front ()).parent_path(); | |
+ fs::path currentFilePath = modulePath / fs::u8path (VSTPLUGIN_NAME ".vst3"); | |
+ if (fs::exists (currentFilePath)) | |
+ vstBundlePath = currentFilePath; | |
+ } | |
+ | |
+ if (vstBundlePath.empty ()) | |
+ { | |
+ for (const std::string& modulePath : VST3::Hosting::Module::getModulePaths ()) | |
+ { | |
+ fs::path currentFilePath = fs::u8path (modulePath) / fs::u8path (VSTPLUGIN_NAME ".vst3"); | |
+ if (fs::exists (currentFilePath)) | |
+ { | |
+ vstBundlePath = currentFilePath; | |
+ break; | |
+ } | |
+ } | |
+ } | |
+ | |
+ if (vstBundlePath.empty ()) | |
+ { | |
+ IPlatform::instance ().kill (-1, "module not found"); | |
+ } | |
+ | |
+ openEditor (vstBundlePath.u8string (), std::move (uid), flags); | |
} | |
//------------------------------------------------------------------------ | |
@@ -431,6 +480,6 @@ | |
} | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg | |
diff -urN vst3sdk_v3.7.2_build_28/standalonehost.h jpcima/standalonehost.h | |
--- vst3sdk_v3.7.2_build_28/standalonehost.h 2023-10-22 20:43:53.572611776 +0200 | |
+++ jpcima/standalonehost.h 2023-10-22 20:42:03.150630966 +0200 | |
@@ -2,7 +2,7 @@ | |
// Flags : clang-format auto | |
// Project : VST SDK | |
// | |
-// Category : EditorHost | |
+// Category : StandaloneHost | |
// Filename : public.sdk/samples/vst-hosting/editorhost/source/editorhost.h | |
// Created by : Steinberg 09.2016 | |
// Description : Example of opening a Plug-in editor | |
@@ -37,7 +37,8 @@ | |
#pragma once | |
-#include "public.sdk/samples/vst-hosting/editorhost/source/platform/iapplication.h" | |
+#include "platform/iapplication.h" | |
+#include "media/audioclient.h" | |
#include "public.sdk/source/vst/hosting/hostclasses.h" | |
#include "public.sdk/source/vst/hosting/module.h" | |
#include "public.sdk/source/vst/hosting/plugprovider.h" | |
@@ -46,7 +47,7 @@ | |
//------------------------------------------------------------------------ | |
namespace Steinberg { | |
namespace Vst { | |
-namespace EditorHost { | |
+namespace StandaloneHost { | |
class WindowController; | |
@@ -69,11 +70,12 @@ | |
VST3::Hosting::Module::Ptr module {nullptr}; | |
IPtr<PlugProvider> plugProvider {nullptr}; | |
+ AudioClientPtr vst3Processor; | |
Vst::HostApplication pluginContext; | |
std::shared_ptr<WindowController> windowController; | |
}; | |
//------------------------------------------------------------------------ | |
-} // EditorHost | |
+} // StandaloneHost | |
} // Vst | |
} // Steinberg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment