Skip to content

Commit

Permalink
building again
Browse files Browse the repository at this point in the history
  • Loading branch information
fps committed Feb 21, 2015
1 parent 636fb23 commit 9523be9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Expand Up @@ -32,11 +32,13 @@ configure_file(ladspamm/plugin.h.in ladspamm-${PROJECT_VERSION}/plugin.h)
configure_file(ladspamm/plugin_instance.h.in ladspamm-${PROJECT_VERSION}/plugin_instance.h)
configure_file(ladspamm/world.h.in ladspamm-${PROJECT_VERSION}/world.h)

configure_file(ladspamm-test.cc.in ladspamm-${PROJECT_VERSION}-test.cc)

include_directories(${PROJECT_BINARY_DIR})

add_definitions(-DPROJECT_VERSION=\"${PROJECT_VERSION}\")

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wconversion -Wall -pthread -fmax-errors=1")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -Wall -pthread -fmax-errors=1")

if(CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -pg")
Expand Down Expand Up @@ -76,6 +78,12 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(Boost_USE_STATIC_LIBS)
find_package(Boost COMPONENTS filesystem system REQUIRED)

#
# TARGETS
#
add_executable(ladspamm-${PROJECT_VERSION}-test ladspamm-${PROJECT_VERSION}-test.cc)
target_link_libraries(ladspamm-${PROJECT_VERSION}-test ${Boost_LIBRARIES} dl)

#
# INSTALLATION
#
Expand Down
13 changes: 8 additions & 5 deletions ladspamm-test.cc → ladspamm-test.cc.in
@@ -1,13 +1,16 @@
#include <ladspamm-0/world.h>
#include <ladspamm-0/plugin_instance.h>
#include <ladspamm-@PROJECT_VERSION@/world.h>
#include <ladspamm-@PROJECT_VERSION@/plugin_instance.h>

#include <iostream>
#include <cstdlib>
#include <vector>

void analyseplugin(ladspamm::plugin_ptr plugin)
using namespace ladspamm@PROJECT_VERSION@;

void analyseplugin(plugin_ptr plugin)
{
ladspamm::plugin_instance_ptr instance(new ladspamm::plugin_instance(plugin, 48000));
using namespace ladspamm@PROJECT_VERSION@;
plugin_instance_ptr instance(new plugin_instance(plugin, 48000));

std::cout << " Name: " << instance->plugin()->name() << std::endl;
std::cout << " Label: " << instance->plugin()->label() << std::endl;
Expand Down Expand Up @@ -80,7 +83,7 @@ int main()
{
try
{
ladspamm::world world;
world world;

for (unsigned int lib_index = 0; lib_index < world.libraries.size(); ++lib_index)
{
Expand Down
12 changes: 6 additions & 6 deletions ladspamm/plugin.h.in
Expand Up @@ -239,35 +239,35 @@ namespace ladspamm@PROJECT_VERSION@
{
if (port_is_logarithmic(index))
{
return exp(log(port_lower_bound(index)) * 0.5 + log(port_upper_bound(index)) * 0.5);
return expf(logf(port_lower_bound(index)) * 0.5f + logf(port_upper_bound(index)) * 0.5f);
}
else
{
return port_lower_bound(index) * 0.5 + port_upper_bound(index) * 0.5;
return port_lower_bound(index) * 0.5f + port_upper_bound(index) * 0.5f;
}
}

if (port_default_is_low(index))
{
if (port_is_logarithmic(index))
{
return exp(log(port_lower_bound(index)) * 0.75 + log(port_upper_bound(index)) * 0.25);
return expf(logf(port_lower_bound(index)) * 0.75f + logf(port_upper_bound(index)) * 0.25f);
}
else
{
return port_lower_bound(index) * 0.75 + port_upper_bound(index) * 0.25;
return port_lower_bound(index) * 0.75f + port_upper_bound(index) * 0.25f;
}
}

if (port_default_is_high(index))
{
if (port_is_logarithmic(index))
{
return exp(log(port_lower_bound(index)) * 0.25 + log(port_upper_bound(index)) * 0.75);
return expf(logf(port_lower_bound(index)) * 0.25f + logf(port_upper_bound(index)) * 0.75f);
}
else
{
return port_lower_bound(index) * 0.25 + port_upper_bound(index) * 0.75;
return port_lower_bound(index) * 0.25f + port_upper_bound(index) * 0.75f;
}
}

Expand Down
8 changes: 4 additions & 4 deletions ladspamm/plugin_instance.h.in
Expand Up @@ -102,7 +102,7 @@ namespace ladspamm@PROJECT_VERSION@

if (true == the_plugin->port_is_scaled_by_samplerate(index))
{
return samplerate * the_plugin->port_lower_bound(index);
return (float)samplerate * the_plugin->port_lower_bound(index);
}

return the_plugin->port_lower_bound(index);
Expand All @@ -120,7 +120,7 @@ namespace ladspamm@PROJECT_VERSION@

if (true == the_plugin->port_is_scaled_by_samplerate(index))
{
return samplerate * the_plugin->port_upper_bound(index);
return (float)samplerate * the_plugin->port_upper_bound(index);
}

return the_plugin->port_upper_bound(index);
Expand Down Expand Up @@ -162,12 +162,12 @@ namespace ladspamm@PROJECT_VERSION@
{
if (the_plugin->port_is_integer(index))
{
return round(the_plugin->port_default(index));
return roundf(the_plugin->port_default(index));
}

if (the_plugin->port_default_is_scaled_by_samplerate(index))
{
return samplerate * the_plugin->port_default(index);
return (float)samplerate * the_plugin->port_default(index);
}

return the_plugin->port_default(index);
Expand Down
4 changes: 2 additions & 2 deletions ladspamm/world.h.in
Expand Up @@ -16,15 +16,15 @@ namespace ladspamm@PROJECT_VERSION@
/**
* @brief The libraries found in the system.
*/
const std::vector<ladspamm::library_ptr> libraries;
const std::vector<library_ptr> libraries;

/**
* @brief This constructor scans the system (parsing LADSPA_PATH or
* using sensible defaults).
*/
world(std::string path = get_path_from_environment())
:
libraries(ladspamm::world_scan(path))
libraries(world_scan(path))
{

}
Expand Down

0 comments on commit 9523be9

Please sign in to comment.