Skip to content

Commit

Permalink
Merge pull request #30 from AlloSphere-Research-Group/time_sync_presets
Browse files Browse the repository at this point in the history
Time sync presets
  • Loading branch information
mantaraya36 authored Dec 27, 2019
2 parents 6a548c3 + 713a835 commit 5be6b83
Show file tree
Hide file tree
Showing 129 changed files with 4,812 additions and 5,056 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ set(headers
include/al/app/al_App.hpp
include/al/app/al_AudioApp.hpp
include/al/app/al_DistributedApp.hpp
include/al/app/al_NodeConfiguration.hpp
include/al/app/al_FPS.hpp/
include/al/app/al_WindowApp.hpp
# include/al/app/al_WindowApp.hpp

include/al/app/al_AudioDomain.hpp
include/al/app/al_ComputationDomain.hpp
Expand Down Expand Up @@ -108,7 +109,7 @@ set(headers
include/al/scene/al_SequencerMIDI.hpp
include/al/scene/al_SynthSequencer.hpp
include/al/sound/al_Ambisonics.hpp
include/al/sound/al_AudioScene.hpp
# include/al/sound/al_AudioScene.hpp
include/al/sound/al_Biquad.hpp
include/al/sound/al_Crossover.hpp
include/al/sound/al_Dbap.hpp
Expand All @@ -121,6 +122,8 @@ set(headers
include/al/sound/al_SoundFile.hpp
include/al/spatial/al_HashSpace.hpp
include/al/spatial/al_Pose.hpp
include/al/sphere/al_SphereUtils.hpp
include/al/sphere/al_PerProjection.hpp
include/al/system/al_PeriodicThread.hpp
include/al/system/al_Printing.hpp
include/al/system/al_Thread.hpp
Expand All @@ -144,6 +147,7 @@ set(headers
include/al/ui/al_Gnomon.hpp
include/al/ui/al_Pickable.hpp
include/al/ui/al_SequenceRecorder.hpp
include/al/ui/al_SequenceServer.hpp
include/al/ui/al_HtmlInterfaceServer.hpp
include/al/ui/al_PickableManager.hpp
)
Expand All @@ -152,7 +156,7 @@ set(sources
src/app/al_App.cpp
src/app/al_AudioApp.cpp
src/app/al_FPS.cpp
src/app/al_WindowApp.cpp
# src/app/al_WindowApp.cpp
src/app/al_DistributedApp.cpp

src/app/al_AudioDomain.cpp
Expand Down Expand Up @@ -208,16 +212,18 @@ set(sources
src/scene/al_PolySynth.cpp
src/scene/al_SynthSequencer.cpp
src/sound/al_Ambisonics.cpp
src/sound/al_AudioScene.cpp
# src/sound/al_AudioScene.cpp
src/sound/al_Biquad.cpp
src/sound/al_Dbap.cpp
src/sound/al_Lbap.cpp
src/sound/al_Vbap.cpp
src/sound/al_Spatializer.cpp
src/sound/al_Speaker.cpp
src/sound/al_StereoPanner.cpp
src/sound/al_SoundFile.cpp
src/spatial/al_HashSpace.cpp
src/spatial/al_Pose.cpp
src/sphere/al_AlloSphereSpeakerLayout.cpp
src/sphere/al_SphereUtils.cpp
src/sphere/al_PerProjection.cpp
src/system/al_PeriodicThread.cpp
Expand All @@ -235,6 +241,7 @@ set(sources
src/ui/al_FileSelector.cpp
src/ui/al_ParameterServer.cpp
src/ui/al_SequenceRecorder.cpp
src/ui/al_SequenceServer.cpp
src/ui/al_HtmlInterfaceServer.cpp
src/ui/al_PresetHandler.cpp
src/ui/al_PresetServer.cpp
Expand All @@ -253,6 +260,7 @@ set_target_properties(al PROPERTIES

if (AL_WINDOWS)
target_compile_options(al PRIVATE "")
target_compile_definitions(al PUBLIC NOMINMAX)
else ()
target_compile_options(al PRIVATE "-Wall")
endif (AL_WINDOWS)
Expand Down
48 changes: 0 additions & 48 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,8 @@ MACRO(SUBDIRLIST result curdir)
SET(${result} ${dirlist})
ENDMACRO()

# Ignore examples that wont work in CI
set(EXAMPLES_TO_IGNORE
one-line-of-c/main.cpp
sound/multiFilePlayer.cpp
sound/sound_file.cpp
sound/ambiPlayer.cpp
graphics/textureImage.cpp
graphics/asset.cpp
)

#if(AL_WINDOWS EQUAL 1 AND APPVEYOR_BUILD EQUAL 1)
# Don't build files with dynamic dependencies on Appveyor CI build
#set(EXAMPLES_TO_IGNORE
# examples/sound/multiFilePlayer.cpp
# examples/sound/sound_file.cpp
# examples/sound/ambiPlayer.cpp
# examples/graphics/textureImage.cpp
# examples/graphics/font.cpp
# examples/graphics/asset.cpp
# examples/user_flags/main.cpp
# examples/openvr/openvr.cpp
# examples/openvr/openvr-app.cpp
# examples/one-line-of-c/main.cpp
#)
#endif()

macro(BuildExample example_src dir)
get_filename_component(EXAMPLE_NAME ${example_src} NAME_WE) # Get name w/o extension
#get_filename_component(EXAMPLE_DIRECTORY ${example_src} DIRECTORY) # Get name w/o extension
set(example_directory ${CMAKE_CURRENT_LIST_DIR})

if ("${dir}" STREQUAL ".")
Expand All @@ -57,15 +30,8 @@ macro(BuildExample example_src dir)

RUNTIME_OUTPUT_DIRECTORY_DEBUG ${example_directory}/${dir}/bin
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${example_directory}/${dir}/bin
#RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXAMPLE_DIRECTORY}/bin
#RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXAMPLE_DIRECTORY}/bin
)

# message("Adding target for example: ${example_src}")
#include_directories(${ALLOCORE_INCLUDE_DIR} ${GAMMA_INCLUDE_DIRS}})
# message("Gamma : ${GAMMA_INCLUDE_DIRs}")
#add_dependencies(${EXAMPLE_TARGET} al Gamma)
#target_link_libraries(${EXAMPLE_TARGET} al Gamma ${OPENGL_gl_LIBRARY} ${ADDITIONAL_LIBRARIES} ${EXTERNAL_LIBRARIES})
target_link_libraries(${EXAMPLE_TARGET} al)

#get_target_property(DLLS_TO_COPY al AL_DLL_LIBRARIES)
Expand All @@ -79,21 +45,7 @@ foreach(dir ${EXAMPLE_DIRS})
file(GLOB EXAMPLE_FILES RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${dir}/*.cpp)

foreach(example_src ${EXAMPLE_FILES})
list (FIND EXAMPLES_TO_IGNORE "${example_src}" _index)
if (${_index} EQUAL -1)
BuildExample("${example_src}" "${dir}")
else()
message("Ignoring example ${EXAMPLE_NAME}")
endif (${_index} EQUAL -1)
endforeach(example_src)

endforeach(dir)

#foreach(example_src ${EXTENSIONS_EXAMPLES})
## message("Building extension example: ${example_src}")
# get_filename_component(EXAMPLE_DIR "${example_src}" DIRECTORY)
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${EXAMPLE_DIR}/bin")
# BuildExample("${example_src}" "extensions" )
#endforeach()


20 changes: 11 additions & 9 deletions examples/distributed/omnirendering.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

#include <iostream>

#include "al/app/al_DistributedApp.hpp"
#include "al/app/al_OmniRendererDomain.hpp"
//#include "al/app/al_OmniRendererDomain.hpp"

using namespace std;
using namespace al;

struct MyOmniRendererApp : DistributedApp {
VAOMesh mesh;

// Nav mNav;
// Viewpoint mView {mNav.transformed()};
// NavInputControl mNavControl {mNav};
ParameterPose currentPose{"currentPose"};

bool DO_BLENDING = false;
float alpha = 0.9f;
Expand All @@ -20,12 +18,16 @@ struct MyOmniRendererApp : DistributedApp {
// append(mNavControl);
addIcosahedron(mesh);
mesh.update();
parameterServer() << currentPose;
}

// void onAnimate(double dt) override {
// mNav.step();
//// pose(mView.pose()); // should not be in onDraw
// }
void onAnimate(double dt) override {
if (isPrimary()) {
currentPose = pose();
} else {
pose().set(currentPose.get());
}
}

void onDraw(Graphics& g) override {
g.clear(0, 0, 1);
Expand Down
19 changes: 10 additions & 9 deletions examples/graphics/textureImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ smooth. This is because interpolation is done on the GPU.
Karl Yerkes and Matt Wright (2011/10/10)
*/

#include "al/core.hpp"
#include "module/img/loadImage.hpp"

#include <cassert>
#include <cstdint>
#include <iostream>
#include <vector>

#include "al/app/al_App.hpp"
#include "al/graphics/al_Image.hpp"

using namespace al;
using namespace std;

Expand All @@ -27,15 +27,16 @@ class MyApp : public App {
//
const char* filename = "data/hubble.jpg";

auto imageData = imgModule::loadImage(filename);
if (imageData.data.size() == 0) {
auto imageData = Image(filename);

if (imageData.array().size() == 0) {
cout << "failed to load image" << endl;
}
cout << "loaded image size: " << imageData.width << ", " << imageData.height
<< endl;
cout << "loaded image size: " << imageData.width() << ", "
<< imageData.height() << endl;

texture.create2D(imageData.width, imageData.height);
texture.submit(imageData.data.data(), GL_RGBA, GL_UNSIGNED_BYTE);
texture.create2D(imageData.width(), imageData.height());
texture.submit(imageData.array().data(), GL_RGBA, GL_UNSIGNED_BYTE);

texture.filter(Texture::LINEAR);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/imgui/imgui_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct my_app : public App {
// so need to flag active/inactive here
navControl().active(!isImguiUsingInput());

// call beginIMGUI before everything, so info about gui status can be used
// call imguiBeginFrame before everything, so info about gui status can be used
// to update app state
imguiBeginFrame();

Expand Down
15 changes: 8 additions & 7 deletions examples/io/midiIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Lance Putnam, 12/2012
*/

#include <stdio.h>

#include "al/io/al_MIDI.hpp"
using namespace al;

Expand Down Expand Up @@ -69,11 +70,11 @@ void midiCallback(double deltaTime, std::vector<unsigned char> *msg,
}

int main() {
MIDIIn midiIn;
RtMidiIn RtMidiIn;

// Check available ports vs. specified
unsigned portToOpen = 0;
unsigned numPorts = midiIn.getPortCount();
unsigned numPorts = RtMidiIn.getPortCount();

if (portToOpen >= numPorts) {
printf("Invalid port specifier!\n");
Expand All @@ -82,23 +83,23 @@ int main() {
try {
// Print out names of available input ports
for (unsigned i = 0; i < numPorts; ++i) {
printf("Port %u: %s\n", i, midiIn.getPortName(i).c_str());
printf("Port %u: %s\n", i, RtMidiIn.getPortName(i).c_str());
}

// Open the port specified above
midiIn.openPort(portToOpen);
} catch (MIDIError &error) {
RtMidiIn.openPort(portToOpen);
} catch (RtMidiError &error) {
error.printMessage();
return 1;
}

// Set our callback function. This should be done immediately after
// opening the port to avoid having incoming messages written to the
// queue instead of sent to the callback function.
midiIn.setCallback(&midiCallback);
RtMidiIn.setCallback(&midiCallback);

// Don't ignore sysex, timing, or active sensing messages.
midiIn.ignoreTypes(false, false, false);
RtMidiIn.ignoreTypes(false, false, false);

printf("\nReading MIDI input ... press <enter> to quit.\n");
getchar();
Expand Down
15 changes: 10 additions & 5 deletions examples/io/midiInApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ Lance Putnam, 9/2013
*/

#include <stdio.h>

#include "al/app/al_App.hpp"
#include "al/io/al_MIDI.hpp"
using namespace al;

class MyApp : public App, public MIDIMessageHandler {
public:
MIDIIn midiIn;
RtMidiIn midiIn;

void onCreate() {
void onInit() {
// Check for connected MIDI devices
if (midiIn.getPortCount() > 0) {
// Bind ourself to the MIDIIn
// Bind ourself to the RtMidiIn object, to have the onMidiMessage()
// callback called whenever a MIDI message is received
MIDIMessageHandler::bindTo(midiIn);

// Open the last device found
int port = midiIn.getPortCount() - 1;
unsigned int port = midiIn.getPortCount() - 1;
midiIn.openPort(port);
printf("Opened port to %s\n", midiIn.getPortName(port).c_str());
} else {
Expand Down Expand Up @@ -83,4 +85,7 @@ class MyApp : public App, public MIDIMessageHandler {
}
};

int main() { MyApp().start(); }
int main() {
MyApp().start();
return 0;
}
20 changes: 20 additions & 0 deletions examples/io/windowResizeCb.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>

#include "al/app/al_App.hpp"
#include "al/graphics/al_Shapes.hpp"

using namespace al;

struct MyApp : App {
void onDraw(Graphics& g) override { g.clear(0, 0, 0); }

void onResize(int w, int h) override {
std::cout << "Resized to: " << w << "," << h << std::endl;
}
};

int main() {
MyApp app;
app.dimensions(600, 400);
app.start();
}
2 changes: 1 addition & 1 deletion examples/scene/distributed_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct MyApp : public DistributedApp {
return true;
}

DistributedScene scene{PolySynth::TIME_MASTER_CPU};
DistributedScene scene{TimeMasterMode::TIME_MASTER_CPU};
};

int main() {
Expand Down
Loading

0 comments on commit 5be6b83

Please sign in to comment.