Browse Source

Make jsusfx report the pin names

pull/1490/head
Jean Pierre Cimalando 3 years ago
parent
commit
223471a8e8
2 changed files with 46 additions and 6 deletions
  1. +44
    -6
      source/modules/jsusfx/source/jsusfx.cpp
  2. +2
    -0
      source/modules/jsusfx/source/jsusfx.h

+ 44
- 6
source/modules/jsusfx/source/jsusfx.cpp View File

@@ -501,6 +501,8 @@ JsusFx::JsusFx(JsusFxPathLibrary &_pathLibrary)
numInputs = 0; numInputs = 0;
numOutputs = 0; numOutputs = 0;
inputNames.reserve(16);
outputNames.reserve(16);
numValidInputChannels = 0; numValidInputChannels = 0;
@@ -656,6 +658,9 @@ static char *trim(char *line, bool trimStart, bool trimEnd)
bool JsusFx::readHeader(JsusFxPathLibrary &pathLibrary, const std::string &path, std::istream &input) { bool JsusFx::readHeader(JsusFxPathLibrary &pathLibrary, const std::string &path, std::istream &input) {
char line[4096]; char line[4096];
inputNames.clear();
outputNames.clear();
for(int lnumber = 1; ! input.eof(); lnumber++) { for(int lnumber = 1; ! input.eof(); lnumber++) {
input.getline(line, sizeof(line), '\n'); input.getline(line, sizeof(line), '\n');
@@ -693,10 +698,30 @@ bool JsusFx::readHeader(JsusFxPathLibrary &pathLibrary, const std::string &path,
continue; continue;
} }
else if ( ! strncmp(line, "in_pin:", 7) ) { else if ( ! strncmp(line, "in_pin:", 7) ) {
numInputs++;
char *src = line+7;
src = trim(src, true, true);
if ( ! strncmp(src, "none", 4) ) {
inputNames.clear();
numInputs = -1;
} else {
if ( numInputs != -1 ) {
inputNames.push_back(src);
numInputs++;
}
}
} }
else if ( ! strncmp(line, "out_pin:", 8) ) { else if ( ! strncmp(line, "out_pin:", 8) ) {
numOutputs++;
char *src = line+8;
src = trim(src, true, true);
if ( ! strncmp(src, "none", 4) ) {
outputNames.clear();
numOutputs = -1;
} else {
if ( numOutputs != -1 ) {
outputNames.push_back(src);
numOutputs++;
}
}
} }
} }
@@ -707,6 +732,9 @@ bool JsusFx::readSections(JsusFxPathLibrary &pathLibrary, const std::string &pat
WDL_String * code = nullptr; WDL_String * code = nullptr;
char line[4096]; char line[4096];
inputNames.clear();
outputNames.clear();
// are we reading the header or sections? // are we reading the header or sections?
bool isHeader = true; bool isHeader = true;
@@ -840,19 +868,29 @@ bool JsusFx::readSections(JsusFxPathLibrary &pathLibrary, const std::string &pat
continue; continue;
} }
else if ( ! strncmp(line, "in_pin:", 7) ) { else if ( ! strncmp(line, "in_pin:", 7) ) {
if ( ! strncmp(line+7, "none", 4) ) {
char *src = line+7;
src = trim(src, true, true);
if ( ! strncmp(src, "none", 4) ) {
inputNames.clear();
numInputs = -1; numInputs = -1;
} else { } else {
if ( numInputs != -1 )
if ( numInputs != -1 ) {
inputNames.push_back(src);
numInputs++; numInputs++;
}
} }
} }
else if ( ! strncmp(line, "out_pin:", 8) ) { else if ( ! strncmp(line, "out_pin:", 8) ) {
if ( ! strncmp(line+8, "none", 4) ) {
char *src = line+8;
src = trim(src, true, true);
if ( ! strncmp(src, "none", 4) ) {
outputNames.clear();
numOutputs = -1; numOutputs = -1;
} else { } else {
if ( numOutputs != -1 )
if ( numOutputs != -1 ) {
outputNames.push_back(src);
numOutputs++; numOutputs++;
}
} }
} }
} }


+ 2
- 0
source/modules/jsusfx/source/jsusfx.h View File

@@ -197,6 +197,8 @@ public:
int numInputs; int numInputs;
int numOutputs; int numOutputs;
int numValidInputChannels; int numValidInputChannels;
std::vector<std::string> inputNames;
std::vector<std::string> outputNames;
JsusFxPathLibrary &pathLibrary; JsusFxPathLibrary &pathLibrary;


Loading…
Cancel
Save