Skip to content
Snippets Groups Projects
Commit 935fb96d authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Fixed linux version

parent 21f14a2b
No related branches found
No related tags found
No related merge requests found
*.pd binary
......@@ -2,3 +2,4 @@
*.o
*.so
*.os
*.import
......@@ -3,19 +3,15 @@
[sub_resource type="GDScript" id=1]
script/source = "extends Control
var _gdpd
var _patch = 0
onready var _gdpd = load(\"res://addons/gdpd/bin/gdpd.gdns\").new()
func _ready():
_gdpd = load(\"res://addons/gdpd/bin/gdpd.gdns\").new()
pass
func _process(delta):
while _gdpd.has_message() :
print(\"got msg\")
var msg = _gdpd.get_next()
print(msg)
print(\"got message from pd \", msg)
func _load_patch(pd_patch) :
#separate file name from directory
......@@ -26,27 +22,44 @@ func _load_patch(pd_patch) :
_gdpd.openfile(patch_name, patch_dir)
func _on_Start_pressed() :
#retrieve the list of available input and outputs
var inps = _gdpd.get_available_input_devices()
var outs = _gdpd.get_available_output_devices()
#initialise the first ones
_gdpd.init_devices(inps[0], outs[0])
#the patch path should be the absolute one
_load_patch(ProjectSettings.globalize_path(\"res://patch1.pd\"))
_load_patch(ProjectSettings.globalize_path(\"res://patch2.pd\"))
#send message to [receive from_godot] with one symbol
_gdpd.start_message(1)
_gdpd.add_symbol(\"from godot\")
_gdpd.finish_list(\"blup\")
_gdpd.subscribe(\"toBfWeb\")
_gdpd.add_symbol(\"hello\")
_gdpd.finish_list(\"from_godot\")
func _on_Stop_pressed():
#listen to messages sent with [send to_godot]
_gdpd.subscribe(\"to_godot\")
func _on_Stop_pressed():
_gdpd.closefile(\"patch1.pd\")
_gdpd.closefile(\"patch2.pd\")
_gdpd.stop()
func _on_HSlider_value_changed(value):
#send message to [receive from_godot] with three elements
_gdpd.start_message(3)
_gdpd.add_symbol(\"patch1\")
_gdpd.add_symbol(\"pitch\")
_gdpd.add_float(value)
_gdpd.finish_list(\"from_godot\")
func _on_HSlider2_value_changed(value):
_gdpd.start_message(3)
_gdpd.add_symbol(\"patch2\")
_gdpd.add_symbol(\"pitch\")
_gdpd.add_float(value)
_gdpd.finish_list(\"from_godot\")
"
[node name="Control" type="Control"]
......@@ -58,28 +71,60 @@ __meta__ = {
}
[node name="Stop" type="Button" parent="."]
margin_left = 73.0
margin_top = 198.0
margin_right = 176.0
margin_bottom = 244.0
margin_left = 213.0
margin_top = 83.0
margin_right = 316.0
margin_bottom = 129.0
text = "Stop"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Start" type="Button" parent="."]
margin_left = 83.0
margin_top = 93.0
margin_right = 187.0
margin_bottom = 144.0
margin_left = 73.0
margin_top = 83.0
margin_right = 177.0
margin_bottom = 134.0
text = "Start"
[node name="Load" type="Button" parent="."]
margin_left = 103.0
margin_top = 159.0
margin_right = 145.0
margin_bottom = 179.0
text = "Load"
[node name="HSlider" type="HSlider" parent="."]
margin_left = 73.0
margin_top = 193.0
margin_right = 406.0
margin_bottom = 209.0
max_value = 12.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_left = 73.0
margin_top = 170.0
margin_right = 113.0
margin_bottom = 184.0
text = "Send pitch to patch1"
[node name="HSlider2" type="HSlider" parent="."]
margin_left = 73.0
margin_top = 275.0
margin_right = 406.0
margin_bottom = 291.0
max_value = 12.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label2" type="Label" parent="."]
margin_left = 73.0
margin_top = 246.0
margin_right = 204.0
margin_bottom = 260.0
text = "Send pitch to patch2"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="Stop" to="." method="_on_Stop_pressed"]
[connection signal="pressed" from="Start" to="." method="_on_Start_pressed"]
[connection signal="pressed" from="Load" to="." method="_on_Load_pressed"]
[connection signal="value_changed" from="HSlider" to="." method="_on_HSlider_value_changed"]
[connection signal="value_changed" from="HSlider2" to="." method="_on_HSlider2_value_changed"]
......@@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -10,7 +10,6 @@ config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
......
......@@ -7,8 +7,9 @@ Godot add-on for loading and processing Pure Data patches
## Compiling on GNU/Linux
- Open a terminal
- Type the following commandes :
- Install the following packages :
- scons
- Open a terminal and type the following commands :
- git clone https://gitlab.univ-lille.fr/ivmi/gdpd.git
- cd gdpd
- ./update.sh linux
......@@ -16,7 +17,7 @@ Godot add-on for loading and processing Pure Data patches
## Compiling on Windows
- Open the Windows Powershell
- Type the following commandes :
- Type the following commands :
- git clone https://gitlab.univ-lille.fr/ivmi/gdpd.git
- cd gdpd
- ./update.sh windows
......
......@@ -4,7 +4,7 @@ import os, subprocess
opts = Variables([], ARGUMENTS)
# Gets the standard flags CC, CCX, etc.
env = DefaultEnvironment()
env = Environment(ENV = os.environ)
# Define our options
opts.Add(EnumVariable('target', "Compilation target", 'release', ['d', 'debug', 'r', 'release']))
......@@ -61,12 +61,13 @@ if env['platform'] == "osx":
env.Append(CCFLAGS=['-g', '-O3', '-arch', 'x86_64'])
elif env['platform'] in ('x11', 'linux'):
env['CC'] = 'gcc-7'
env['CXX'] = 'g++-7'
env['CC'] = 'gcc'
env['CXX'] = 'g++'
env['target_path'] += 'x11/'
cpp_library += '.linux'
env.Append(CPPDEFINES=['__UNIX_JACK__', 'LIBPD_EXTRA'])
env.Append(LINKFLAGS=['-ljack','-pthread'])
env.Append(LIBS=['jack', 'pthread'])
env.Append(LDPATH=['/usr/lib/x86_64-linux-gnu'])
if env['target'] in ('debug', 'd'):
env.Append(CCFLAGS=['-fPIC', '-g3', '-Og'])
env.Append(CFLAGS=['-std=c11'])
......@@ -80,6 +81,7 @@ elif env['platform'] == "windows":
env['target_path'] += 'win64/'
cpp_library += '.windows'
env.Append(ENV=os.environ)
env.Append(CPPDEFINES=['NOMINMAX'])
if not env['use_mingw']:
# MSVC
......
......@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <map>
#include <algorithm>
#include <Godot.hpp>
#include <AudioStreamPlayer.hpp>
......
This diff is collapsed.
This diff is collapsed.
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment