Skip to content

Commit

Permalink
Add support for Engine 4.0.0/4.0.1 (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-smidge authored Sep 29, 2024
1 parent 62032d0 commit 3fb72d1
Show file tree
Hide file tree
Showing 12 changed files with 984 additions and 10 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(libdjinterop
VERSION 0.22.0
VERSION 0.22.1
DESCRIPTION "C++ library providing access to DJ record libraries")
set(PROJECT_HOMEPAGE_URL "https://github.com/xsco/libdjinterop")

Expand Down Expand Up @@ -60,6 +60,8 @@ add_library(
src/djinterop/engine/schema/schema_2_20_2.cpp
src/djinterop/engine/schema/schema_2_20_3.cpp
src/djinterop/engine/schema/schema_2_21_0.cpp
src/djinterop/engine/schema/schema_2_21_1.cpp
src/djinterop/engine/schema/schema_2_21_2.cpp
src/djinterop/engine/schema/schema.cpp
src/djinterop/engine/v1/engine_crate_impl.cpp
src/djinterop/engine/v1/engine_database_impl.cpp
Expand Down
39 changes: 30 additions & 9 deletions include/djinterop/engine/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,42 +137,63 @@ constexpr const engine_version os_3_0_0{
semantic_version{3, 0, 0}, engine_database_type::os,
"Engine DJ OS 3.0.0 to 3.0.1", semantic_version{2, 20, 3}};

/// Engine DJ desktop 3.1.0 to 3.2.0
/// Engine DJ desktop 3.1.0 to 3.4.0
constexpr const engine_version desktop_3_1_0{
semantic_version{3, 1, 0}, engine_database_type::desktop,
"Engine DJ Desktop 3.1.0 to 3.4.0", semantic_version{2, 21, 0}};

/// Engine DJ OS 3.1.0 to 3.2.0
constexpr const engine_version os_3_1_0{
semantic_version{3, 1, 0}, engine_database_type::desktop,
semantic_version{3, 1, 0}, engine_database_type::os,
"Engine DJ OS 3.1.0 to 3.4.0", semantic_version{2, 21, 0}};

/// Engine DJ desktop 4.0.0
constexpr const engine_version desktop_4_0_0{
semantic_version{4, 0, 0}, engine_database_type::desktop,
"Engine DJ Desktop 4.0.0", semantic_version{2, 21, 1}};

/// Engine DJ OS 4.0.0
constexpr const engine_version os_4_0_0{
semantic_version{4, 0, 0}, engine_database_type::os,
"Engine DJ OS 4.0.0", semantic_version{2, 21, 1}};

/// Engine DJ desktop 4.0.1
constexpr const engine_version desktop_4_0_1{
semantic_version{4, 0, 1}, engine_database_type::desktop,
"Engine DJ Desktop 4.0.1", semantic_version{2, 21, 2}};

/// Engine DJ OS 4.0.1
constexpr const engine_version os_4_0_1{
semantic_version{4, 0, 1}, engine_database_type::os,
"Engine DJ OS 4.0.1", semantic_version{2, 21, 2}};

/// Set of available versions.
constexpr const std::array<engine_version, 21> all_versions{
constexpr const std::array<engine_version, 25> all_versions{
os_1_0_0, os_1_0_3, desktop_1_1_1, os_1_2_0, os_1_2_2,
desktop_1_2_2, os_1_3_1, os_1_4_0, os_1_5_1, desktop_1_5_1,
os_1_6_0, desktop_2_0_0, os_2_0_0, desktop_2_2_0, os_2_2_0,
desktop_2_4_0, os_2_4_0, desktop_3_0_0, os_3_0_0, desktop_3_1_0,
os_3_1_0};
os_3_1_0, desktop_4_0_0, os_4_0_0, desktop_4_0_1, os_4_0_1};

/// Set of available V1 versions.
constexpr const std::array<engine_version, 11> all_v1_versions{
os_1_0_0, os_1_0_3, desktop_1_1_1, os_1_2_0, os_1_2_2, desktop_1_2_2,
os_1_3_1, os_1_4_0, os_1_5_1, desktop_1_5_1, os_1_6_0};

/// Set of available V2 versions.
constexpr const std::array<engine_version, 10> all_v2_versions{
constexpr const std::array<engine_version, 14> all_v2_versions{
desktop_2_0_0, os_2_0_0, desktop_2_2_0, os_2_2_0, desktop_2_4_0,
os_2_4_0, desktop_3_0_0, os_3_0_0, desktop_3_1_0, os_3_1_0};
os_2_4_0, desktop_3_0_0, os_3_0_0, desktop_3_1_0, os_3_1_0,
desktop_4_0_0, os_4_0_0, desktop_4_0_1, os_4_0_1};

/// The most recent version supported by the library.
constexpr engine_version latest = os_3_1_0;
constexpr engine_version latest = os_4_0_1;

/// The most recent V2 version supported by the library.
constexpr engine_version latest_v2 = os_3_1_0;
constexpr engine_version latest_v2 = os_4_0_1;

/// The most recent OS-type version supported by the library.
constexpr engine_version latest_os = os_3_1_0;
constexpr engine_version latest_os = os_4_0_1;

namespace standard_pad_colors
{
Expand Down
12 changes: 12 additions & 0 deletions src/djinterop/engine/schema/schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include "schema_2_20_2.hpp"
#include "schema_2_20_3.hpp"
#include "schema_2_21_0.hpp"
#include "schema_2_21_1.hpp"
#include "schema_2_21_2.hpp"

namespace djinterop::engine::schema
{
Expand Down Expand Up @@ -80,6 +82,16 @@ std::unique_ptr<schema_creator_validator> make_schema_creator_validator(
return std::make_unique<schema_2_20_3>();
else if (version == desktop_3_1_0)
return std::make_unique<schema_2_21_0>();
else if (version == os_3_1_0)
return std::make_unique<schema_2_21_0>();
else if (version == desktop_4_0_0)
return std::make_unique<schema_2_21_1>();
else if (version == os_4_0_0)
return std::make_unique<schema_2_21_1>();
else if (version == desktop_4_0_1)
return std::make_unique<schema_2_21_2>();
else if (version == os_4_0_1)
return std::make_unique<schema_2_21_2>();

throw unsupported_engine_database{version.schema_version};
}
Expand Down
Loading

0 comments on commit 3fb72d1

Please sign in to comment.