From e9d462e655ef90843ee3f3160f61310f0b5809ca Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 8 Jan 2024 18:53:13 -0800 Subject: [PATCH] move player package into backend --- CONTRIBUTING.md | 4 ++-- backend/app.go | 4 ++-- backend/mpris.go | 2 +- backend/playbackmanager.go | 2 +- {player => backend/player}/jukebox/jukeboxplayer.go | 0 {player => backend/player}/mpv/equalizer.go | 0 {player => backend/player}/mpv/player.go | 2 +- {player => backend/player}/player.go | 0 ui/browsing/nowplayingpage.go | 4 ++-- ui/controller/controller.go | 4 ++-- ui/dialogs/settingsdialog.go | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) rename {player => backend/player}/jukebox/jukeboxplayer.go (100%) rename {player => backend/player}/mpv/equalizer.go (100%) rename {player => backend/player}/mpv/player.go (99%) rename {player => backend/player}/player.go (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54cb746..39770fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,8 +25,8 @@ At this time, the `main` branch is intended to be 'shippable' at any time, meani As this application is in early development, major refactorings and re-organization of the code structure may occur frequently as needed. As a rough guide to newcomers, the high-level project structure is as follows: * `backend` - To the extent possible all backend logic should reside in this package - - `playbackmanager.go` - Subsonic-aware high level playback APIs. (e.g. manipulating play queue) -* `player` - A low-level player API atop libmpv. This may be moved to its own repo under a more permissive license in the future + - `playbackmanager.go` - Subsonic-aware high level playback APIs. Manages play queue and communication between the UI and various player backends. + - `player` - Interface and package for different player backends, currently MPV (local), and Jukebox, and in the future, DLNA and Chromecast * `res` - Application resource files * `sharedutil` - Utility functions shared between the backend and UI layers * `ui` - The UI and UI business logic diff --git a/backend/app.go b/backend/app.go index f57d3fd..0042470 100644 --- a/backend/app.go +++ b/backend/app.go @@ -10,9 +10,9 @@ import ( "reflect" "time" + "github.com/dweymouth/supersonic/backend/player" + "github.com/dweymouth/supersonic/backend/player/mpv" "github.com/dweymouth/supersonic/backend/util" - "github.com/dweymouth/supersonic/player" - "github.com/dweymouth/supersonic/player/mpv" "github.com/dweymouth/supersonic/sharedutil" "github.com/fsnotify/fsnotify" "github.com/google/uuid" diff --git a/backend/mpris.go b/backend/mpris.go index e60809c..5d22e0b 100644 --- a/backend/mpris.go +++ b/backend/mpris.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/dweymouth/supersonic/backend/mediaprovider" - "github.com/dweymouth/supersonic/player" + "github.com/dweymouth/supersonic/backend/player" "github.com/godbus/dbus/v5" "github.com/quarckster/go-mpris-server/pkg/events" "github.com/quarckster/go-mpris-server/pkg/server" diff --git a/backend/playbackmanager.go b/backend/playbackmanager.go index 1d0790a..fe1a343 100644 --- a/backend/playbackmanager.go +++ b/backend/playbackmanager.go @@ -8,8 +8,8 @@ import ( "time" "github.com/dweymouth/supersonic/backend/mediaprovider" + "github.com/dweymouth/supersonic/backend/player" "github.com/dweymouth/supersonic/backend/util" - "github.com/dweymouth/supersonic/player" "github.com/dweymouth/supersonic/sharedutil" ) diff --git a/player/jukebox/jukeboxplayer.go b/backend/player/jukebox/jukeboxplayer.go similarity index 100% rename from player/jukebox/jukeboxplayer.go rename to backend/player/jukebox/jukeboxplayer.go diff --git a/player/mpv/equalizer.go b/backend/player/mpv/equalizer.go similarity index 100% rename from player/mpv/equalizer.go rename to backend/player/mpv/equalizer.go diff --git a/player/mpv/player.go b/backend/player/mpv/player.go similarity index 99% rename from player/mpv/player.go rename to backend/player/mpv/player.go index 76ec161..57e77ea 100644 --- a/player/mpv/player.go +++ b/backend/player/mpv/player.go @@ -8,7 +8,7 @@ import ( "strconv" "github.com/dweymouth/go-mpv" - "github.com/dweymouth/supersonic/player" + "github.com/dweymouth/supersonic/backend/player" ) // Error returned by many Player functions if called before the player has not been initialized. diff --git a/player/player.go b/backend/player/player.go similarity index 100% rename from player/player.go rename to backend/player/player.go diff --git a/ui/browsing/nowplayingpage.go b/ui/browsing/nowplayingpage.go index 1f62fc8..78475c7 100644 --- a/ui/browsing/nowplayingpage.go +++ b/ui/browsing/nowplayingpage.go @@ -7,8 +7,8 @@ import ( "github.com/dweymouth/supersonic/backend" "github.com/dweymouth/supersonic/backend/mediaprovider" - "github.com/dweymouth/supersonic/player" - "github.com/dweymouth/supersonic/player/mpv" + "github.com/dweymouth/supersonic/backend/player" + "github.com/dweymouth/supersonic/backend/player/mpv" "github.com/dweymouth/supersonic/sharedutil" "github.com/dweymouth/supersonic/ui/controller" "github.com/dweymouth/supersonic/ui/layouts" diff --git a/ui/controller/controller.go b/ui/controller/controller.go index 10e45a7..7768b6c 100644 --- a/ui/controller/controller.go +++ b/ui/controller/controller.go @@ -12,8 +12,8 @@ import ( "github.com/dweymouth/supersonic/backend" "github.com/dweymouth/supersonic/backend/mediaprovider" - "github.com/dweymouth/supersonic/player" - "github.com/dweymouth/supersonic/player/mpv" + "github.com/dweymouth/supersonic/backend/player" + "github.com/dweymouth/supersonic/backend/player/mpv" "github.com/dweymouth/supersonic/sharedutil" "github.com/dweymouth/supersonic/ui/dialogs" "github.com/dweymouth/supersonic/ui/util" diff --git a/ui/dialogs/settingsdialog.go b/ui/dialogs/settingsdialog.go index 30bf10b..85151f0 100644 --- a/ui/dialogs/settingsdialog.go +++ b/ui/dialogs/settingsdialog.go @@ -10,7 +10,7 @@ import ( "unicode" "github.com/dweymouth/supersonic/backend" - "github.com/dweymouth/supersonic/player/mpv" + "github.com/dweymouth/supersonic/backend/player/mpv" "github.com/dweymouth/supersonic/ui/layouts" myTheme "github.com/dweymouth/supersonic/ui/theme" "github.com/dweymouth/supersonic/ui/util"