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
cbea8a2a
Commit
cbea8a2a
authored
Feb 04, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: pass const playlist pointers
Pass constant playlist objects to functions which do not modify it.
parent
080dd095
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
playlist.c
src/playlist.c
+6
-6
playlist.h
src/playlist.h
+6
-9
No files found.
src/playlist.c
View file @
cbea8a2a
...
...
@@ -247,13 +247,13 @@ playPlaylistIfPlayerStopped(struct playlist *playlist)
}
bool
getPlaylistRepeatStatus
(
struct
playlist
*
playlist
)
getPlaylistRepeatStatus
(
const
struct
playlist
*
playlist
)
{
return
playlist
->
queue
.
repeat
;
}
bool
getPlaylistRandomStatus
(
struct
playlist
*
playlist
)
getPlaylistRandomStatus
(
const
struct
playlist
*
playlist
)
{
return
playlist
->
queue
.
random
;
}
...
...
@@ -323,7 +323,7 @@ void setPlaylistRandomStatus(struct playlist *playlist, bool status)
idle_add
(
IDLE_OPTIONS
);
}
int
getPlaylistCurrentSong
(
struct
playlist
*
playlist
)
int
getPlaylistCurrentSong
(
const
struct
playlist
*
playlist
)
{
if
(
playlist
->
current
>=
0
)
return
queue_order_to_position
(
&
playlist
->
queue
,
...
...
@@ -333,19 +333,19 @@ int getPlaylistCurrentSong(struct playlist *playlist)
}
unsigned
long
getPlaylistVersion
(
struct
playlist
*
playlist
)
getPlaylistVersion
(
const
struct
playlist
*
playlist
)
{
return
playlist
->
queue
.
version
;
}
int
getPlaylistLength
(
struct
playlist
*
playlist
)
getPlaylistLength
(
const
struct
playlist
*
playlist
)
{
return
queue_length
(
&
playlist
->
queue
);
}
unsigned
getPlaylistSongId
(
struct
playlist
*
playlist
,
unsigned
song
)
getPlaylistSongId
(
const
struct
playlist
*
playlist
,
unsigned
song
)
{
return
queue_position_to_id
(
&
playlist
->
queue
,
song
);
}
src/playlist.h
View file @
cbea8a2a
...
...
@@ -153,9 +153,6 @@ void previousSongInPlaylist(struct playlist *playlist);
void
shufflePlaylist
(
struct
playlist
*
playlist
);
enum
playlist_result
savePlaylist
(
struct
playlist
*
playlist
,
const
char
*
utf8file
);
void
deleteASongFromPlaylist
(
struct
playlist
*
playlist
,
const
struct
song
*
song
);
...
...
@@ -172,24 +169,24 @@ enum playlist_result
swapSongsInPlaylistById
(
struct
playlist
*
playlist
,
unsigned
id1
,
unsigned
id2
);
bool
getPlaylistRepeatStatus
(
struct
playlist
*
playlist
);
getPlaylistRepeatStatus
(
const
struct
playlist
*
playlist
);
void
setPlaylistRepeatStatus
(
struct
playlist
*
playlist
,
bool
status
);
bool
getPlaylistRandomStatus
(
struct
playlist
*
playlist
);
getPlaylistRandomStatus
(
const
struct
playlist
*
playlist
);
void
setPlaylistRandomStatus
(
struct
playlist
*
playlist
,
bool
status
);
int
getPlaylistCurrentSong
(
struct
playlist
*
playlist
);
int
getPlaylistCurrentSong
(
const
struct
playlist
*
playlist
);
unsigned
getPlaylistSongId
(
struct
playlist
*
playlist
,
unsigned
song
);
getPlaylistSongId
(
const
struct
playlist
*
playlist
,
unsigned
song
);
int
getPlaylistLength
(
struct
playlist
*
playlist
);
int
getPlaylistLength
(
const
struct
playlist
*
playlist
);
unsigned
long
getPlaylistVersion
(
struct
playlist
*
playlist
);
getPlaylistVersion
(
const
struct
playlist
*
playlist
);
enum
playlist_result
seekSongInPlaylist
(
struct
playlist
*
playlist
,
unsigned
song
,
float
seek_time
);
...
...
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