Skip to content

Commit

Permalink
Fix initial playback fail, refactor (#10)
Browse files Browse the repository at this point in the history
* Bugfix: After boot and loading the first file into the playlist, playback fails.

* Bugfix: Fix issue caused by playing and sopping the same file repeatedly (it glitched and refused to play).

* Refactor: new folder structure for better code maintainability.

---------

Co-authored-by: Rodrigo Méndez <[email protected]>
  • Loading branch information
Rodmg and Rodrigo Méndez authored Sep 18, 2024
1 parent ecf8fb4 commit 21a6ec7
Show file tree
Hide file tree
Showing 76 changed files with 146 additions and 309 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ CMakeCache.txt
Makefile
cmake_install.cmake
player_autogen
Testing
CMakeCache.txt.prev
.cmake

234 changes: 79 additions & 155 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,94 @@ project(player VERSION 1.0 LANGUAGES C CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)

find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent DBus Gui Multimedia MultimediaWidgets Network Widgets)

qt_standard_project_setup()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/audiosource-base)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/audiosource-coordinator)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/audiosourcebluetooth)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/audiosourcecd)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/audiosourcefile)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/shared)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/view-basewindow)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/view-menu)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/view-player)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/view-playlist)

qt_add_executable(player WIN32 MACOSX_BUNDLE
audiosource.cpp audiosource.h
audiosourcebluetooth.cpp audiosourcebluetooth.h
audiosourcecd.cpp audiosourcecd.h
audiosourcecoordinator.cpp audiosourcecoordinator.h
audiosourcefile.cpp audiosourcefile.h
audiosourcewspectrumcapture.cpp audiosourcewspectrumcapture.h
controlbuttonswidget.cpp controlbuttonswidget.h controlbuttonswidget.ui
desktopbasewindow.cpp desktopbasewindow.h desktopbasewindow.ui
desktopplayerwindow.cpp desktopplayerwindow.h desktopplayerwindow.ui
embeddedbasewindow.cpp embeddedbasewindow.h embeddedbasewindow.ui
fft.cpp fft.h
filebrowsericonprovider.cpp filebrowsericonprovider.h
main.cpp
mainmenuview.cpp mainmenuview.h mainmenuview.ui
mainwindow.cpp mainwindow.h
mediaplayer.cpp mediaplayer.h
playerview.cpp playerview.h playerview.ui
playlistmodel.cpp playlistmodel.h
playlistview.cpp playlistview.h playlistview.ui
qmediaplaylist.cpp qmediaplaylist.h qmediaplaylist_p.cpp qmediaplaylist_p.h
qplaylistfileparser.cpp qplaylistfileparser.h
scale.cpp scale.h
scrolltext.cpp scrolltext.h
spectrumwidget.cpp spectrumwidget.h
systemaudiocontrol.cpp systemaudiocontrol.h
titlebar.cpp titlebar.h titlebar.ui
util.cpp util.h
src/audiosource-base/audiosource.cpp
src/audiosource-base/audiosource.h
src/audiosource-base/audiosourcewspectrumcapture.cpp
src/audiosource-base/audiosourcewspectrumcapture.h
src/audiosourcebluetooth/audiosourcebluetooth.cpp
src/audiosourcebluetooth/audiosourcebluetooth.h
src/audiosourcecd/audiosourcecd.cpp
src/audiosourcecd/audiosourcecd.h
src/audiosource-coordinator/audiosourcecoordinator.cpp
src/audiosource-coordinator/audiosourcecoordinator.h
src/audiosourcefile/audiosourcefile.cpp
src/audiosourcefile/audiosourcefile.h
src/audiosourcefile/mediaplayer.cpp
src/audiosourcefile/mediaplayer.h
src/view-player/controlbuttonswidget.cpp
src/view-player/controlbuttonswidget.h
src/view-player/controlbuttonswidget.ui
src/view-player/scrolltext.cpp
src/view-player/scrolltext.h
src/view-player/spectrumwidget.cpp
src/view-player/spectrumwidget.h
src/view-player/playerview.cpp
src/view-player/playerview.h
src/view-player/playerview.ui
src/view-basewindow/desktopbasewindow.cpp
src/view-basewindow/desktopbasewindow.h
src/view-basewindow/desktopbasewindow.ui
src/view-basewindow/desktopplayerwindow.cpp
src/view-basewindow/desktopplayerwindow.h
src/view-basewindow/desktopplayerwindow.ui
src/view-basewindow/embeddedbasewindow.cpp
src/view-basewindow/embeddedbasewindow.h
src/view-basewindow/embeddedbasewindow.ui
src/view-basewindow/mainwindow.cpp
src/view-basewindow/mainwindow.h
src/view-basewindow/titlebar.cpp
src/view-basewindow/titlebar.h
src/view-basewindow/titlebar.ui
src/view-playlist/filebrowsericonprovider.cpp
src/view-playlist/filebrowsericonprovider.h
src/view-playlist/playlistmodel.cpp
src/view-playlist/playlistmodel.h
src/view-playlist/playlistview.cpp
src/view-playlist/playlistview.h
src/view-playlist/playlistview.ui
src/view-playlist/qmediaplaylist.cpp
src/view-playlist/qmediaplaylist.h
src/view-playlist/qmediaplaylist_p.cpp
src/view-playlist/qmediaplaylist_p.h
src/view-playlist/qplaylistfileparser.cpp
src/view-playlist/qplaylistfileparser.h
src/view-menu/mainmenuview.cpp
src/view-menu/mainmenuview.h
src/view-menu/mainmenuview.ui
src/shared/scale.cpp
src/shared/scale.h
src/shared/systemaudiocontrol.cpp
src/shared/systemaudiocontrol.h
src/shared/fft.cpp
src/shared/fft.h
src/shared/util.cpp
src/shared/util.h
src/main.cpp
uiassets.qrc
)

target_include_directories(player PRIVATE
/usr/include/pipewire-0.3
/usr/include/python3.11
Expand All @@ -63,134 +115,6 @@ target_link_libraries(player PRIVATE
tag
)


# Resources:
set(uiassets_resource_files
"assets/LED_LCD_123.ttf"
"assets/Minecraft.ttf"
"assets/Winamp.ttf"
"assets/background.png"
"assets/balanceHandle.png"
"assets/balanceHandle_p.png"
"assets/bignumbers.ttf"
"assets/eq_off.png"
"assets/eq_off_p.png"
"assets/eq_on.png"
"assets/eq_on_p.png"
"assets/fb_folderIcon.png"
"assets/fb_folderIcon_selected.png"
"assets/fb_musicIcon.png"
"assets/fb_musicIcon_selected.png"
"assets/filesIcon.png"
"assets/logoButton.png"
"assets/next.png"
"assets/next_p.png"
"assets/open.png"
"assets/open_p.png"
"assets/pause.png"
"assets/pause_p.png"
"assets/pl_add.png"
"assets/pl_addIcon.png"
"assets/pl_add_p.png"
"assets/pl_close.png"
"assets/pl_close_p.png"
"assets/pl_homeIcon.png"
"assets/pl_off.png"
"assets/pl_off_p.png"
"assets/pl_on.png"
"assets/pl_on_p.png"
"assets/pl_playerIcon.png"
"assets/pl_upIcon.png"
"assets/play.png"
"assets/play_p.png"
"assets/playlistsIcon.png"
"assets/posHandle.png"
"assets/posHandle_p.png"
"assets/prev.png"
"assets/prev_p.png"
"assets/repeat_off.png"
"assets/repeat_off_p.png"
"assets/repeat_on.png"
"assets/repeat_on_p.png"
"assets/scroll_handle.png"
"assets/scroll_handle_p.png"
"assets/shuffle_off.png"
"assets/shuffle_off_p.png"
"assets/shuffle_on.png"
"assets/shuffle_on_p.png"
"assets/spotifyIcon.png"
"assets/status_paused.png"
"assets/status_playing.png"
"assets/status_stopped.png"
"assets/stop.png"
"assets/stop_p.png"
"assets/visualizationBackground.png"
"assets/volumeHandle.png"
"assets/volumeHandle_p.png"
"assets/windowClose.png"
"assets/windowMaximize.png"
"assets/windowMinimize.png"
"styles/controlbuttonswidget.repeatButton.1x.qss"
"styles/controlbuttonswidget.repeatButton.2x.qss"
"styles/controlbuttonswidget.repeatButton.3x.qss"
"styles/controlbuttonswidget.repeatButton.4x.qss"
"styles/controlbuttonswidget.shuffleButton.1x.qss"
"styles/controlbuttonswidget.shuffleButton.2x.qss"
"styles/controlbuttonswidget.shuffleButton.3x.qss"
"styles/controlbuttonswidget.shuffleButton.4x.qss"
"styles/desktopbasewindow.1x.qss"
"styles/desktopbasewindow.2x.qss"
"styles/desktopbasewindow.3x.qss"
"styles/desktopbasewindow.4x.qss"
"styles/playerview.balanceSlider.1x.qss"
"styles/playerview.balanceSlider.2x.qss"
"styles/playerview.balanceSlider.3x.qss"
"styles/playerview.balanceSlider.4x.qss"
"styles/playerview.codecDetailsContainer.1x.qss"
"styles/playerview.codecDetailsContainer.2x.qss"
"styles/playerview.codecDetailsContainer.3x.qss"
"styles/playerview.codecDetailsContainer.4x.qss"
"styles/playerview.eqButton.1x.qss"
"styles/playerview.eqButton.2x.qss"
"styles/playerview.eqButton.3x.qss"
"styles/playerview.eqButton.4x.qss"
"styles/playerview.kbpsFrame.1x.qss"
"styles/playerview.kbpsFrame.2x.qss"
"styles/playerview.kbpsFrame.3x.qss"
"styles/playerview.kbpsFrame.4x.qss"
"styles/playerview.khzFrame.1x.qss"
"styles/playerview.khzFrame.2x.qss"
"styles/playerview.khzFrame.3x.qss"
"styles/playerview.khzFrame.4x.qss"
"styles/playerview.playlistButton.1x.qss"
"styles/playerview.playlistButton.2x.qss"
"styles/playerview.playlistButton.3x.qss"
"styles/playerview.playlistButton.4x.qss"
"styles/playerview.posBar.1x.qss"
"styles/playerview.posBar.2x.qss"
"styles/playerview.posBar.3x.qss"
"styles/playerview.posBar.4x.qss"
"styles/playerview.songInfoContainer.1x.qss"
"styles/playerview.songInfoContainer.2x.qss"
"styles/playerview.songInfoContainer.3x.qss"
"styles/playerview.songInfoContainer.4x.qss"
"styles/playerview.visualizationFrame.1x.qss"
"styles/playerview.visualizationFrame.2x.qss"
"styles/playerview.visualizationFrame.3x.qss"
"styles/playerview.visualizationFrame.4x.qss"
"styles/playerview.volumeSlider.1x.qss"
"styles/playerview.volumeSlider.2x.qss"
"styles/playerview.volumeSlider.3x.qss"
"styles/playerview.volumeSlider.4x.qss"
)

qt_add_resources(player "uiassets"
PREFIX
"/"
FILES
${uiassets_resource_files}
)

install(TARGETS player
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pip install -r python/requirements.txt

**Using Qt Creator:**

1. Open this project with Qt Creator (open player.pro in Qt Creator)
1. Open this project with Qt Creator (open CMakeLists.txt in Qt Creator)
2. Qt Creator should guide you setting up your paths and settings for building the proyect in your machine
3. You should be able to click the green "Play" icon in Qt Creator to build and run the app

Expand Down
Binary file removed assets/LED_LCD_123.ttf
Binary file not shown.
Binary file removed assets/Minecraft.ttf
Binary file not shown.
Binary file removed assets/Winamp.ttf
Binary file not shown.
Binary file removed assets/background.png
Binary file not shown.
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
linamp (1.2.0) bookworm; urgency=medium

* Bugfix: After boot and loading the first file into the playlist, playback fails.
* Bugfix: Fix issue caused by playing and sopping the same file repeatedly (it glitched and refused to play).
* Refactor: new folder structure for better code maintainability.

-- Rodrigo Méndez <[email protected]> Tue, 17 Sep 2024 21:54:00 -0600

linamp (1.1.2) bookworm; urgency=medium

* Trim trailing whitespace.
Expand Down
Binary file removed doc/images/mediaplayerex.jpg
Binary file not shown.
48 changes: 0 additions & 48 deletions doc/src/player.qdoc

This file was deleted.

Loading

0 comments on commit 21a6ec7

Please sign in to comment.