NanoOcp
Minimal AES70 / OCP.1 TCP client/server library for d&b Soundscape devices
Loading...
Searching...
No Matches
MainComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2022-2023, Christian Ahrens
2 *
3 * This file is part of NanoOcp <https://github.com/ChristianAhrens/NanoOcp>
4 *
5 * This library 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 library 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 library; 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
24namespace NanoOcp1
25{
26 class NanoOcp1;
27 class NanoOcp1Client;
28 struct Ocp1CommandDefinition;
29 using ByteVector = std::vector<std::uint8_t>;
30}
31
32namespace NanoOcp1Demo
33{
34
35//==============================================================================
36/*
37 This component lives inside our window, and this is where you should put all
38 your controls and content.
39*/
40class MainComponent : public Component, public juce::TextEditor::Listener
41{
42public:
43 //==============================================================================
46
47 //==============================================================================
48 void resized() override;
49
50 //==============================================================================
51 void textEditorReturnKeyPressed(TextEditor& editor) override;
52
53 //==============================================================================
55
56private:
57 //==============================================================================
58 std::unique_ptr<NanoOcp1::NanoOcp1Client> m_nanoOcp1Client;
59
60 std::unique_ptr<NanoOcp1::Ocp1CommandDefinition> m_pwrOnObjDef;
61 std::unique_ptr<NanoOcp1::Ocp1CommandDefinition> m_potiLevelObjDef;
62 std::unique_ptr<NanoOcp1::Ocp1CommandDefinition> m_soundobjectEnableObjDef;
63 std::unique_ptr<NanoOcp1::Ocp1CommandDefinition> m_speakerGroupObjDef;
64 std::unique_ptr<NanoOcp1::Ocp1CommandDefinition> m_guidObjDef;
65 std::map<std::uint32_t, NanoOcp1::Ocp1CommandDefinition*> m_ocaHandleMap;
66
67 //==============================================================================
68 std::unique_ptr<TextEditor> m_ipAndPortEditor;
69 std::unique_ptr<TextButton> m_connectedLED;
70 std::unique_ptr<TextButton> m_subscribeButton;
71 std::unique_ptr<TextButton> m_powerD40LED;
72 std::unique_ptr<TextButton> m_powerOnD40Button;
73 std::unique_ptr<TextButton> m_powerOffD40Button;
74 std::unique_ptr<Slider> m_gainSlider;
75
76 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainComponent)
77};
78
79}
void textEditorReturnKeyPressed(TextEditor &editor) override
bool OnOcp1MessageReceived(const NanoOcp1::ByteVector &message)
Minimal AES70 / OCP.1 TCP client/server library built on JUCE.
Definition NanoOcp1.cpp:23
std::vector< std::uint8_t > ByteVector
Binary buffer type used throughout NanoOcp for all serialized OCP.1 data.