View Single Post
Old 11-30-2020, 05:56 AM   #1
seeb0h
Human being with feelings
 
Join Date: Nov 2020
Posts: 3
Default How-to compile NINJAM on windows with VST2.4 SDK

Tested and it worked.

git clone git@github.com:justinfrankel/ninjam.git ninjam
install visual studio community 2019 profil c/c++

Set up ogg and vorbis
Set up the project
  • Convert ninjam\jmde\fx\reaninjam\reaninjam.vcxproj to jmde\fx\reaninjam\reaninjam.sln
  • OutputDir=$(Platform)\$(Configuration)\
  • AdditionalIncludeDirectories=$(SolutionDir)..\..\. .\sdks\libvorbis\include;$(SolutionDir)..\..\..\sd ks\libogg\include;%(AdditionalIncludeDirectories)

Deal with VST2.4
  • Get VST vstsdk366_27_06_2016_build_61
  • Move vstsdk366_27_06_2016_build_61\VST3 SDK\pluginterfaces\vst2.x\aeffect.h and aeffectx.h to ninjam\jmde\

Code:
diff --git a/jmde/fx/reaninjam/vstframe.cpp b/jmde/fx/reaninjam/vstframe.cpp
index 31dfa83..2a94801 100644
--- a/jmde/fx/reaninjam/vstframe.cpp
+++ b/jmde/fx/reaninjam/vstframe.cpp
@@ -249,7 +249,8 @@ public:
     m_hwndcfg=0;
     m_effect.magic = kEffectMagic;
     m_effect.dispatcher = staticDispatcher;
-    m_effect.process = staticProcess;
+    //2.3 m_effect.process = staticProcess;
+    m_effect.processReplacing = staticProcess;
     m_effect.getParameter = staticGetParameter;
     m_effect.setParameter = staticSetParameter;
     m_effect.numPrograms = 1;
@@ -263,7 +264,7 @@ public:
     m_effect.version=1100;

     m_effect.object=this;
-    m_effect.ioRatio=1.0;
+    //2.3 m_effect.ioRatio=1.0;
     m_lasttransportpos=-100000000.0;
     m_lastplaytrackpos=-100000000.0;
   }
@@ -442,8 +443,9 @@ public:

         }
       return 0;
-      case effIdentify:
-        return CCONST ('N', 'v', 'E', 'f');    }
+//2.3      case effIdentify:
+//        return CCONST ('N', 'v', 'E', 'f');
+}
     return 0;
   }
   short cfgRect[4];
Code:
$ git diff jmde/fx/reaninjam/res.rc
diff --git a/jmde/fx/reaninjam/res.rc b/jmde/fx/reaninjam/res.rc
index dce6c2b..6399941 100644
--- a/jmde/fx/reaninjam/res.rc
+++ b/jmde/fx/reaninjam/res.rc
@@ -7,7 +7,12 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include <windows.h>
+
+#ifndef IDC_STATIC
+#define IDC_STATIC              -1
+#endif
+

 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -342,7 +347,7 @@ END

 IDR_MENU1 MENU DISCARDABLE
 BEGIN
-    POPUP "&File"
+    POPUP "&Spiral"
     BEGIN
         MENUITEM "&Connect...\tCtrl+O",                 ID_FILE_CONNECT
         MENUITEM "&Disconnect\tCtrl+D",                 ID_FILE_DISCONNECT, GRAYED
Code:
diff --git a/jmde/fx/reaninjam/vstframe.cpp b/jmde/fx/reaninjam/vstframe.cpp
index 31dfa83..2a94801 100644
--- a/jmde/fx/reaninjam/vstframe.cpp
+++ b/jmde/fx/reaninjam/vstframe.cpp
@@ -249,7 +249,8 @@ public:
     m_hwndcfg=0;
     m_effect.magic = kEffectMagic;
     m_effect.dispatcher = staticDispatcher;
-    m_effect.process = staticProcess;
+    //2.3 m_effect.process = staticProcess;
+    m_effect.processReplacing = staticProcess;
     m_effect.getParameter = staticGetParameter;
     m_effect.setParameter = staticSetParameter;
     m_effect.numPrograms = 1;
@@ -263,7 +264,7 @@ public:
     m_effect.version=1100;

     m_effect.object=this;
-    m_effect.ioRatio=1.0;
+    //2.3 m_effect.ioRatio=1.0;
     m_lasttransportpos=-100000000.0;
     m_lastplaytrackpos=-100000000.0;
   }
@@ -442,8 +443,9 @@ public:

         }
       return 0;
-      case effIdentify:
-        return CCONST ('N', 'v', 'E', 'f');    }
+//2.3      case effIdentify:
+//        return CCONST ('N', 'v', 'E', 'f');
+}
     return 0;
   }
   short cfgRect[4];
Code:
$ git diff WDL/vorbisencdec.h
diff --git a/WDL/vorbisencdec.h b/WDL/vorbisencdec.h
index 000c3a8..0e31c6d 100644
--- a/WDL/vorbisencdec.h
+++ b/WDL/vorbisencdec.h
@@ -94,6 +94,7 @@ class VorbisDecoder : public VorbisDecoderInterface

       ogg_sync_init(&oy); /* Now we can read pages */
       m_err=0;
+      m_samples=0;
     }
     ~VorbisDecoder()
     {
@@ -106,6 +107,8 @@ class VorbisDecoder : public VorbisDecoderInterface
          ogg_sync_clear(&oy);
     }

+    int m_samples_used;
+
     int GetSampleRate() { return vi.rate; }
     int GetNumChannels() { return vi.channels?vi.channels:1; }

@@ -219,6 +222,7 @@ class VorbisDecoder : public VorbisDecoderInterface

     int m_err;
     int packets;
+    int m_samples;

     ogg_sync_state   oy; /* sync and verify incoming physical bitstream */
     ogg_stream_state os; /* take physical pages, weld into a logical
seeb0h is offline   Reply With Quote