Skip to content

Commit bd81332

Browse files
committed
cleanup and fixes for texture cable activation/deactivation
1 parent efaf46a commit bd81332

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

src/PatchObject.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ void PatchObject::update(map<int,shared_ptr<PatchObject>> &patchObjects, pdsp::E
159159
if(this->getIsPDSPPatchableObject() || this->getName() == "audio device"){
160160
this->pdspOut[outPut[i]->fromOutletID] >> patchObjects[outPut[i]->toObjectID]->pdspIn[outPut[i]->toInletID];
161161
}
162-
}else if(outPut[i]->type == VP_LINK_TEXTURE){
163-
// TODO
164162
}
165163
patchObjects[outPut[i]->toObjectID]->_inletParams[outPut[i]->toInletID] = _outletParams[out];
166164
}else{
@@ -169,10 +167,7 @@ void PatchObject::update(map<int,shared_ptr<PatchObject>> &patchObjects, pdsp::E
169167
if(patchObjects[outPut[i]->toObjectID]->getIsPDSPPatchableObject() && patchObjects[outPut[i]->toObjectID]->pdspIn[outPut[i]->toInletID].getInputsList().size() > 0){
170168
patchObjects[outPut[i]->toObjectID]->pdspIn[outPut[i]->toInletID].disconnectIn();
171169
}
172-
}else if(outPut[i]->type == VP_LINK_TEXTURE){
173-
// TODO
174170
}
175-
176171
}
177172
}
178173
}

src/objects/graphics/ImageExporter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void ImageExporter::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWindow){
7979

8080
//--------------------------------------------------------------
8181
void ImageExporter::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjects){
82+
unusedArgs(patchObjects);
8283

8384
if(isImageSaved){
8485
isImageSaved = false;
@@ -103,9 +104,11 @@ void ImageExporter::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchO
103104

104105
//--------------------------------------------------------------
105106
void ImageExporter::drawObjectContent(ofTrueTypeFont *font, shared_ptr<ofBaseGLRenderer>& glRenderer){
107+
unusedArgs(font,glRenderer);
108+
106109
ofSetColor(255);
107110
// draw node texture preview with OF
108-
if(static_cast<ofTexture *>(_inletParams[0])->isAllocated()){
111+
if(this->inletsConnected[0] && static_cast<ofTexture *>(_inletParams[0])->isAllocated()){
109112
if(scaledObjW*canvasZoom > 90.0f){
110113
drawNodeOFTexture(*static_cast<ofTexture *>(_inletParams[0]), posX, posY, drawW, drawH, objOriginX, objOriginY, scaledObjW, scaledObjH, canvasZoom, this->scaleFactor);
111114
}
@@ -209,7 +212,7 @@ void ImageExporter::drawObjectNodeConfig(){
209212

210213
//--------------------------------------------------------------
211214
void ImageExporter::removeObjectContent(bool removeFileFromData){
212-
215+
unusedArgs(removeFileFromData);
213216
}
214217

215218
//--------------------------------------------------------------

src/objects/video/VideoGate.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ void VideoGate::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWindow){
110110

111111
//--------------------------------------------------------------
112112
void VideoGate::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjects){
113+
unusedArgs(patchObjects);
113114

114115
if(this->inletsConnected[0]){
115116
openInlet = static_cast<int>(floor(*(float *)&_inletParams[0]));
116117
}
117118

118-
if(openInlet >= 1 && openInlet < this->numInlets){
119+
if(this->inletsConnected[openInlet] && openInlet >= 1 && openInlet < this->numInlets){
119120
*static_cast<ofTexture *>(_outletParams[0]) = *static_cast<ofTexture *>(_inletParams[openInlet]);
120-
}else if(openInlet == 0){
121+
}else if(openInlet == 0 || !this->inletsConnected[openInlet]){
121122
*static_cast<ofTexture *>(_outletParams[0]) = *kuroTex;
122123
}
123124

@@ -139,6 +140,8 @@ void VideoGate::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjec
139140

140141
//--------------------------------------------------------------
141142
void VideoGate::drawObjectContent(ofTrueTypeFont *font, shared_ptr<ofBaseGLRenderer>& glRenderer){
143+
unusedArgs(font,glRenderer);
144+
142145
ofSetColor(255);
143146

144147
}
@@ -223,7 +226,7 @@ void VideoGate::drawObjectNodeConfig(){
223226

224227
//--------------------------------------------------------------
225228
void VideoGate::removeObjectContent(bool removeFileFromData){
226-
229+
unusedArgs(removeFileFromData);
227230
}
228231

229232
//--------------------------------------------------------------
@@ -252,7 +255,7 @@ void VideoGate::resetInletsSettings(){
252255
_inletParams[0] = new float(); // open
253256
*(float *)&_inletParams[0] = 0.0f;
254257

255-
for(size_t i=1;i<this->numInlets;i++){
258+
for(int i=1;i<this->numInlets;i++){
256259
_inletParams[i] = new ofTexture();
257260
}
258261

@@ -261,7 +264,7 @@ void VideoGate::resetInletsSettings(){
261264

262265
this->addInlet(VP_LINK_NUMERIC,"open");
263266

264-
for(size_t i=1;i<this->numInlets;i++){
267+
for(int i=1;i<this->numInlets;i++){
265268
this->addInlet(VP_LINK_TEXTURE,"t"+ofToString(i));
266269
}
267270

src/objects/video/VideoMixer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ void VideoMixer::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObje
161161

162162
//--------------------------------------------------------------
163163
void VideoMixer::drawObjectContent(ofTrueTypeFont *font, shared_ptr<ofBaseGLRenderer>& glRenderer){
164+
unusedArgs(font,glRenderer);
165+
164166
ofSetColor(255);
165167

166168
mixFbo->begin();

0 commit comments

Comments
 (0)