OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
juce_MessageListener.cpp
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23 namespace juce
24{
25
26 Message::Message() noexcept {}
27Message::~Message() {}
28
29 void Message::messageCallback()
30{
31 if (auto* r = recipient.get())
32 r->handleMessage (*this);
33}
34
35MessageListener::MessageListener() noexcept
36{
37 // Are you trying to create a messagelistener before or after juce has been initialised??
38 JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
39}
40
41 MessageListener::~MessageListener()
42{
43 masterReference.clear();
44}
45
46 void MessageListener::postMessage (Message* const message) const
47{
48 message->recipient = const_cast<MessageListener*> (this);
49 message->post();
50}
51
52} // namespace juce
juce::MessageListener
Definition juce_MessageListener.h:35
juce::MessageListener::~MessageListener
virtual ~MessageListener()
Definition juce_MessageListener.cpp:41
juce::MessageListener::postMessage
void postMessage(Message *message) const
Definition juce_MessageListener.cpp:46
juce::Message
Definition juce_Message.h:44
juce::Message::Message
Message() noexcept
Definition juce_MessageListener.cpp:26