Commit e544a7b3 authored by Benjamin Heisch's avatar Benjamin Heisch
Browse files

Changed Name from XPlug to APAL because XPlug... sounds kind of strange and...

Changed Name from XPlug to APAL because XPlug... sounds kind of strange and APAL has a better fitting meaning.
parent 3e50f1ae
Pipeline #19424 passed with stages
in 6 minutes and 9 seconds
#ifndef I_INFO_COMPONENT_HPP
#define I_INFO_COMPONENT_HPP
#include <Types.hpp>
namespace XPlug {
namespace APAL {
/**
* @brief Componentinterface, which is used to retreive Information over the
* Plugin. Maybe in the Future it can be extended with generic information, but
......
......@@ -9,7 +9,7 @@
#include "Ports/IPortComponent.hpp"
#include <memory>
#include <string>
namespace XPlug {
namespace APAL {
/**
* @brief Template Class to Register Plugins in Sourcefiles. The Use of this is
* to instantiate a static class, which calls the Code in the Connstructor. Call
......
......@@ -2,7 +2,7 @@
#define IAUDIO_PORT_HPP
#include "IPort.hpp"
#include "Speaker.hpp"
namespace XPlug {
namespace APAL {
/**
* @brief Interfaceclass, which implements AudioChannel
*/
......
#ifndef I_MIDI_PORT_HPP
#define I_MIDI_PORT_HPP
#include "IPort.hpp"
namespace XPlug {
namespace APAL {
/**
* @brief Midi events as enum with correct Byte representation.
......
#ifndef IPORT_HPP
#define IPORT_HPP
#include <Types.hpp>
namespace XPlug {
namespace APAL {
enum class PortDirection
{
// None = 0,
......
......@@ -2,7 +2,7 @@
#define I_PORT_COMPONENT_HPP
#include "IPort.hpp"
namespace XPlug {
namespace APAL {
/**
* @brief Component for porthandling. This interface and the implementation
......
......@@ -5,7 +5,7 @@
#define SPOS_TO_SCONF(SpeakerConfigurationtype) \
static_cast<std::underlying_type<SpeakerConfiguration>::type>( \
SpeakerConfigurationtype)
namespace XPlug {
namespace APAL {
enum class SpeakerConfiguration : uint64_t;
/**
......
#ifndef LIB_LOADING_HPP
#define LIB_LOADING_HPP
#include <string>
namespace XPlug {
namespace APAL {
typedef void* library_t;
/**
......
......@@ -5,7 +5,7 @@
#include <interfaces/Ports/IMidiPort.hpp>
#include <interfaces/Ports/IPortComponent.hpp>
#include <type_traits>
namespace XPlug {
namespace APAL {
/**
* @brief Iterate through all Ports, which are type of the given template
......@@ -22,7 +22,7 @@ namespace XPlug {
template<typename T>
void
iteratePorts(IPlugin* plug,
XPlug::PortDirection dir,
APAL::PortDirection dir,
std::function<bool(T*, size_t)> iterFunc)
{
static_assert(std::is_base_of<IPort, T>::value, "T must derive from IPort.");
......@@ -49,7 +49,7 @@ template<typename T>
inline void
iteratePorts(IPlugin* plug, std::function<bool(T*, size_t)> iterFunc)
{
iteratePorts<T>(plug, XPlug::PortDirection::All, iterFunc);
iteratePorts<T>(plug, APAL::PortDirection::All, iterFunc);
}
/**
......@@ -90,7 +90,7 @@ getPortAt(IPlugin* plug, size_t index, PortDirection dir = PortDirection::All)
*/
template<typename T>
size_t
getNumberOfPorts(IPlugin* plug, XPlug::PortDirection dir)
getNumberOfPorts(IPlugin* plug, APAL::PortDirection dir)
{
size_t size = 0;
iteratePorts<T>(plug, dir, [&size](T*, size_t) {
......@@ -109,7 +109,7 @@ getNumberOfPorts(IPlugin* plug, XPlug::PortDirection dir)
*/
size_t
getAudioChannelCount(IPlugin* plug,
XPlug::PortDirection dir = PortDirection::All);
APAL::PortDirection dir = PortDirection::All);
/**
* @brief Iterates all Audiochannels in a Plugin.
......@@ -140,7 +140,7 @@ getAudioChannelFromIndex(IPlugin* plug, size_t index);
*/
void
iteratePortsFlat(IPlugin* plug,
std::function<bool(XPlug::IPort*, size_t)> iterFunc);
std::function<bool(APAL::IPort*, size_t)> iterFunc);
}
#endif //! PORT_HANDLING_HPP
\ No newline at end of file
#ifndef STRING_TOOLS_HPP
#define STRING_TOOLS_HPP
#include <string>
namespace XPlug {
namespace APAL {
/**
* @brief Replaces all occurences of an itemToReplace in the given strToChange
* @param strToChange string to replaces stuff in.
......
# Add all includefiles together and set them in Parentscope
SET(XPLUG_SOURCE_FILES ${XPLUG_SOURCE_FILES}
SET(APAL_SOURCE_FILES ${APAL_SOURCE_FILES}
${CMAKE_CURRENT_LIST_DIR}/GlobalData.cpp
${CMAKE_CURRENT_LIST_DIR}/tools/LibLoading.cpp
${CMAKE_CURRENT_LIST_DIR}/tools/PortHandling.cpp
......
#include <GlobalData.hpp>
#include <interfaces/IPlugin.hpp>
namespace XPlug {
namespace APAL {
GlobalDataType&
GlobalData()
{
......@@ -9,15 +9,15 @@ GlobalData()
}
VERSION
XPlugGetVersion()
APALGetVersion()
{
// struct my_struct s2 = { "string literal" };
static const struct VERSION XPlug_VERSION = { XPlug_VERSION_MAJOR,
XPlug_VERSION_MINOR,
XPlug_VERSION_PATCH,
XPlug_VERSION_TWEAK,
static const struct VERSION APAL_VERSION = { APAL_VERSION_MAJOR,
APAL_VERSION_MINOR,
APAL_VERSION_PATCH,
APAL_VERSION_TWEAK,
"test" };
return XPlug_VERSION;
return APAL_VERSION;
}
size_t
......@@ -52,12 +52,12 @@ GlobalDataType::getPlugin(std::string name)
}
VERSION
XPlugGetVersion()
APALGetVersion()
{
return XPlug_VERSION;
return APAL_VERSION;
}
XPlug::GlobalDataType&
XPlugGlobalData()
APAL::GlobalDataType&
APALGlobalData()
{
return XPlug::GlobalData();
return APAL::GlobalData();
}
\ No newline at end of file
#include "base/FeatureComponents.hpp"
#include "tools/PortHandling.hpp"
using namespace XPlug;
XPlug::DynamicFeatureComponent::DynamicFeatureComponent(
using namespace APAL;
APAL::DynamicFeatureComponent::DynamicFeatureComponent(
std::vector<Feature> features)
: supportedFeatures(std::move(features))
{}
bool
XPlug::DynamicFeatureComponent::supportsFeature(Feature feature)
APAL::DynamicFeatureComponent::supportsFeature(Feature feature)
{
return std::find(supportedFeatures.begin(),
supportedFeatures.end(),
feature) != supportedFeatures.end();
}
void
XPlug::DynamicFeatureComponent::formatNotSupportedFeature(Feature feature,
APAL::DynamicFeatureComponent::formatNotSupportedFeature(Feature feature,
std::string)
{
throw UseOfNonSupportedFeature(feature);
}
void
XPlug::DynamicFeatureComponent::addSupportedFeature(Feature feat)
APAL::DynamicFeatureComponent::addSupportedFeature(Feature feat)
{
this->supportedFeatures.push_back(feat);
}
XPlug::AutomaticFeatureComponent::AutomaticFeatureComponent(
APAL::AutomaticFeatureComponent::AutomaticFeatureComponent(
IPortComponent* pComp,
std::vector<Feature> features)
: DynamicFeatureComponent::DynamicFeatureComponent(features)
......@@ -34,7 +34,7 @@ XPlug::AutomaticFeatureComponent::AutomaticFeatureComponent(
}
void
XPlug::AutomaticFeatureComponent::detectFeatures(IPortComponent* pComp)
APAL::AutomaticFeatureComponent::detectFeatures(IPortComponent* pComp)
{
// bool suppAudioPort = false;
bool suppMidiIn = false;
......
#include <base/InfoComponents.hpp>
using namespace XPlug;
XPlug::StaticInfoComponent::StaticInfoComponent()
using namespace APAL;
APAL::StaticInfoComponent::StaticInfoComponent()
{
this->pluginName = "";
this->pluginUri = "";
......@@ -10,7 +10,7 @@ XPlug::StaticInfoComponent::StaticInfoComponent()
this->creatorURL = "";
this->id = 0;
}
XPlug::StaticInfoComponent::StaticInfoComponent(std::string _pluginName,
APAL::StaticInfoComponent::StaticInfoComponent(std::string _pluginName,
std::string _pluginUri,
std::string _pluginDescription,
std::string _pluginCopyright,
......@@ -27,38 +27,38 @@ XPlug::StaticInfoComponent::StaticInfoComponent(std::string _pluginName,
this->id = _id;
}
std::string_view
XPlug::StaticInfoComponent::getPluginName()
APAL::StaticInfoComponent::getPluginName()
{
return this->pluginName;
}
std::string_view
XPlug::StaticInfoComponent::getPluginURI()
APAL::StaticInfoComponent::getPluginURI()
{
return this->pluginUri;
}
std::string_view
XPlug::StaticInfoComponent::getPluginDescription()
APAL::StaticInfoComponent::getPluginDescription()
{
return this->pluginDescription;
}
std::string_view
XPlug::StaticInfoComponent::getPluginCopyright()
APAL::StaticInfoComponent::getPluginCopyright()
{
return this->pluginCopyright;
}
std::string_view
XPlug::StaticInfoComponent::getCreatorName()
APAL::StaticInfoComponent::getCreatorName()
{
return this->creatorName;
}
std::string_view
XPlug::StaticInfoComponent::getCreatorURL()
APAL::StaticInfoComponent::getCreatorURL()
{
return this->creatorURL;
}
int64_t
XPlug::StaticInfoComponent::getID()
APAL::StaticInfoComponent::getID()
{
return this->id;
}
#include <base/PluginBases.hpp>
#include <memory>
#include <random>
using namespace XPlug;
using namespace APAL;
XPlug::LazyPlugin::LazyPlugin()
APAL::LazyPlugin::LazyPlugin()
{
std::default_random_engine engine;
this->infoComponent = std::make_unique<StaticInfoComponent>(
......@@ -20,7 +20,7 @@ XPlug::LazyPlugin::LazyPlugin()
std::make_unique<AutomaticFeatureComponent>(this->portComponent.get());
}
XPlug::LazyPlugin::LazyPlugin(std::vector<std::unique_ptr<IPort>> ports)
APAL::LazyPlugin::LazyPlugin(std::vector<std::unique_ptr<IPort>> ports)
: LazyPlugin()
{
for (size_t i = 0; i < ports.size(); i++) {
......@@ -30,17 +30,17 @@ XPlug::LazyPlugin::LazyPlugin(std::vector<std::unique_ptr<IPort>> ports)
}
void
XPlug::LazyPlugin::init()
APAL::LazyPlugin::init()
{}
void
XPlug::LazyPlugin::deinit()
APAL::LazyPlugin::deinit()
{}
void
XPlug::LazyPlugin::activate()
APAL::LazyPlugin::activate()
{}
void
XPlug::LazyPlugin::deactivate()
APAL::LazyPlugin::deactivate()
{}
#include "tools/LibLoading.hpp"
namespace XPlug {
namespace APAL {
std::string
GetErrorStr()
{
......@@ -10,7 +10,7 @@ GetErrorStr()
}
#ifdef _WIN32
#include <windows.h>
namespace XPlug {
namespace APAL {
char* lastError = nullptr;
char* lastErrorReturnCopy = nullptr;
library_t
......@@ -60,7 +60,7 @@ UnloadLib(library_t lib)
}
#else
#include <dlfcn.h>
namespace XPlug {
namespace APAL {
library_t
LoadLib(const char* libName)
{
......
#include <tools/PortHandling.hpp>
using namespace XPlug;
using namespace APAL;
size_t
XPlug::getAudioChannelCount(IPlugin* plug, XPlug::PortDirection dir)
APAL::getAudioChannelCount(IPlugin* plug, APAL::PortDirection dir)
{
size_t size = 0;
iteratePorts<IAudioPort>(plug, dir, [&size](IAudioPort* p, size_t) {
......@@ -12,7 +12,7 @@ XPlug::getAudioChannelCount(IPlugin* plug, XPlug::PortDirection dir)
}
void
XPlug::iterateAudioChannels(
APAL::iterateAudioChannels(
IPlugin* plug,
std::function<bool(IAudioPort*, IAudioChannel*, size_t)> iterFunc)
{
......@@ -27,9 +27,9 @@ XPlug::iterateAudioChannels(
});
}
IAudioChannel*
XPlug::getAudioChannelFromIndex(IPlugin* plug, size_t index)
APAL::getAudioChannelFromIndex(IPlugin* plug, size_t index)
{
XPlug::IAudioChannel* channel = nullptr;
APAL::IAudioChannel* channel = nullptr;
iterateAudioChannels(
plug,
[&channel, index](IAudioPort*, IAudioChannel* c, size_t channelIndex) {
......@@ -42,9 +42,9 @@ XPlug::getAudioChannelFromIndex(IPlugin* plug, size_t index)
return channel;
}
void
XPlug::iteratePortsFlat(
APAL::iteratePortsFlat(
IPlugin* plug,
std::function<bool(XPlug::IPort* p, size_t ind)> iterFunc)
std::function<bool(APAL::IPort* p, size_t ind)> iterFunc)
{
size_t index = 0;
for (size_t i = 0; i < plug->getPortComponent()->size(); i++) {
......
#include <tools/StringTools.hpp>
std::string
XPlug::replaceInString(std::string strToChange,
APAL::replaceInString(std::string strToChange,
const std::string itemToReplace,
const std::string substitute)
{
......@@ -14,7 +14,7 @@ XPlug::replaceInString(std::string strToChange,
*Get File Name from a Path with or without extension
*/
std::string
XPlug::getFileName(std::string filePath, bool withExtension, char seperator)
APAL::getFileName(std::string filePath, bool withExtension, char seperator)
{
// Get last dot position
std::size_t dotPos = filePath.rfind('.');
......
......@@ -4,5 +4,5 @@ file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/regression_data.hpp CONTENT
add_executable(regression_tests ${CMAKE_CURRENT_BINARY_DIR}/catch_main.cpp)
target_include_directories(regression_tests PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/../test_utils ../test_utils ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(regression_tests PUBLIC XPlug)
add_test(NAME xplug_regression_tests COMMAND regression_tests)
\ No newline at end of file
target_link_libraries(regression_tests PUBLIC APAL)
add_test(NAME APAL_regression_tests COMMAND regression_tests)
\ No newline at end of file
......@@ -5,7 +5,7 @@ add_executable(XValidate
"${PROJECT_SOURCE_DIR}/deps/clipp.hpp"
"IFormatTestSuite.hpp" )
target_link_libraries(XValidate PUBLIC XPlug)
target_link_libraries(XValidate PUBLIC APAL)
target_include_directories(XValidate PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/../test_utils ${PROJECT_SOURCE_DIR}/deps/ )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment