Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
082592f2
Commit
082592f2
authored
May 23, 2014
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File: Make Type available from the interface & constify some methods
parent
ca8d6b1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
include/IFile.h
include/IFile.h
+11
-3
src/File.cpp
src/File.cpp
+3
-3
src/File.h
src/File.h
+3
-11
No files found.
include/IFile.h
View file @
082592f2
...
...
@@ -14,14 +14,22 @@ class ITrackInformation;
class
IFile
{
public:
enum
Type
{
VideoType
,
// Any video file, not being a tv show episode
AudioType
,
// Any kind of audio file, not being an album track
ShowEpisodeType
,
AlbumTrackType
,
UnknownType
,
};
virtual
~
IFile
()
{}
virtual
unsigned
int
id
()
const
=
0
;
virtual
std
::
shared_ptr
<
IAlbumTrack
>
albumTrack
()
=
0
;
virtual
unsigned
int
duration
()
=
0
;
virtual
unsigned
int
duration
()
const
=
0
;
virtual
std
::
shared_ptr
<
IShowEpisode
>
showEpisode
()
=
0
;
virtual
int
playCount
()
=
0
;
virtual
const
std
::
string
&
mrl
()
=
0
;
virtual
int
playCount
()
const
=
0
;
virtual
const
std
::
string
&
mrl
()
const
=
0
;
virtual
bool
addLabel
(
LabelPtr
label
)
=
0
;
virtual
bool
removeLabel
(
LabelPtr
label
)
=
0
;
virtual
std
::
vector
<
std
::
shared_ptr
<
ILabel
>
>
labels
()
=
0
;
...
...
src/File.cpp
View file @
082592f2
...
...
@@ -59,7 +59,7 @@ std::shared_ptr<IAlbumTrack> File::albumTrack()
return
m_albumTrack
;
}
unsigned
int
File
::
duration
()
unsigned
int
File
::
duration
()
const
{
return
m_duration
;
}
...
...
@@ -83,12 +83,12 @@ std::vector<std::shared_ptr<ILabel> > File::labels()
return
labels
;
}
int
File
::
playCount
()
int
File
::
playCount
()
const
{
return
m_playCount
;
}
const
std
::
string
&
File
::
mrl
()
const
std
::
string
&
File
::
mrl
()
const
{
return
m_mrl
;
}
...
...
src/File.h
View file @
082592f2
...
...
@@ -34,14 +34,6 @@ class File : public IFile, public Cache<File, IFile, policy::FileTable, policy::
private:
typedef
Cache
<
File
,
IFile
,
policy
::
FileTable
,
policy
::
FileCache
>
_Cache
;
public:
enum
Type
{
VideoType
,
// Any video file, not being a tv show episode
AudioType
,
// Any kind of audio file, not being an album track
ShowEpisodeType
,
AlbumTrackType
,
UnknownType
,
};
// Those should be private, however the standard states that the expression
// ::new (pv) T(std::forward(args)...)
...
...
@@ -55,13 +47,13 @@ class File : public IFile, public Cache<File, IFile, policy::FileTable, policy::
virtual
unsigned
int
id
()
const
;
virtual
std
::
shared_ptr
<
IAlbumTrack
>
albumTrack
();
virtual
unsigned
int
duration
();
virtual
unsigned
int
duration
()
const
;
virtual
std
::
shared_ptr
<
IShowEpisode
>
showEpisode
();
virtual
bool
addLabel
(
LabelPtr
label
);
virtual
bool
removeLabel
(
LabelPtr
label
);
virtual
std
::
vector
<
std
::
shared_ptr
<
ILabel
>
>
labels
();
virtual
int
playCount
();
virtual
const
std
::
string
&
mrl
();
virtual
int
playCount
()
const
;
virtual
const
std
::
string
&
mrl
()
const
;
private:
sqlite3
*
m_dbConnection
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment