Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: init
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
- name: configure
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF -DJUKE_USE_LIBXMP=OFF -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
- name: build debug
run: cmake --build build --config=Debug -- -v
- name: build release
Expand All @@ -24,7 +24,7 @@ jobs:
- name: init
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build clang-19 mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
- name: configure
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF -DJUKE_USE_LIBXMP=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
- name: build debug
run: cmake --build build --config=Debug -- -v
- name: build release
Expand All @@ -40,7 +40,7 @@ jobs:
- name: init
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
- name: configure
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF -DJUKE_USE_LIBXMP=OFF -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
- name: build debug
run: cmake --build build --config=Debug -- -v
- name: build release
Expand All @@ -56,7 +56,7 @@ jobs:
- name: init
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build clang-19 mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
- name: configure
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF -DJUKE_USE_LIBXMP=OFF -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
- name: build debug
run: cmake --build build --config=Debug -- -v
- name: build release
Expand All @@ -70,7 +70,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: configure
run: cmake -S . --preset=vs22 -B build
run: cmake -S . --preset=vs22 -B build -DJUKE_USE_LIBXMP=OFF
- name: build debug
run: cmake --build build --config=Debug --parallel
- name: build release
Expand All @@ -83,10 +83,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: init
run: choco install ninja
- name: configure
run: cmake -S . --preset=ninja-clang -B build
run: cmake -S . --preset=ninja-clang -B build -DJUKE_USE_LIBXMP=OFF
- name: build debug
run: cmake --build build --config=Debug -- -v
- name: build release
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(jukebox
VERSION 1.0
)

option(JUKE_USE_LIBXMP "Use libxmp backend" ON)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
20 changes: 19 additions & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,45 @@ project(jukebox-deps)
include(FetchContent)
set(BUILD_SHARED_LIBS OFF)

set(fetch_list gvdi capo djson)

# gvdi
FetchContent_Declare(gvdi
GIT_REPOSITORY https://github.com/karnkaul/gvdi
GIT_TAG v0.2.5
GIT_SHALLOW TRUE
)

# capo
FetchContent_Declare(
capo
GIT_REPOSITORY https://github.com/capo-devs/capo-lite
GIT_TAG v2.0.1
GIT_SHALLOW TRUE
)

if(JUKE_USE_LIBXMP)
# libxmp
FetchContent_Declare(
libxmp
GIT_REPOSITORY https://github.com/libxmp/libxmp
GIT_TAG libxmp-4.6.3
GIT_SHALLOW TRUE
)
list(APPEND fetch_list libxmp)
endif()

# djson
FetchContent_Declare(
djson
GIT_REPOSITORY https://github.com/karnkaul/djson
GIT_TAG v2.1.1
GIT_SHALLOW TRUE
)

FetchContent_MakeAvailable(gvdi capo djson)
set(BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(LIBXMP_PIC ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(${fetch_list})

add_library(jukebox-deps INTERFACE)
add_library(jukebox::deps ALIAS jukebox-deps)
Expand Down
14 changes: 0 additions & 14 deletions deps/imgui-sfml/CMakeLists.txt

This file was deleted.

51 changes: 0 additions & 51 deletions deps/imgui/CMakeLists.txt

This file was deleted.

21 changes: 0 additions & 21 deletions deps/imgui/LICENSE.txt

This file was deleted.

8 changes: 8 additions & 0 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ target_link_libraries(juke
jukebox::deps
)

if(JUKE_USE_LIBXMP)
target_link_libraries(juke
PRIVATE
libxmp::xmp_static
)
target_compile_definitions(juke PRIVATE JUKE_USE_LIBXMP)
endif()

# Glob all headers
file(GLOB_RECURSE headers "include/*.hpp")

Expand Down
5 changes: 2 additions & 3 deletions library/include/juke/core/MediaPlayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ class MediaPlayer {
[[nodiscard]] auto stopped() const -> bool { return m_status == MediaStatus::stopped; }

private:
std::unique_ptr<capo::ISource> m_source{};

MediaStatus m_status;
MediaStatus m_status{MediaStatus::stopped};
[[maybe_unused]] bool m_trigger{};

std::optional<MediaFile> m_file{};
std::unique_ptr<capo::ISource> m_source{};

std::string m_status_string{"stopped"};
};
Expand Down
2 changes: 1 addition & 1 deletion library/src/core/MediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace juke {

MediaPlayer::MediaPlayer(capo::IEngine& audio_engine) : m_source(audio_engine.create_source()), m_status{MediaStatus::stopped} {
MediaPlayer::MediaPlayer(capo::IEngine& audio_engine) : m_source(audio_engine.create_source()) {
if (!m_source) { throw std::runtime_error{"Failed to create Audio Source"}; }
}

Expand Down