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.

87 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. namespace juce
  18. {
  19. //==============================================================================
  20. /**
  21. An interface for handling analytics events collected by an Analytics object.
  22. For basic analytics logging you can implement this interface and add your
  23. class to an Analytics object.
  24. For more advanced logging you may want to subclass
  25. ThreadedAnalyticsDestination instead, which is more suitable for interacting
  26. with web servers and other time consuming destinations.
  27. @see Analytics, ThreadedAnalyticsDestination
  28. */
  29. struct JUCE_API AnalyticsDestination
  30. {
  31. /** Contains information about an event to be logged. */
  32. struct AnalyticsEvent
  33. {
  34. /** The name of the event. */
  35. String name;
  36. /**
  37. The timestamp of the event.
  38. Timestamps are automatically applied by an Analytics object and are
  39. derived from Time::getMillisecondCounter(). As such these timestamps
  40. do not represent absolute times, but relative timings of events for
  41. each user in each session will be accurate.
  42. */
  43. uint32 timestamp;
  44. /** The parameters of the event. */
  45. StringPairArray parameters;
  46. /** The user ID associated with the event. */
  47. String userID;
  48. /** Properties associated with the user. */
  49. StringPairArray userProperties;
  50. };
  51. /** Constructor. */
  52. AnalyticsDestination() = default;
  53. /** Destructor. */
  54. virtual ~AnalyticsDestination() {}
  55. /**
  56. When an AnalyticsDestination is added to an Analytics object this method
  57. is called when an analytics event is triggered from the Analytics
  58. object.
  59. Override this method to log the event information somewhere useful.
  60. */
  61. virtual void logEvent (const AnalyticsEvent& event) = 0;
  62. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnalyticsDestination)
  63. };
  64. } // namespace juce