diff --git a/examples/HostSpecificExtensionsPlugin/HostSpecificExtensionsPlugin.cpp b/examples/HostSpecificExtensionsPlugin/HostSpecificExtensionsPlugin.cpp index 8a20892..0397b1a 100644 --- a/examples/HostSpecificExtensionsPlugin/HostSpecificExtensionsPlugin.cpp +++ b/examples/HostSpecificExtensionsPlugin/HostSpecificExtensionsPlugin.cpp @@ -15,15 +15,15 @@ HostSpecificExtensionsPlugin::HostSpecificExtensionsPlugin() { // we want to check that we can load/use the extensions in the plugin constructor. // for REAPER our silly test is to try muting track 0. - using GetTrackFunc = MediaTrack *(*)(ReaProject *, int); - auto getTrackFunc = - reinterpret_cast(reaperPluginExtension->GetFunc("GetTrack")); - auto *track0 = getTrackFunc(nullptr, 0); + using GetMasterTrackFunc = MediaTrack *(*)(ReaProject *); + auto getMasterTrackFunc = + reinterpret_cast(reaperPluginExtension->GetFunc("GetMasterTrack")); + auto *masterTrack = getMasterTrackFunc(nullptr); using SetMuteFunc = int (*)(MediaTrack *track, int mute, int igngroupflags); auto setMuteFunc = reinterpret_cast(reaperPluginExtension->GetFunc("SetTrackUIMute")); - auto result = (*setMuteFunc)(track0, 1, 0); + auto result = (*setMuteFunc)(masterTrack, 1, 0); jassert(result == 1); } } diff --git a/examples/HostSpecificExtensionsPlugin/PluginEditor.cpp b/examples/HostSpecificExtensionsPlugin/PluginEditor.cpp index acf40ae..d6c97c2 100644 --- a/examples/HostSpecificExtensionsPlugin/PluginEditor.cpp +++ b/examples/HostSpecificExtensionsPlugin/PluginEditor.cpp @@ -9,6 +9,8 @@ PluginEditor::PluginEditor(HostSpecificExtensionsPlugin &plug) using GetTrackFunc = MediaTrack *(*)(ReaProject *, int); auto getTrackFunc = reinterpret_cast(reaperExt->GetFunc("GetTrack")); auto *track0 = getTrackFunc(nullptr, 0); + if (track0 == nullptr) + return; using ColorToNativeFunc = int (*)(int r, int g, int b); auto colorToNativeFunc =