Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
MemaClientDiscoverComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2024-2025, Christian Ahrens
2 *
3 * This file is part of Mema <https://github.com/ChristianAhrens/Mema>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#pragma once
20
21#include <JuceHeader.h>
22
23#include <ServiceTopologyManager.h>
24
25namespace JUCEAppBasics
26{
27 class ServiceTopologyTreeView;
28}
29
31class MemaClientDiscoverComponent : public juce::Component
32{
33public:
36
37 //==============================================================================
38 void paint(Graphics&) override;
39 void resized() override;
40 void lookAndFeelChanged() override;
41
42 void setupServiceDiscovery(const juce::String& serviceTypeUIDBase, const juce::String& serviceTypeUID);
43 void resetServices();
44
45 std::vector<JUCEAppBasics::SessionMasterAwareService> getAvailableServices();
46
47 void setMasterServiceDescription(const juce::String& masterServiceDescription);
48
49 //==============================================================================
50 std::function<void(const JUCEAppBasics::SessionMasterAwareService&)> onServiceSelected;
51
52private:
53 //==============================================================================
54 void setDiscoveredServiceTopology(const JUCEAppBasics::SessionServiceTopology& topology);
55
56 //==============================================================================
57 std::unique_ptr<juce::Label> m_discoveredTopologyLabel;
58 std::unique_ptr<JUCEAppBasics::ServiceTopologyTreeView> m_discoveredTopologyTreeView;
59 std::unique_ptr<juce::TextButton> m_selectServiceButton;
60
61 std::unique_ptr<JUCEAppBasics::ServiceTopologyManager> m_serviceTopologyManager;
62
63 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemaClientDiscoverComponent)
64};
65
std::function< void(const JUCEAppBasics::SessionMasterAwareService &)> onServiceSelected
void setMasterServiceDescription(const juce::String &masterServiceDescription)
void setupServiceDiscovery(const juce::String &serviceTypeUIDBase, const juce::String &serviceTypeUID)
std::vector< JUCEAppBasics::SessionMasterAwareService > getAvailableServices()