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.

70 lines
4.4KB

  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>SDK</tt> directory of the BLOCKS-SDK repository.
  9. Here you will find header files that you can include in your own projects and the <tt>Build</tt> subdirectory contains an XCode project, a Visual Studio project and a Linux Makefile for compiling the SDK source code into a static library.
  10. Use the appropriate choice for your platform, select either the "Debug" or "Release" configuration, and build the project.
  11. For MacOS this will produce <tt>libBLOCKS-SDK.a</tt> in either the <tt>SDK/Build/MacOS/Debug/</tt> or <tt>SDK/Build/MacOS/Release/</tt> directory, for Linux this will produce <tt>libBLOCKS-SDK.a</tt> in either the <tt>SDK/Build/Linux/Debug/</tt> or <tt>SDK/Build/Linux/Release/</tt> directory, and for Windows this will produce <tt>BLOCKS-SDK.lib</tt> in either the <tt>SDK\\Build\\Windows\\x64\\Debug</tt> or <tt>SDK\\Build\\Windows\\x64\\Release</tt> folder.
  12. @section standalone_using_header Using the SDK header file
  13. To use BLOCKS classes and functions in your application you must include the <tt>BlocksHeader.h</tt> file in your source code.
  14. You also need to tell the compiler to look in the <tt>SDK</tt> directory for additional header files, which you can configure inside your XCode or Visual Studio project.
  15. 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/Linux/Makefile</tt> (which is also configured for MacOS, despite being located inside the Linux directory).
  16. @section standalone_linking Linking against the SDK library
  17. 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.
  18. 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 configured for MacOS).
  19. @section standalone_example An example application
  20. 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.
  21. The main functionality of the application is contained within the following class:
  22. <tt>BlockFinder/BlockFinder.h</tt>:
  23. @include BlockFinder/BlockFinder.h
  24. <tt>BlockFinder/BlockFinder.cpp</tt>:
  25. @include BlockFinder/BlockFinder.cpp
  26. 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.
  27. When the topology changes we print some information about the available BLOCKS.
  28. The <tt>main</tt> function of the MacOS application is the easiest to understand.
  29. <tt>BlockFinder/MacOS/main.mm</tt>:
  30. @include BlockFinder/MacOS/main.mm
  31. Here we simply perform some JUCE initialisation, instantiate a BlockFinder class, then run the event loop.
  32. 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.
  33. @section standalone_dependencies Standalone SDK dependencies
  34. - A C++11 compatible compiler
  35. @subsection standalone_libraries_macos MacOS frameworks
  36. - Accelerate
  37. - AudioToolbox
  38. - CoreAudio
  39. - CoreMIDI
  40. @subsection standalone_libraries_linux Linux packages
  41. - x11
  42. - alsa
  43. - libcurl
  44. */