Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
ff7d830a
Commit
ff7d830a
authored
Apr 10, 2016
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put public types in a medialibrary namespace
parent
0c9b3d36
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
120 additions
and
37 deletions
+120
-37
include/IAlbum.h
include/IAlbum.h
+5
-0
include/IAlbumTrack.h
include/IAlbumTrack.h
+5
-0
include/IArtist.h
include/IArtist.h
+5
-0
include/IAudioTrack.h
include/IAudioTrack.h
+5
-0
include/IFile.h
include/IFile.h
+5
-0
include/IGenre.h
include/IGenre.h
+5
-0
include/IHistoryEntry.h
include/IHistoryEntry.h
+5
-0
include/ILabel.h
include/ILabel.h
+5
-0
include/ILogger.h
include/ILogger.h
+5
-0
include/IMedia.h
include/IMedia.h
+5
-0
include/IMediaLibrary.h
include/IMediaLibrary.h
+3
-2
include/IMovie.h
include/IMovie.h
+5
-0
include/IPlaylist.h
include/IPlaylist.h
+5
-0
include/IShow.h
include/IShow.h
+5
-0
include/IShowEpisode.h
include/IShowEpisode.h
+5
-2
include/IVideoTrack.h
include/IVideoTrack.h
+5
-0
include/Types.h
include/Types.h
+12
-7
src/File.h
src/File.h
+1
-1
src/MediaLibrary.h
src/MediaLibrary.h
+2
-0
src/discoverer/DiscovererWorker.h
src/discoverer/DiscovererWorker.h
+1
-1
src/logging/IostreamLogger.h
src/logging/IostreamLogger.h
+2
-2
src/logging/Logger.cpp
src/logging/Logger.cpp
+2
-0
src/logging/Logger.h
src/logging/Logger.h
+16
-16
src/parser/Parser.h
src/parser/Parser.h
+0
-2
src/parser/ParserService.h
src/parser/ParserService.h
+1
-2
src/utils/ModificationsNotifier.h
src/utils/ModificationsNotifier.h
+2
-1
src/utils/VLCInstance.cpp
src/utils/VLCInstance.cpp
+1
-1
test/mocks/NoopCallback.h
test/mocks/NoopCallback.h
+2
-0
No files found.
include/IAlbum.h
View file @
ff7d830a
...
...
@@ -27,6 +27,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IAlbum
{
public:
...
...
@@ -66,3 +69,5 @@ public:
virtual
uint32_t
nbTracks
()
const
=
0
;
virtual
unsigned
int
duration
()
const
=
0
;
};
}
include/IAlbumTrack.h
View file @
ff7d830a
...
...
@@ -25,6 +25,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IAlbumTrack
{
public:
...
...
@@ -50,4 +53,6 @@ class IAlbumTrack
virtual
unsigned
int
discNumber
()
const
=
0
;
};
}
#endif // IALBUMTRACK_H
include/IArtist.h
View file @
ff7d830a
...
...
@@ -27,6 +27,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IArtist
{
public:
...
...
@@ -39,3 +42,5 @@ public:
virtual
const
std
::
string
&
artworkMrl
()
const
=
0
;
virtual
const
std
::
string
&
musicBrainzId
()
const
=
0
;
};
}
include/IAudioTrack.h
View file @
ff7d830a
...
...
@@ -25,6 +25,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IAudioTrack
{
public:
...
...
@@ -41,4 +44,6 @@ class IAudioTrack
virtual
const
std
::
string
&
description
()
const
=
0
;
};
}
#endif // IAUDIOTRACK_H
include/IFile.h
View file @
ff7d830a
...
...
@@ -24,6 +24,9 @@
#include <string>
namespace
medialibrary
{
class
IFile
{
public:
...
...
@@ -53,3 +56,5 @@ public:
virtual
Type
type
()
const
=
0
;
virtual
unsigned
int
lastModificationDate
()
const
=
0
;
};
}
include/IGenre.h
View file @
ff7d830a
...
...
@@ -26,6 +26,9 @@
#include <vector>
namespace
medialibrary
{
class
IGenre
{
public:
...
...
@@ -36,3 +39,5 @@ public:
virtual
std
::
vector
<
MediaPtr
>
tracks
(
medialibrary
::
SortingCriteria
sort
=
medialibrary
::
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
virtual
std
::
vector
<
AlbumPtr
>
albums
(
medialibrary
::
SortingCriteria
sort
=
medialibrary
::
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
};
}
include/IHistoryEntry.h
View file @
ff7d830a
...
...
@@ -24,6 +24,9 @@
#include <string>
namespace
medialibrary
{
class
IHistoryEntry
{
public:
...
...
@@ -33,3 +36,5 @@ public:
virtual
bool
isFavorite
()
const
=
0
;
virtual
bool
setFavorite
(
bool
isFavorite
)
=
0
;
};
}
include/ILabel.h
View file @
ff7d830a
...
...
@@ -28,6 +28,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
ILabel
{
public:
...
...
@@ -38,4 +41,6 @@ class ILabel
virtual
std
::
vector
<
MediaPtr
>
files
()
=
0
;
};
}
#endif // ILABEL_H
include/ILogger.h
View file @
ff7d830a
...
...
@@ -24,6 +24,9 @@
#include <string>
namespace
medialibrary
{
class
ILogger
{
public:
...
...
@@ -33,3 +36,5 @@ public:
virtual
void
Info
(
const
std
::
string
&
msg
)
=
0
;
virtual
void
Debug
(
const
std
::
string
&
msg
)
=
0
;
};
}
include/IMedia.h
View file @
ff7d830a
...
...
@@ -27,6 +27,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IAlbumTrack
;
class
IShowEpisode
;
class
ITrackInformation
;
...
...
@@ -93,3 +96,5 @@ class IMedia
virtual
unsigned
int
insertionDate
()
const
=
0
;
virtual
unsigned
int
releaseDate
()
const
=
0
;
};
}
include/IMediaLibrary.h
View file @
ff7d830a
...
...
@@ -64,7 +64,6 @@ namespace medialibrary
LastModificationDate
,
ReleaseDate
,
};
}
class
IMediaLibraryCb
{
...
...
@@ -207,9 +206,11 @@ class IMediaLibrary
virtual
void
reload
(
const
std
::
string
&
entryPoint
)
=
0
;
};
}
extern
"C"
{
IMediaLibrary
*
NewMediaLibrary
();
medialibrary
::
IMediaLibrary
*
NewMediaLibrary
();
}
#endif // IMEDIALIBRARY_H
include/IMovie.h
View file @
ff7d830a
...
...
@@ -25,6 +25,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IMovie
{
public:
...
...
@@ -37,4 +40,6 @@ class IMovie
virtual
std
::
vector
<
MediaPtr
>
files
()
=
0
;
};
}
#endif // IMOVIE_H
include/IPlaylist.h
View file @
ff7d830a
...
...
@@ -26,6 +26,9 @@
#include "Types.h"
namespace
medialibrary
{
class
IPlaylist
{
public:
...
...
@@ -72,3 +75,5 @@ public:
///
virtual
bool
remove
(
int64_t
mediaId
)
=
0
;
};
}
include/IShow.h
View file @
ff7d830a
...
...
@@ -25,6 +25,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IShow
{
public:
...
...
@@ -38,4 +41,6 @@ class IShow
virtual
std
::
vector
<
ShowEpisodePtr
>
episodes
()
=
0
;
};
}
#endif // ISHOW_H
include/IShowEpisode.h
View file @
ff7d830a
...
...
@@ -23,10 +23,11 @@
#ifndef ISHOWEPISODE_H
#define ISHOWEPISODE_H
class
IShow
;
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IShowEpisode
{
public:
...
...
@@ -43,4 +44,6 @@ class IShowEpisode
virtual
std
::
vector
<
MediaPtr
>
files
()
=
0
;
};
}
#endif // ISHOWEPISODE_H
include/IVideoTrack.h
View file @
ff7d830a
...
...
@@ -25,6 +25,9 @@
#include "IMediaLibrary.h"
namespace
medialibrary
{
class
IVideoTrack
{
public:
...
...
@@ -36,4 +39,6 @@ class IVideoTrack
virtual
float
fps
()
const
=
0
;
};
}
#endif // IVIDEOTRACK_H
include/Types.h
View file @
ff7d830a
...
...
@@ -24,10 +24,12 @@
#include <memory>
namespace
medialibrary
{
class
IAlbum
;
class
IAlbumTrack
;
class
IAudioTrack
;
class
IDiscoverer
;
class
IFile
;
class
IGenre
;
class
IHistoryEntry
;
...
...
@@ -41,8 +43,7 @@ class IVideoTrack;
class
ILogger
;
class
IArtist
;
class
IPlaylist
;
class
SqliteConnection
;
class
MediaLibrary
;
class
IMediaLibraryCb
;
using
AlbumPtr
=
std
::
shared_ptr
<
IAlbum
>
;
using
AlbumTrackPtr
=
std
::
shared_ptr
<
IAlbumTrack
>
;
...
...
@@ -59,10 +60,6 @@ using ShowEpisodePtr = std::shared_ptr<IShowEpisode>;
using
ShowPtr
=
std
::
shared_ptr
<
IShow
>
;
using
VideoTrackPtr
=
std
::
shared_ptr
<
IVideoTrack
>
;
using
MediaLibraryPtr
=
const
MediaLibrary
*
;
typedef
SqliteConnection
*
DBConnection
;
enum
class
LogLevel
{
/// Verbose: Extra logs (currently used by to enable third parties logs
...
...
@@ -73,3 +70,11 @@ enum class LogLevel
Warning
,
Error
,
};
}
class
SqliteConnection
;
class
MediaLibrary
;
typedef
SqliteConnection
*
DBConnection
;
using
MediaLibraryPtr
=
const
MediaLibrary
*
;
src/File.h
View file @
ff7d830a
...
...
@@ -41,7 +41,7 @@ struct FileTable
};
}
class
File
:
public
IFile
,
public
DatabaseHelpers
<
File
,
policy
::
FileTable
>
class
File
:
public
medialibrary
::
IFile
,
public
DatabaseHelpers
<
File
,
policy
::
FileTable
>
{
public:
File
(
MediaLibraryPtr
ml
,
sqlite
::
Row
&
row
);
...
...
src/MediaLibrary.h
View file @
ff7d830a
...
...
@@ -48,6 +48,8 @@ namespace factory
class
IFileSystem
;
}
using
namespace
medialibrary
;
class
MediaLibrary
:
public
IMediaLibrary
{
public:
...
...
src/discoverer/DiscovererWorker.h
View file @
ff7d830a
...
...
@@ -65,6 +65,6 @@ private:
std
::
condition_variable
m_cond
;
std
::
atomic_bool
m_run
;
std
::
vector
<
std
::
unique_ptr
<
IDiscoverer
>>
m_discoverers
;
IMediaLibraryCb
*
m_cb
;
medialibrary
::
IMediaLibraryCb
*
m_cb
;
};
src/logging/IostreamLogger.h
View file @
ff7d830a
...
...
@@ -22,10 +22,10 @@
#pragma once
#include
<
ILogger.h
>
#include
"
ILogger.h
"
#include <iostream>
class
IostreamLogger
:
public
ILogger
class
IostreamLogger
:
public
medialibrary
::
ILogger
{
public:
virtual
void
Error
(
const
std
::
string
&
msg
)
override
...
...
src/logging/Logger.cpp
View file @
ff7d830a
...
...
@@ -23,6 +23,8 @@
#include "Logger.h"
#include "logging/IostreamLogger.h"
using
namespace
medialibrary
;
std
::
unique_ptr
<
ILogger
>
Log
::
s_defaultLogger
=
std
::
unique_ptr
<
ILogger
>
(
new
IostreamLogger
);
std
::
atomic
<
ILogger
*>
Log
::
s_logger
;
std
::
atomic
<
LogLevel
>
Log
::
s_logLevel
;
src/logging/Logger.h
View file @
ff7d830a
...
...
@@ -55,7 +55,7 @@ private:
}
template
<
typename
...
Args
>
static
void
log
(
LogLevel
lvl
,
Args
&&
...
args
)
static
void
log
(
medialibrary
::
LogLevel
lvl
,
Args
&&
...
args
)
{
if
(
lvl
<
s_logLevel
.
load
(
std
::
memory_order_relaxed
)
)
return
;
...
...
@@ -72,34 +72,34 @@ private:
switch
(
lvl
)
{
case
LogLevel
::
Error
:
case
medialibrary
::
LogLevel
::
Error
:
l
->
Error
(
msg
);
break
;
case
LogLevel
::
Warning
:
case
medialibrary
::
LogLevel
::
Warning
:
l
->
Warning
(
msg
);
break
;
case
LogLevel
::
Info
:
case
medialibrary
::
LogLevel
::
Info
:
l
->
Info
(
msg
);
break
;
case
LogLevel
::
Verbose
:
case
LogLevel
::
Debug
:
case
medialibrary
::
LogLevel
::
Verbose
:
case
medialibrary
::
LogLevel
::
Debug
:
l
->
Debug
(
msg
);
break
;
}
}
public:
static
void
SetLogger
(
ILogger
*
logger
)
static
void
SetLogger
(
medialibrary
::
ILogger
*
logger
)
{
s_logger
.
store
(
logger
,
std
::
memory_order_relaxed
);
}
static
void
setLogLevel
(
LogLevel
level
)
static
void
setLogLevel
(
medialibrary
::
LogLevel
level
)
{
s_logLevel
.
store
(
level
,
std
::
memory_order_relaxed
);
}
static
LogLevel
logLevel
()
static
medialibrary
::
LogLevel
logLevel
()
{
return
s_logLevel
.
load
(
std
::
memory_order_relaxed
);
}
...
...
@@ -107,33 +107,33 @@ public:
template
<
typename
...
Args
>
static
void
Error
(
Args
&&
...
args
)
{
log
(
LogLevel
::
Error
,
std
::
forward
<
Args
>
(
args
)...
);
log
(
medialibrary
::
LogLevel
::
Error
,
std
::
forward
<
Args
>
(
args
)...
);
}
template
<
typename
...
Args
>
static
void
Warning
(
Args
&&
...
args
)
{
log
(
LogLevel
::
Warning
,
std
::
forward
<
Args
>
(
args
)...
);
log
(
medialibrary
::
LogLevel
::
Warning
,
std
::
forward
<
Args
>
(
args
)...
);
}
template
<
typename
...
Args
>
static
void
Info
(
Args
&&
...
args
)
{
log
(
LogLevel
::
Info
,
std
::
forward
<
Args
>
(
args
)...
);
log
(
medialibrary
::
LogLevel
::
Info
,
std
::
forward
<
Args
>
(
args
)...
);
}
template
<
typename
...
Args
>
static
void
Debug
(
Args
&&
...
args
)
{
log
(
LogLevel
::
Debug
,
std
::
forward
<
Args
>
(
args
)...
);
log
(
medialibrary
::
LogLevel
::
Debug
,
std
::
forward
<
Args
>
(
args
)...
);
}
private:
private:
static
std
::
unique_ptr
<
ILogger
>
s_defaultLogger
;
static
std
::
atomic
<
ILogger
*>
s_logger
;
static
std
::
atomic
<
LogLevel
>
s_logLevel
;
static
std
::
unique_ptr
<
medialibrary
::
ILogger
>
s_defaultLogger
;
static
std
::
atomic
<
medialibrary
::
ILogger
*>
s_logger
;
static
std
::
atomic
<
medialibrary
::
LogLevel
>
s_logLevel
;
};
#if defined(__clang__) || defined(__GNUG__)
...
...
src/parser/Parser.h
View file @
ff7d830a
...
...
@@ -29,8 +29,6 @@
#include "File.h"
class
IMediaLibraryCb
;
// Use an interface to expose only the "done" method
class
IParserCb
{
...
...
src/parser/ParserService.h
View file @
ff7d830a
...
...
@@ -32,7 +32,6 @@
#include "Types.h"
class
IParserCb
;
class
IMediaLibraryCb
;
class
ModificationNotifier
;
class
ParserService
...
...
@@ -73,7 +72,7 @@ private:
protected:
MediaLibrary
*
m_ml
;
IMediaLibraryCb
*
m_cb
;
medialibrary
::
IMediaLibraryCb
*
m_cb
;
std
::
shared_ptr
<
ModificationNotifier
>
m_notifier
;
private:
...
...
src/utils/ModificationsNotifier.h
View file @
ff7d830a
...
...
@@ -29,9 +29,10 @@
#include <thread>
#include <vector>
#include <chrono>
#include "Types.h"
class
IM
edia
L
ibrary
Cb
;
using
namespace
m
edia
l
ibrary
;
class
ModificationNotifier
{
...
...
src/utils/VLCInstance.cpp
View file @
ff7d830a
...
...
@@ -36,7 +36,7 @@ struct Init
};
instance
=
VLC
::
Instance
(
sizeof
(
args
)
/
sizeof
(
args
[
0
]),
args
);
instance
.
logSet
([
this
](
int
lvl
,
const
libvlc_log_t
*
,
std
::
string
msg
)
{
if
(
Log
::
logLevel
()
!=
LogLevel
::
Verbose
)
if
(
Log
::
logLevel
()
!=
medialibrary
::
LogLevel
::
Verbose
)
return
;
if
(
lvl
==
LIBVLC_ERROR
)
Log
::
Error
(
msg
);
...
...
test/mocks/NoopCallback.h
View file @
ff7d830a
...
...
@@ -24,6 +24,8 @@
#include "IMediaLibrary.h"
using
namespace
medialibrary
;
namespace
mock
{
...
...
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