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
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
- Fix ignoring of "clientConfigDir" setting
### DeaDBeeF
- Provide universal .deb package to match `deadbeef-static_*.deb`
- Fix deadlock with streamer
- Fix deadlock with streamer code
- Fix playOrPause command behavior under v1.10

# Changes in v0.10 (released 2025-02-28)
- Add ability to configure output device
Expand Down
6 changes: 6 additions & 0 deletions ci/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if "%BUILD_ARCH%" == "x64" (

cmd /c scripts\install\foobar2000.cmd v2.1-x64
@if errorlevel 1 goto :end

cmd /c scripts\install\foobar2000.cmd v2.24-x64
@if errorlevel 1 goto :end
) else (
cmd /c scripts\install\foobar2000.cmd v1.6
@if errorlevel 1 goto :end
Expand All @@ -19,6 +22,9 @@ if "%BUILD_ARCH%" == "x64" (

cmd /c scripts\install\foobar2000.cmd v2.1
@if errorlevel 1 goto :end

cmd /c scripts\install\foobar2000.cmd v2.24
@if errorlevel 1 goto :end
)

:end
7 changes: 5 additions & 2 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set -e

function main
{
scripts/install/deadbeef.sh v1.8
scripts/install/deadbeef.sh v1.9
cd scripts/install

./deadbeef.sh v1.8
./deadbeef.sh v1.9
./deadbeef.sh v1.10
}

source "$(dirname $0)/run_in_docker.sh"
14 changes: 14 additions & 0 deletions ci/test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ set API_TEST_ERROR=0
set BEEFWEB_TEST_FOOBAR2000_VERSION=v2.1-x64
cmd /c yarn test
@if errorlevel 1 set API_TEST_ERROR=1

@echo.
@echo === Running API tests on foobar2000 v2.24-x64 ===
@echo.
set BEEFWEB_TEST_FOOBAR2000_VERSION=v2.24-x64
cmd /c yarn test
@if errorlevel 1 set API_TEST_ERROR=1
) else (
@echo.
@echo === Running API tests on foobar2000 v1.6 ===
Expand All @@ -49,6 +56,13 @@ set API_TEST_ERROR=0
set BEEFWEB_TEST_FOOBAR2000_VERSION=v2.1
cmd /c yarn test
@if errorlevel 1 set API_TEST_ERROR=1

@echo.
@echo === Running API tests on foobar2000 v2.24 ===
@echo.
set BEEFWEB_TEST_FOOBAR2000_VERSION=v2.24
cmd /c yarn test
@if errorlevel 1 set API_TEST_ERROR=1
)

@popd
Expand Down
1 change: 1 addition & 0 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function main
run_server_tests
run_api_tests v1.8
run_api_tests v1.9
run_api_tests v1.10
}

source "$(dirname $0)/run_in_docker.sh"
11 changes: 11 additions & 0 deletions cpp/server/deadbeef/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@ class PlayerImpl final : public Player
bool playNextBy(const std::string& expression, PlaylistItemSelector selector);
PlaylistInfo getPlaylistInfo(ddb_playlist_t* playlist, int index, bool isCurrent);

bool isStopped()
{
if (ddbApi->get_output()->state() == OUTPUT_STATE_STOPPED)
{
PlaylistItemPtr activeItem(ddbApi->streamer_get_playing_track());
return !activeItem;
}

return false;
}

PlaylistMutex playlistMutex_;
ConfigMutex configMutex_;
PlaylistMapping playlists_;
Expand Down
21 changes: 11 additions & 10 deletions cpp/server/deadbeef/player_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,22 +211,23 @@ void PlayerImpl::pause()
ddbApi->sendmessage(DB_EV_PAUSE, 0, 0, 0);
}

// DeaDBeeF behavior:
// < v1.10: DB_EV_TOGGLE_PAUSE acts like playOrPause
// >= v1.10: DB_EV_TOGGLE_PAUSE acts like togglePause
// Check playback state manually to support all versions

void PlayerImpl::togglePause()
{
if (ddbApi->get_output()->state() == OUTPUT_STATE_STOPPED)
{
PlaylistItemPtr activeItem(ddbApi->streamer_get_playing_track());

if (!activeItem)
return;
}

ddbApi->sendmessage(DB_EV_TOGGLE_PAUSE, 0, 0, 0);
if (!isStopped())
ddbApi->sendmessage(DB_EV_TOGGLE_PAUSE, 0, 0, 0);
}

void PlayerImpl::playOrPause()
{
ddbApi->sendmessage(DB_EV_TOGGLE_PAUSE, 0, 0, 0);
if (isStopped())
ddbApi->sendmessage(DB_EV_PLAY_CURRENT, 0, 0, 0);
else
ddbApi->sendmessage(DB_EV_TOGGLE_PAUSE, 0, 0, 0);
}

void PlayerImpl::setMuted(Switch value)
Expand Down
10 changes: 6 additions & 4 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Alternatively you can build from console:

And create package:
```
> cpack
> cpack -C Release
```

`foo_beefweb-*.zip` will be created in `build\Release` directory.
Expand Down Expand Up @@ -150,10 +150,12 @@ This command supports `--env buildType` and `--env outputDir` with the same defa

Full build needs to be performed before running API tests.

Additionally player binaries have to be installed:
`curl` should be available in `PATH`.

Additionally player binaries should be installed:

```
> scripts\install\foobar2000.cmd v2.1-x64
> scripts\install\foobar2000.cmd v2.24-x64
```

or
Expand All @@ -173,7 +175,7 @@ This command supports various parameters via environment variables:

`BEEFWEB_TEST_BUILD_TYPE` - which build type to use (defaults to `Debug`)

`BEEFWEB_TEST_FOOBAR2000_VERSION` - foobar2000 version to use (defaults to `v2.1-x64`)
`BEEFWEB_TEST_FOOBAR2000_VERSION` - foobar2000 version to use (defaults to `v2.24-x64`)

`BEEFWEB_TEST_DEADBEEF_VERSION` - DeaDBeeF version to use (defaults to `v1.9`)

Expand Down
2 changes: 1 addition & 1 deletion js/api_tests/src/foobar2000/test_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class Foobar2000TestContextFactory extends TestContextFactory
config.playerId = 'foobar2000';

const { BEEFWEB_TEST_FOOBAR2000_VERSION } = process.env;
config.playerVersion = BEEFWEB_TEST_FOOBAR2000_VERSION || 'v2.1-x64';
config.playerVersion = BEEFWEB_TEST_FOOBAR2000_VERSION || 'v2.24-x64';
config.playerDir = path.join(config.appsDir, 'foobar2000', config.playerVersion);

config.pluginBuildDir = path.join(
Expand Down
5 changes: 5 additions & 0 deletions scripts/install/deadbeef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ case "$version" in
hash='aa17741053f63a7fceace003bf269bd4c4c9e55e42ee14286d9fbf34fbc8e014'
;;

'v1.10')
url='https://sourceforge.net/projects/deadbeef/files/travis/linux/1.10/deadbeef-static_1.10.0-rc1-1_x86_64.tar.bz2'
hash='3226f09f4ee4e4fb3e3db79971402e55d9ae38dee0ca9e4761ba007e85f62764'
;;

*)
echo "usage: $(basename $0) <version>"
exit 1
Expand Down
18 changes: 14 additions & 4 deletions scripts/install/foobar2000.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@setlocal

@if "%1" == "v1.6" (
@set pkg_file=foobar2000_v1.6.14.exe
@set pkg_file=foobar2000_v1.6.17.exe
@goto :install
)

Expand All @@ -16,17 +16,27 @@
)

@if "%1" == "v2.1" (
@set pkg_file=foobar2000_v2.1.5.exe
@set pkg_file=foobar2000_v2.1.6.exe
@goto :install
)

@if "%1" == "v2.1-x64" (
@set pkg_file=foobar2000-x64_v2.1.5.exe
@set pkg_file=foobar2000-x64_v2.1.6.exe
@goto :install
)

@if "%1" == "v2.24" (
@set pkg_file=foobar2000_v2.24.2.exe
@goto :install
)

@if "%1" == "v2.24-x64" (
@set pkg_file=foobar2000-x64_v2.24.2.exe
@goto :install
)

@echo Usage: %~nx0 version
@echo Supported versions: v1.6 v2.0 v2.0-x64 v2.1 v2.1-x64
@echo Supported versions: v1.6 v2.0 v2.0-x64 v2.1 v2.1-x64 v2.24 v2.24-x64
@cmd /c exit 1
@goto :end

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.