diff --git a/.gitignore b/.gitignore index 452e804..6efd255 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,7 @@ CMakeCache.txt Makefile cmake_install.cmake player_autogen +Testing +CMakeCache.txt.prev +.cmake + diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ddfc72..33eee7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ 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) @@ -10,35 +12,85 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent DBus Gui Multi 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 @@ -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} diff --git a/README.md b/README.md index 375616f..fd2939d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/assets/LED_LCD_123.ttf b/assets/LED_LCD_123.ttf deleted file mode 100644 index 8d6588c..0000000 Binary files a/assets/LED_LCD_123.ttf and /dev/null differ diff --git a/assets/Minecraft.ttf b/assets/Minecraft.ttf deleted file mode 100644 index 85c1472..0000000 Binary files a/assets/Minecraft.ttf and /dev/null differ diff --git a/assets/Winamp.ttf b/assets/Winamp.ttf deleted file mode 100644 index d90aa69..0000000 Binary files a/assets/Winamp.ttf and /dev/null differ diff --git a/assets/background.png b/assets/background.png deleted file mode 100644 index 34d359c..0000000 Binary files a/assets/background.png and /dev/null differ diff --git a/debian/changelog b/debian/changelog index 0a2ade7..985221c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 17 Sep 2024 21:54:00 -0600 + linamp (1.1.2) bookworm; urgency=medium * Trim trailing whitespace. diff --git a/doc/images/mediaplayerex.jpg b/doc/images/mediaplayerex.jpg deleted file mode 100644 index e875bd1..0000000 Binary files a/doc/images/mediaplayerex.jpg and /dev/null differ diff --git a/doc/src/player.qdoc b/doc/src/player.qdoc deleted file mode 100644 index f934a3f..0000000 --- a/doc/src/player.qdoc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example player - \title Media Player Example - \ingroup multimedia_examples - \ingroup video_examples - \brief Playing audio and video. - \meta {tag} {widgets} - - \image mediaplayerex.jpg - - \e{Media Player} demonstrates a simple multimedia player that can play - audio and or video files using various codecs. - - \include examples-run.qdocinc - - The example uses a QMediaPlayer object passed into a QVideoWidget to - control the video output. To give the application playlist capability - we also use a QPlayList object. - - To activate the various functions such as play and stop on the dialog, - the button clicked events emit the play() and stop() signals, which - are connected to the play() and stop() slots of QMediaPlayer. - - \code - connect(controls, SIGNAL(play()), player, SLOT(play())); - connect(controls, SIGNAL(pause()), player, SLOT(pause())); - connect(controls, SIGNAL(stop()), player, SLOT(stop())); - \endcode - - We can get the volume (and set our user interface representation) - - \code - controls->setVolume(player->volume()); - \endcode - - and we can make widget 'volume' changes change the volume - - \code - connect(controls, SIGNAL(changeVolume(int)), player, SLOT(setVolume(int))); - \endcode - - The example also allows us to change video properties by means - of the QVideoWidget object. We can go to Full Screen mode with a single - button click, and back again. -*/ diff --git a/player.pro b/player.pro deleted file mode 100644 index a695fa0..0000000 --- a/player.pro +++ /dev/null @@ -1,100 +0,0 @@ -TEMPLATE = app -TARGET = player - -QT += network \ - multimedia \ - multimediawidgets \ - widgets \ - concurrent \ - dbus - -LIBS += -ltag -lasound -lpulse -lpulse-simple -lpipewire-0.3 -L/usr/lib/python3.11/config-3.11-x86_64-linux-gnu/ -lpython3.11 -INCLUDEPATH += /usr/include/python3.11 /usr/include/pipewire-0.3 /usr/include/spa-0.2 - -HEADERS = \ - audiosource.h \ - audiosourcebluetooth.h \ - audiosourcecd.h \ - audiosourcecoordinator.h \ - audiosourcefile.h \ - audiosourcewspectrumcapture.h \ - controlbuttonswidget.h \ - desktopbasewindow.h \ - desktopplayerwindow.h \ - embeddedbasewindow.h \ - fft.h \ - filebrowsericonprovider.h \ - mainmenuview.h \ - mainwindow.h \ - mediaplayer.h \ - playerview.h \ - playlistmodel.h \ - playlistview.h \ - scale.h \ - scrolltext.h \ - qmediaplaylist.h \ - qmediaplaylist_p.h \ - qplaylistfileparser.h \ - spectrumwidget.h \ - systemaudiocontrol.h \ - titlebar.h \ - util.h - -SOURCES = main.cpp \ - audiosource.cpp \ - audiosourcebluetooth.cpp \ - audiosourcecd.cpp \ - audiosourcecoordinator.cpp \ - audiosourcefile.cpp \ - audiosourcewspectrumcapture.cpp \ - controlbuttonswidget.cpp \ - desktopbasewindow.cpp \ - desktopplayerwindow.cpp \ - embeddedbasewindow.cpp \ - fft.cpp \ - filebrowsericonprovider.cpp \ - mainmenuview.cpp \ - mainwindow.cpp \ - mediaplayer.cpp \ - playerview.cpp \ - playlistmodel.cpp \ - playlistview.cpp \ - scale.cpp \ - scrolltext.cpp \ - qmediaplaylist.cpp \ - qmediaplaylist_p.cpp \ - qplaylistfileparser.cpp \ - spectrumwidget.cpp \ - systemaudiocontrol.cpp \ - titlebar.cpp \ - util.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/player -INSTALLS += target - -FORMS += \ - controlbuttonswidget.ui \ - desktopbasewindow.ui \ - desktopplayerwindow.ui \ - embeddedbasewindow.ui \ - mainmenuview.ui \ - playerview.ui \ - playlistview.ui \ - titlebar.ui - -RESOURCES += \ - uiassets.qrc - -DISTFILES += \ - README.md \ - install.sh \ - python/linamp/__init__.py \ - python/linamp/cdplayer.py \ - python/linamp-mock/__init__.py \ - python/linamp-mock/mock_cdplayer.py \ - python/requirements.txt \ - scale-skin.sh \ - setup.sh \ - shutdown.sh \ - start.sh \ - styles/controlbuttonswidget.shuffleButton.4x.qss diff --git a/skin/background.png b/skin/background.png deleted file mode 100644 index faf27e9..0000000 Binary files a/skin/background.png and /dev/null differ diff --git a/audiosource.cpp b/src/audiosource-base/audiosource.cpp similarity index 100% rename from audiosource.cpp rename to src/audiosource-base/audiosource.cpp diff --git a/audiosource.h b/src/audiosource-base/audiosource.h similarity index 100% rename from audiosource.h rename to src/audiosource-base/audiosource.h diff --git a/audiosourcewspectrumcapture.cpp b/src/audiosource-base/audiosourcewspectrumcapture.cpp similarity index 100% rename from audiosourcewspectrumcapture.cpp rename to src/audiosource-base/audiosourcewspectrumcapture.cpp diff --git a/audiosourcewspectrumcapture.h b/src/audiosource-base/audiosourcewspectrumcapture.h similarity index 100% rename from audiosourcewspectrumcapture.h rename to src/audiosource-base/audiosourcewspectrumcapture.h diff --git a/audiosourcecoordinator.cpp b/src/audiosource-coordinator/audiosourcecoordinator.cpp similarity index 100% rename from audiosourcecoordinator.cpp rename to src/audiosource-coordinator/audiosourcecoordinator.cpp diff --git a/audiosourcecoordinator.h b/src/audiosource-coordinator/audiosourcecoordinator.h similarity index 100% rename from audiosourcecoordinator.h rename to src/audiosource-coordinator/audiosourcecoordinator.h diff --git a/audiosourcebluetooth.cpp b/src/audiosourcebluetooth/audiosourcebluetooth.cpp similarity index 100% rename from audiosourcebluetooth.cpp rename to src/audiosourcebluetooth/audiosourcebluetooth.cpp diff --git a/audiosourcebluetooth.h b/src/audiosourcebluetooth/audiosourcebluetooth.h similarity index 100% rename from audiosourcebluetooth.h rename to src/audiosourcebluetooth/audiosourcebluetooth.h diff --git a/audiosourcecd.cpp b/src/audiosourcecd/audiosourcecd.cpp similarity index 100% rename from audiosourcecd.cpp rename to src/audiosourcecd/audiosourcecd.cpp diff --git a/audiosourcecd.h b/src/audiosourcecd/audiosourcecd.h similarity index 100% rename from audiosourcecd.h rename to src/audiosourcecd/audiosourcecd.h diff --git a/audiosourcefile.cpp b/src/audiosourcefile/audiosourcefile.cpp similarity index 100% rename from audiosourcefile.cpp rename to src/audiosourcefile/audiosourcefile.cpp diff --git a/audiosourcefile.h b/src/audiosourcefile/audiosourcefile.h similarity index 100% rename from audiosourcefile.h rename to src/audiosourcefile/audiosourcefile.h diff --git a/mediaplayer.cpp b/src/audiosourcefile/mediaplayer.cpp similarity index 87% rename from mediaplayer.cpp rename to src/audiosourcefile/mediaplayer.cpp index 1c3d5ab..71ca158 100644 --- a/mediaplayer.cpp +++ b/src/audiosourcefile/mediaplayer.cpp @@ -9,6 +9,13 @@ #include #include +/* + * Max number of times the player will retry playing + * after a buffer underrun while loading the file + * before stopping + */ +#define MP_MAX_BUFFER_UNDERRUN_RETRIES 10 + MediaPlayer::MediaPlayer(QObject *parent) : QIODevice{parent}, m_input(&m_data), @@ -61,6 +68,8 @@ void MediaPlayer::setupAudioOutput() delete m_audioOutput; } m_audioOutput = new QAudioSink(m_format, this); + connect(m_audioOutput, &QAudioSink::stateChanged, this, &MediaPlayer::onOutputStateChanged); + m_audioOutput->setVolume(m_volume); emit volumeChanged(volume()); } @@ -164,8 +173,10 @@ void MediaPlayer::stop(bool stopAudioOutput) if(stopAudioOutput) m_audioOutput->stop(); // Clear buffers, avoids pops and clicks when playing after stopping - m_audioOutput->reset(); this->reset(); + // Fully reset audio output + clearAudioOutput(); + setupAudioOutput(); setPosition(0); onPositionChanged(); @@ -185,6 +196,7 @@ void MediaPlayer::clear() m_output.close(); isDecodingFinished = false; isInited = false; + bufferUnderrunRetries = 0; } // Is at the end of the file @@ -292,6 +304,45 @@ void MediaPlayer::onAtEnd() ///////////////////////////////////////////////////////////////////// +void MediaPlayer::onOutputStateChanged(QAudio::State newState) +{ + QAudio::Error error = m_audioOutput->error(); + if(error != QAudio::NoError) { + qDebug() << "Audio Ouput Error: " << error; + } + + switch(newState) { + case QAudio::IdleState: + if(error == QAudio::UnderrunError) { + + if(this->bufferUnderrunRetries > MP_MAX_BUFFER_UNDERRUN_RETRIES) { + this->stop(); + qDebug() << "Media Player Buffer Underrun: max retries reached"; + return; + } + this->bufferUnderrunRetries++; + + // Handle race condition on initial loading + // Retry playing + qint64 pos = this->position(); + qDebug() << "Retry playing from position: " << pos; + + this->stop(); + + // Give some time for the buffer to fill + int timeout = 200; // msecs + QTimer::singleShot(timeout, this, [=](){ + this->play(); + // Try resuming from previous position + this->setPosition(pos); + }); + } + break; + default: + break; + } +} + MediaPlayer::PlaybackState MediaPlayer::playbackState() const { return m_state; diff --git a/mediaplayer.h b/src/audiosourcefile/mediaplayer.h similarity index 97% rename from mediaplayer.h rename to src/audiosourcefile/mediaplayer.h index da696a4..2dea2a7 100644 --- a/mediaplayer.h +++ b/src/audiosourcefile/mediaplayer.h @@ -83,6 +83,7 @@ class MediaPlayer : public QIODevice bool isInited; bool isDecodingFinished; + qint8 bufferUnderrunRetries = 0; bool m_seekable = false; qint64 m_position = 0; @@ -112,6 +113,7 @@ private slots: void onDurationChanged(qint64 duration); void onDecoderError(QAudioDecoder::Error error); void onAtEnd(); + void onOutputStateChanged(QAudio::State newState); signals: void playbackStateChanged(MediaPlayer::PlaybackState state); diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/fft.cpp b/src/shared/fft.cpp similarity index 100% rename from fft.cpp rename to src/shared/fft.cpp diff --git a/fft.h b/src/shared/fft.h similarity index 100% rename from fft.h rename to src/shared/fft.h diff --git a/scale.cpp b/src/shared/scale.cpp similarity index 100% rename from scale.cpp rename to src/shared/scale.cpp diff --git a/scale.h b/src/shared/scale.h similarity index 100% rename from scale.h rename to src/shared/scale.h diff --git a/systemaudiocontrol.cpp b/src/shared/systemaudiocontrol.cpp similarity index 100% rename from systemaudiocontrol.cpp rename to src/shared/systemaudiocontrol.cpp diff --git a/systemaudiocontrol.h b/src/shared/systemaudiocontrol.h similarity index 100% rename from systemaudiocontrol.h rename to src/shared/systemaudiocontrol.h diff --git a/util.cpp b/src/shared/util.cpp similarity index 100% rename from util.cpp rename to src/shared/util.cpp diff --git a/util.h b/src/shared/util.h similarity index 100% rename from util.h rename to src/shared/util.h diff --git a/desktopbasewindow.cpp b/src/view-basewindow/desktopbasewindow.cpp similarity index 100% rename from desktopbasewindow.cpp rename to src/view-basewindow/desktopbasewindow.cpp diff --git a/desktopbasewindow.h b/src/view-basewindow/desktopbasewindow.h similarity index 100% rename from desktopbasewindow.h rename to src/view-basewindow/desktopbasewindow.h diff --git a/desktopbasewindow.ui b/src/view-basewindow/desktopbasewindow.ui similarity index 100% rename from desktopbasewindow.ui rename to src/view-basewindow/desktopbasewindow.ui diff --git a/desktopplayerwindow.cpp b/src/view-basewindow/desktopplayerwindow.cpp similarity index 100% rename from desktopplayerwindow.cpp rename to src/view-basewindow/desktopplayerwindow.cpp diff --git a/desktopplayerwindow.h b/src/view-basewindow/desktopplayerwindow.h similarity index 100% rename from desktopplayerwindow.h rename to src/view-basewindow/desktopplayerwindow.h diff --git a/desktopplayerwindow.ui b/src/view-basewindow/desktopplayerwindow.ui similarity index 100% rename from desktopplayerwindow.ui rename to src/view-basewindow/desktopplayerwindow.ui diff --git a/embeddedbasewindow.cpp b/src/view-basewindow/embeddedbasewindow.cpp similarity index 100% rename from embeddedbasewindow.cpp rename to src/view-basewindow/embeddedbasewindow.cpp diff --git a/embeddedbasewindow.h b/src/view-basewindow/embeddedbasewindow.h similarity index 100% rename from embeddedbasewindow.h rename to src/view-basewindow/embeddedbasewindow.h diff --git a/embeddedbasewindow.ui b/src/view-basewindow/embeddedbasewindow.ui similarity index 100% rename from embeddedbasewindow.ui rename to src/view-basewindow/embeddedbasewindow.ui diff --git a/mainwindow.cpp b/src/view-basewindow/mainwindow.cpp similarity index 100% rename from mainwindow.cpp rename to src/view-basewindow/mainwindow.cpp diff --git a/mainwindow.h b/src/view-basewindow/mainwindow.h similarity index 100% rename from mainwindow.h rename to src/view-basewindow/mainwindow.h diff --git a/titlebar.cpp b/src/view-basewindow/titlebar.cpp similarity index 100% rename from titlebar.cpp rename to src/view-basewindow/titlebar.cpp diff --git a/titlebar.h b/src/view-basewindow/titlebar.h similarity index 100% rename from titlebar.h rename to src/view-basewindow/titlebar.h diff --git a/titlebar.ui b/src/view-basewindow/titlebar.ui similarity index 100% rename from titlebar.ui rename to src/view-basewindow/titlebar.ui diff --git a/mainmenuview.cpp b/src/view-menu/mainmenuview.cpp similarity index 100% rename from mainmenuview.cpp rename to src/view-menu/mainmenuview.cpp diff --git a/mainmenuview.h b/src/view-menu/mainmenuview.h similarity index 100% rename from mainmenuview.h rename to src/view-menu/mainmenuview.h diff --git a/mainmenuview.ui b/src/view-menu/mainmenuview.ui similarity index 100% rename from mainmenuview.ui rename to src/view-menu/mainmenuview.ui diff --git a/controlbuttonswidget.cpp b/src/view-player/controlbuttonswidget.cpp similarity index 100% rename from controlbuttonswidget.cpp rename to src/view-player/controlbuttonswidget.cpp diff --git a/controlbuttonswidget.h b/src/view-player/controlbuttonswidget.h similarity index 100% rename from controlbuttonswidget.h rename to src/view-player/controlbuttonswidget.h diff --git a/controlbuttonswidget.ui b/src/view-player/controlbuttonswidget.ui similarity index 100% rename from controlbuttonswidget.ui rename to src/view-player/controlbuttonswidget.ui diff --git a/playerview.cpp b/src/view-player/playerview.cpp similarity index 100% rename from playerview.cpp rename to src/view-player/playerview.cpp diff --git a/playerview.h b/src/view-player/playerview.h similarity index 100% rename from playerview.h rename to src/view-player/playerview.h diff --git a/playerview.ui b/src/view-player/playerview.ui similarity index 100% rename from playerview.ui rename to src/view-player/playerview.ui diff --git a/scrolltext.cpp b/src/view-player/scrolltext.cpp similarity index 100% rename from scrolltext.cpp rename to src/view-player/scrolltext.cpp diff --git a/scrolltext.h b/src/view-player/scrolltext.h similarity index 100% rename from scrolltext.h rename to src/view-player/scrolltext.h diff --git a/spectrumwidget.cpp b/src/view-player/spectrumwidget.cpp similarity index 100% rename from spectrumwidget.cpp rename to src/view-player/spectrumwidget.cpp diff --git a/spectrumwidget.h b/src/view-player/spectrumwidget.h similarity index 100% rename from spectrumwidget.h rename to src/view-player/spectrumwidget.h diff --git a/filebrowsericonprovider.cpp b/src/view-playlist/filebrowsericonprovider.cpp similarity index 100% rename from filebrowsericonprovider.cpp rename to src/view-playlist/filebrowsericonprovider.cpp diff --git a/filebrowsericonprovider.h b/src/view-playlist/filebrowsericonprovider.h similarity index 100% rename from filebrowsericonprovider.h rename to src/view-playlist/filebrowsericonprovider.h diff --git a/playlistmodel.cpp b/src/view-playlist/playlistmodel.cpp similarity index 100% rename from playlistmodel.cpp rename to src/view-playlist/playlistmodel.cpp diff --git a/playlistmodel.h b/src/view-playlist/playlistmodel.h similarity index 100% rename from playlistmodel.h rename to src/view-playlist/playlistmodel.h diff --git a/playlistview.cpp b/src/view-playlist/playlistview.cpp similarity index 100% rename from playlistview.cpp rename to src/view-playlist/playlistview.cpp diff --git a/playlistview.h b/src/view-playlist/playlistview.h similarity index 100% rename from playlistview.h rename to src/view-playlist/playlistview.h diff --git a/playlistview.ui b/src/view-playlist/playlistview.ui similarity index 100% rename from playlistview.ui rename to src/view-playlist/playlistview.ui diff --git a/qmediaplaylist.cpp b/src/view-playlist/qmediaplaylist.cpp similarity index 100% rename from qmediaplaylist.cpp rename to src/view-playlist/qmediaplaylist.cpp diff --git a/qmediaplaylist.h b/src/view-playlist/qmediaplaylist.h similarity index 100% rename from qmediaplaylist.h rename to src/view-playlist/qmediaplaylist.h diff --git a/qmediaplaylist_p.cpp b/src/view-playlist/qmediaplaylist_p.cpp similarity index 100% rename from qmediaplaylist_p.cpp rename to src/view-playlist/qmediaplaylist_p.cpp diff --git a/qmediaplaylist_p.h b/src/view-playlist/qmediaplaylist_p.h similarity index 100% rename from qmediaplaylist_p.h rename to src/view-playlist/qmediaplaylist_p.h diff --git a/qplaylistfileparser.cpp b/src/view-playlist/qplaylistfileparser.cpp similarity index 100% rename from qplaylistfileparser.cpp rename to src/view-playlist/qplaylistfileparser.cpp diff --git a/qplaylistfileparser.h b/src/view-playlist/qplaylistfileparser.h similarity index 100% rename from qplaylistfileparser.h rename to src/view-playlist/qplaylistfileparser.h diff --git a/uiassets.qrc b/uiassets.qrc index 6a8f181..da106bd 100644 --- a/uiassets.qrc +++ b/uiassets.qrc @@ -12,7 +12,6 @@ assets/prev.png assets/stop_p.png assets/stop.png - assets/background.png assets/posHandle_p.png assets/posHandle.png assets/eq_off_p.png @@ -35,10 +34,7 @@ assets/balanceHandle.png assets/volumeHandle_p.png assets/volumeHandle.png - assets/Minecraft.ttf - assets/Winamp.ttf assets/visualizationBackground.png - assets/LED_LCD_123.ttf assets/status_paused.png assets/status_stopped.png assets/status_playing.png