diff --git a/.gitignore b/.gitignore index e227c36f7b7374bacba2c600686e210979634162..7e8ea38a87c731336f4c99a9052fd38adba02cbe 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ build.clang/* # Local configurations .vim/* .vscode/* + +# CCLS styff +.ccls*/ +.ccls diff --git a/CMakeLists.txt b/CMakeLists.txt index bfa3728ed3e58b52149c4b134404659194c4511f..5cafdd3d98d9821e93314747d34a2e18d4381168 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.17) # Alpho Vivy, CXX only project(Vivy VERSION 0.1 LANGUAGES CXX) @@ -7,16 +7,16 @@ cmake_policy(SET CMP0009 NEW) # Do not follow symlinks with GLOB_RECURSE # Don't forget for specific things if(WIN32) - message("You are building on windows, pay attenion to the dependencies") + message(STATUS "You are building on windows, pay attenion to the dependencies") endif() if(MSVC OR MSYS OR MINGW) - message("You are building with a windows compiler") + message(STATUS "You are building with a windows compiler") endif() if(APPLE) - message("You are building on MacOS X") + message(STATUS "You are building on MacOS X") endif() if(UNIX AND NOT APPLE) - message("You are building on Linux, FreeBSD or any other toaster OS") + message(STATUS "You are building on Linux, FreeBSD or any other toaster OS") endif() # Pass -fPIC diff --git a/src/UI/DocumentViews/MpvContainer.cc b/src/UI/DocumentViews/MpvContainer.cc index fb094d4e4de76b9ac07418019d03b36714ede238..1ba5067bdbee66a8ff2f8ca0c7c4de3e952759fb 100644 --- a/src/UI/DocumentViews/MpvContainer.cc +++ b/src/UI/DocumentViews/MpvContainer.cc @@ -297,6 +297,10 @@ MpvContainer::mpvPause() noexcept void MpvContainer::mpvTogglePlayback() noexcept { + if (!isMpvAlreadyInitialized) { + reCreateMpvContext(); + } + logDebug() << "MPV: Toggling the playback"; asyncCommand(AsyncCmdType::TogglePlayback, { "cycle", "pause", "up", nullptr }); } diff --git a/src/UI/DocumentViews/MpvControls.cc b/src/UI/DocumentViews/MpvControls.cc index a9d63a8f2e9c0a55cc4c555c864cd1573a2d6128..453c87c5ff116415c0ee121c1bbd2329bfe93ca7 100644 --- a/src/UI/DocumentViews/MpvControls.cc +++ b/src/UI/DocumentViews/MpvControls.cc @@ -9,8 +9,6 @@ MpvControls::MpvControls(MpvContainer *passedContainer, QWidget *parent) noexcep { auto *progressBar = new QSlider(this); auto *togglePlaybackButton = new QPushButton(playIcon, "", this); // Be default MPV is paused - auto *reCreateMpvButton = new QPushButton( - reCreateMpvIcon, "", this); // Recreate the MPV context if something went wrong progressBar->setTracking(false); progressBar->setOrientation(Qt::Horizontal); @@ -56,7 +54,6 @@ MpvControls::MpvControls(MpvContainer *passedContainer, QWidget *parent) noexcep }); connect(togglePlaybackButton, &QAbstractButton::clicked, mpv, &MpvContainer::mpvTogglePlayback); - connect(reCreateMpvButton, &QAbstractButton::clicked, mpv, &MpvContainer::reCreateMpvContext); connect(mpv, &MpvContainer::mpvPlaybackToggled, this, [this, togglePlaybackButton](bool isPlay) noexcept -> void { togglePlaybackButton->setIcon(isPlay ? pauseIcon : playIcon); @@ -64,7 +61,6 @@ MpvControls::MpvControls(MpvContainer *passedContainer, QWidget *parent) noexcep auto *centralLayout = new QHBoxLayout(this); centralLayout->addWidget(togglePlaybackButton); - centralLayout->addWidget(reCreateMpvButton); centralLayout->addWidget(progressBar, 1); setLayout(centralLayout); } diff --git a/src/UI/DocumentViews/MpvControls.hh b/src/UI/DocumentViews/MpvControls.hh index 84cd143aaa76c30f6fb293124b73b245729ec93e..5c792dc72af07ec2866f5bc07e7bd6eaec077a7a 100644 --- a/src/UI/DocumentViews/MpvControls.hh +++ b/src/UI/DocumentViews/MpvControls.hh @@ -23,7 +23,6 @@ private: const QIcon playIcon{ VIVY_ICON_PLAY }; const QIcon pauseIcon{ VIVY_ICON_PAUSE }; - const QIcon reCreateMpvIcon{ VIVY_ICON_RUN }; public: explicit MpvControls(MpvContainer *mpv, QWidget *parent) noexcept;