7104
by darkdonno
changed: file cosmetics removed: trailing whitespace fixed: some TAB usage added: GPL Header |
1 |
/*
|
10178
by vulkanr
merge with trunk. revision 13100. |
2 |
* Copyright (C) 2005-2008 Team XBMC
|
3 |
* http://www.xbmc.org
|
|
7104
by darkdonno
changed: file cosmetics removed: trailing whitespace fixed: some TAB usage added: GPL Header |
4 |
*
|
5 |
* This Program is free software; you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation; either version 2, or (at your option)
|
|
8 |
* any later version.
|
|
9 |
*
|
|
10 |
* This Program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
10178
by vulkanr
merge with trunk. revision 13100. |
16 |
* along with XBMC; see the file COPYING. If not, write to
|
7104
by darkdonno
changed: file cosmetics removed: trailing whitespace fixed: some TAB usage added: GPL Header |
17 |
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
18 |
* http://www.gnu.org/copyleft/gpl.html
|
|
19 |
*
|
|
20 |
*/
|
|
21 |
||
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
22 |
#include "stdafx.h" |
23 |
#include "PictureThumbLoader.h" |
|
24 |
#include "Picture.h" |
|
8601
by vulkanr
merge with trunk. rev: 9636-10031. |
25 |
#include "Util.h" |
10043
by vulkanr
merge with trunk. rev. 12805. |
26 |
#include "URL.h" |
27 |
#include "FileSystem/File.h" |
|
28 |
#include "FileItem.h" |
|
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
29 |
|
7175
by spiff_
fixed: severe global namespace pollution |
30 |
using namespace XFILE; |
3618
by bobbin007
fixed: ftp server can not be shut down via settings menu |
31 |
|
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
32 |
CPictureThumbLoader::CPictureThumbLoader() |
33 |
{
|
|
10519
by spiff_
cosmetics (trailing whitespace) |
34 |
m_regenerateThumbs = false; |
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
35 |
}
|
36 |
||
37 |
CPictureThumbLoader::~CPictureThumbLoader() |
|
38 |
{
|
|
8894
by vulkanr
merge with trunk. revision 10882. |
39 |
StopThread(); |
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
40 |
}
|
41 |
||
42 |
bool CPictureThumbLoader::LoadItem(CFileItem* pItem) |
|
43 |
{
|
|
3505
by jmarshallnz
- 04-07-2005 fixed: Some embedded image thumbs in mp3s weren't loaded correctly. |
44 |
if (pItem->m_bIsShareOrDrive) return true; |
5475
by jmarshallnz
- 06-05-2006 changed: Cleaned up more thumb related code (Picture thumbs are now in UserData/Thumbnails/Pictures/0..F/) |
45 |
pItem->SetCachedPictureThumb(); |
10519
by spiff_
cosmetics (trailing whitespace) |
46 |
|
8601
by vulkanr
merge with trunk. rev: 9636-10031. |
47 |
if(pItem->HasThumbnail()) |
3505
by jmarshallnz
- 04-07-2005 fixed: Some embedded image thumbs in mp3s weren't loaded correctly. |
48 |
{
|
8601
by vulkanr
merge with trunk. rev: 9636-10031. |
49 |
CStdString thumb(pItem->GetThumbnailImage()); |
50 |
||
10519
by spiff_
cosmetics (trailing whitespace) |
51 |
// look for remote thumbs
|
8601
by vulkanr
merge with trunk. rev: 9636-10031. |
52 |
if (!CURL::IsFileOnly(thumb) && !CUtil::IsHD(thumb)) |
53 |
{
|
|
54 |
CStdString cachedThumb(pItem->GetCachedPictureThumb()); |
|
55 |
if(CFile::Exists(cachedThumb)) |
|
56 |
pItem->SetThumbnailImage(cachedThumb); |
|
57 |
else
|
|
58 |
{
|
|
59 |
CPicture pic; |
|
60 |
if(pic.DoCreateThumbnail(thumb, cachedThumb)) |
|
61 |
pItem->SetThumbnailImage(cachedThumb); |
|
62 |
else
|
|
63 |
pItem->SetThumbnailImage(""); |
|
64 |
}
|
|
65 |
}
|
|
66 |
else if (m_regenerateThumbs) |
|
67 |
{
|
|
68 |
CFile::Delete(thumb); |
|
69 |
pItem->SetThumbnailImage(""); |
|
70 |
}
|
|
3505
by jmarshallnz
- 04-07-2005 fixed: Some embedded image thumbs in mp3s weren't loaded correctly. |
71 |
}
|
8601
by vulkanr
merge with trunk. rev: 9636-10031. |
72 |
|
4475
by kraqh3d
- 26-12-2005 added: custom slideshows in My Pictures via m3u playlists (only images are queued into the slideshow) |
73 |
if ((pItem->IsPicture() && !pItem->IsZIP() && !pItem->IsRAR() && !pItem->IsCBZ() && !pItem->IsCBR() && !pItem->IsPlayList()) && !pItem->HasThumbnail()) |
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
74 |
{ // load the thumb from the image file |
75 |
CPicture pic; |
|
5475
by jmarshallnz
- 06-05-2006 changed: Cleaned up more thumb related code (Picture thumbs are now in UserData/Thumbnails/Pictures/0..F/) |
76 |
pic.DoCreateThumbnail(pItem->m_strPath, pItem->GetCachedPictureThumb()); |
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
77 |
}
|
5475
by jmarshallnz
- 06-05-2006 changed: Cleaned up more thumb related code (Picture thumbs are now in UserData/Thumbnails/Pictures/0..F/) |
78 |
// refill in the thumb to get it to update
|
79 |
pItem->SetCachedPictureThumb(); |
|
3477
by jmarshallnz
- 30-06-2005 added: Background thumb reader for My Pictures. Creates thumbs on enter of dir in the background as needed. |
80 |
pItem->FillInDefaultIcon(); |
81 |
return true; |
|
9031
by yuvalt
SF [ 1860228 ] LINUX: Even More GCC Warnings Fixes (thanks monkeyman) |
82 |
}
|
3505
by jmarshallnz
- 04-07-2005 fixed: Some embedded image thumbs in mp3s weren't loaded correctly. |
83 |
|
84 |
void CPictureThumbLoader::OnLoaderFinish() |
|
85 |
{
|
|
86 |
m_regenerateThumbs = false; |
|
8035
by yuvalt
Initial port to Linux/SDL |
87 |
}
|
88 |