Skip to content

Commit 0ae9748

Browse files
committed
removed ofxPdExternals addon for cross-compile compatibility
1 parent fd40c9e commit 0ae9748

File tree

4 files changed

+7
-100
lines changed

4 files changed

+7
-100
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ In order to build ofxVisualProgramming, you'll need this addons:
9393

9494
#### [ofxPd](https://github.com/danomatika/ofxPd)
9595

96-
#### [ofxPdExternals](https://github.com/d3cod3/ofxPdExternals)
97-
9896
#### [ofxPDSP](https://github.com/d3cod3/ofxPDSP)
9997

10098
#### [ofxPython](https://github.com/d3cod3/ofxPython)
@@ -135,7 +133,6 @@ git clone https://github.com/d3cod3/ofxMtlMapping2D
135133
git clone https://github.com/d3cod3/ofxNDI
136134
git clone https://github.com/d3cod3/ofxPython
137135
git clone https://github.com/danomatika/ofxPd
138-
git clone https://github.com/d3cod3/ofxPdExternals
139136
git clone https://github.com/d3cod3/ofxPDSP
140137
git clone https://github.com/d3cod3/ofxSyphon
141138
git clone https://github.com/d3cod3/ofxTimeline

addon_config.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ common:
7373

7474

7575
linux64:
76-
ADDON_DEPENDENCIES += ofxHapPlayer ofxPd ofxPdExternals ofxNDI
76+
ADDON_DEPENDENCIES += ofxHapPlayer ofxPd ofxNDI
7777
ADDON_SOURCES_EXCLUDE = src/objects/video/SyphonSender% src/objects/video/SyphonReceiver%
7878

7979
msys2:
8080
ADDON_SOURCES_EXCLUDE = src/objects/scripting/BashScript% src/objects/sound/PDPatch% src/objects/video/VideoSender% src/objects/video/VideoReceiver% src/objects/video/SyphonSender% src/objects/video/SyphonReceiver%
8181

82+
vs:
83+
ADDON_SOURCES_EXCLUDE = src/objects/scripting/BashScript% src/objects/video/VideoSender% src/objects/video/VideoReceiver% src/objects/video/SyphonSender% src/objects/video/SyphonReceiver%
84+
8285
osx:
83-
ADDON_DEPENDENCIES += ofxHapPlayer ofxPd ofxPdExternals ofxNDI ofxSyphon
86+
ADDON_DEPENDENCIES += ofxHapPlayer ofxPd ofxNDI ofxSyphon

src/objects/sound/PDPatch.cpp

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
3131
==============================================================================*/
3232

33-
#if defined(TARGET_WIN32)
34-
// Unavailable on windows.
35-
#elif !defined(OFXVP_BUILD_WITH_MINIMAL_OBJECTS)
33+
#ifndef OFXVP_BUILD_WITH_MINIMAL_OBJECTS
3634

3735
#include "PDPatch.h"
3836

@@ -65,14 +63,10 @@ PDPatch::PDPatch() : PatchObject("pd patch"){
6563
isAudioOUTObject = true;
6664

6765
lastLoadedPatch = "";
68-
prevExternalsFolder = "/path_to_pd_externals";
69-
lastExternalsFolder = "SET PD EXTERNAL FOLDER!";
7066
loadPatchFlag = false;
7167
savePatchFlag = false;
72-
setExternalFlag = false;
7368
patchLoaded = false;
7469
patchSaved = false;
75-
externalPathSaved = false;
7670
loading = true;
7771

7872
isPDSPPatchableObject = true;
@@ -96,8 +90,6 @@ void PDPatch::newObject(){
9690
this->addOutlet(VP_LINK_AUDIO,"audioOut3");
9791
this->addOutlet(VP_LINK_AUDIO,"audioOut4");
9892
this->addOutlet(VP_LINK_ARRAY,"data");
99-
100-
this->setCustomVar(0.0f,"/path_to_pd_externals");
10193
}
10294

10395
//--------------------------------------------------------------
@@ -171,28 +163,6 @@ void PDPatch::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjects
171163
this->saveConfig(false);
172164
}
173165

174-
if(externalPathSaved){
175-
externalPathSaved = false;
176-
if(lastExternalsFolder != ""){
177-
ofFile tempfile (lastExternalsFolder);
178-
if(tempfile.exists() && tempfile.isDirectory()){
179-
string temp = tempfile.getAbsolutePath().substr(0, tempfile.getAbsolutePath().size()-1);
180-
pd.addToSearchPath(temp);
181-
this->substituteCustomVar(prevExternalsFolder,temp.c_str());
182-
prevExternalsFolder = lastExternalsFolder;
183-
ofLog(OF_LOG_NOTICE,"PD Externals Folder set to: %s",temp.c_str());
184-
this->saveConfig(false);
185-
// load externals
186-
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
187-
if(lastExternalsFolder != "SET PD EXTERNAL FOLDER!"){
188-
cyclone_setup();
189-
zexy_setup();
190-
}
191-
#endif
192-
}
193-
}
194-
}
195-
196166
if(pd.isInited() && pd.isComputingAudio() && currentPatch.isValid()){
197167
pd.startMessage();
198168
for(size_t s=0;s<static_cast<size_t>(static_cast<vector<float> *>(_inletParams[4])->size());s++){
@@ -225,7 +195,6 @@ void PDPatch::drawObjectContent(ofTrueTypeFont *font, shared_ptr<ofBaseGLRendere
225195
void PDPatch::drawObjectNodeGui( ImGuiEx::NodeCanvas& _nodeCanvas ){
226196
loadPatchFlag = false;
227197
savePatchFlag = false;
228-
setExternalFlag = false;
229198

230199
// CONFIG GUI inside Menu
231200
if(_nodeCanvas.BeginNodeMenu()){
@@ -267,11 +236,6 @@ void PDPatch::drawObjectNodeGui( ImGuiEx::NodeCanvas& _nodeCanvas ){
267236
patchLoaded = true;
268237
}
269238

270-
if(ImGuiEx::getFileDialog(fileDialog, setExternalFlag, "Select your PD external folder", imgui_addons::ImGuiFileBrowser::DialogMode::SELECT, "", "", scaleFactor)){
271-
lastExternalsFolder = fileDialog.selected_path;
272-
externalPathSaved = true;
273-
}
274-
275239
}
276240

277241
//--------------------------------------------------------------
@@ -280,7 +244,6 @@ void PDPatch::drawObjectNodeConfig(){
280244

281245
loadPatchFlag = false;
282246
savePatchFlag = false;
283-
setExternalFlag = false;
284247

285248
ImGui::Spacing();
286249
ImGui::Text("Loaded PD Patch:");
@@ -290,8 +253,6 @@ void PDPatch::drawObjectNodeConfig(){
290253
ImGui::Text("%s",tempFilename.getFileName().c_str());
291254
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s",tempFilename.getAbsolutePath().c_str());
292255
}
293-
ImGui::Spacing();
294-
ImGui::Text("%s",lastExternalsFolder.c_str());
295256

296257
ImGui::Spacing();
297258
ImGui::Spacing();
@@ -306,10 +267,6 @@ void PDPatch::drawObjectNodeConfig(){
306267
if(ImGui::Button("Open",ImVec2(224*scaleFactor,26*scaleFactor))){
307268
loadPatchFlag = true;
308269
}
309-
ImGui::Spacing();
310-
if(ImGui::Button("Set Externals Path",ImVec2(224*scaleFactor,26*scaleFactor))){
311-
setExternalFlag = true;
312-
}
313270

314271
ImGuiEx::ObjectInfo(
315272
"Pure Data ( Pd-Vanilla ) patch container with inlets and outlets. As for live coding, with this object you can live patching, passing in real time and in both directions audio and data cables.",
@@ -327,10 +284,6 @@ void PDPatch::drawObjectNodeConfig(){
327284
patchLoaded = true;
328285
}
329286

330-
if(ImGuiEx::getFileDialog(fileDialog, setExternalFlag, "Select your PD external folder", imgui_addons::ImGuiFileBrowser::DialogMode::SELECT, "", "", scaleFactor)){
331-
lastExternalsFolder = fileDialog.selected_path;
332-
externalPathSaved = true;
333-
}
334287
}
335288

336289
//--------------------------------------------------------------
@@ -422,30 +375,6 @@ void PDPatch::loadAudioSettings(){
422375
bufferSize = XML.getValue("buffer_size",0);
423376
XML.popTag();
424377
}
425-
int totalObjects = XML.getNumTags("object");
426-
427-
// Load object outlet config
428-
for(int i=0;i<totalObjects;i++){
429-
if(XML.pushTag("object", i)){
430-
if(XML.getValue("id", -1) == this->nId){
431-
if (XML.pushTag("vars")){
432-
int totalVars = XML.getNumTags("var");
433-
434-
for (int t=0;t<totalVars;t++){
435-
if(XML.pushTag("var",t)){
436-
prevExternalsFolder = XML.getValue("name","");
437-
lastExternalsFolder = prevExternalsFolder;
438-
ofLog(OF_LOG_NOTICE,"Externals folder: %s",lastExternalsFolder.c_str());
439-
XML.popTag();
440-
}
441-
}
442-
443-
XML.popTag();
444-
}
445-
}
446-
XML.popTag();
447-
}
448-
}
449378
}
450379

451380
lastInputBuffer.allocate(bufferSize,4);
@@ -461,14 +390,6 @@ void PDPatch::loadAudioSettings(){
461390
lastOutputBuffer4.allocate(bufferSize,1);
462391

463392
pd.init(4,4,sampleRate,bufferSize/ofxPd::blockSize(),false);
464-
// load externals
465-
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
466-
if(lastExternalsFolder != "SET PD EXTERNAL FOLDER!"){
467-
cyclone_setup();
468-
zexy_setup();
469-
}
470-
#endif
471-
472393

473394
pd.subscribe("toMosaic");
474395

@@ -505,13 +426,6 @@ void PDPatch::loadPatch(string scriptFile){
505426

506427
currentPatchFile.open(filepath);
507428

508-
if(prevExternalsFolder != "" && prevExternalsFolder != "/path_to_pd_externals"){
509-
ofFile tempfile (prevExternalsFolder);
510-
if(tempfile.exists() && tempfile.isDirectory()){
511-
pd.addToSearchPath(tempfile.getAbsolutePath());
512-
}
513-
}
514-
515429
currentPatch = pd.openPatch(currentPatchFile.getAbsolutePath());
516430

517431
pd.addToSearchPath(currentPatchFile.getEnclosingDirectory());

src/objects/sound/PDPatch.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
3131
==============================================================================*/
3232

33-
#if defined(TARGET_WIN32)
34-
// Unavailable on windows.
35-
#elif !defined(OFXVP_BUILD_WITH_MINIMAL_OBJECTS)
33+
#ifndef OFXVP_BUILD_WITH_MINIMAL_OBJECTS
3634

3735
#pragma once
3836

@@ -42,7 +40,6 @@
4240
#include "IconsFontAwesome5.h"
4341

4442
#include "ofxPd.h"
45-
#include "ofxPdExternals.h"
4643

4744

4845
using namespace pd;
@@ -126,14 +123,10 @@ class PDPatch : public PatchObject, public PdReceiver, public PdMidiReceiver{
126123
imgui_addons::ImGuiFileBrowser fileDialog;
127124

128125
string lastLoadedPatch;
129-
string prevExternalsFolder;
130-
string lastExternalsFolder;
131126
bool loadPatchFlag;
132127
bool savePatchFlag;
133-
bool setExternalFlag;
134128
bool patchLoaded;
135129
bool patchSaved;
136-
bool externalPathSaved;
137130

138131

139132
bool loading;

0 commit comments

Comments
 (0)