1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
#pragma once
/*
* Copyright (C) 2005-2008 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, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include "StdString.h"
#include <vector>
#include "GUIPassword.h"
/*!
\ingroup windows
\brief Represents a share.
\sa VECMediaSource, IVECSOURCES
*/
class CMediaSource
{
public:
enum SourceType
{
SOURCE_TYPE_UNKNOWN = 0,
SOURCE_TYPE_LOCAL = 1,
SOURCE_TYPE_DVD = 2,
SOURCE_TYPE_VIRTUAL_DVD = 3,
SOURCE_TYPE_REMOTE = 4,
SOURCE_TYPE_VPATH = 5
};
CMediaSource() { m_iDriveType=SOURCE_TYPE_UNKNOWN; m_iLockMode=LOCK_MODE_EVERYONE; m_iBadPwdCount=0; m_iHasLock=0; m_ignore=false; };
virtual ~CMediaSource() {};
void FromNameAndPaths(const CStdString &category, const CStdString &name, const std::vector<CStdString> &paths);
bool isWritable() const;
CStdString strName; ///< Name of the share, can be choosen freely.
CStdString strStatus; ///< Status of the share (eg has disk etc.)
CStdString strPath; ///< Path of the share, eg. iso9660:// or F:
/*!
\brief The type of the media source.
Value can be:
- SOURCE_TYPE_UNKNOWN \n
Unknown source, maybe a wrong path.
- SOURCE_TYPE_LOCAL \n
Harddisk source.
- SOURCE_TYPE_DVD \n
DVD-ROM source of the build in drive, strPath may vary.
- SOURCE_TYPE_VIRTUAL_DVD \n
DVD-ROM source, strPath is fix.
- SOURCE_TYPE_REMOTE \n
Network source.
*/
SourceType m_iDriveType;
/*!
\brief The type of Lock UI to show when accessing the media source.
Value can be:
- CMediaSource::LOCK_MODE_EVERYONE \n
Default value. No lock UI is shown, user can freely access the source.
- LOCK_MODE_NUMERIC \n
Lock code is entered via OSD numpad or IrDA remote buttons.
- LOCK_MODE_GAMEPAD \n
Lock code is entered via XBOX gamepad buttons.
- LOCK_MODE_QWERTY \n
Lock code is entered via OSD keyboard or PC USB keyboard.
- LOCK_MODE_SAMBA \n
Lock code is entered via OSD keyboard or PC USB keyboard and passed directly to SMB for authentication.
- LOCK_MODE_EEPROM_PARENTAL \n
Lock code is retrieved from XBOX EEPROM and entered via XBOX gamepad or remote.
- LOCK_MODE_UNKNOWN \n
Value is unknown or unspecified.
*/
LockType m_iLockMode;
CStdString m_strLockCode; ///< Input code for Lock UI to verify, can be chosen freely.
int m_iHasLock;
int m_iBadPwdCount; ///< Number of wrong passwords user has entered since share was last unlocked
CStdString m_strThumbnailImage; ///< Path to a thumbnail image for the share, or blank for default
std::vector<CStdString> vecPaths;
bool m_ignore; /// <Do not store in xml
};
/*!
\ingroup windows
\brief A vector to hold CMediaSource objects.
\sa CMediaSource, IVECSOURCES
*/
typedef std::vector<CMediaSource> VECSOURCES;
/*!
\ingroup windows
\brief Iterator of VECSOURCES.
\sa CMediaSource, VECSOURCES
*/
typedef std::vector<CMediaSource>::iterator IVECSOURCES;
|