Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1521f41

Browse files
authored
Merge pull request #19 from d3cod3/0.7.2-pre-release
0.7.2 pre release
2 parents 887a576 + a518880 commit 1521f41

File tree

151 files changed

+4883
-693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+4883
-693
lines changed

‎README.md‎

Lines changed: 27 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Table of Contents
1818
* [INSTALLING](#installing)
1919
* [USAGE](#usage)
2020
* [CONTRIBUTING](#contributing)
21+
* [COLLECTIONS](#collections)
2122
* [OBJECTS LIST](#objects_list)
2223
* [LICENSE](#license)
2324
* [CREDITS](#credits)
@@ -72,8 +73,6 @@ In order to build ofxVisualProgramming, you'll need this addons:
7273

7374
#### [ofxFft](https://github.com/kylemcdonald/ofxFft)
7475

75-
#### [ofxJSON](https://github.com/jeffcrouse/ofxJSON)
76-
7776
#### [ofxImGui](https://github.com/d3cod3/ofxImGui)
7877

7978
#### [ofxInfiniteCanvas](https://github.com/d3cod3/ofxInfiniteCanvas)
@@ -117,7 +116,6 @@ git clone https://github.com/kylemcdonald/ofxCv
117116
git clone https://github.com/arturoc/ofxEasing
118117
git clone https://github.com/d3cod3/ofxFFmpegRecorder
119118
git clone https://github.com/kylemcdonald/ofxFft
120-
git clone https://github.com/jeffcrouse/ofxJSON
121119
git clone https://github.com/d3cod3/ofxImGui
122120
git clone https://github.com/d3cod3/ofxInfiniteCanvas
123121
git clone https://github.com/danomatika/ofxLua
@@ -135,83 +133,31 @@ git clone https://github.com/d3cod3/ofxVisualProgramming
135133

136134
# USAGE
137135

138-
In ofApp.h include the ofxVisualProgramming addon:
139-
140-
```c
141-
142-
#include "ofMain.h"
143-
144-
#include "ofxVisualProgramming.h"
145-
146-
class ofApp : public ofBaseApp{
147-
148-
public:
149-
void setup();
150-
void update();
151-
void draw();
152-
// ....
153-
// ....
154-
155-
ofxVisualProgramming *visualProgramming; /**/
156-
157-
};
158-
159-
```
160-
161-
then in ofApp.cpp:
136+
Check [Mosaic](https://github.com/d3cod3/Mosaic) project to look at a ofxVisualProgramming addon usage and implementation
162137

163-
```c
164-
165-
#include "ofApp.h"
166-
167-
//--------------------------------------------------------------
168-
void ofApp::setup(){
169-
ofSetWindowTitle("ofxVisualProgramming Example");
170-
171-
visualProgramming = new ofxVisualProgramming();
172-
visualProgramming->setup();
173-
}
174-
175-
//--------------------------------------------------------------
176-
void ofApp::update(){
177-
visualProgramming->update();
178-
}
179-
180-
//--------------------------------------------------------------
181-
void ofApp::draw(){
182-
ofBackground(20);
183-
visualProgramming->draw();
184-
}
185-
186-
```
187138

188139
# CONTRIBUTING
189140

190141
Contributing to the project adding new objects is relatively easy, as ofxVisualProgramming is at the core of [Mosaic](https://github.com/d3cod3/Mosaic) software, i've implemented a plugin mechanism based on [Pugg](http://pugg.sourceforge.net/), in order to facilitate the extension and the creation of new objects/nodes to add at the ofxVisualProgramming/Mosaic default objects/nodes library. (see objects/nodes list below)
191142

192143
You can find the repo of the plugin template here: [ofxMosaicPlugin](https://github.com/d3cod3/ofxMosaicPlugin), with some generic objects templates and more detailed info in the readme.
193144

145+
# COLLECTIONS
146+
147+
A list of contributed collections of new objects
148+
149+
- [ofxVPObjectsDaan](https://github.com/Daandelange/ofxVPObjectsDaan) by [@Daandelange](https://github.com/Daandelange)
194150

195151
# OBJECTS LIST
196152

197153
Audio Analysis | Ready
198154
---------- | ----------
199155
audio analyzer | X |
200156
bpm extractor | X |
201-
centroid extractor | X |
202-
dissonance extractor | X |
203157
fft extractor | X |
204-
hfc extractor | X |
205-
hpcp extractor | X |
206-
inharmonicity extractor | X |
207158
mel bands extractor | X |
208-
mfcc extractor | X |
209-
onset extractor | X |
210159
pitch extractor | X |
211-
power extractor | X |
212160
rms extractor | X |
213-
rolloff extractor | X |
214-
tristimulus extractor | X |
215161

216162
Communications | Ready
217163
---------- | ----------
@@ -229,7 +175,6 @@ osc sender | X |
229175
Computer Vision | Ready
230176
---------- | ----------
231177
background subtraction | X |
232-
chroma key | X |
233178
color tracking | X |
234179
contour tracking | X |
235180
haar tracking | X |
@@ -241,10 +186,13 @@ Data | Ready
241186
bang multiplexer | X |
242187
bang to float | X |
243188
color palette | X |
189+
data to file | X |
244190
data to texture | X |
245191
file to data | X |
246192
float multiplexer | X |
247193
floats to vector | X |
194+
receiver | X |
195+
sender | X |
248196
texture to data | X |
249197
vector at | X |
250198
vector concat | X |
@@ -259,6 +207,9 @@ bang | X |
259207
comment | X |
260208
data viewer | X |
261209
message | X |
210+
multislider | X |
211+
multitoggle | X |
212+
piano keyboard | X |
262213
player controls | X |
263214
signal viewer | X |
264215
slider | X |
@@ -286,10 +237,10 @@ Math | Ready
286237
---------- | ----------
287238
1D noise | X |
288239
clamp | X |
289-
constant | X |
290240
cosine generator | X |
291241
map | X |
292242
metronome | X |
243+
number | X |
293244
operator | X |
294245
simple random | X |
295246
sine generator | X |
@@ -300,15 +251,15 @@ Scripting | Ready
300251
bash script | X |
301252
glsl shader | X |
302253
lua script | X |
303-
python script | X |
304-
scheme script | |
254+
scheme live coding | X |
305255

306256

307257
Sound | Ready
308258
---------- | ----------
309259
ADSR envelope | X |
310260
AHR envelope | X |
311261
amplifier | X |
262+
address sequencer | X |
312263
audio exporter | X |
313264
bit cruncher | X |
314265
bit noise | X |
@@ -319,6 +270,7 @@ data oscillator | X |
319270
decimator | X |
320271
delay | X |
321272
dimension chorus | X |
273+
frequency to note | X |
322274
high pass | X |
323275
kick | X |
324276
lfo | X |
@@ -327,20 +279,23 @@ mixer | X |
327279
note to frequency | X |
328280
oscillator | X |
329281
panner | X |
330-
parametric EQ | | X
282+
parametric EQ | X |
331283
pd patch | X |
284+
polyphonic oscillator | X |
332285
quad panner | X |
333-
quantizer | | X
286+
quantizer | X |
334287
resonant filter | X |
335288
reverb | X |
336289
sample and hold | | X
290+
sample player | X |
337291
saturator | | X
338292
sequencer | X |
339293
sidechain compressor | X |
340294
signal gate | X |
341295
signal operator | X |
342296
signal trigger | X |
343297
soundfile player | X |
298+
summing mixer | X |
344299

345300
Texture | Ready
346301
---------- | ----------
@@ -349,20 +304,20 @@ image loader | X |
349304
kinect grabber | X |
350305
pixels to texture | X |
351306
texture crop | X |
307+
texture gate | X |
352308
texture information | X |
353309
texture mixer | X |
354310
texture to pixels | X |
355311
texture transform | X |
356312
to grayscale texture | X |
357-
syphon sender | X |
358-
syphon receiver | X |
313+
syphon sender ( osx only ) | X |
314+
syphon receiver ( osx only ) | X |
359315
video exporter | X |
360316
video feedback | X |
361-
video gate | X |
362317
video grabber | X |
363318
video player | X |
364-
video receiver | X |
365-
video sender | X |
319+
video receiver ( osx only ) | X |
320+
video sender ( osx only ) | X |
366321
video streaming | X |
367322
video timedelay | X |
368323

@@ -390,8 +345,6 @@ ofxEasing original addon by [Arturo Castro](https://github.com/arturoc)
390345

391346
ofxFFmpegRecorder original addon by [Furkan Üzümcü](https://github.com/Furkanzmc)
392347

393-
ofxJSON original addon by [Jeff Crouse](https://github.com/jeffcrouse/)
394-
395348
ofxImGui original addon by [Jason Van Cleave](https://github.com/jvcleave)
396349

397350
ofxInfiniteCanvas original addon by [Roy Macdonald](https://github.com/roymacdonald)

‎addon_config.mk‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ common:
2626
# or use += in several lines
2727
ADDON_DEPENDENCIES = ofxKinect ofxOpenCv ofxOsc ofxXmlSettings
2828
ADDON_DEPENDENCIES += ofxAudioFile ofxBTrack ofxCv ofxEasing ofxFFmpegRecorder ofxFft
29-
ADDON_DEPENDENCIES += ofxJSON ofxImGui ofxInfiniteCanvas ofxLua ofxMidi ofxMtlMapping2D
29+
ADDON_DEPENDENCIES += ofxGLEditor ofxImGui ofxLua ofxMidi ofxMtlMapping2D
3030
ADDON_DEPENDENCIES += ofxOpenDHT ofxPd ofxPDSP ofxTimeline ofxWarp
3131

3232
# include search paths, this will be usually parsed from the file system
@@ -74,6 +74,7 @@ common:
7474

7575
linux64:
7676
#ADDON_DEPENDENCIES += ofxNDI
77+
ADDON_DEPENDENCIES += ofxScheme
7778
ADDON_SOURCES_EXCLUDE = src/objects/video/VideoSender% src/objects/video/VideoReceiver% src/objects/video/SyphonSender% src/objects/video/SyphonReceiver%
7879

7980
msys2:
@@ -84,3 +85,4 @@ vs:
8485

8586
osx:
8687
ADDON_DEPENDENCIES += ofxNDI ofxSyphon
88+
ADDON_SOURCES_EXCLUDE = src/objects/scripting/SchemeScript%

‎src/PatchObject.cpp‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
339339
}
340340
}
341341

342-
ImGuiEx::NodeConnectData connectData = _nodeCanvas.AddNodePin( nId, i, inletsNames.at(i).c_str(), tempLinkData, getInletTypeName(i), getInletWirelessReceive(i), inletsConnected[i], IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Left );
342+
std::ostringstream inletInfo;
343+
inletInfo << inletsNames.at(i); // << " " << _inletParams[i];
344+
ImGuiEx::NodeConnectData connectData = _nodeCanvas.AddNodePin( nId, i, inletInfo.str().c_str(), tempLinkData, getInletTypeName(i), getInletWirelessReceive(i), inletsConnected[i], IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Left );
343345

344346
inletsPositions[i] = _nodeCanvas.getInletPosition(nId,i);
345347

@@ -397,7 +399,10 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
397399
}
398400
}
399401

400-
_nodeCanvas.AddNodePin( nId, i, getOutletName(i).c_str(), tempLinkData, getOutletTypeName(i), getOutletWirelessSend(i), getIsOutletConnected(i), IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Right );
402+
std::ostringstream outletInfo;
403+
outletInfo << getOutletName(i); // << " " << _outletParams[i];
404+
405+
_nodeCanvas.AddNodePin( nId, i, outletInfo.str().c_str(), tempLinkData, getOutletTypeName(i), getOutletWirelessSend(i), getIsOutletConnected(i), IM_COL32(pinCol.r,pinCol.g,pinCol.b,pinCol.a), ImGuiExNodePinsFlags_Right );
401406

402407
outletsPositions[i] = _nodeCanvas.getOutletPosition(nId,i);
403408
}
@@ -434,7 +439,7 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
434439
linksDeactivated = _nodeCanvas.getDeactivatedLinks();
435440

436441
// Refresh objects selected to eventually duplicate or delete ( cmd-d or backsapce )
437-
objectsSelected = _nodeCanvas.getSelectedNodes();
442+
objectsSelected = _nodeCanvas.getSelectedNodesId();
438443

439444
// Let objects draw their own Gui
440445
this->drawObjectNodeGui( _nodeCanvas );
@@ -1194,6 +1199,7 @@ void PatchObject::keyPressed(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>>
11941199
//--------------------------------------------------------------
11951200
void PatchObject::keyReleased(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>> &patchObjects){
11961201
if(!willErase){
1202+
// DELETE SELECTED OBJECTS
11971203
if(e.key == OF_KEY_BACKSPACE){
11981204
for (int j=0;j<static_cast<int>(linksToDisconnect.size());j++){
11991205
disconnectLink(patchObjects,linksToDisconnect.at(j));
@@ -1202,16 +1208,20 @@ void PatchObject::keyReleased(ofKeyEventArgs &e,map<int,shared_ptr<PatchObject>>
12021208

12031209
for(int j=0;j<static_cast<int>(objectsSelected.size());j++){
12041210
if(objectsSelected.at(j) == this->nId){
1205-
ofNotifyEvent(removeEvent, objectsSelected.at(j));
1206-
this->setWillErase(true);
1211+
if(this->getName() != "audio device"){
1212+
ofNotifyEvent(removeEvent, objectsSelected.at(j));
1213+
this->setWillErase(true);
1214+
}
12071215
}
12081216
}
1209-
objectsSelected.clear();
1217+
//objectsSelected.clear();
12101218
// OSX: CMD-D, WIN/LINUX: CTRL-D (DUPLICATE SELECTED OBJECTS)
12111219
}else if(e.hasModifier(MOD_KEY) && e.keycode == 68){
12121220
for(int j=0;j<static_cast<int>(objectsSelected.size());j++){
12131221
if(objectsSelected.at(j) == this->nId){
1214-
ofNotifyEvent(duplicateEvent, objectsSelected.at(j));
1222+
if(!this->getIsHardwareObject()){
1223+
ofNotifyEvent(duplicateEvent, objectsSelected.at(j));
1224+
}
12151225
}
12161226
}
12171227
}

‎src/core/imgui_controls.cpp‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,4 +446,25 @@ SmartButtonState BangButton(const char* label, ImVec4& color, ImVec2 size) {
446446
return state;
447447
}
448448

449+
void ToggleButton(const char* str_id, bool* v)
450+
{
451+
ImVec4* colors = ImGui::GetStyle().Colors;
452+
ImVec2 p = ImGui::GetCursorScreenPos();
453+
ImDrawList* draw_list = ImGui::GetWindowDrawList();
454+
455+
float height = ImGui::GetFrameHeight()/3*2;
456+
float width = height * 1.55f;
457+
float radius = height * 0.50f;
458+
459+
ImGui::InvisibleButton(str_id, ImVec2(width, height));
460+
if (ImGui::IsItemClicked()) *v = !*v;
461+
462+
if (ImGui::IsItemHovered())
463+
draw_list->AddRectFilled(p, ImVec2(p.x + width, p.y + height), ImGui::GetColorU32(*v ? colors[ImGuiCol_ButtonActive] : ImVec4(0.78f, 0.78f, 0.78f, 1.0f)), height * 0.5f);
464+
else
465+
draw_list->AddRectFilled(p, ImVec2(p.x + width, p.y + height), ImGui::GetColorU32(*v ? colors[ImGuiCol_Button] : ImVec4(0.85f, 0.85f, 0.85f, 1.0f)), height * 0.50f);
466+
467+
draw_list->AddCircleFilled(ImVec2(p.x + radius + (*v ? 1 : 0) * (width - radius * 2.0f), p.y + radius), radius - 1.5f, IM_COL32(255, 255, 255, 255));
468+
}
469+
449470
}

‎src/core/imgui_controls.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ SmartButtonState SmartButton(const char* label, ImVec2 size = {0, 0});
3232

3333
SmartButtonState BangButton(const char* label, ImVec4& color, ImVec2 size = {0, 0});
3434

35+
void ToggleButton(const char* str_id, bool* v);
36+
3537
}

‎src/core/imgui_helpers.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ inline void drawWaveform(ImDrawList* drawList, ImVec2 dim, float* data, int data
153153
}
154154

155155
//--------------------------------------------------------------
156-
inline void plotValue(float value, float min, float max, ImU32 color=IM_COL32(255,255,255,255), float retinaScale=1.0f){
156+
inline void plotValue(float value, float min, float max, ImU32 color=IM_COL32(255,255,255,255), float height=OBJECT_STANDARD_HEIGHT, float scale=1.0f){
157157
ImGuiEx::PlotVarConfig conf;
158158
conf.value = value;
159-
conf.frame_size = ImVec2(ImGui::GetWindowSize().x - 20, ImGui::GetWindowSize().y - ((IMGUI_EX_NODE_HEADER_HEIGHT+IMGUI_EX_NODE_FOOTER_HEIGHT)*retinaScale));
159+
conf.frame_size = ImVec2(ImGui::GetWindowSize().x - (20*scale), height);
160160
conf.scale.min = min;
161161
conf.scale.max = max;
162162
conf.buffer_size = 256;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /