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

Add return for opening file

parent 51164ed1
No related branches found
No related tags found
No related merge requests found
......@@ -91,8 +91,17 @@ if env["platform"] == "linux":
'-fPIC', '-O3', '-ffast-math', '-funroll-loops',
'-fomit-frame-pointer'])
env.Append(CXXFLAGS=['-std=c++17'])
elif env["platform"] == "android":
env.Append(CPPDEFINES=['__UNSPECIFIED__', 'HAVE_LIBDL'])
env.Append(CFLAGS=['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast',
'-Wno-discarded-qualifiers',
'-fPIC', '-O3', '-ffast-math', '-funroll-loops',
'-fomit-frame-pointer'])
env.Append(CXXFLAGS=['-std=c++17'])
elif env["platform"] == "windows":
env.Append(CPPDEFINES=['NOMINMAX', '__WINDOWS_DS__', 'PD_INTERNAL'])
elif env["platform"] == "macos":
env.Append(CPPDEFINES=['NOMINMAX', '__MACOSX_CORE__', 'PD_INTERNAL'])
if env["platform"] == "macos":
library = env.SharedLibrary(
......
......@@ -97,7 +97,6 @@ int GdPd::init_devices(String inputDevice, String outputDevice) {
std::string inpStr(inputDevice.utf8().get_data());
std::string outStr(outputDevice.utf8().get_data());
for(int d=0; d<m_audio.getDeviceCount(); d++) {
std::string n = m_audio.getDeviceInfo(d).name;
if(n.compare(inpStr)==0) {
......@@ -202,23 +201,25 @@ void GdPd::processAudio(void *outputBuffer, void *inputBuffer,
}
}
void GdPd::openfile(godot::String baseStr, godot::String dirStr) {
bool GdPd::openfile(godot::String baseStr, godot::String dirStr) {
std::string baseS(baseStr.utf8().get_data());
std::string dirS(dirStr.utf8().get_data());
if(m_patchsMap.find(baseS)!=m_patchsMap.end()) {
print("Patch "+baseS+" already opened");
return;
return true;
}
pd::Patch p1 = m_pd.openPatch(baseS.c_str(), dirS.c_str());
if(!p1.isValid()) {
print("Could not open patch "+baseS);
return false;
}
else {
print("Opened patch "+baseS);
m_patchsMap[baseS] = p1;
}
return true;
}
void GdPd::closefile(godot::String baseStr) {
......
......@@ -76,7 +76,7 @@ public:
int init(int nbInputs, int nbOutputs, int sampleRate, int bufferSize);
int start();
void stop();
void openfile(String basename, String dirname);
bool openfile(String basename, String dirname);
void closefile(String basename);
bool has_message();
Array get_next();
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment