forked from UrbanLienert/blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockFinder.hpp
More file actions
61 lines (46 loc) · 1.53 KB
/
Copy pathBlockFinder.hpp
File metadata and controls
61 lines (46 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// BlockFinder.hpp
// Blocks
//
// Created by Urban Lienert on 02.02.20.
// Copyright © 2020 Urban Lienert. All rights reserved.
//
#pragma once
#ifndef JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED
#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1
#endif
#ifndef JUCE_DONT_DECLARE_PROJECTINFO
#define JUCE_DONT_DECLARE_PROJECTINFO 1
#endif
#include <BlocksHeader.h>
#include "BlockComponent.hpp"
#include "m_pd.h"
// Monitors a PhysicalTopologySource for changes to the connected BLOCKS and
// prints some information about the BLOCKS that are available.
class BlockFinder : private juce::TopologySource::Listener
{
public:
// Register as a listener to the PhysicalTopologySource, so that we receive
// callbacks in topologyChanged().
BlockFinder();
~BlockFinder();
t_outlet *out_A;
t_outlet *out_B;
t_outlet *out_C;
t_outlet *out_D;
bool loadPrgram;
void setPdNameForSerial(const char *serial, const char *name);
void doBlockCommand(t_symbol *name, int argc, t_atom *argv);
void pollInfos();
private:
// Called by the PhysicalTopologySource when the BLOCKS topology changes.
void topologyChanged() override;
// The PhysicalTopologySource member variable which reports BLOCKS changes.
juce::PhysicalTopologySource pts;
juce::StringPairArray* serialsAndNames = nullptr;
// new for multiple Blocks
juce::OwnedArray<BlockComponent> blockComponents;
void updateComponents();
void outputTopology();
JUCE_LEAK_DETECTOR (BlockFinder)
};