aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kodi.xcodeproj/project.pbxproj8
-rw-r--r--addons/resource.language.en_gb/resources/strings.po4
-rw-r--r--project/VS2010Express/XBMC.vcxproj2
-rw-r--r--project/VS2010Express/XBMC.vcxproj.filters6
-rw-r--r--xbmc/ContextMenuManager.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.h1
-rw-r--r--xbmc/music/CMakeLists.txt2
-rw-r--r--xbmc/music/ContextMenus.cpp49
-rw-r--r--xbmc/music/ContextMenus.h52
-rw-r--r--xbmc/music/Makefile1
-rw-r--r--xbmc/music/windows/GUIWindowMusicBase.cpp6
-rw-r--r--xbmc/music/windows/GUIWindowMusicNav.cpp27
-rw-r--r--xbmc/music/windows/GUIWindowMusicPlaylist.cpp1
13 files changed, 128 insertions, 35 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj
index a3078c61cc..06c372c7d0 100644
--- a/Kodi.xcodeproj/project.pbxproj
+++ b/Kodi.xcodeproj/project.pbxproj
@@ -718,6 +718,8 @@
9A999F1E1C67B77600E4E0D5 /* AddonBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A999F1B1C67B77600E4E0D5 /* AddonBuilder.cpp */; };
9AA7E3E81C972CF4000B7863 /* ContextMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7E3E61C972CF4000B7863 /* ContextMenus.cpp */; };
9AA7E3E91C972CF4000B7863 /* ContextMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7E3E61C972CF4000B7863 /* ContextMenus.cpp */; };
+ 9ABFE7A11C972D60002F1318 /* ContextMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ABFE79F1C972D60002F1318 /* ContextMenus.cpp */; };
+ 9ABFE7A21C972D60002F1318 /* ContextMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ABFE79F1C972D60002F1318 /* ContextMenus.cpp */; };
9AC167B61C5ED478004F0C29 /* MusicFileItemListModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC167B41C5ED478004F0C29 /* MusicFileItemListModifier.cpp */; };
9AC167B71C5ED478004F0C29 /* MusicFileItemListModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC167B41C5ED478004F0C29 /* MusicFileItemListModifier.cpp */; };
AE32174218313ADF0003FAFC /* XSLTUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE4E87A517354C4A00D15206 /* XSLTUtils.cpp */; };
@@ -3451,6 +3453,8 @@
9A999F1C1C67B77600E4E0D5 /* AddonBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonBuilder.h; sourceTree = "<group>"; };
9AA7E3E61C972CF4000B7863 /* ContextMenus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContextMenus.cpp; sourceTree = "<group>"; };
9AA7E3E71C972CF4000B7863 /* ContextMenus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenus.h; sourceTree = "<group>"; };
+ 9ABFE79F1C972D60002F1318 /* ContextMenus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContextMenus.cpp; sourceTree = "<group>"; };
+ 9ABFE7A01C972D60002F1318 /* ContextMenus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenus.h; sourceTree = "<group>"; };
9AC167B41C5ED478004F0C29 /* MusicFileItemListModifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicFileItemListModifier.cpp; sourceTree = "<group>"; };
9AC167B51C5ED478004F0C29 /* MusicFileItemListModifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicFileItemListModifier.h; sourceTree = "<group>"; };
AE4E87A517354C4A00D15206 /* XSLTUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTUtils.cpp; sourceTree = "<group>"; };
@@ -5364,6 +5368,8 @@
18B7C853129423A7009E7A26 /* music */ = {
isa = PBXGroup;
children = (
+ 9ABFE79F1C972D60002F1318 /* ContextMenus.cpp */,
+ 9ABFE7A01C972D60002F1318 /* ContextMenus.h */,
431376A812D640B500680C15 /* dialogs */,
431376CC12D6421A00680C15 /* infoscanner */,
18B7C854129423A7009E7A26 /* tags */,
@@ -10363,6 +10369,7 @@
C84828CF156CFCD8005A996F /* GUIDialogPVRGuideSearch.cpp in Sources */,
C84828D0156CFCD8005A996F /* GUIDialogPVRRecordingInfo.cpp in Sources */,
C84828D1156CFCD8005A996F /* GUIDialogPVRTimerSettings.cpp in Sources */,
+ 9ABFE7A11C972D60002F1318 /* ContextMenus.cpp in Sources */,
C84828D4156CFCD8005A996F /* PVRDatabase.cpp in Sources */,
C84828D5156CFCD8005A996F /* PVRGUIInfo.cpp in Sources */,
C84828D6156CFCD8005A996F /* PVRManager.cpp in Sources */,
@@ -11801,6 +11808,7 @@
DFD717291C09EDD70025D964 /* MessagePrinter.cpp in Sources */,
7CCDA834192756250074CF51 /* NptSystem.cpp in Sources */,
7CCDA83D192756250074CF51 /* NptThreads.cpp in Sources */,
+ 9ABFE7A21C972D60002F1318 /* ContextMenus.cpp in Sources */,
7CCDA846192756250074CF51 /* NptTime.cpp in Sources */,
7CCDA84F192756250074CF51 /* NptTls.cpp in Sources */,
7CCDA852192756250074CF51 /* NptUri.cpp in Sources */,
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index fce5b286c5..1f9c3c75af 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -2961,6 +2961,7 @@ msgctxt "#657"
msgid "Browse for folder"
msgstr ""
+#: xbmc/music/ContextMenus.h
msgctxt "#658"
msgid "Song information"
msgstr ""
@@ -5022,6 +5023,7 @@ msgctxt "#10522"
msgid "Now playing - Videos"
msgstr ""
+#: xbmc/music/ContextMenus.h
msgctxt "#10523"
msgid "Album information"
msgstr ""
@@ -6255,6 +6257,7 @@ msgctxt "#13350"
msgid "Current playlist"
msgstr ""
+#: Not used anymore. Use #10523 instead.
msgctxt "#13351"
msgid "Album information"
msgstr ""
@@ -13175,6 +13178,7 @@ msgctxt "#21890"
msgid "Select artist"
msgstr ""
+#: xbmc/music/ContextMenus.h
msgctxt "#21891"
msgid "Artist information"
msgstr ""
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 1912df7f41..ca18da90b4 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -719,6 +719,7 @@
<ClCompile Include="..\..\xbmc\messaging\helpers\DialogHelper.cpp" />
<ClCompile Include="..\..\xbmc\music\Album.cpp" />
<ClCompile Include="..\..\xbmc\music\Artist.cpp" />
+ <ClCompile Include="..\..\xbmc\music\ContextMenus.cpp" />
<ClCompile Include="..\..\xbmc\music\CueInfoLoader.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicInfo.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicOSD.cpp" />
@@ -1107,6 +1108,7 @@
<ClInclude Include="..\..\xbmc\input\joysticks\IButtonMapper.h" />
<ClInclude Include="..\..\xbmc\input\joysticks\IDriverHandler.h" />
<ClInclude Include="..\..\xbmc\input\joysticks\IInputHandler.h" />
+ <ClInclude Include="..\..\xbmc\music\ContextMenus.h" />
<ClInclude Include="..\..\xbmc\music\windows\MusicFileItemListModifier.h" />
<ClInclude Include="..\..\xbmc\filesystem\OverrideDirectory.h" />
<ClInclude Include="..\..\xbmc\filesystem\OverrideFile.h" />
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index 9fc9d688e8..c05b66eb48 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -843,6 +843,9 @@
<ClCompile Include="..\..\xbmc\music\Artist.cpp">
<Filter>music</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\music\ContextMenus.cpp">
+ <Filter>music</Filter>
+ </ClCompile>
<ClCompile Include="..\..\xbmc\music\GUIViewStateMusic.cpp">
<Filter>music</Filter>
</ClCompile>
@@ -6731,6 +6734,9 @@
<ClInclude Include="..\..\xbmc\addons\BinaryAddonCache.h">
<Filter>addons</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\music\ContextMenus.h">
+ <Filter>music</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
diff --git a/xbmc/ContextMenuManager.cpp b/xbmc/ContextMenuManager.cpp
index 4fe2c92e9b..0c479c2e3e 100644
--- a/xbmc/ContextMenuManager.cpp
+++ b/xbmc/ContextMenuManager.cpp
@@ -25,6 +25,7 @@
#include "addons/ContextMenuAddon.h"
#include "addons/ContextMenus.h"
#include "addons/IAddon.h"
+#include "music/ContextMenus.h"
#include "video/ContextMenus.h"
#include "utils/log.h"
@@ -63,6 +64,9 @@ void CContextMenuManager::Init()
std::make_shared<CONTEXTMENU::CMovieInfo>(),
std::make_shared<CONTEXTMENU::CMusicVideoInfo>(),
std::make_shared<CONTEXTMENU::CTVShowInfo>(),
+ std::make_shared<CONTEXTMENU::CAlbumInfo>(),
+ std::make_shared<CONTEXTMENU::CArtistInfo>(),
+ std::make_shared<CONTEXTMENU::CSongInfo>(),
std::make_shared<CONTEXTMENU::CMarkWatched>(),
std::make_shared<CONTEXTMENU::CMarkUnWatched>(),
};
diff --git a/xbmc/dialogs/GUIDialogContextMenu.h b/xbmc/dialogs/GUIDialogContextMenu.h
index 1f2e9d907e..98c2898da5 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.h
+++ b/xbmc/dialogs/GUIDialogContextMenu.h
@@ -87,7 +87,6 @@ enum CONTEXT_BUTTON { CONTEXT_BUTTON_CANCELLED = 0,
CONTEXT_BUTTON_MARK_UNWATCHED,
CONTEXT_BUTTON_SET_CONTENT,
CONTEXT_BUTTON_ADD_TO_LIBRARY,
- CONTEXT_BUTTON_SONG_INFO,
CONTEXT_BUTTON_EDIT_PARTYMODE,
CONTEXT_BUTTON_LINK_MOVIE,
CONTEXT_BUTTON_UNLINK_MOVIE,
diff --git a/xbmc/music/CMakeLists.txt b/xbmc/music/CMakeLists.txt
index e6309b362b..364f72a02d 100644
--- a/xbmc/music/CMakeLists.txt
+++ b/xbmc/music/CMakeLists.txt
@@ -1,5 +1,6 @@
set(SOURCES Album.cpp
Artist.cpp
+ ContextMenus.cpp
CueInfoLoader.cpp
GUIViewStateMusic.cpp
MusicDatabase.cpp
@@ -10,6 +11,7 @@ set(SOURCES Album.cpp
set(HEADERS Album.h
Artist.h
+ ContextMenus.h
CueInfoLoader.h
EmbeddedArt.h
GUIViewStateMusic.h
diff --git a/xbmc/music/ContextMenus.cpp b/xbmc/music/ContextMenus.cpp
new file mode 100644
index 0000000000..d26fdf1823
--- /dev/null
+++ b/xbmc/music/ContextMenus.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2016 Team Kodi
+ * http://kodi.tv
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "ContextMenus.h"
+#include "guilib/GUIWindowManager.h"
+#include "music/windows/GUIWindowMusicNav.h"
+#include "tags/MusicInfoTag.h"
+
+
+namespace CONTEXTMENU
+{
+
+CMusicInfo::CMusicInfo(MediaType mediaType)
+ : CStaticContextMenuAction(19033), m_mediaType(mediaType) {}
+
+bool CMusicInfo::IsVisible(const CFileItem& item) const
+{
+ return item.HasMusicInfoTag() && item.GetMusicInfoTag()->GetType() == m_mediaType;
+}
+
+bool CMusicInfo::Execute(const CFileItemPtr& item) const
+{
+ auto window = static_cast<CGUIWindowMusicNav*>(g_windowManager.GetWindow(WINDOW_MUSIC_NAV));
+ if (window)
+ {
+ window->OnItemInfo(item.get());
+ return true;
+ }
+ return false;
+}
+
+}
diff --git a/xbmc/music/ContextMenus.h b/xbmc/music/ContextMenus.h
new file mode 100644
index 0000000000..b93b63a1eb
--- /dev/null
+++ b/xbmc/music/ContextMenus.h
@@ -0,0 +1,52 @@
+#pragma once
+/*
+ * Copyright (C) 2016 Team Kodi
+ * http://kodi.tv
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "ContextMenuItem.h"
+
+
+namespace CONTEXTMENU
+{
+
+struct CMusicInfo : CStaticContextMenuAction
+{
+ explicit CMusicInfo(MediaType mediaType);
+ bool IsVisible(const CFileItem& item) const override;
+ bool Execute(const CFileItemPtr& item) const override;
+private:
+ const MediaType m_mediaType;
+};
+
+struct CAlbumInfo : CMusicInfo
+{
+ CAlbumInfo() : CMusicInfo(MediaTypeAlbum) {}
+};
+
+struct CArtistInfo : CMusicInfo
+{
+ CArtistInfo() : CMusicInfo(MediaTypeArtist) {}
+};
+
+struct CSongInfo : CMusicInfo
+{
+ CSongInfo() : CMusicInfo(MediaTypeSong) {}
+};
+
+}
diff --git a/xbmc/music/Makefile b/xbmc/music/Makefile
index a8f66bed7b..aabca8d50c 100644
--- a/xbmc/music/Makefile
+++ b/xbmc/music/Makefile
@@ -1,5 +1,6 @@
SRCS=Album.cpp \
Artist.cpp \
+ ContextMenus.cpp \
GUIViewStateMusic.cpp \
MusicDatabase.cpp \
MusicDbUrl.cpp \
diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp
index b642600c10..7d1e4b53a4 100644
--- a/xbmc/music/windows/GUIWindowMusicBase.cpp
+++ b/xbmc/music/windows/GUIWindowMusicBase.cpp
@@ -931,12 +931,6 @@ bool CGUIWindowMusicBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
OnItemInfo(itemNumber);
return true;
- case CONTEXT_BUTTON_SONG_INFO:
- {
- ShowSongInfo(item.get());
- return true;
- }
-
case CONTEXT_BUTTON_EDIT:
{
std::string playlist = item->IsPlayList() ? item->GetPath() : m_vecItems->GetPath(); // save path as activatewindow will destroy our items
diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp
index 4939e3fcd4..e604bd83eb 100644
--- a/xbmc/music/windows/GUIWindowMusicNav.cpp
+++ b/xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -46,7 +46,6 @@
#include "Application.h"
#include "messaging/ApplicationMessenger.h"
#include "settings/Settings.h"
-#include "settings/AdvancedSettings.h"
#include "guilib/LocalizeStrings.h"
#include "utils/LegacyPathTranslation.h"
#include "utils/log.h"
@@ -481,32 +480,6 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
CMusicDatabaseDirectory dir;
- // enable music info button on an album or on a song.
- if (item->IsAudio() && !item->IsPlayList() && !item->IsSmartPlayList() &&
- !item->m_bIsFolder)
- buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658);
- else if (item->IsVideoDb())
- {
- if (!item->m_bIsFolder) // music video
- buttons.Add(CONTEXT_BUTTON_INFO, 20393);
- if (StringUtils::StartsWithNoCase(item->GetPath(), "videodb://musicvideos/artists/") && item->m_bIsFolder)
- {
- long idArtist = m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel());
- if (idArtist > - 1)
- buttons.Add(CONTEXT_BUTTON_INFO,21891);
- }
- }
- else if (!inPlaylists && (dir.HasAlbumInfo(item->GetPath())||
- dir.IsArtistDir(item->GetPath()) ) &&
- !dir.IsAllItem(item->GetPath()) && !item->IsParentFolder() &&
- !item->IsPlugin() && !item->IsScript() &&
- !StringUtils::StartsWithNoCase(item->GetPath(), "musicsearch://"))
- {
- if (dir.IsArtistDir(item->GetPath()))
- buttons.Add(CONTEXT_BUTTON_INFO, 21891);
- else
- buttons.Add(CONTEXT_BUTTON_INFO, 13351);
- }
// enable query all albums button only in album view
if (dir.HasAlbumInfo(item->GetPath()) && !dir.IsAllItem(item->GetPath()) &&
diff --git a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
index 546ec7f1e5..f1838e8056 100644
--- a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
+++ b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp
@@ -516,7 +516,6 @@ void CGUIWindowMusicPlayList::GetContextButtons(int itemNumber, CContextButtons
if (players.size() > 1)
buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); // Play With...
- buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
if (XFILE::CFavouritesDirectory::IsFavourite(item.get(), GetID()))
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14077); // Remove Favourite
else