Rename ENABLE_CHROMAPRINT to ENABLE_MUSICBRAINZ

This commit is contained in:
jonas@jkvinge.net 2021-05-10 21:17:50 +02:00
parent c2108a35d0
commit 4a0a1a32a4
9 changed files with 48 additions and 46 deletions

View File

@ -306,8 +306,9 @@ optional_component(VLC ON "Engine: VLC backend"
DEPENDS "libvlc" LIBVLC_FOUND DEPENDS "libvlc" LIBVLC_FOUND
) )
optional_component(CHROMAPRINT ON "Chromaprint (Tag fetching from Musicbrainz)" optional_component(MUSICBRAINZ ON "MusicBrainz integration"
DEPENDS "chromaprint" CHROMAPRINT_FOUND DEPENDS "chromaprint" CHROMAPRINT_FOUND
DEPENDS "gstreamer" GSTREAMER_FOUND
) )
if (X11_FOUND OR HAVE_DBUS OR APPLE OR WIN32) if (X11_FOUND OR HAVE_DBUS OR APPLE OR WIN32)
@ -324,6 +325,7 @@ optional_component(X11_GLOBALSHORTCUTS ON "X11 global shortcuts"
optional_component(AUDIOCD ON "Devices: Audio CD support" optional_component(AUDIOCD ON "Devices: Audio CD support"
DEPENDS "libcdio" LIBCDIO_FOUND DEPENDS "libcdio" LIBCDIO_FOUND
DEPENDS "gstreamer" GSTREAMER_FOUND
) )
optional_component(UDISKS2 ON "Devices: UDisks2 backend" optional_component(UDISKS2 ON "Devices: UDisks2 backend"

View File

@ -855,26 +855,26 @@ UI
settings/transcodersettingspage.ui settings/transcodersettingspage.ui
) )
# MusicBrainz
optional_source(HAVE_MUSICBRAINZ
SOURCES
musicbrainz/chromaprinter.cpp
musicbrainz/tagfetcher.cpp
HEADERS
musicbrainz/tagfetcher.h
)
# CDIO backend and device # CDIO backend and device
if(HAVE_GSTREAMER) optional_source(HAVE_AUDIOCD
optional_source(HAVE_CHROMAPRINT SOURCES
SOURCES device/cddadevice.cpp
musicbrainz/chromaprinter.cpp device/cddalister.cpp
musicbrainz/tagfetcher.cpp device/cddasongloader.cpp
HEADERS HEADERS
musicbrainz/tagfetcher.h device/cddadevice.h
) device/cddalister.h
optional_source(HAVE_AUDIOCD device/cddasongloader.h
SOURCES )
device/cddadevice.cpp
device/cddalister.cpp
device/cddasongloader.cpp
HEADERS
device/cddadevice.h
device/cddalister.h
device/cddasongloader.h
)
endif()
# Platform specific - macOS # Platform specific - macOS
optional_source(APPLE optional_source(APPLE
@ -1081,9 +1081,9 @@ if(HAVE_VLC)
link_directories(${LIBVLC_LIBRARY_DIRS}) link_directories(${LIBVLC_LIBRARY_DIRS})
endif() endif()
if(HAVE_CHROMAPRINT) if(HAVE_MUSICBRAINZ)
link_directories(${CHROMAPRINT_LIBRARY_DIRS}) link_directories(${CHROMAPRINT_LIBRARY_DIRS})
endif(HAVE_CHROMAPRINT) endif(HAVE_MUSICBRAINZ)
if(X11_FOUND) if(X11_FOUND)
link_directories(${X11_LIBRARY_DIRS}) link_directories(${X11_LIBRARY_DIRS})
@ -1195,10 +1195,10 @@ if(HAVE_VLC)
target_link_libraries(strawberry_lib PRIVATE ${LIBVLC_LIBRARIES}) target_link_libraries(strawberry_lib PRIVATE ${LIBVLC_LIBRARIES})
endif() endif()
if(HAVE_CHROMAPRINT) if(HAVE_MUSICBRAINZ)
target_include_directories(strawberry_lib SYSTEM PRIVATE ${CHROMAPRINT_INCLUDE_DIRS}) target_include_directories(strawberry_lib SYSTEM PRIVATE ${CHROMAPRINT_INCLUDE_DIRS})
target_link_libraries(strawberry_lib PRIVATE ${CHROMAPRINT_LIBRARIES}) target_link_libraries(strawberry_lib PRIVATE ${CHROMAPRINT_LIBRARIES})
endif(HAVE_CHROMAPRINT) endif(HAVE_MUSICBRAINZ)
if(X11_FOUND) if(X11_FOUND)
target_include_directories(strawberry_lib SYSTEM PRIVATE ${X11_INCLUDE_DIR}) target_include_directories(strawberry_lib SYSTEM PRIVATE ${X11_INCLUDE_DIR})

View File

@ -17,7 +17,7 @@
#cmakedefine HAVE_LIBPULSE #cmakedefine HAVE_LIBPULSE
#cmakedefine HAVE_SPARKLE #cmakedefine HAVE_SPARKLE
#cmakedefine HAVE_QTSPARKLE #cmakedefine HAVE_QTSPARKLE
#cmakedefine HAVE_CHROMAPRINT #cmakedefine HAVE_MUSICBRAINZ
#cmakedefine HAVE_GLOBALSHORTCUTS #cmakedefine HAVE_GLOBALSHORTCUTS
#cmakedefine USE_INSTALL_PREFIX #cmakedefine USE_INSTALL_PREFIX

View File

@ -180,7 +180,7 @@
#include "scrobbler/audioscrobbler.h" #include "scrobbler/audioscrobbler.h"
#include "scrobbler/lastfmimport.h" #include "scrobbler/lastfmimport.h"
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
# include "musicbrainz/tagfetcher.h" # include "musicbrainz/tagfetcher.h"
#endif #endif
@ -486,7 +486,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
QObject::connect(ui_->action_renumber_tracks, &QAction::triggered, this, &MainWindow::RenumberTracks); QObject::connect(ui_->action_renumber_tracks, &QAction::triggered, this, &MainWindow::RenumberTracks);
QObject::connect(ui_->action_selection_set_value, &QAction::triggered, this, &MainWindow::SelectionSetValue); QObject::connect(ui_->action_selection_set_value, &QAction::triggered, this, &MainWindow::SelectionSetValue);
QObject::connect(ui_->action_edit_value, &QAction::triggered, this, &MainWindow::EditValue); QObject::connect(ui_->action_edit_value, &QAction::triggered, this, &MainWindow::EditValue);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
QObject::connect(ui_->action_auto_complete_tags, &QAction::triggered, this, &MainWindow::AutoCompleteTags); QObject::connect(ui_->action_auto_complete_tags, &QAction::triggered, this, &MainWindow::AutoCompleteTags);
#endif #endif
QObject::connect(ui_->action_settings, &QAction::triggered, this, &MainWindow::OpenSettingsDialog); QObject::connect(ui_->action_settings, &QAction::triggered, this, &MainWindow::OpenSettingsDialog);
@ -697,7 +697,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
playlist_menu_->addAction(ui_->action_edit_value); playlist_menu_->addAction(ui_->action_edit_value);
playlist_menu_->addAction(ui_->action_renumber_tracks); playlist_menu_->addAction(ui_->action_renumber_tracks);
playlist_menu_->addAction(ui_->action_selection_set_value); playlist_menu_->addAction(ui_->action_selection_set_value);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
playlist_menu_->addAction(ui_->action_auto_complete_tags); playlist_menu_->addAction(ui_->action_auto_complete_tags);
#endif #endif
playlist_rescan_songs_ = playlist_menu_->addAction(IconLoader::Load("view-refresh"), tr("Rescan song(s)..."), this, &MainWindow::RescanSongs); playlist_rescan_songs_ = playlist_menu_->addAction(IconLoader::Load("view-refresh"), tr("Rescan song(s)..."), this, &MainWindow::RescanSongs);
@ -1830,7 +1830,7 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
// this is available when we have one or many files and at least one of those is not CUE related // this is available when we have one or many files and at least one of those is not CUE related
ui_->action_edit_track->setEnabled(local_songs > 0 && editable > 0); ui_->action_edit_track->setEnabled(local_songs > 0 && editable > 0);
ui_->action_edit_track->setVisible(local_songs > 0 && editable > 0); ui_->action_edit_track->setVisible(local_songs > 0 && editable > 0);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
ui_->action_auto_complete_tags->setEnabled(local_songs > 0 && editable > 0); ui_->action_auto_complete_tags->setEnabled(local_songs > 0 && editable > 0);
ui_->action_auto_complete_tags->setVisible(local_songs > 0 && editable > 0); ui_->action_auto_complete_tags->setVisible(local_songs > 0 && editable > 0);
#endif #endif
@ -2865,7 +2865,7 @@ bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *r
void MainWindow::AutoCompleteTags() { void MainWindow::AutoCompleteTags() {
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
autocomplete_tag_items_.clear(); autocomplete_tag_items_.clear();

View File

@ -84,7 +84,7 @@ class OrganizeDialog;
class PlaylistListContainer; class PlaylistListContainer;
class QueueView; class QueueView;
class SystemTrayIcon; class SystemTrayIcon;
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
class TagFetcher; class TagFetcher;
#endif #endif
class TrackSelectionDialog; class TrackSelectionDialog;
@ -327,7 +327,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
#endif #endif
Lazy<AddStreamDialog> add_stream_dialog_; Lazy<AddStreamDialog> add_stream_dialog_;
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
std::unique_ptr<TagFetcher> tag_fetcher_; std::unique_ptr<TagFetcher> tag_fetcher_;
#endif #endif
std::unique_ptr<TrackSelectionDialog> track_selection_dialog_; std::unique_ptr<TrackSelectionDialog> track_selection_dialog_;

View File

@ -185,7 +185,7 @@ void CddaSongLoader::LoadSongs() {
} }
emit SongsDurationLoaded(songs); emit SongsDurationLoaded(songs);
#ifdef HAVE_CHROMAPRINT #ifdef HAVE_MUSICBRAINZ
// Handle TAG message: generate MusicBrainz DiscId // Handle TAG message: generate MusicBrainz DiscId
if (msg_tag) { if (msg_tag) {
GstTagList *tags = nullptr; GstTagList *tags = nullptr;
@ -211,7 +211,7 @@ void CddaSongLoader::LoadSongs() {
} }
#ifdef HAVE_CHROMAPRINT #ifdef HAVE_MUSICBRAINZ
void CddaSongLoader::AudioCDTagsLoaded(const QString &artist, const QString &album, const MusicBrainzClient::ResultList &results) { void CddaSongLoader::AudioCDTagsLoaded(const QString &artist, const QString &album, const MusicBrainzClient::ResultList &results) {
MusicBrainzClient *musicbrainz_client = qobject_cast<MusicBrainzClient*>(sender()); MusicBrainzClient *musicbrainz_client = qobject_cast<MusicBrainzClient*>(sender());

View File

@ -36,7 +36,7 @@
#include <gst/audio/gstaudiocdsrc.h> #include <gst/audio/gstaudiocdsrc.h>
#include "core/song.h" #include "core/song.h"
#ifdef HAVE_CHROMAPRINT #ifdef HAVE_MUSICBRAINZ
# include "musicbrainz/musicbrainzclient.h" # include "musicbrainz/musicbrainzclient.h"
#endif #endif
@ -63,7 +63,7 @@ class CddaSongLoader : public QObject {
void SongsMetadataLoaded(SongList songs); void SongsMetadataLoaded(SongList songs);
private slots: private slots:
#ifdef HAVE_CHROMAPRINT #ifdef HAVE_MUSICBRAINZ
void AudioCDTagsLoaded(const QString &artist, const QString &album, const MusicBrainzClient::ResultList &results); void AudioCDTagsLoaded(const QString &artist, const QString &album, const MusicBrainzClient::ResultList &results);
#endif #endif

View File

@ -81,7 +81,7 @@
#include "collection/collectionbackend.h" #include "collection/collectionbackend.h"
#include "playlist/playlist.h" #include "playlist/playlist.h"
#include "playlist/playlistdelegates.h" #include "playlist/playlistdelegates.h"
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
# include "musicbrainz/tagfetcher.h" # include "musicbrainz/tagfetcher.h"
# include "trackselectiondialog.h" # include "trackselectiondialog.h"
#endif #endif
@ -105,7 +105,7 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
ui_(new Ui_EditTagDialog), ui_(new Ui_EditTagDialog),
app_(app), app_(app),
album_cover_choice_controller_(new AlbumCoverChoiceController(this)), album_cover_choice_controller_(new AlbumCoverChoiceController(this)),
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
tag_fetcher_(new TagFetcher(this)), tag_fetcher_(new TagFetcher(this)),
results_dialog_(new TrackSelectionDialog(this)), results_dialog_(new TrackSelectionDialog(this)),
#endif #endif
@ -121,7 +121,7 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &EditTagDialog::AlbumCoverLoaded); QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &EditTagDialog::AlbumCoverLoaded);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
QObject::connect(tag_fetcher_, &TagFetcher::ResultAvailable, results_dialog_, &TrackSelectionDialog::FetchTagFinished, Qt::QueuedConnection); QObject::connect(tag_fetcher_, &TagFetcher::ResultAvailable, results_dialog_, &TrackSelectionDialog::FetchTagFinished, Qt::QueuedConnection);
QObject::connect(tag_fetcher_, &TagFetcher::Progress, results_dialog_, &TrackSelectionDialog::FetchTagProgress); QObject::connect(tag_fetcher_, &TagFetcher::Progress, results_dialog_, &TrackSelectionDialog::FetchTagProgress);
QObject::connect(results_dialog_, &TrackSelectionDialog::SongChosen, this, &EditTagDialog::FetchTagSongChosen); QObject::connect(results_dialog_, &TrackSelectionDialog::SongChosen, this, &EditTagDialog::FetchTagSongChosen);
@ -136,7 +136,7 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
ui_->label_lyrics->hide(); ui_->label_lyrics->hide();
ui_->fetch_tag->setIcon(QPixmap::fromImage(QImage(":/pictures/musicbrainz.png"))); ui_->fetch_tag->setIcon(QPixmap::fromImage(QImage(":/pictures/musicbrainz.png")));
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
ui_->fetch_tag->setEnabled(true); ui_->fetch_tag->setEnabled(true);
#else #else
ui_->fetch_tag->setEnabled(false); ui_->fetch_tag->setEnabled(false);
@ -185,7 +185,7 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
QObject::connect(ui_->song_list->selectionModel(), &QItemSelectionModel::selectionChanged, this, &EditTagDialog::SelectionChanged); QObject::connect(ui_->song_list->selectionModel(), &QItemSelectionModel::selectionChanged, this, &EditTagDialog::SelectionChanged);
QObject::connect(ui_->button_box, &QDialogButtonBox::clicked, this, &EditTagDialog::ButtonClicked); QObject::connect(ui_->button_box, &QDialogButtonBox::clicked, this, &EditTagDialog::ButtonClicked);
QObject::connect(ui_->playcount_reset, &QPushButton::clicked, this, &EditTagDialog::ResetPlayCounts); QObject::connect(ui_->playcount_reset, &QPushButton::clicked, this, &EditTagDialog::ResetPlayCounts);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
QObject::connect(ui_->fetch_tag, &QPushButton::clicked, this, &EditTagDialog::FetchTag); QObject::connect(ui_->fetch_tag, &QPushButton::clicked, this, &EditTagDialog::FetchTag);
#endif #endif
@ -368,7 +368,7 @@ bool EditTagDialog::SetLoading(const QString &message) {
ui_->button_box->setEnabled(!loading); ui_->button_box->setEnabled(!loading);
ui_->tab_widget->setEnabled(!loading); ui_->tab_widget->setEnabled(!loading);
ui_->song_list->setEnabled(!loading); ui_->song_list->setEnabled(!loading);
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
ui_->fetch_tag->setEnabled(!loading); ui_->fetch_tag->setEnabled(!loading);
#endif #endif
ui_->loading_label->setVisible(loading); ui_->loading_label->setVisible(loading);
@ -1263,7 +1263,7 @@ void EditTagDialog::ResetPlayCounts() {
void EditTagDialog::FetchTag() { void EditTagDialog::FetchTag() {
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
@ -1290,7 +1290,7 @@ void EditTagDialog::FetchTag() {
void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &new_metadata) { void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &new_metadata) {
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
const QString filename = original_song.url().toLocalFile(); const QString filename = original_song.url().toLocalFile();

View File

@ -54,7 +54,7 @@ class QHideEvent;
class Application; class Application;
class AlbumCoverChoiceController; class AlbumCoverChoiceController;
class Ui_EditTagDialog; class Ui_EditTagDialog;
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
class TrackSelectionDialog; class TrackSelectionDialog;
class TagFetcher; class TagFetcher;
#endif #endif
@ -179,7 +179,7 @@ class EditTagDialog : public QDialog {
Application *app_; Application *app_;
AlbumCoverChoiceController *album_cover_choice_controller_; AlbumCoverChoiceController *album_cover_choice_controller_;
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #ifdef HAVE_MUSICBRAINZ
TagFetcher *tag_fetcher_; TagFetcher *tag_fetcher_;
TrackSelectionDialog *results_dialog_; TrackSelectionDialog *results_dialog_;
#endif #endif