3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
24 #include "GUIPassword.h"
28 \brief Represents a share.
29 \sa VECMediaSource, IVECSOURCES
36 SOURCE_TYPE_UNKNOWN
= 0,
37 SOURCE_TYPE_LOCAL
= 1,
39 SOURCE_TYPE_VIRTUAL_DVD
= 3,
40 SOURCE_TYPE_REMOTE
= 4,
41 SOURCE_TYPE_VPATH
= 5,
42 SOURCE_TYPE_REMOVABLE
= 6
44 CMediaSource() { m_iDriveType
=SOURCE_TYPE_UNKNOWN
; m_iLockMode
=LOCK_MODE_EVERYONE
; m_iBadPwdCount
=0; m_iHasLock
=0; m_ignore
=false; m_allowSharing
=true; };
45 virtual ~CMediaSource() {};
47 bool operator==(const CMediaSource
&right
) const;
49 void FromNameAndPaths(const CStdString
&category
, const CStdString
&name
, const std::vector
<CStdString
> &paths
);
50 bool IsWritable() const;
51 CStdString strName
; ///< Name of the share, can be choosen freely.
52 CStdString strStatus
; ///< Status of the share (eg has disk etc.)
53 CStdString strDiskUniqueId
; ///< removable:// + DVD Label + DVD ID for resume point storage, if available
54 CStdString strPath
; ///< Path of the share, eg. iso9660:// or F:
57 \brief The type of the media source.
60 - SOURCE_TYPE_UNKNOWN \n
61 Unknown source, maybe a wrong path.
62 - SOURCE_TYPE_LOCAL \n
65 DVD-ROM source of the build in drive, strPath may vary.
66 - SOURCE_TYPE_VIRTUAL_DVD \n
67 DVD-ROM source, strPath is fix.
68 - SOURCE_TYPE_REMOTE \n
71 SourceType m_iDriveType
;
74 \brief The type of Lock UI to show when accessing the media source.
77 - CMediaSource::LOCK_MODE_EVERYONE \n
78 Default value. No lock UI is shown, user can freely access the source.
79 - LOCK_MODE_NUMERIC \n
80 Lock code is entered via OSD numpad or IrDA remote buttons.
81 - LOCK_MODE_GAMEPAD \n
82 Lock code is entered via XBOX gamepad buttons.
84 Lock code is entered via OSD keyboard or PC USB keyboard.
86 Lock code is entered via OSD keyboard or PC USB keyboard and passed directly to SMB for authentication.
87 - LOCK_MODE_EEPROM_PARENTAL \n
88 Lock code is retrieved from XBOX EEPROM and entered via XBOX gamepad or remote.
89 - LOCK_MODE_UNKNOWN \n
90 Value is unknown or unspecified.
93 CStdString m_strLockCode
; ///< Input code for Lock UI to verify, can be chosen freely.
95 int m_iBadPwdCount
; ///< Number of wrong passwords user has entered since share was last unlocked
97 CStdString m_strThumbnailImage
; ///< Path to a thumbnail image for the share, or blank for default
99 std::vector
<CStdString
> vecPaths
;
100 bool m_ignore
; /// <Do not store in xml
101 bool m_allowSharing
; /// <Allow browsing of source from UPnP / WebServer
106 \brief A vector to hold CMediaSource objects.
107 \sa CMediaSource, IVECSOURCES
109 typedef std::vector
<CMediaSource
> VECSOURCES
;
113 \brief Iterator of VECSOURCES.
114 \sa CMediaSource, VECSOURCES
116 typedef std::vector
<CMediaSource
>::iterator IVECSOURCES
;
117 typedef std::vector
<CMediaSource
>::const_iterator CIVECSOURCES
;
119 void AddOrReplace(VECSOURCES
& sources
, const VECSOURCES
& extras
);
120 void AddOrReplace(VECSOURCES
& sources
, const CMediaSource
& source
);