OpenShot Library | libopenshot-audio  0.1.9
juce_ChangeListener.h
1 
2 /** @weakgroup juce_events-broadcasters
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 namespace juce
28 {
29 
30 class ChangeBroadcaster;
31 
32 //==============================================================================
33 /**
34  Receives change event callbacks that are sent out by a ChangeBroadcaster.
35 
36  A ChangeBroadcaster keeps a set of listeners to which it broadcasts a message when
37  the ChangeBroadcaster::sendChangeMessage() method is called. A subclass of
38  ChangeListener is used to receive these callbacks.
39 
40  Note that the major difference between an ActionListener and a ChangeListener
41  is that for a ChangeListener, multiple changes will be coalesced into fewer
42  callbacks, but ActionListeners perform one callback for every event posted.
43 
44  @see ChangeBroadcaster, ActionListener
45 
46  @tags{Events}
47 */
49 {
50 public:
51  /** Destructor. */
52  virtual ~ChangeListener() = default;
53 
54  /** Your subclass should implement this method to receive the callback.
55  @param source the ChangeBroadcaster that triggered the callback.
56  */
57  virtual void changeListenerCallback (ChangeBroadcaster* source) = 0;
58 
59 
60  //==============================================================================
61  #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
62  // This method's signature has changed to take a ChangeBroadcaster parameter - please update your code!
63  private: virtual int changeListenerCallback (void*) { return 0; }
64  #endif
65 };
66 
67 } // namespace juce
68 
69 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
Holds a list of ChangeListeners, and sends messages to them when instructed.
Receives change event callbacks that are sent out by a ChangeBroadcaster.