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
62159e88
Commit
62159e88
authored
Jan 23, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: removed song_id_to_position()
song_id_to_position() is only a wrapper for queue_id_to_position().
parent
a6ad0cde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
playlist.c
src/playlist.c
+7
-12
No files found.
src/playlist.c
View file @
62159e88
...
...
@@ -311,18 +311,13 @@ playlistInfo(struct client *client, unsigned start, unsigned end)
return
PLAYLIST_RESULT_SUCCESS
;
}
static
int
song_id_to_position
(
unsigned
id
)
{
return
queue_id_to_position
(
&
playlist
.
queue
,
id
);
}
enum
playlist_result
playlistId
(
struct
client
*
client
,
int
id
)
{
int
begin
=
0
;
unsigned
end
=
queue_length
(
&
playlist
.
queue
);
if
(
id
>=
0
)
{
begin
=
song_id_to_position
(
id
);
begin
=
queue_id_to_position
(
&
playlist
.
queue
,
id
);
if
(
begin
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
@@ -568,8 +563,8 @@ enum playlist_result swapSongsInPlaylist(unsigned song1, unsigned song2)
enum
playlist_result
swapSongsInPlaylistById
(
unsigned
id1
,
unsigned
id2
)
{
int
song1
=
song_id_to_position
(
id1
);
int
song2
=
song_id_to_position
(
id2
);
int
song1
=
queue_id_to_position
(
&
playlist
.
queue
,
id1
);
int
song2
=
queue_id_to_position
(
&
playlist
.
queue
,
id2
);
if
(
song1
<
0
||
song2
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
@@ -641,7 +636,7 @@ enum playlist_result deleteFromPlaylist(unsigned song)
enum
playlist_result
deleteFromPlaylistById
(
unsigned
id
)
{
int
song
=
song_id_to_position
(
id
);
int
song
=
queue_id_to_position
(
&
playlist
.
queue
,
id
);
if
(
song
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
@@ -765,7 +760,7 @@ enum playlist_result playPlaylistById(int id)
return
playPlaylist
(
id
);
}
song
=
song_id_to_position
(
id
);
song
=
queue_id_to_position
(
&
playlist
.
queue
,
id
);
if
(
song
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
@@ -966,7 +961,7 @@ enum playlist_result moveSongInPlaylist(unsigned from, int to)
enum
playlist_result
moveSongInPlaylistById
(
unsigned
id1
,
int
to
)
{
int
song
=
song_id_to_position
(
id1
);
int
song
=
queue_id_to_position
(
&
playlist
.
queue
,
id1
);
if
(
song
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
@@ -1186,7 +1181,7 @@ enum playlist_result seekSongInPlaylist(unsigned song, float seek_time)
enum
playlist_result
seekSongInPlaylistById
(
unsigned
id
,
float
seek_time
)
{
int
song
=
song_id_to_position
(
id
);
int
song
=
queue_id_to_position
(
&
playlist
.
queue
,
id
);
if
(
song
<
0
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
...
...
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