2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
12 #include "media/MediaLockState.h"
19 \brief Represents a share.
20 \sa VECMediaSource, std::vector<CMediaSource>::iterator
22 class CMediaSource final
27 SOURCE_TYPE_UNKNOWN
= 0,
28 SOURCE_TYPE_LOCAL
= 1,
29 SOURCE_TYPE_OPTICAL_DISC
= 2,
30 SOURCE_TYPE_VIRTUAL_OPTICAL_DISC
= 3,
31 SOURCE_TYPE_REMOTE
= 4,
32 SOURCE_TYPE_VPATH
= 5,
33 SOURCE_TYPE_REMOVABLE
= 6
36 bool operator==(const CMediaSource
&right
) const;
38 void FromNameAndPaths(const std::string
&category
, const std::string
&name
, const std::vector
<std::string
> &paths
);
39 bool IsWritable() const;
40 std::string strName
; ///< Name of the share, can be chosen freely.
41 std::string strStatus
; ///< Status of the share (eg has disk etc.)
42 std::string strDiskUniqueId
; ///< removable:// + DVD Label + DVD ID for resume point storage, if available
43 std::string strPath
; ///< Path of the share, eg. iso9660:// or F:
46 \brief The type of the media source.
49 - SOURCE_TYPE_UNKNOWN \n
50 Unknown source, maybe a wrong path.
51 - SOURCE_TYPE_LOCAL \n
53 - SOURCE_TYPE_OPTICAL_DISC \n
54 DVD-ROM source of the build in drive, strPath may vary.
55 - SOURCE_TYPE_VIRTUAL_OPTICAL_DISC \n
56 DVD-ROM source, strPath is fix.
57 - SOURCE_TYPE_REMOTE \n
60 SourceType m_iDriveType
= SOURCE_TYPE_UNKNOWN
;
63 \brief The type of Lock UI to show when accessing the media source.
66 - CMediaSource::LOCK_MODE_EVERYONE \n
67 Default value. No lock UI is shown, user can freely access the source.
68 - LOCK_MODE_NUMERIC \n
69 Lock code is entered via OSD numpad or IrDA remote buttons.
70 - LOCK_MODE_GAMEPAD \n
71 Lock code is entered via XBOX gamepad buttons.
73 Lock code is entered via OSD keyboard or PC USB keyboard.
75 Lock code is entered via OSD keyboard or PC USB keyboard and passed directly to SMB for authentication.
76 - LOCK_MODE_EEPROM_PARENTAL \n
77 Lock code is retrieved from XBOX EEPROM and entered via XBOX gamepad or remote.
78 - LOCK_MODE_UNKNOWN \n
79 Value is unknown or unspecified.
81 LockType m_iLockMode
= LOCK_MODE_EVERYONE
;
82 std::string m_strLockCode
; ///< Input code for Lock UI to verify, can be chosen freely.
83 int m_iHasLock
= LOCK_STATE_NO_LOCK
;
84 int m_iBadPwdCount
= 0; ///< Number of wrong passwords user has entered since share was last unlocked
86 std::string m_strThumbnailImage
; ///< Path to a thumbnail image for the share, or blank for default
88 std::vector
<std::string
> vecPaths
;
89 bool m_ignore
= false; /// <Do not store in xml
90 bool m_allowSharing
= true; /// <Allow browsing of source from UPnP / WebServer
93 void AddOrReplace(std::vector
<CMediaSource
>& sources
, const std::vector
<CMediaSource
>& extras
);
94 void AddOrReplace(std::vector
<CMediaSource
>& sources
, const CMediaSource
& source
);