The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
4.5KB

  1. /**
  2. @page the_standalone_blocks_sdk The standalone BLOCKS SDK
  3. The easiest way to get started developing BLOCKS applications is to use <a href="https://github.com/julianstorer/JUCE">the JUCE framework</a>, but if you would prefer not to use JUCE directly the standalone BLOCKS SDK can be obtained from the <a href="https://github.com/WeAreROLI/BLOCKS-SDK">BLOCKS-SDK repository</a>.
  4. The most straightforward way to use the SDK is to compile the SDK source code into a static library.
  5. Then, in your BLOCKS application code, you can use the header files in the SDK to give you access to the BLOCKS classes and functions.
  6. Finally, when you want to compile your application, you must link against the static library to get all the BLOCKS functionality.
  7. @section standalone_building_library Building the SDK library
  8. The source code for the BLOCKS SDK library is contained within the <tt>BLOCKS-SDK-static</tt> and <tt>BLOCKS-SDK-dynamic</tt> directories of the BLOCKS-SDK repository.
  9. Here you will find header files that you can include in your own projects and the <tt>Builds</tt> subdirectory contains an XCode project, a Visual Studio project and a Linux Makefile for compiling the SDK source code into either static or dynamic library.
  10. Open the appropriate project for your platform, select either the "Debug" or "Release" configuration, and build the project.
  11. For the remainder of this page of documentation we will assume that you will be building the static library.
  12. For MacOS this will produce <tt>libBLOCKS-SDK-static.a</tt> in either a <tt>build/Debug/</tt> or <tt>build/Release/</tt> directory, for Linux this will produce <tt>libBLOCKS-SDK-static.a</tt> in <tt>build/</tt>, and for Windows this will produce <tt>BLOCKS-SDK-static.lib</tt> in <tt>x64/Debug/</tt> or <tt>x64/Release/</tt>.
  13. @section standalone_using_header Using the SDK header file
  14. To use BLOCKS classes and functions in your application you must include the <tt>BlocksHeader.h</tt> file in your source code.
  15. You must also tell the compiler to look in the <tt>BLOCKS-SDK-static/JuceLibraryCode/</tt> and <tt>BLOCKS-SDK-static/JuceLibraryCode/modules</tt> directories for additional header files, which you can configure inside your XCode or Visual Studio project.
  16. If you are using the command line to compile your application then you can see an example of how to do this in <tt>examples/BLOCKS-SDK/BlockFinder/LinuxMakefile/Makefile</tt> (which is also appropriate for MacOS, despite being located inside the Linux directory).
  17. @section standalone_linking Linking against the SDK library
  18. You must also tell your compiler where to find the SDK static library before your BLOCKS application will compile, and include all of the dependencies for your platform, which are listed in the @ref standalone_dependencies section.
  19. Again, this is configured in your XCode or Visual Studio project, but if you are using the command line you can see an example of how to do this in <tt>examples/BLOCKS-SDK/BlockFinder/Linux/Makefile</tt> (which, again, is also appropriate for MacOS).
  20. @section standalone_example An example application
  21. The source code for this example can be found in the <a href="https://github.com/WeAreROLI/BLOCKS-SDK">BLOCKS-SDK repository</a> at <tt>examples/BlockFinder/</tt>, with the parts that are specific to different operating systems in the corresonding subdirectories.
  22. The main functionality of the application is contained within the following class:
  23. <tt>BlockFinder/BlockFinder.h</tt>:
  24. @include BlockFinder/BlockFinder.h
  25. <tt>BlockFinder/BlockFinder.cpp</tt>:
  26. @include BlockFinder/BlockFinder.cpp
  27. All this class does is create a PhysicalTopologySource and register for TopologySource::Listener::topologyChanged() callbacks---for more information about how this works you should see the @ref discovering_blocks section.
  28. When the topology changes we print some information about the available BLOCKS.
  29. The <tt>main</tt> function of the MacOS application is the easiest to understand.
  30. <tt>BlockFinder/MacOS/main.mm</tt>:
  31. @include BlockFinder/MacOS/main.mm
  32. Here we simply perform some JUCE initialisation, instantiate a BlockFinder class, then run the event loop.
  33. Whilst in the event loop, the <tt>finder</tt> object receives TopologySource::Listener::topologyChanged() callbacks and we see output printed to stdout when BLOCKS are connected or disconnected.
  34. @section standalone_dependencies Standalone SDK dependencies
  35. - A C++11 compatible compiler
  36. @subsection standalone_libraries_macos MacOS frameworks
  37. - Accelerate
  38. - AudioToolbox
  39. - CoreAudio
  40. - CoreMIDI
  41. @subsection standalone_libraries_linux Linux packages
  42. - x11
  43. - alsa
  44. - libcurl
  45. */