Permalink
Browse files

Merge pull request #1558 from cptspiff/nomscan

Replace GUIDialogMusicScan by the extended progress bar
  • Loading branch information...
2 parents a40dd9b + a724e0e commit d1dda65f5bbcba5ef03448cffed60a88c1d40e5f Arne Morten Kvarving committed Oct 7, 2012
View
6 XBMC-ATV2.xcodeproj/project.pbxproj
@@ -631,7 +631,6 @@
F56C7A80131EC155000AD0F6 /* GUIDialogMusicInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75C7131EC153000AD0F6 /* GUIDialogMusicInfo.cpp */; };
F56C7A81131EC155000AD0F6 /* GUIDialogMusicOSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75C9131EC153000AD0F6 /* GUIDialogMusicOSD.cpp */; };
F56C7A82131EC155000AD0F6 /* GUIDialogMusicOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75CB131EC153000AD0F6 /* GUIDialogMusicOverlay.cpp */; };
- F56C7A83131EC155000AD0F6 /* GUIDialogMusicScan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75CD131EC153000AD0F6 /* GUIDialogMusicScan.cpp */; };
F56C7A84131EC155000AD0F6 /* GUIDialogSongInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75CF131EC153000AD0F6 /* GUIDialogSongInfo.cpp */; };
F56C7A85131EC155000AD0F6 /* GUIDialogVisualisationPresetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75D1131EC153000AD0F6 /* GUIDialogVisualisationPresetList.cpp */; };
F56C7A86131EC155000AD0F6 /* MusicAlbumInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C75D4131EC153000AD0F6 /* MusicAlbumInfo.cpp */; };
@@ -2450,8 +2449,6 @@
F56C75CA131EC153000AD0F6 /* GUIDialogMusicOSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicOSD.h; sourceTree = "<group>"; };
F56C75CB131EC153000AD0F6 /* GUIDialogMusicOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicOverlay.cpp; sourceTree = "<group>"; };
F56C75CC131EC153000AD0F6 /* GUIDialogMusicOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicOverlay.h; sourceTree = "<group>"; };
- F56C75CD131EC153000AD0F6 /* GUIDialogMusicScan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicScan.cpp; sourceTree = "<group>"; };
- F56C75CE131EC153000AD0F6 /* GUIDialogMusicScan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicScan.h; sourceTree = "<group>"; };
F56C75CF131EC153000AD0F6 /* GUIDialogSongInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogSongInfo.cpp; sourceTree = "<group>"; };
F56C75D0131EC153000AD0F6 /* GUIDialogSongInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogSongInfo.h; sourceTree = "<group>"; };
F56C75D1131EC153000AD0F6 /* GUIDialogVisualisationPresetList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogVisualisationPresetList.cpp; sourceTree = "<group>"; };
@@ -5275,8 +5272,6 @@
F56C75CA131EC153000AD0F6 /* GUIDialogMusicOSD.h */,
F56C75CB131EC153000AD0F6 /* GUIDialogMusicOverlay.cpp */,
F56C75CC131EC153000AD0F6 /* GUIDialogMusicOverlay.h */,
- F56C75CD131EC153000AD0F6 /* GUIDialogMusicScan.cpp */,
- F56C75CE131EC153000AD0F6 /* GUIDialogMusicScan.h */,
F56C75CF131EC153000AD0F6 /* GUIDialogSongInfo.cpp */,
F56C75D0131EC153000AD0F6 /* GUIDialogSongInfo.h */,
F56C75D1131EC153000AD0F6 /* GUIDialogVisualisationPresetList.cpp */,
@@ -7068,7 +7063,6 @@
F56C7A80131EC155000AD0F6 /* GUIDialogMusicInfo.cpp in Sources */,
F56C7A81131EC155000AD0F6 /* GUIDialogMusicOSD.cpp in Sources */,
F56C7A82131EC155000AD0F6 /* GUIDialogMusicOverlay.cpp in Sources */,
- F56C7A83131EC155000AD0F6 /* GUIDialogMusicScan.cpp in Sources */,
F56C7A84131EC155000AD0F6 /* GUIDialogSongInfo.cpp in Sources */,
F56C7A85131EC155000AD0F6 /* GUIDialogVisualisationPresetList.cpp in Sources */,
F56C7A86131EC155000AD0F6 /* MusicAlbumInfo.cpp in Sources */,
View
6 XBMC-IOS.xcodeproj/project.pbxproj
@@ -716,7 +716,6 @@
F56C8A6A131F42ED000AD0F6 /* GUIDialogMusicInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85AA131F42EA000AD0F6 /* GUIDialogMusicInfo.cpp */; };
F56C8A6B131F42ED000AD0F6 /* GUIDialogMusicOSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85AC131F42EA000AD0F6 /* GUIDialogMusicOSD.cpp */; };
F56C8A6C131F42ED000AD0F6 /* GUIDialogMusicOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85AE131F42EA000AD0F6 /* GUIDialogMusicOverlay.cpp */; };
- F56C8A6D131F42ED000AD0F6 /* GUIDialogMusicScan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85B0131F42EA000AD0F6 /* GUIDialogMusicScan.cpp */; };
F56C8A6E131F42ED000AD0F6 /* GUIDialogSongInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85B2131F42EA000AD0F6 /* GUIDialogSongInfo.cpp */; };
F56C8A6F131F42ED000AD0F6 /* GUIDialogVisualisationPresetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85B4131F42EA000AD0F6 /* GUIDialogVisualisationPresetList.cpp */; };
F56C8A70131F42ED000AD0F6 /* MusicAlbumInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C85B7131F42EA000AD0F6 /* MusicAlbumInfo.cpp */; };
@@ -2637,8 +2636,6 @@
F56C85AD131F42EA000AD0F6 /* GUIDialogMusicOSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicOSD.h; sourceTree = "<group>"; };
F56C85AE131F42EA000AD0F6 /* GUIDialogMusicOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicOverlay.cpp; sourceTree = "<group>"; };
F56C85AF131F42EA000AD0F6 /* GUIDialogMusicOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicOverlay.h; sourceTree = "<group>"; };
- F56C85B0131F42EA000AD0F6 /* GUIDialogMusicScan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicScan.cpp; sourceTree = "<group>"; };
- F56C85B1131F42EA000AD0F6 /* GUIDialogMusicScan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicScan.h; sourceTree = "<group>"; };
F56C85B2131F42EA000AD0F6 /* GUIDialogSongInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogSongInfo.cpp; sourceTree = "<group>"; };
F56C85B3131F42EA000AD0F6 /* GUIDialogSongInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogSongInfo.h; sourceTree = "<group>"; };
F56C85B4131F42EA000AD0F6 /* GUIDialogVisualisationPresetList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogVisualisationPresetList.cpp; sourceTree = "<group>"; };
@@ -5637,8 +5634,6 @@
F56C85AD131F42EA000AD0F6 /* GUIDialogMusicOSD.h */,
F56C85AE131F42EA000AD0F6 /* GUIDialogMusicOverlay.cpp */,
F56C85AF131F42EA000AD0F6 /* GUIDialogMusicOverlay.h */,
- F56C85B0131F42EA000AD0F6 /* GUIDialogMusicScan.cpp */,
- F56C85B1131F42EA000AD0F6 /* GUIDialogMusicScan.h */,
F56C85B2131F42EA000AD0F6 /* GUIDialogSongInfo.cpp */,
F56C85B3131F42EA000AD0F6 /* GUIDialogSongInfo.h */,
F56C85B4131F42EA000AD0F6 /* GUIDialogVisualisationPresetList.cpp */,
@@ -7180,7 +7175,6 @@
F56C8A6A131F42ED000AD0F6 /* GUIDialogMusicInfo.cpp in Sources */,
F56C8A6B131F42ED000AD0F6 /* GUIDialogMusicOSD.cpp in Sources */,
F56C8A6C131F42ED000AD0F6 /* GUIDialogMusicOverlay.cpp in Sources */,
- F56C8A6D131F42ED000AD0F6 /* GUIDialogMusicScan.cpp in Sources */,
F56C8A6E131F42ED000AD0F6 /* GUIDialogSongInfo.cpp in Sources */,
F56C8A6F131F42ED000AD0F6 /* GUIDialogVisualisationPresetList.cpp in Sources */,
F56C8A70131F42ED000AD0F6 /* MusicAlbumInfo.cpp in Sources */,
View
6 XBMC.xcodeproj/project.pbxproj
@@ -647,7 +647,6 @@
E38E20830D25F9FD00618676 /* GUIDialogGamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17AC0D25F9FA00618676 /* GUIDialogGamepad.cpp */; };
E38E20890D25F9FD00618676 /* GUIDialogMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17B80D25F9FA00618676 /* GUIDialogMediaSource.cpp */; };
E38E208A0D25F9FD00618676 /* GUIDialogMusicOSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17BA0D25F9FA00618676 /* GUIDialogMusicOSD.cpp */; };
- E38E208B0D25F9FD00618676 /* GUIDialogMusicScan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17BC0D25F9FA00618676 /* GUIDialogMusicScan.cpp */; };
E38E208C0D25F9FD00618676 /* GUIDialogMuteBug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17BE0D25F9FA00618676 /* GUIDialogMuteBug.cpp */; };
E38E208D0D25F9FD00618676 /* GUIDialogNetworkSetup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17C00D25F9FA00618676 /* GUIDialogNetworkSetup.cpp */; };
E38E208E0D25F9FD00618676 /* GUIDialogNumeric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17C20D25F9FA00618676 /* GUIDialogNumeric.cpp */; };
@@ -2448,8 +2447,6 @@
E38E17B90D25F9FA00618676 /* GUIDialogMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMediaSource.h; sourceTree = "<group>"; };
E38E17BA0D25F9FA00618676 /* GUIDialogMusicOSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicOSD.cpp; sourceTree = "<group>"; };
E38E17BB0D25F9FA00618676 /* GUIDialogMusicOSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicOSD.h; sourceTree = "<group>"; };
- E38E17BC0D25F9FA00618676 /* GUIDialogMusicScan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMusicScan.cpp; sourceTree = "<group>"; };
- E38E17BD0D25F9FA00618676 /* GUIDialogMusicScan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMusicScan.h; sourceTree = "<group>"; };
E38E17BE0D25F9FA00618676 /* GUIDialogMuteBug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogMuteBug.cpp; sourceTree = "<group>"; };
E38E17BF0D25F9FA00618676 /* GUIDialogMuteBug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogMuteBug.h; sourceTree = "<group>"; };
E38E17C00D25F9FA00618676 /* GUIDialogNetworkSetup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogNetworkSetup.cpp; sourceTree = "<group>"; };
@@ -3778,8 +3775,6 @@
E38E17BB0D25F9FA00618676 /* GUIDialogMusicOSD.h */,
E38E18130D25F9FA00618676 /* GUIDialogMusicOverlay.cpp */,
E38E18140D25F9FA00618676 /* GUIDialogMusicOverlay.h */,
- E38E17BC0D25F9FA00618676 /* GUIDialogMusicScan.cpp */,
- E38E17BD0D25F9FA00618676 /* GUIDialogMusicScan.h */,
E38E17DA0D25F9FA00618676 /* GUIDialogSongInfo.cpp */,
E38E17DB0D25F9FA00618676 /* GUIDialogSongInfo.h */,
E38E17E60D25F9FA00618676 /* GUIDialogVisualisationPresetList.cpp */,
@@ -6882,7 +6877,6 @@
E38E20830D25F9FD00618676 /* GUIDialogGamepad.cpp in Sources */,
E38E20890D25F9FD00618676 /* GUIDialogMediaSource.cpp in Sources */,
E38E208A0D25F9FD00618676 /* GUIDialogMusicOSD.cpp in Sources */,
- E38E208B0D25F9FD00618676 /* GUIDialogMusicScan.cpp in Sources */,
E38E208C0D25F9FD00618676 /* GUIDialogMuteBug.cpp in Sources */,
E38E208D0D25F9FD00618676 /* GUIDialogNetworkSetup.cpp in Sources */,
E38E208E0D25F9FD00618676 /* GUIDialogNumeric.cpp in Sources */,
View
49 addons/skin.confluence/720p/DialogMusicScan.xml
@@ -1,49 +0,0 @@
-<window id="112">
- <defaultcontrol></defaultcontrol>
- <animation effect="slide" start="0,-70" end="0,0" time="100">WindowOpen</animation>
- <animation effect="slide" start="0,0" end="0,-70" delay="400" time="100">WindowClose</animation>
- <controls>
- <control type="group">
- <posx>720</posx>
- <posy>0</posy>
- <animation effect="slide" end="-400,0" time="200" condition="Window.IsVisible(133)">conditional</animation>
- <animation effect="slide" end="0,-80" time="200" condition="Window.IsVisible(FullscreenVideo) | Window.IsVisible(Visualisation)">conditional</animation>
- <control type="image">
- <posx>0</posx>
- <posy>-10</posy>
- <width>400</width>
- <height>70</height>
- <texture flipy="true" border="20,20,20,2">InfoMessagePanel.png</texture>
- </control>
- <control type="label" id="401">
- <description>Caption Label</description>
- <posx>15</posx>
- <posy>4</posy>
- <width>370</width>
- <height>18</height>
- <font>font10_title</font>
- <textcolor>selected</textcolor>
- <align>left</align>
- <aligny>center</aligny>
- </control>
- <control type="label" id="402">
- <description>Current Directory Label</description>
- <posx>15</posx>
- <posy>20</posy>
- <width>370</width>
- <height>20</height>
- <font>font10</font>
- <align>left</align>
- <aligny>center</aligny>
- <haspath>true</haspath>
- </control>
- <control type="progress" id="403">
- <description>progress control</description>
- <posx>15</posx>
- <posy>42</posy>
- <width>370</width>
- <height>8</height>
- </control>
- </control>
- </controls>
-</window>
View
2 project/VS2010Express/XBMC.vcxproj
@@ -772,7 +772,6 @@
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicInfo.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicOSD.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicOverlay.cpp" />
- <ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicScan.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogSongInfo.cpp" />
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogVisualisationPresetList.cpp" />
<ClCompile Include="..\..\xbmc\music\GUIViewStateMusic.cpp" />
@@ -2158,7 +2157,6 @@
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicInfo.h" />
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicOSD.h" />
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicOverlay.h" />
- <ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicScan.h" />
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogSongInfo.h" />
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogVisualisationPresetList.h" />
<ClInclude Include="..\..\xbmc\music\GUIViewStateMusic.h" />
View
6 project/VS2010Express/XBMC.vcxproj.filters
@@ -1258,9 +1258,6 @@
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicOverlay.cpp">
<Filter>music\dialogs</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogMusicScan.cpp">
- <Filter>music\dialogs</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\music\dialogs\GUIDialogSongInfo.cpp">
<Filter>music\dialogs</Filter>
</ClCompile>
@@ -4113,9 +4110,6 @@
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicOverlay.h">
<Filter>music\dialogs</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogMusicScan.h">
- <Filter>music\dialogs</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\music\dialogs\GUIDialogSongInfo.h">
<Filter>music\dialogs</Filter>
</ClInclude>
View
63 xbmc/Application.cpp
@@ -178,6 +178,7 @@
#include "peripherals/dialogs/GUIDialogPeripheralManager.h"
#include "peripherals/dialogs/GUIDialogPeripheralSettings.h"
#include "peripherals/devices/PeripheralImon.h"
+#include "music/infoscanner/MusicInfoScanner.h"
// Windows includes
#include "guilib/GUIWindowManager.h"
@@ -251,7 +252,6 @@
#include "dialogs/GUIDialogFavourites.h"
#include "dialogs/GUIDialogButtonMenu.h"
#include "dialogs/GUIDialogContextMenu.h"
-#include "music/dialogs/GUIDialogMusicScan.h"
#include "dialogs/GUIDialogPlayerControls.h"
#include "music/dialogs/GUIDialogSongInfo.h"
#include "dialogs/GUIDialogSmartPlaylistEditor.h"
@@ -1262,7 +1262,6 @@ bool CApplication::Initialize()
g_windowManager.Add(new CGUIDialogNumeric); // window id = 109
g_windowManager.Add(new CGUIDialogGamepad); // window id = 110
g_windowManager.Add(new CGUIDialogButtonMenu); // window id = 111
- g_windowManager.Add(new CGUIDialogMusicScan); // window id = 112
g_windowManager.Add(new CGUIDialogMuteBug); // window id = 113
g_windowManager.Add(new CGUIDialogPlayerControls); // window id = 114
#ifdef HAS_KARAOKE
@@ -1387,14 +1386,6 @@ bool CApplication::Initialize()
CLog::Log(LOGINFO, "removing tempfiles");
CUtil::RemoveTempFiles();
- // if the user shutoff the system during music scan
- // restore the settings
- if (g_settings.m_bMyMusicIsScanning)
- {
- CLog::Log(LOGWARNING,"System rebooted during music scan! ... restoring UseTags and FindRemoteThumbs");
- RestoreMusicScanSettings();
- }
-
if (!g_settings.UsingLoginScreen())
{
UpdateLibraries();
@@ -3457,7 +3448,6 @@ bool CApplication::Cleanup()
g_windowManager.Delete(WINDOW_DIALOG_SUB_MENU);
g_windowManager.Delete(WINDOW_DIALOG_BUTTON_MENU);
g_windowManager.Delete(WINDOW_DIALOG_CONTEXT_MENU);
- g_windowManager.Delete(WINDOW_DIALOG_MUSIC_SCAN);
g_windowManager.Delete(WINDOW_DIALOG_PLAYER_CONTROLS);
g_windowManager.Delete(WINDOW_DIALOG_KARAOKE_SONGSELECT);
g_windowManager.Delete(WINDOW_DIALOG_KARAOKE_SELECTOR);
@@ -5817,21 +5807,6 @@ PLAYERCOREID CApplication::GetCurrentPlayer()
return m_eCurrentPlayer;
}
-// when a scan is initiated, save current settings
-// and enable tag reading and remote thums
-void CApplication::SaveMusicScanSettings()
-{
- CLog::Log(LOGINFO,"Music scan has started... Enabling tag reading, and remote thumbs");
- g_settings.m_bMyMusicIsScanning = true;
- g_settings.Save();
-}
-
-void CApplication::RestoreMusicScanSettings()
-{
- g_settings.m_bMyMusicIsScanning = false;
- g_settings.Save();
-}
-
void CApplication::UpdateLibraries()
{
if (g_guiSettings.GetBool("videolibrary.updateonstartup"))
@@ -5908,15 +5883,8 @@ void CApplication::StartMusicScan(const CStdString &strDirectory, int flags)
}
if (!(flags & CMusicInfoScanner::SCAN_BACKGROUND))
- {
- CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
- if (musicScan)
- {
- m_musicInfoScanner->SetObserver(musicScan);
- musicScan->ShowScan();
- }
- }
- SaveMusicScanSettings();
+ m_musicInfoScanner->ShowDialog(true);
+
m_musicInfoScanner->Start(strDirectory, flags);
}
@@ -5926,16 +5894,8 @@ void CApplication::StartMusicAlbumScan(const CStdString& strDirectory,
if (m_musicInfoScanner->IsScanning())
return;
- if (!g_guiSettings.GetBool("musiclibrary.backgroundupdate"))
- {
- CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
- if (musicScan)
- {
- m_musicInfoScanner->SetObserver(musicScan);
- musicScan->ShowScan();
- }
- }
- SaveMusicScanSettings();
+ m_musicInfoScanner->ShowDialog(true);
+
m_musicInfoScanner->FetchAlbumInfo(strDirectory,refresh);
}
@@ -5945,18 +5905,9 @@ void CApplication::StartMusicArtistScan(const CStdString& strDirectory,
if (m_musicInfoScanner->IsScanning())
return;
- if (!g_guiSettings.GetBool("musiclibrary.backgroundupdate"))
- {
- CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
- if (musicScan)
- {
- m_musicInfoScanner->SetObserver(musicScan);
- musicScan->ShowScan();
- }
- }
- SaveMusicScanSettings();
- m_musicInfoScanner->FetchArtistInfo(strDirectory,refresh);
+ m_musicInfoScanner->ShowDialog(true);
+ m_musicInfoScanner->FetchArtistInfo(strDirectory,refresh);
}
void CApplication::CheckPlayingProgress()
View
3 xbmc/Application.h
@@ -247,9 +247,6 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
void StopShutdownTimer();
void ResetShutdownTimers();
- void SaveMusicScanSettings();
- void RestoreMusicScanSettings();
-
void StopVideoScan();
void StopMusicScan();
bool IsMusicScanning() const;
View
6 xbmc/dialogs/GUIDialogExtendedProgressBar.cpp
@@ -45,6 +45,12 @@ void CGUIDialogProgressBarHandle::SetText(const string &strText)
m_strText = strText;
}
+void CGUIDialogProgressBarHandle::SetTitle(const string &strTitle)
+{
+ CSingleLock lock(m_critSection);
+ m_strTitle = strTitle;
+}
+
void CGUIDialogProgressBarHandle::SetProgress(int currentItem, int itemCount)
{
float fPercentage = (float)((currentItem*100)/itemCount);
View
1 xbmc/dialogs/GUIDialogExtendedProgressBar.h
@@ -31,6 +31,7 @@ class CGUIDialogProgressBarHandle
virtual ~CGUIDialogProgressBarHandle(void) {}
const std::string &Title(void) { return m_strTitle; }
+ void SetTitle(const std::string &strTitle);
std::string Text(void) const;
void SetText(const std::string &strText);
View
1 xbmc/guilib/Key.h
@@ -355,7 +355,6 @@
#define WINDOW_DIALOG_NUMERIC 10109
#define WINDOW_DIALOG_GAMEPAD 10110
#define WINDOW_DIALOG_BUTTON_MENU 10111
-#define WINDOW_DIALOG_MUSIC_SCAN 10112
#define WINDOW_DIALOG_MUTE_BUG 10113
#define WINDOW_DIALOG_PLAYER_CONTROLS 10114
#define WINDOW_DIALOG_SEEK_BAR 10115
View
1 xbmc/input/ButtonTranslator.cpp
@@ -282,7 +282,6 @@ static const ActionMapping windows[] =
{"numericinput" , WINDOW_DIALOG_NUMERIC},
{"gamepadinput" , WINDOW_DIALOG_GAMEPAD},
{"shutdownmenu" , WINDOW_DIALOG_BUTTON_MENU},
- {"musicscan" , WINDOW_DIALOG_MUSIC_SCAN},
{"mutebug" , WINDOW_DIALOG_MUTE_BUG},
{"playercontrols" , WINDOW_DIALOG_PLAYER_CONTROLS},
{"seekbar" , WINDOW_DIALOG_SEEK_BAR},
View
7 xbmc/interfaces/Builtins.cpp
@@ -31,7 +31,6 @@
#include "dialogs/GUIDialogFileBrowser.h"
#include "guilib/GUIKeyboardFactory.h"
#include "dialogs/GUIDialogKaiToast.h"
-#include "music/dialogs/GUIDialogMusicScan.h"
#include "dialogs/GUIDialogNumeric.h"
#include "dialogs/GUIDialogProgress.h"
#include "video/dialogs/GUIDialogVideoScan.h"
@@ -55,6 +54,7 @@
#include "utils/URIUtils.h"
#include "Util.h"
#include "URL.h"
+#include "music/MusicDatabase.h"
#include "filesystem/PluginDirectory.h"
#ifdef HAS_FILESYSTEM_RAR
@@ -1239,12 +1239,7 @@ int CBuiltins::Execute(const CStdString& execString)
g_application.StopPlaying();
if (g_application.IsMusicScanning())
- {
g_application.StopMusicScan();
- CGUIDialogMusicScan *musicScan = (CGUIDialogMusicScan *)g_windowManager.GetWindow(WINDOW_DIALOG_MUSIC_SCAN);
- if (musicScan)
- musicScan->Close(true);
- }
if (g_application.IsVideoScanning())
{
View
2 xbmc/interfaces/http-api/XBMChttp.cpp
@@ -2630,8 +2630,6 @@ int CXbmcHttp::xbmcSTSetting(int numParas, CStdString paras[])
tmp = (g_settings.m_bMyVideoPlaylistShuffle==0) ? "False" : "True";
else if (paras[i]=="myvideoplaylistrepeat")
tmp = (g_settings.m_bMyVideoPlaylistRepeat==0) ? "False" : "True";
- else if (paras[i]=="mymusicisscanning")
- tmp = (g_settings.m_bMyMusicIsScanning==0) ? "False" : "True";
else if (paras[i]=="mymusicplaylistshuffle")
tmp = (g_settings.m_bMyMusicPlaylistShuffle==0) ? "False" : "True";
else if (paras[i]=="mymusicplaylistrepeat")
View
190 xbmc/music/dialogs/GUIDialogMusicScan.cpp
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
- *
- * 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 "GUIDialogMusicScan.h"
-#include "guilib/GUIProgressControl.h"
-#include "Application.h"
-#include "ApplicationMessenger.h"
-#include "Util.h"
-#include "URL.h"
-#include "guilib/GUIWindowManager.h"
-#include "settings/GUISettings.h"
-#include "GUIUserMessages.h"
-#include "threads/SingleLock.h"
-#include "utils/log.h"
-
-using namespace MUSIC_INFO;
-
-#define CONTROL_LABELSTATUS 401
-#define CONTROL_LABELDIRECTORY 402
-#define CONTROL_PROGRESS 403
-
-CGUIDialogMusicScan::CGUIDialogMusicScan(void)
-: CGUIDialog(WINDOW_DIALOG_MUSIC_SCAN, "DialogMusicScan.xml")
-{
- m_loadType = KEEP_IN_MEMORY;
-}
-
-CGUIDialogMusicScan::~CGUIDialogMusicScan(void)
-{
-}
-
-bool CGUIDialogMusicScan::OnMessage(CGUIMessage& message)
-{
- switch ( message.GetMessage() )
- {
- case GUI_MSG_WINDOW_INIT:
- {
- CGUIDialog::OnMessage(message);
-
- m_strCurrentDir.Empty();
-
- m_fPercentDone=-1.0F;
-
- UpdateState();
- return true;
- }
- break;
- }
-
- return CGUIDialog::OnMessage(message);
-}
-
-void CGUIDialogMusicScan::FrameMove()
-{
- if (m_active)
- UpdateState();
-
- CGUIDialog::FrameMove();
-}
-
-void CGUIDialogMusicScan::OnDirectoryChanged(const CStdString& strDirectory)
-{
- CSingleLock lock (m_critical);
-
- m_strCurrentDir = strDirectory;
-}
-
-void CGUIDialogMusicScan::OnStateChanged(SCAN_STATE state)
-{
- CSingleLock lock (m_critical);
-
- m_ScanState = state;
-}
-
-void CGUIDialogMusicScan::OnSetProgress(int currentItem, int itemCount)
-{
- CSingleLock lock (m_critical);
-
- m_fPercentDone=(float)((currentItem*100)/itemCount);
- if (m_fPercentDone>100.0F) m_fPercentDone=100.0F;
-}
-
-void CGUIDialogMusicScan::ShowScan()
-{
- m_ScanState = PREPARING;
- Show();
-}
-
-void CGUIDialogMusicScan::OnDirectoryScanned(const CStdString& strDirectory)
-{
- CGUIMessage msg(GUI_MSG_DIRECTORY_SCANNED, 0, 0, 0);
- msg.SetStringParam(strDirectory);
- g_windowManager.SendThreadMessage(msg);
-}
-
-void CGUIDialogMusicScan::OnFinished()
-{
- // clear cache
- CUtil::DeleteMusicDatabaseDirectoryCache();
-
- // send message
- CGUIMessage msg(GUI_MSG_SCAN_FINISHED, 0, 0, 0);
- g_windowManager.SendThreadMessage(msg);
-
- // be sure to restore the settings
- CLog::Log(LOGINFO,"Music scan was stopped or finished ... restoring FindRemoteThumbs");
- g_application.RestoreMusicScanSettings();
-
- if (!g_guiSettings.GetBool("musiclibrary.backgroundupdate"))
- {
- CApplicationMessenger::Get().Close(this, false, false);
- }
-}
-
-void CGUIDialogMusicScan::UpdateState()
-{
- CSingleLock lock (m_critical);
-
- SET_CONTROL_LABEL(CONTROL_LABELSTATUS, GetStateString());
-
- if (m_ScanState == READING_MUSIC_INFO)
- {
- CURL url(m_strCurrentDir);
- CStdString strStrippedPath = url.GetWithoutUserDetails();
- CURL::Decode(strStrippedPath);
-
- SET_CONTROL_LABEL(CONTROL_LABELDIRECTORY, strStrippedPath);
-
- if (m_fPercentDone>-1.0F)
- {
- SET_CONTROL_VISIBLE(CONTROL_PROGRESS);
- CGUIProgressControl* pProgressCtrl=(CGUIProgressControl*)GetControl(CONTROL_PROGRESS);
- if (pProgressCtrl) pProgressCtrl->SetPercentage(m_fPercentDone);
- }
- }
- else if (m_ScanState == DOWNLOADING_ALBUM_INFO || m_ScanState == DOWNLOADING_ARTIST_INFO)
- {
- SET_CONTROL_LABEL(CONTROL_LABELDIRECTORY, m_strCurrentDir);
- if (m_fPercentDone>-1.0F)
- {
- SET_CONTROL_VISIBLE(CONTROL_PROGRESS);
- CGUIProgressControl* pProgressCtrl=(CGUIProgressControl*)GetControl(CONTROL_PROGRESS);
- if (pProgressCtrl) pProgressCtrl->SetPercentage(m_fPercentDone);
- }
- }
- else
- {
- SET_CONTROL_LABEL(CONTROL_LABELDIRECTORY, "");
- SET_CONTROL_HIDDEN(CONTROL_PROGRESS);
- }
-}
-
-int CGUIDialogMusicScan::GetStateString()
-{
- if (m_ScanState == PREPARING)
- return 314;
- else if (m_ScanState == REMOVING_OLD)
- return 701;
- else if (m_ScanState == CLEANING_UP_DATABASE)
- return 700;
- else if (m_ScanState == READING_MUSIC_INFO)
- return 505;
- else if (m_ScanState == COMPRESSING_DATABASE)
- return 331;
- else if (m_ScanState == WRITING_CHANGES)
- return 328;
- else if (m_ScanState == DOWNLOADING_ALBUM_INFO)
- return 21885;
- else if (m_ScanState == DOWNLOADING_ARTIST_INFO)
- return 21886;
-
- return -1;
-}
View
54 xbmc/music/dialogs/GUIDialogMusicScan.h
@@ -1,54 +0,0 @@
-#pragma once
-
-/*
- * Copyright (C) 2005-2012 Team XBMC
- * http://www.xbmc.org
- *
- * 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 "guilib/GUIDialog.h"
-#include "music/infoscanner/MusicInfoScanner.h"
-#include "threads/CriticalSection.h"
-
-class CGUIDialogMusicScan: public CGUIDialog, public MUSIC_INFO::IMusicInfoScannerObserver
-{
-public:
- CGUIDialogMusicScan(void);
- virtual ~CGUIDialogMusicScan(void);
- virtual bool OnMessage(CGUIMessage& message);
- virtual void FrameMove();
-
- void ShowScan();
-
- void UpdateState();
-protected:
- int GetStateString();
- virtual void OnDirectoryChanged(const CStdString& strDirectory);
- virtual void OnDirectoryScanned(const CStdString& strDirectory);
- virtual void OnFinished();
- virtual void OnStateChanged(MUSIC_INFO::SCAN_STATE state);
- virtual void OnSetProgress(int currentItem, int itemCount);
-
- MUSIC_INFO::SCAN_STATE m_ScanState;
- CStdString m_strCurrentDir;
-
- CCriticalSection m_critical;
-
- float m_fPercentDone;
- int m_currentItem;
- int m_itemCount;
-};
View
1 xbmc/music/dialogs/Makefile
@@ -1,7 +1,6 @@
SRCS=GUIDialogMusicInfo.cpp \
GUIDialogMusicOSD.cpp \
GUIDialogMusicOverlay.cpp \
- GUIDialogMusicScan.cpp \
GUIDialogSongInfo.cpp \
GUIDialogVisualisationPresetList.cpp \
View
126 xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -32,6 +32,7 @@
#include "NfoFile.h"
#include "music/tags/MusicInfoTag.h"
#include "guilib/GUIWindowManager.h"
+#include "dialogs/GUIDialogExtendedProgressBar.h"
#include "dialogs/GUIDialogProgress.h"
#include "dialogs/GUIDialogSelect.h"
#include "guilib/GUIKeyboardFactory.h"
@@ -49,6 +50,7 @@
#include "TextureCache.h"
#include "ThumbLoader.h"
#include "interfaces/AnnouncementManager.h"
+#include "GUIUserMessages.h"
#include <algorithm>
@@ -60,7 +62,8 @@ using namespace MUSIC_GRABBER;
CMusicInfoScanner::CMusicInfoScanner() : CThread("CMusicInfoScanner")
{
m_bRunning = false;
- m_pObserver = NULL;
+ m_showDialog = false;
+ m_handle = NULL;
m_bCanInterrupt = false;
m_currentItem=0;
m_itemCount=0;
@@ -80,17 +83,21 @@ void CMusicInfoScanner::Process()
m_musicDatabase.Open();
- if (m_pObserver)
- m_pObserver->OnStateChanged(PREPARING);
+ if (m_showDialog && !g_guiSettings.GetBool("musiclibrary.backgroundupdate"))
+ {
+ CGUIDialogExtendedProgressBar* dialog =
+ (CGUIDialogExtendedProgressBar*)g_windowManager.GetWindow(WINDOW_DIALOG_EXT_PROGRESS);
+ m_handle = dialog->GetHandle(g_localizeStrings.Get(314));
+ }
m_bCanInterrupt = true;
if (m_scanType == 0) // load info from files
{
CLog::Log(LOGDEBUG, "%s - Starting scan", __FUNCTION__);
- if (m_pObserver)
- m_pObserver->OnStateChanged(READING_MUSIC_INFO);
+ if (m_handle)
+ m_handle->SetTitle(g_localizeStrings.Get(505));
// Reset progress vars
m_currentItem=0;
@@ -99,7 +106,7 @@ void CMusicInfoScanner::Process()
// Create the thread to count all files to be scanned
SetPriority( GetMinPriority() );
CThread fileCountReader(this, "CMusicInfoScanner");
- if (m_pObserver)
+ if (m_handle)
fileCountReader.Create();
// Database operations should not be canceled
@@ -130,13 +137,16 @@ void CMusicInfoScanner::Process()
if (m_needsCleanup)
{
- if (m_pObserver)
- m_pObserver->OnStateChanged(CLEANING_UP_DATABASE);
+ if (m_handle)
+ {
+ m_handle->SetTitle(g_localizeStrings.Get(700));
+ m_handle->SetText("");
+ }
m_musicDatabase.CleanupOrphanedItems();
- if (m_pObserver)
- m_pObserver->OnStateChanged(COMPRESSING_DATABASE);
+ if (m_handle)
+ m_handle->SetTitle(g_localizeStrings.Get(331));
m_musicDatabase.Compress(false);
}
@@ -155,16 +165,15 @@ void CMusicInfoScanner::Process()
bool bCanceled;
if (m_scanType == 1) // load album info
{
- if (m_pObserver)
- m_pObserver->OnStateChanged(DOWNLOADING_ALBUM_INFO);
-
+ if (m_handle)
+ m_handle->SetTitle(g_localizeStrings.Get(21885));
int iCurrentItem = 1;
for (set<CAlbum>::iterator it=m_albumsToScan.begin();it != m_albumsToScan.end();++it)
{
- if (m_pObserver)
+ if (m_handle)
{
- m_pObserver->OnDirectoryChanged(StringUtils::Join(it->artist, g_advancedSettings.m_musicItemSeparator)+" - "+it->strAlbum);
- m_pObserver->OnSetProgress(iCurrentItem++, m_albumsToScan.size());
+ m_handle->SetText(StringUtils::Join(it->artist, g_advancedSettings.m_musicItemSeparator)+" - "+it->strAlbum);
+ m_handle->SetPercentage(iCurrentItem++/(double)m_albumsToScan.size());
}
CMusicAlbumInfo albumInfo;
@@ -176,16 +185,16 @@ void CMusicInfoScanner::Process()
}
if (m_scanType == 2) // load artist info
{
- if (m_pObserver)
- m_pObserver->OnStateChanged(DOWNLOADING_ARTIST_INFO);
+ if (m_handle)
+ m_handle->SetTitle(g_localizeStrings.Get(21886));
int iCurrentItem=1;
for (set<CArtist>::iterator it=m_artistsToScan.begin();it != m_artistsToScan.end();++it)
{
- if (m_pObserver)
+ if (m_handle)
{
- m_pObserver->OnDirectoryChanged(it->strArtist);
- m_pObserver->OnSetProgress(iCurrentItem++, m_artistsToScan.size());
+ m_handle->SetText(it->strArtist);
+ m_handle->SetPercentage(iCurrentItem++/(double)m_artistsToScan.size()*100);
}
DownloadArtistInfo(it->genre[0],it->strArtist,bCanceled); // genre field holds path - see fetchartistinfo()
@@ -202,8 +211,18 @@ void CMusicInfoScanner::Process()
}
ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "OnScanFinished");
m_bRunning = false;
- if (m_pObserver)
- m_pObserver->OnFinished();
+ if (m_showDialog)
+ {
+ // clear cache
+ CUtil::DeleteMusicDatabaseDirectoryCache();
+
+ // send message
+ CGUIMessage msg(GUI_MSG_SCAN_FINISHED, 0, 0, 0);
+ g_windowManager.SendThreadMessage(msg);
+ }
+ if (m_handle)
+ m_handle->MarkFinished();
+ m_handle = NULL;
}
void CMusicInfoScanner::Start(const CStdString& strDirectory, int flags)
@@ -341,15 +360,26 @@ void CMusicInfoScanner::Stop()
StopThread();
}
-void CMusicInfoScanner::SetObserver(IMusicInfoScannerObserver* pObserver)
+static void OnDirectoryScanned(const CStdString& strDirectory)
+{
+ CGUIMessage msg(GUI_MSG_DIRECTORY_SCANNED, 0, 0, 0);
+ msg.SetStringParam(strDirectory);
+ g_windowManager.SendThreadMessage(msg);
+}
+
+static CStdString Prettify(const CStdString& strDirectory)
{
- m_pObserver = pObserver;
+ CURL url(strDirectory);
+ CStdString strStrippedPath = url.GetWithoutUserDetails();
+ CURL::Decode(strStrippedPath);
+
+ return strStrippedPath;
}
bool CMusicInfoScanner::DoScan(const CStdString& strDirectory)
{
- if (m_pObserver)
- m_pObserver->OnDirectoryChanged(strDirectory);
+ if (m_handle)
+ m_handle->SetText(Prettify(strDirectory));
/*
* remove this path from the list we're processing. This must be done prior to
@@ -394,8 +424,8 @@ bool CMusicInfoScanner::DoScan(const CStdString& strDirectory)
// and then scan in the new information
if (RetrieveMusicInfo(items, strDirectory) > 0)
{
- if (m_pObserver)
- m_pObserver->OnDirectoryScanned(strDirectory);
+ if (m_handle)
+ OnDirectoryScanned(strDirectory);
}
// save information about this folder
@@ -406,12 +436,12 @@ bool CMusicInfoScanner::DoScan(const CStdString& strDirectory)
CLog::Log(LOGDEBUG, "%s Skipping dir '%s' due to no change", __FUNCTION__, strDirectory.c_str());
m_currentItem += CountFiles(items, false); // false for non-recursive
- // notify our observer of our progress
- if (m_pObserver)
+ // updated the dialog with our progress
+ if (m_handle)
{
if (m_itemCount>0)
- m_pObserver->OnSetProgress(m_currentItem, m_itemCount);
- m_pObserver->OnDirectoryScanned(strDirectory);
+ m_handle->SetPercentage(m_currentItem/(double)m_itemCount*100);
+ OnDirectoryScanned(strDirectory);
}
}
@@ -479,10 +509,10 @@ int CMusicInfoScanner::RetrieveMusicInfo(CFileItemList& items, const CStdString&
pLoader->Load(pItem->GetPath(), tag);
}
- // if we have the itemcount, notify our
- // observer with the progress we made
- if (m_pObserver && m_itemCount>0)
- m_pObserver->OnSetProgress(m_currentItem, m_itemCount);
+ // if we have the itemcount, update our
+ // dialog with the progress we made
+ if (m_handle && m_itemCount>0)
+ m_handle->SetPercentage(m_currentItem/(double)m_itemCount*100);
if (tag.Loaded())
{
@@ -604,8 +634,8 @@ int CMusicInfoScanner::RetrieveMusicInfo(CFileItemList& items, const CStdString&
}
}
}
- if (m_pObserver)
- m_pObserver->OnStateChanged(READING_MUSIC_INFO);
+ if (m_handle)
+ m_handle->SetTitle(g_localizeStrings.Get(505));
return songsToAdd.size();
}
@@ -888,10 +918,10 @@ bool CMusicInfoScanner::DownloadAlbumInfo(const CStdString& strPath, const CStdS
return false;
}
- if (m_pObserver)
+ if (m_handle)
{
- m_pObserver->OnStateChanged(DOWNLOADING_ALBUM_INFO);
- m_pObserver->OnDirectoryChanged(strAlbum);
+ m_handle->SetTitle(g_localizeStrings.Get(21885));
+ m_handle->SetText(strArtist+" - "+strAlbum);
}
// clear our scraper cache
@@ -1122,15 +1152,15 @@ bool CMusicInfoScanner::DownloadArtistInfo(const CStdString& strPath, const CStd
return false;
}
- // clear our scraper cache
- info->ClearCache();
-
- if (m_pObserver)
+ if (m_handle)
{
- m_pObserver->OnStateChanged(DOWNLOADING_ARTIST_INFO);
- m_pObserver->OnDirectoryChanged(strArtist);
+ m_handle->SetTitle(g_localizeStrings.Get(21886));
+ m_handle->SetText(strArtist);
}
+ // clear our scraper cache
+ info->ClearCache();
+
CMusicInfoScraper scraper(info);
// handle nfo files
CStdString strArtistPath, strNfo;
View
21 xbmc/music/infoscanner/MusicInfoScanner.h
@@ -24,22 +24,10 @@
class CAlbum;
class CArtist;
+class CGUIDialogProgressBarHandle;
namespace MUSIC_INFO
{
-enum SCAN_STATE { PREPARING = 0, REMOVING_OLD, CLEANING_UP_DATABASE, READING_MUSIC_INFO, DOWNLOADING_ALBUM_INFO, DOWNLOADING_ARTIST_INFO, COMPRESSING_DATABASE, WRITING_CHANGES };
-
-class IMusicInfoScannerObserver
-{
-public:
- virtual ~IMusicInfoScannerObserver() {}
- virtual void OnStateChanged(SCAN_STATE state) = 0;
- virtual void OnDirectoryChanged(const CStdString& strDirectory) = 0;
- virtual void OnDirectoryScanned(const CStdString& strDirectory) = 0;
- virtual void OnSetProgress(int currentItem, int itemCount)=0;
- virtual void OnFinished() = 0;
-};
-
class CMusicInfoScanner : CThread, public IRunnable
{
public:
@@ -58,7 +46,9 @@ class CMusicInfoScanner : CThread, public IRunnable
void FetchArtistInfo(const CStdString& strDirectory, bool refresh=false);
bool IsScanning();
void Stop();
- void SetObserver(IMusicInfoScannerObserver* pObserver);
+
+ //! \brief Set whether or not to show a progress dialog
+ void ShowDialog(bool show) { m_showDialog = show; }
/*! \brief Categorise songs into albums
Albums are defined uniquely by the album name and album artist.
@@ -117,7 +107,8 @@ class CMusicInfoScanner : CThread, public IRunnable
int CountFilesRecursively(const CStdString& strPath);
protected:
- IMusicInfoScannerObserver* m_pObserver;
+ bool m_showDialog;
+ CGUIDialogProgressBarHandle* m_handle;
int m_currentItem;
int m_itemCount;
bool m_bRunning;
View
2 xbmc/music/windows/GUIWindowMusicBase.cpp
@@ -37,7 +37,6 @@
#include "cdrip/CDDARipper.h"
#endif
#include "GUIPassword.h"
-#include "music/dialogs/GUIDialogMusicScan.h"
#include "dialogs/GUIDialogMediaSource.h"
#include "PartyModeManager.h"
#include "GUIInfoManager.h"
@@ -66,6 +65,7 @@
#include "utils/StringUtils.h"
#include "ThumbLoader.h"
#include "URL.h"
+#include "music/infoscanner/MusicInfoScanner.h"
using namespace std;
using namespace XFILE;
View
15 xbmc/settings/Settings.cpp
@@ -115,9 +115,6 @@ void CSettings::Initialize()
m_logFolder = "special://home/"; // log file location
#endif
- // defaults for scanning
- m_bMyMusicIsScanning = false;
-
iAdditionalSubtitleDirectoryChecked = 0;
m_iMyMusicStartWindow = WINDOW_MUSIC_FILES;
m_iVideoStartWindow = WINDOW_VIDEO_FILES;
@@ -670,12 +667,6 @@ bool CSettings::LoadSettings(const CStdString& strSettingsFile)
XMLUtils::GetBoolean(pChild, "repeat", m_bMyMusicPlaylistRepeat);
XMLUtils::GetBoolean(pChild, "shuffle", m_bMyMusicPlaylistShuffle);
}
- // if the user happened to reboot in the middle of the scan we save this state
- pChild = pElement->FirstChildElement("scanning");
- if (pChild)
- {
- XMLUtils::GetBoolean(pChild, "isscanning", m_bMyMusicIsScanning);
- }
GetInteger(pElement, "startwindow", m_iMyMusicStartWindow, WINDOW_MUSIC_FILES, WINDOW_MUSIC_FILES, WINDOW_MUSIC_NAV); //501; view songs
XMLUtils::GetBoolean(pElement, "songinfoinvis", m_bMyMusicSongInfoInVis);
XMLUtils::GetBoolean(pElement, "songthumbinvis", m_bMyMusicSongThumbInVis);
@@ -870,12 +861,6 @@ bool CSettings::SaveSettings(const CStdString& strSettingsFile, CGUISettings *lo
XMLUtils::SetBoolean(pChild, "repeat", m_bMyMusicPlaylistRepeat);
XMLUtils::SetBoolean(pChild, "shuffle", m_bMyMusicPlaylistShuffle);
}
- {
- TiXmlElement childNode("scanning");
- TiXmlNode *pChild = pNode->InsertEndChild(childNode);
- if (!pChild) return false;
- XMLUtils::SetBoolean(pChild, "isscanning", m_bMyMusicIsScanning);
- }
XMLUtils::SetInt(pNode, "needsupdate", m_musicNeedsUpdate);
XMLUtils::SetInt(pNode, "startwindow", m_iMyMusicStartWindow);
View
3 xbmc/settings/Settings.h
@@ -189,9 +189,6 @@ class CSettings
bool m_bMyMusicPlaylistShuffle;
int m_iMyMusicStartWindow;
- // for scanning
- bool m_bMyMusicIsScanning;
-
CVideoSettings m_defaultVideoSettings;
CVideoSettings m_currentVideoSettings;

0 comments on commit d1dda65

Please sign in to comment.