Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4a3dc2ce
Commit
4a3dc2ce
authored
Jan 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp: rename variables
parent
bd0cfffe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
UpnpDatabasePlugin.cxx
src/db/plugins/UpnpDatabasePlugin.cxx
+21
-21
No files found.
src/db/plugins/UpnpDatabasePlugin.cxx
View file @
4a3dc2ce
...
...
@@ -69,8 +69,8 @@ public:
};
class
UpnpDatabase
:
public
Database
{
LibUPnP
*
m_
lib
;
UPnPDeviceDirectory
*
m_superdir
;
LibUPnP
*
lib
;
UPnPDeviceDirectory
*
discovery
;
public
:
static
Database
*
Create
(
EventLoop
&
loop
,
DatabaseListener
&
listener
,
...
...
@@ -175,17 +175,17 @@ UpnpDatabase::Configure(const config_param &, Error &)
bool
UpnpDatabase
::
Open
(
Error
&
error
)
{
m_
lib
=
new
LibUPnP
();
if
(
!
m_
lib
->
ok
())
{
error
.
Set
(
m_
lib
->
GetInitError
());
delete
m_
lib
;
lib
=
new
LibUPnP
();
if
(
!
lib
->
ok
())
{
error
.
Set
(
lib
->
GetInitError
());
delete
lib
;
return
false
;
}
m_superdir
=
new
UPnPDeviceDirectory
(
m_
lib
);
if
(
!
m_superdir
->
Start
(
error
))
{
delete
m_superdir
;
delete
m_
lib
;
discovery
=
new
UPnPDeviceDirectory
(
lib
);
if
(
!
discovery
->
Start
(
error
))
{
delete
discovery
;
delete
lib
;
return
false
;
}
...
...
@@ -198,8 +198,8 @@ UpnpDatabase::Open(Error &error)
void
UpnpDatabase
::
Close
()
{
delete
m_superdir
;
delete
m_
lib
;
delete
discovery
;
delete
lib
;
}
void
...
...
@@ -223,7 +223,7 @@ UpnpDatabase::GetSong(const char *uri, Error &error) const
}
ContentDirectoryService
server
;
if
(
!
m_superdir
->
getServer
(
vpath
.
front
().
c_str
(),
server
,
error
))
if
(
!
discovery
->
getServer
(
vpath
.
front
().
c_str
(),
server
,
error
))
return
nullptr
;
vpath
.
pop_front
();
...
...
@@ -277,7 +277,7 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
return
true
;
std
::
list
<
std
::
string
>
searchcaps
;
if
(
!
server
.
getSearchCapabilities
(
m_
lib
->
getclh
(),
searchcaps
,
error
))
if
(
!
server
.
getSearchCapabilities
(
lib
->
getclh
(),
searchcaps
,
error
))
return
false
;
if
(
searchcaps
.
empty
())
...
...
@@ -344,7 +344,7 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
}
}
return
server
.
search
(
m_
lib
->
getclh
(),
return
server
.
search
(
lib
->
getclh
(),
objid
,
cond
.
c_str
(),
dirbuf
,
error
);
}
...
...
@@ -431,7 +431,7 @@ UpnpDatabase::ReadNode(const ContentDirectoryService &server,
Error
&
error
)
const
{
UPnPDirContent
dirbuf
;
if
(
!
server
.
getMetadata
(
m_
lib
->
getclh
(),
objid
,
dirbuf
,
error
))
if
(
!
server
.
getMetadata
(
lib
->
getclh
(),
objid
,
dirbuf
,
error
))
return
false
;
if
(
dirbuf
.
objects
.
size
()
==
1
)
{
...
...
@@ -485,7 +485,7 @@ UpnpDatabase::Namei(const ContentDirectoryService &server,
return
true
;
}
const
UpnpClient_Handle
handle
=
m_
lib
->
getclh
();
const
UpnpClient_Handle
handle
=
lib
->
getclh
();
std
::
string
objid
(
rootid
);
...
...
@@ -663,7 +663,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
and loop here, but it's not useful as mpd will only return
data to the client when we're done anyway. */
UPnPDirContent
dirbuf
;
if
(
!
server
.
readDir
(
m_
lib
->
getclh
(),
tdirent
.
m_id
.
c_str
(),
dirbuf
,
if
(
!
server
.
readDir
(
lib
->
getclh
(),
tdirent
.
m_id
.
c_str
(),
dirbuf
,
error
))
return
false
;
...
...
@@ -692,7 +692,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
auto
vpath
=
stringToTokens
(
selection
.
uri
,
"/"
,
true
);
if
(
vpath
.
empty
())
{
std
::
vector
<
ContentDirectoryService
>
servers
;
if
(
!
m_superdir
->
getDirServices
(
servers
,
error
))
if
(
!
discovery
->
getDirServices
(
servers
,
error
))
return
false
;
for
(
const
auto
&
server
:
servers
)
{
...
...
@@ -717,7 +717,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
vpath
.
pop_front
();
ContentDirectoryService
server
;
if
(
!
m_superdir
->
getServer
(
servername
.
c_str
(),
server
,
error
))
if
(
!
discovery
->
getServer
(
servername
.
c_str
(),
server
,
error
))
return
false
;
return
VisitServer
(
server
,
vpath
,
selection
,
...
...
@@ -734,7 +734,7 @@ UpnpDatabase::VisitUniqueTags(const DatabaseSelection &selection,
return
true
;
std
::
vector
<
ContentDirectoryService
>
servers
;
if
(
!
m_superdir
->
getDirServices
(
servers
,
error
))
if
(
!
discovery
->
getDirServices
(
servers
,
error
))
return
false
;
std
::
set
<
std
::
string
>
values
;
...
...
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