Skip to content

Commit

Permalink
Remove deprecated audio features/analysis from side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Nov 30, 2024
1 parent 143b534 commit ff18160
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 178 deletions.
5 changes: 0 additions & 5 deletions src/enum/sidepaneltype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ enum class SidePanelType: char
*/
Search,

/**
* Audio features, paired with track ID
*/
AudioFeatures,

/**
* Lyrics, paired with track ID
*/
Expand Down
1 change: 0 additions & 1 deletion src/view/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ add_subdirectory(search)
add_subdirectory(sidepanel)

target_sources(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/audiofeatures.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cacheview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/configview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/crashes.cpp
Expand Down
108 changes: 0 additions & 108 deletions src/view/audiofeatures.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions src/view/audiofeatures.hpp

This file was deleted.

34 changes: 0 additions & 34 deletions src/view/sidepanel/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,6 @@ void SidePanel::View::openArtist(const std::string &artistId)
SidePanelType::Artist, QString::fromStdString(artistId));
}

void SidePanel::View::openAudioFeatures(const std::vector<lib::spt::track> &tracks)
{
QWidget *view;
QString tabTitle;
QString tabId;

if (tracks.size() == 1)
{
const auto &track = tracks.front();
view = new ::View::AudioFeatures(spotify, track.id, this);
tabTitle = QString::fromStdString(track.title());
tabId = QString::fromStdString(track.id);
}
else
{
std::vector<std::string> trackIds;
trackIds.reserve(tracks.size());
for (const auto &track: tracks)
{
trackIds.push_back(track.id);
tabId += QString::fromStdString(track.id);
}

view = new ::View::AudioFeatures(spotify, trackIds, this);
tabTitle = QString("%1 tracks").arg(tracks.size());
}

addTab(view, "view-statistics", tabTitle,
SidePanelType::AudioFeatures, tabId);
}

void SidePanel::View::openLyrics(const lib::spt::track &track)
{
auto *view = new ::View::Lyrics(httpClient, cache, this);
Expand Down Expand Up @@ -111,9 +80,6 @@ auto SidePanel::View::findTab(SidePanelType type, const QString &name) -> QWidge
case SidePanelType::Search:
return nullptr;

case SidePanelType::AudioFeatures:
return find<::View::AudioFeatures *>(name);

case SidePanelType::Lyrics:
return find<::View::Lyrics *>(name);

Expand Down
2 changes: 0 additions & 2 deletions src/view/sidepanel/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "lib/spotify/track.hpp"
#include "view/artist/view.hpp"
#include "view/search/view.hpp"
#include "view/audiofeatures.hpp"
#include "view/lyrics.hpp"
#include "view/sidepanel/title.hpp"
#include "enum/sidepaneltype.hpp"
Expand All @@ -22,7 +21,6 @@ namespace SidePanel
const lib::http_client &httpClient, QWidget *parent);

void openArtist(const std::string &artistId);
void openAudioFeatures(const std::vector<lib::spt::track> &tracks);
void openLyrics(const lib::spt::track &track);
void openLyrics(int lyricsId);

Expand Down

0 comments on commit ff18160

Please sign in to comment.