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
93e6d4c3
Commit
93e6d4c3
authored
Sep 07, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: don't pass "fd" to showPlaylist(), playlistChangesPosId()
Pass the client struct instead of the raw file descriptor.
parent
709ec6fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
command.c
src/command.c
+2
-2
playlist.c
src/playlist.c
+6
-7
playlist.h
src/playlist.h
+2
-2
No files found.
src/command.c
View file @
93e6d4c3
...
...
@@ -525,7 +525,7 @@ static int handleDeleteId(struct client *client, mpd_unused int *permission,
static
int
handlePlaylist
(
struct
client
*
client
,
mpd_unused
int
*
permission
,
mpd_unused
int
argc
,
mpd_unused
char
*
argv
[])
{
showPlaylist
(
client
_get_fd
(
client
)
);
showPlaylist
(
client
);
return
0
;
}
...
...
@@ -641,7 +641,7 @@ static int handlePlaylistChangesPosId(struct client *client, mpd_unused int *per
if
(
check_uint32
(
client
,
&
version
,
argv
[
1
],
need_positive
)
<
0
)
return
-
1
;
return
playlistChangesPosId
(
client
_get_fd
(
client
)
,
version
);
return
playlistChangesPosId
(
client
,
version
);
}
static
int
handlePlaylistInfo
(
struct
client
*
client
,
mpd_unused
int
*
permission
,
...
...
src/playlist.c
View file @
93e6d4c3
...
...
@@ -31,7 +31,6 @@
#include "state_file.h"
#include "storedPlaylist.h"
#include "ack.h"
#include "myfprintf.h"
#include "os_compat.h"
#define PLAYLIST_STATE_STOP 0
...
...
@@ -218,14 +217,14 @@ int clearStoredPlaylist(const char *utf8file)
return
removeAllFromStoredPlaylistByPath
(
utf8file
);
}
void
showPlaylist
(
int
fd
)
void
showPlaylist
(
struct
client
*
client
)
{
int
i
;
char
path_max_tmp
[
MPD_PATH_MAX
];
for
(
i
=
0
;
i
<
playlist
.
length
;
i
++
)
{
fdprintf
(
fd
,
"%i:%s
\n
"
,
i
,
get_song_url
(
path_max_tmp
,
playlist
.
songs
[
i
]));
client_printf
(
client
,
"%i:%s
\n
"
,
i
,
get_song_url
(
path_max_tmp
,
playlist
.
songs
[
i
]));
}
}
...
...
@@ -400,7 +399,7 @@ int playlistChanges(struct client *client, mpd_uint32 version)
return
0
;
}
int
playlistChangesPosId
(
int
fd
,
mpd_uint32
version
)
int
playlistChangesPosId
(
struct
client
*
client
,
mpd_uint32
version
)
{
int
i
;
...
...
@@ -408,8 +407,8 @@ int playlistChangesPosId(int fd, mpd_uint32 version)
if
(
version
>
playlist
.
version
||
playlist
.
songMod
[
i
]
>=
version
||
playlist
.
songMod
[
i
]
==
0
)
{
fdprintf
(
fd
,
"cpos: %i
\n
Id: %i
\n
"
,
i
,
playlist
.
positionToId
[
i
]);
client_printf
(
client
,
"cpos: %i
\n
Id: %i
\n
"
,
i
,
playlist
.
positionToId
[
i
]);
}
}
...
...
src/playlist.h
View file @
93e6d4c3
...
...
@@ -73,7 +73,7 @@ int addToStoredPlaylist(const char *file, const char *utf8file);
enum
playlist_result
addSongToPlaylist
(
Song
*
song
,
int
*
added_id
);
void
showPlaylist
(
int
fd
);
void
showPlaylist
(
struct
client
*
client
);
enum
playlist_result
deleteFromPlaylist
(
int
song
);
...
...
@@ -139,7 +139,7 @@ void playlistVersionChange(void);
int
playlistChanges
(
struct
client
*
client
,
mpd_uint32
version
);
int
playlistChangesPosId
(
int
fd
,
mpd_uint32
version
);
int
playlistChangesPosId
(
struct
client
*
client
,
mpd_uint32
version
);
int
PlaylistInfo
(
struct
client
*
client
,
const
char
*
utf8file
,
int
detail
);
...
...
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