Skip to content

Commit 3a8ba4f

Browse files
committed
Merge branch 'develop'
2 parents 3fddf0a + 44d9f14 commit 3a8ba4f

13 files changed

+624
-74
lines changed

AES70_OCP1_StringGenerator.jucer

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<JUCERPROJECT id="bMvzN6" name="AES70_OCP1_StringGenerator" projectType="guiapp"
4-
jucerFormatVersion="1" version="0.0.2" companyName="escalonely"
4+
jucerFormatVersion="1" version="0.0.3" companyName="escalonely"
55
companyCopyright="Copyright (C) 2023 Bernardo Escalona" companyWebsite="https://github.com/escalonely"
66
headerPath="../../submodules/NanoOcp/Source/&#10;">
77
<MAINGROUP id="rBvj44" name="AES70_OCP1_StringGenerator">
@@ -60,6 +60,19 @@
6060
<MODULEPATH id="juce_gui_basics" path="submodules\JUCE\modules"/>
6161
</MODULEPATHS>
6262
</VS2019>
63+
<VS2022 targetFolder="Builds/VisualStudio2022">
64+
<CONFIGURATIONS>
65+
<CONFIGURATION isDebug="1" name="Debug"/>
66+
<CONFIGURATION isDebug="0" name="Release"/>
67+
</CONFIGURATIONS>
68+
<MODULEPATHS>
69+
<MODULEPATH id="juce_core" path="submodules\JUCE\modules"/>
70+
<MODULEPATH id="juce_data_structures" path="submodules\JUCE\modules"/>
71+
<MODULEPATH id="juce_events" path="submodules\JUCE\modules"/>
72+
<MODULEPATH id="juce_graphics" path="submodules\JUCE\modules"/>
73+
<MODULEPATH id="juce_gui_basics" path="submodules\JUCE\modules"/>
74+
</MODULEPATHS>
75+
</VS2022>
6376
</EXPORTFORMATS>
6477
<MODULES>
6578
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
![TitleBar.png](Resources/Documentation/TitleBar.png "0x3b")
2+
13
# AES70 OCP.1 Binary String Generator
24

35
The AES70 OCP.1 binary string generator is a privately created and driven project.
46

57
## Description
68

7-
- This is a small tool that can generate AES70/OCA binary strings for TCP-network-based control (OCP.1).
8-
- The strings are generated quickly and on the fly after adjusting only a handful of parameters.
9-
- The resulting strings can be used by integrators, e.g. by copy-pasting them into a script, for controlling and monitoring AES70-capable devices.
9+
- This is a small tool that can generate AES70/OCA protocol data units (PDUs) for TCP-network-based control (OCP.1).
10+
- The PDUs are generated quickly and on the fly after adjusting only a handful of parameters.
11+
- The resulting PDUs can be used by integrators, e.g. by copy-pasting them into a script, for controlling and monitoring AES70-capable devices.
1012

1113
For more info in AES70 and/or OCA, visit https://ocaalliance.com/what-is-aes70/
1214

Resources/Documentation/TitleBar.png

12.3 KB
Loading

Source/AES70.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,22 @@ OcaRoot* OcaRoot::CreateCustom()
152152
return new OcaCustomClass();
153153
}
154154

155+
int OcaRoot::GetClassIdxFromName(const juce::String& className)
156+
{
157+
auto iter = std::find_if(MapOfClassNamesAndIds.begin(),
158+
MapOfClassNamesAndIds.end(),
159+
[&className](const auto& p)
160+
{
161+
return p.second == className;
162+
});
163+
164+
// Given className does not exist in MapOfClassNamesAndIds
165+
if (iter == MapOfClassNamesAndIds.end())
166+
return 0;
167+
168+
return iter->first;
169+
}
170+
155171

156172
//==============================================================================
157173
// Class OcaWorker

Source/AES70.h

+34-25
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ enum ClassIdx
4141
OCA_ROOT = 1,
4242
OCA_WORKER,
4343
OCA_ACTUATOR,
44-
OCA_SWITCH,
44+
OCA_BASIC_ACTUATOR,
45+
OCA_INT32_ACTUATOR,
46+
OCA_STRING_ACTUATOR,
4547
OCA_MUTE,
48+
OCA_SWITCH,
4649
OCA_GAIN,
4750
OCA_DELAY,
48-
OCA_BASIC_ACTUATOR,
49-
OCA_STRING_ACTUATOR,
50-
OCA_INT32_ACTUATOR,
5151
OCA_SENSOR,
5252
OCA_BASIC_SENSOR,
5353
OCA_BOOLEAN_SENSOR,
@@ -61,28 +61,28 @@ enum ClassIdx
6161
};
6262

6363
/**
64-
* Decorated names for all supported AES70 classes.
64+
* Class IDs and names for all supported AES70 classes.
6565
*/
66-
static const std::map<int, juce::String> MapOfClassNames = {
67-
{ OCA_ROOT, "OcaRoot" },
68-
{ OCA_WORKER, " +-OcaWorker" },
69-
{ OCA_ACTUATOR, " | +-OcaActuator" },
70-
{ OCA_SWITCH, " | | +-OcaSwitch" },
71-
{ OCA_MUTE, " | | +-OcaMute" },
72-
{ OCA_GAIN, " | | +-OcaGain" },
73-
{ OCA_DELAY, " | | +-OcaDelay" },
74-
{ OCA_BASIC_ACTUATOR, " | | +-OcaBasicActuator" },
75-
{ OCA_STRING_ACTUATOR, " | | +-OcaStringActuator" },
76-
{ OCA_INT32_ACTUATOR, " | | +-OcaInt32Actuator" },
77-
{ OCA_SENSOR, " | +-OcaSensor" },
78-
{ OCA_BASIC_SENSOR, " | +-OcaBasicSensor" },
79-
{ OCA_BOOLEAN_SENSOR, " | | +-OcaBooleanSensor" },
80-
{ OCA_INT32_SENSOR, " | | +-OcaInt32Sensor" },
81-
{ OCA_FLOAT32_SENSOR, " | | +-OcaFloat32Sensor" },
82-
{ OCA_STRING_SENSOR, " | | +-OcaStringSensor" },
83-
{ OCA_LEVEL_SENSOR, " | +-OcaLevelSensor" },
84-
{ OCA_AUDIO_LEVEL_SENSOR, " | +-OcaAudioLevelSensor" },
85-
{ OCA_AGENT, " +-OcaAgent" }
66+
static const std::map<int, juce::String> MapOfClassNamesAndIds = {
67+
{ OCA_ROOT, "1: OcaRoot" },
68+
{ OCA_WORKER, "1.1: OcaWorker" },
69+
{ OCA_ACTUATOR, "1.1.1: OcaActuator" },
70+
{ OCA_BASIC_ACTUATOR, "1.1.1.1: OcaBasicActuator" },
71+
{ OCA_INT32_ACTUATOR, "1.1.1.1.4: OcaInt32Actuator" },
72+
{ OCA_STRING_ACTUATOR, "1.1.1.1.12: OcaStringActuator" },
73+
{ OCA_MUTE, "1.1.1.2: OcaMute" },
74+
{ OCA_SWITCH, "1.1.1.4: OcaSwitch" },
75+
{ OCA_GAIN, "1.1.1.5: OcaGain" },
76+
{ OCA_DELAY, "1.1.1.7: OcaDelay" },
77+
{ OCA_SENSOR, "1.1.2: OcaSensor" },
78+
{ OCA_BASIC_SENSOR, "1.1.2.1: OcaBasicSensor" },
79+
{ OCA_BOOLEAN_SENSOR, "1.1.2.1.1: OcaBooleanSensor" },
80+
{ OCA_INT32_SENSOR, "1.1.2.1.4: OcaInt32Sensor" },
81+
{ OCA_FLOAT32_SENSOR, "1.1.2.1.10: OcaFloat32Sensor" },
82+
{ OCA_STRING_SENSOR, "1.1.2.1.12: OcaStringSensor" },
83+
{ OCA_LEVEL_SENSOR, "1.1.2.2: OcaLevelSensor" },
84+
{ OCA_AUDIO_LEVEL_SENSOR, "1.1.2.2.1: OcaAudioLevelSensor" },
85+
{ OCA_AGENT, "1.2: OcaAgent" }
8686
};
8787

8888
/**
@@ -120,6 +120,15 @@ struct OcaRoot
120120
*/
121121
static OcaRoot* CreateCustom();
122122

123+
/**
124+
* Helper method to obtain the AES70 class index which matches the class' name.
125+
*
126+
* @param[in] className Name of AES70 class.
127+
* @return Index of the corresponding AES70 class within the ClassIdx enum,
128+
* or zero if no such class could be found.
129+
*/
130+
static int GetClassIdxFromName(const juce::String& className);
131+
123132
/**
124133
* Definition level of the AES70 class, where OcaRoot is at level 1 and the level
125134
* increases with depth in the inheritance tree.

Source/Common.h

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
static const juce::Colour AppBackgroundColour(43, 65, 77); // App window background color
2929
static const juce::Colour LabelEnabledTextColour(125, 182, 212); // Color for labels of relevant controls
3030
static const juce::Colour LabelDisabledTextColour(12, 12, 12); // Color for labels of non-relevant controls
31+
static const juce::Colour ButtonBackgroundColour(43, 65, 77); // Color for button background
3132

3233
static const juce::String ProjectHostShortURL("https://github.com/escalonely"); // Web address of this project's host.
3334
static const juce::String ProjectHostLongURL("https://github.com/escalonely/AES70_OCP1_StringGenerator"); // Complete web address of this project's host.

Source/Main.cpp

+31-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class AES70_OCP1_StringGeneratorApplication : public juce::JUCEApplication
3636

3737
void initialise (const juce::String& /*commandLine*/) override
3838
{
39-
m_mainWindow.reset (new MainWindow (getApplicationName()));
39+
m_mainWindow.reset(new MainWindow());
40+
41+
// Create and initialize the tabs in the mainWindow's TabbedComponent.
42+
m_mainWindow->InitializeTabbedComponent();
4043
}
4144

4245
void shutdown() override
@@ -57,17 +60,17 @@ class AES70_OCP1_StringGeneratorApplication : public juce::JUCEApplication
5760
This class implements the desktop window that contains an instance of
5861
our MainTabbedComponent class.
5962
*/
60-
class MainWindow : public juce::DocumentWindow
63+
class MainWindow : public juce::DocumentWindow
6164
{
6265
public:
63-
MainWindow (juce::String name)
64-
: DocumentWindow (name,
65-
juce::Desktop::getInstance().getDefaultLookAndFeel()
66-
.findColour (juce::ResizableWindow::backgroundColourId),
67-
DocumentWindow::allButtons)
66+
MainWindow()
67+
: DocumentWindow(juce::String(),
68+
juce::Desktop::getInstance().getDefaultLookAndFeel()
69+
.findColour(juce::ResizableWindow::backgroundColourId),
70+
DocumentWindow::allButtons)
6871
{
69-
setUsingNativeTitleBar (true);
70-
setContentOwned (new MainTabbedComponent(), true);
72+
setUsingNativeTitleBar(true);
73+
setContentOwned(new MainTabbedComponent(), true);
7174

7275
#if JUCE_IOS || JUCE_ANDROID
7376
setFullScreen (true);
@@ -86,6 +89,25 @@ class AES70_OCP1_StringGeneratorApplication : public juce::JUCEApplication
8689
JUCEApplication::getInstance()->systemRequestedQuit();
8790
}
8891

92+
void InitializeTabbedComponent()
93+
{
94+
// Check if a config file was given in via the commandline.
95+
juce::File configFile;
96+
juce::ArgumentList argList("executable", JUCEApplicationBase::getCommandLineParameterArray());
97+
if (argList.containsOption("-o"))
98+
configFile = argList.getFileForOption("-o");
99+
100+
// Create tabs and pages (using the config file if available).
101+
auto mainComponent = static_cast<MainTabbedComponent*>(getContentComponent());
102+
bool parsedFile = mainComponent->InitializePages(configFile);
103+
104+
// Set the app window name. If successfully opened, add the name of the config file.
105+
juce::String windowName(JUCEApplicationBase::getInstance()->getApplicationName());
106+
if (parsedFile)
107+
windowName = configFile.getFileName() + " - " + windowName;
108+
setName(windowName);
109+
}
110+
89111
private:
90112
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
91113
};

0 commit comments

Comments
 (0)