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.

30 lines
1.1KB

  1. #include "BlockFinder.h"
  2. using namespace juce;
  3. BlockFinder::BlockFinder()
  4. {
  5. // Register to receive topologyChanged() callbacks from pts.
  6. pts.addListener (this);
  7. }
  8. void BlockFinder::topologyChanged()
  9. {
  10. // We have a new topology, so find out what it isand store it in a local
  11. // variable.
  12. BlockTopology currentTopology = pts.getCurrentTopology();
  13. Logger::writeToLog ("\nNew BLOCKS topology.");
  14. // The blocks member of a BlockTopology contains an array of blocks. Here we
  15. // loop over them and print some information.
  16. Logger::writeToLog (String ("Detected ") + String (currentTopology.blocks.size()) + " blocks:");
  17. for (auto& block : currentTopology.blocks)
  18. {
  19. Logger::writeToLog ("");
  20. Logger::writeToLog (String(" Description: ") + block->getDeviceDescription());
  21. Logger::writeToLog (String(" Battery level: ") + String (block->getBatteryLevel()));
  22. Logger::writeToLog (String(" UID: ") + String (block->uid));
  23. Logger::writeToLog (String(" Serial number: ") + block->serialNumber);
  24. }
  25. }