summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorNícolas F. R. A. Prado <n@nfraprado.net>2022-02-27 21:05:04 -0500
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-03-02 22:10:05 -0800
commit2470997fc92fc00501b84f939146ce2ef6fbde69 (patch)
tree4bb59c1b415087da000bf0013cd35f4ecd33b15b /Userland
parent2b1ac91764e9caf058d4a6afa2e9ebf8dd571597 (diff)
downloadserenity-2470997fc92fc00501b84f939146ce2ef6fbde69.zip
SoundPlayer: Rename NoVisualization to AlbumCoverVisualization
Since the NoVisualization widget now shows the album cover, it should be called AlbumCoverVisualization instead.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.cpp (renamed from Userland/Applications/SoundPlayer/NoVisualizationWidget.cpp)10
-rw-r--r--Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h (renamed from Userland/Applications/SoundPlayer/NoVisualizationWidget.h)8
-rw-r--r--Userland/Applications/SoundPlayer/CMakeLists.txt2
-rw-r--r--Userland/Applications/SoundPlayer/main.cpp10
4 files changed, 15 insertions, 15 deletions
diff --git a/Userland/Applications/SoundPlayer/NoVisualizationWidget.cpp b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.cpp
index 7a05c20e36..c4bee0352c 100644
--- a/Userland/Applications/SoundPlayer/NoVisualizationWidget.cpp
+++ b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.cpp
@@ -6,12 +6,12 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include "NoVisualizationWidget.h"
+#include "AlbumCoverVisualizationWidget.h"
#include <AK/LexicalPath.h>
#include <LibCore/File.h>
#include <LibGUI/Painter.h>
-void NoVisualizationWidget::paint_event(GUI::PaintEvent& event)
+void AlbumCoverVisualizationWidget::paint_event(GUI::PaintEvent& event)
{
Frame::paint_event(event);
GUI::Painter painter(*this);
@@ -25,7 +25,7 @@ void NoVisualizationWidget::paint_event(GUI::PaintEvent& event)
}
}
-ErrorOr<NonnullRefPtr<Gfx::Bitmap>> NoVisualizationWidget::get_album_cover(StringView const filename)
+ErrorOr<NonnullRefPtr<Gfx::Bitmap>> AlbumCoverVisualizationWidget::get_album_cover(StringView const filename)
{
auto directory = LexicalPath::dirname(filename);
@@ -39,7 +39,7 @@ ErrorOr<NonnullRefPtr<Gfx::Bitmap>> NoVisualizationWidget::get_album_cover(Strin
return Error::from_string_literal("No cover file found");
}
-void NoVisualizationWidget::start_new_file(StringView filename)
+void AlbumCoverVisualizationWidget::start_new_file(StringView filename)
{
auto album_cover_or_error = get_album_cover(filename);
if (album_cover_or_error.is_error())
@@ -48,6 +48,6 @@ void NoVisualizationWidget::start_new_file(StringView filename)
m_album_cover = album_cover_or_error.value();
}
-void NoVisualizationWidget::set_buffer(RefPtr<Audio::Buffer>)
+void AlbumCoverVisualizationWidget::set_buffer(RefPtr<Audio::Buffer>)
{
}
diff --git a/Userland/Applications/SoundPlayer/NoVisualizationWidget.h b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h
index fb789e0846..9cc54c5d0b 100644
--- a/Userland/Applications/SoundPlayer/NoVisualizationWidget.h
+++ b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h
@@ -11,17 +11,17 @@
#include <LibAudio/Buffer.h>
#include <LibGUI/Frame.h>
-class NoVisualizationWidget final : public VisualizationWidget {
- C_OBJECT(NoVisualizationWidget)
+class AlbumCoverVisualizationWidget final : public VisualizationWidget {
+ C_OBJECT(AlbumCoverVisualizationWidget)
public:
- ~NoVisualizationWidget() override = default;
+ ~AlbumCoverVisualizationWidget() override = default;
void set_buffer(RefPtr<Audio::Buffer>) override;
void start_new_file(StringView) override;
private:
void paint_event(GUI::PaintEvent&) override;
- NoVisualizationWidget() = default;
+ AlbumCoverVisualizationWidget() = default;
ErrorOr<NonnullRefPtr<Gfx::Bitmap>> get_album_cover(StringView const filename);
RefPtr<Gfx::Bitmap> m_serenity_bg;
diff --git a/Userland/Applications/SoundPlayer/CMakeLists.txt b/Userland/Applications/SoundPlayer/CMakeLists.txt
index e2d0e6f0bb..09dff754b2 100644
--- a/Userland/Applications/SoundPlayer/CMakeLists.txt
+++ b/Userland/Applications/SoundPlayer/CMakeLists.txt
@@ -13,7 +13,7 @@ set(SOURCES
SampleWidget.cpp
SoundPlayerWidgetAdvancedView.cpp
BarsVisualizationWidget.cpp
- NoVisualizationWidget.cpp
+ AlbumCoverVisualizationWidget.cpp
M3UParser.cpp
PlaylistWidget.cpp
)
diff --git a/Userland/Applications/SoundPlayer/main.cpp b/Userland/Applications/SoundPlayer/main.cpp
index 1521e0a7fa..8ff1a76621 100644
--- a/Userland/Applications/SoundPlayer/main.cpp
+++ b/Userland/Applications/SoundPlayer/main.cpp
@@ -5,8 +5,8 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include "AlbumCoverVisualizationWidget.h"
#include "BarsVisualizationWidget.h"
-#include "NoVisualizationWidget.h"
#include "Player.h"
#include "SampleWidget.h"
#include "SoundPlayerWidgetAdvancedView.h"
@@ -124,11 +124,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(visualization_menu->try_add_action(samples));
visualization_actions.add_action(samples);
- auto none = GUI::Action::create_checkable("&None", [&](auto&) {
- static_cast<SoundPlayerWidgetAdvancedView*>(player)->set_visualization<NoVisualizationWidget>();
+ auto album_cover_visualization = GUI::Action::create_checkable("&Album Cover", [&](auto&) {
+ static_cast<SoundPlayerWidgetAdvancedView*>(player)->set_visualization<AlbumCoverVisualizationWidget>();
});
- TRY(visualization_menu->try_add_action(none));
- visualization_actions.add_action(none);
+ TRY(visualization_menu->try_add_action(album_cover_visualization));
+ visualization_actions.add_action(album_cover_visualization);
auto help_menu = TRY(window->try_add_menu("&Help"));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Sound Player", app_icon, window)));