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
49ac6fa9
Commit
49ac6fa9
authored
Jan 04, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: use GLib logging
parent
45597cc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
playlist.c
src/playlist.c
+19
-21
No files found.
src/playlist.c
View file @
49ac6fa9
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
#include "client.h"
#include "client.h"
#include "conf.h"
#include "conf.h"
#include "database.h"
#include "database.h"
#include "log.h"
#include "mapper.h"
#include "mapper.h"
#include "path.h"
#include "path.h"
#include "stored_playlist.h"
#include "stored_playlist.h"
...
@@ -136,10 +135,9 @@ void initPlaylist(void)
...
@@ -136,10 +135,9 @@ void initPlaylist(void)
if
(
param
)
{
if
(
param
)
{
playlist_max_length
=
strtol
(
param
->
value
,
&
test
,
10
);
playlist_max_length
=
strtol
(
param
->
value
,
&
test
,
10
);
if
(
*
test
!=
'\0'
)
{
if
(
*
test
!=
'\0'
)
FATAL
(
"max playlist length
\"
%s
\"
is not an integer, "
g_error
(
"max playlist length
\"
%s
\"
is not an integer, "
"line %i
\n
"
,
param
->
value
,
param
->
line
);
"line %i"
,
param
->
value
,
param
->
line
);
}
}
}
playlist_saveAbsolutePaths
=
getBoolConfigParam
(
playlist_saveAbsolutePaths
=
getBoolConfigParam
(
...
@@ -489,22 +487,22 @@ static void queueNextSongInPlaylist(void)
...
@@ -489,22 +487,22 @@ static void queueNextSongInPlaylist(void)
if
(
playlist
.
current
<
(
int
)
playlist
.
length
-
1
)
{
if
(
playlist
.
current
<
(
int
)
playlist
.
length
-
1
)
{
playlist
.
queued
=
playlist
.
current
+
1
;
playlist
.
queued
=
playlist
.
current
+
1
;
DEBUG
(
"playlist: queue song %i:
\"
%s
\"\n
"
,
g_debug
(
"playlist: queue song %i:
\"
%s
\"
"
,
playlist
.
queued
,
playlist
.
queued
,
song_get_url
(
playlist
.
song_get_url
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]],
songs
[
playlist
.
order
[
playlist
.
queued
]],
path_max_tmp
));
path_max_tmp
));
queueSong
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]]);
queueSong
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]]);
}
else
if
(
playlist
.
length
&&
playlist
.
repeat
)
{
}
else
if
(
playlist
.
length
&&
playlist
.
repeat
)
{
if
(
playlist
.
length
>
1
&&
playlist
.
random
)
{
if
(
playlist
.
length
>
1
&&
playlist
.
random
)
{
randomizeOrder
(
0
,
playlist
.
length
-
1
);
randomizeOrder
(
0
,
playlist
.
length
-
1
);
}
}
playlist
.
queued
=
0
;
playlist
.
queued
=
0
;
DEBUG
(
"playlist: queue song %i:
\"
%s
\"\n
"
,
g_debug
(
"playlist: queue song %i:
\"
%s
\"
"
,
playlist
.
queued
,
playlist
.
queued
,
song_get_url
(
playlist
.
song_get_url
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]],
songs
[
playlist
.
order
[
playlist
.
queued
]],
path_max_tmp
));
path_max_tmp
));
queueSong
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]]);
queueSong
(
playlist
.
songs
[
playlist
.
order
[
playlist
.
queued
]]);
}
}
}
}
...
@@ -575,7 +573,7 @@ enum playlist_result addToPlaylist(const char *url, unsigned *added_id)
...
@@ -575,7 +573,7 @@ enum playlist_result addToPlaylist(const char *url, unsigned *added_id)
{
{
struct
song
*
song
;
struct
song
*
song
;
DEBUG
(
"add to playlist: %s
\n
"
,
url
);
g_debug
(
"add to playlist: %s
"
,
url
);
song
=
song_by_url
(
url
);
song
=
song_by_url
(
url
);
if
(
song
==
NULL
)
if
(
song
==
NULL
)
...
@@ -774,7 +772,7 @@ deleteASongFromPlaylist(const struct song *song)
...
@@ -774,7 +772,7 @@ deleteASongFromPlaylist(const struct song *song)
void
stopPlaylist
(
void
)
void
stopPlaylist
(
void
)
{
{
DEBUG
(
"playlist: stop
\n
"
);
g_debug
(
"playlist: stop
"
);
playerWait
();
playerWait
();
playlist
.
queued
=
-
1
;
playlist
.
queued
=
-
1
;
playlist_state
=
PLAYLIST_STATE_STOP
;
playlist_state
=
PLAYLIST_STATE_STOP
;
...
@@ -791,9 +789,9 @@ static void playPlaylistOrderNumber(int orderNum)
...
@@ -791,9 +789,9 @@ static void playPlaylistOrderNumber(int orderNum)
playlist_noGoToNext
=
0
;
playlist_noGoToNext
=
0
;
playlist
.
queued
=
-
1
;
playlist
.
queued
=
-
1
;
DEBUG
(
"playlist: play %i:
\"
%s
\"\n
"
,
orderNum
,
g_debug
(
"playlist: play %i:
\"
%s
\"
"
,
orderNum
,
song_get_url
(
playlist
.
songs
[
playlist
.
order
[
orderNum
]],
song_get_url
(
playlist
.
songs
[
playlist
.
order
[
orderNum
]],
path_max_tmp
));
path_max_tmp
));
playerPlay
(
playlist
.
songs
[
playlist
.
order
[
orderNum
]]);
playerPlay
(
playlist
.
songs
[
playlist
.
order
[
orderNum
]]);
playlist
.
current
=
orderNum
;
playlist
.
current
=
orderNum
;
...
@@ -1112,7 +1110,7 @@ static void randomizeOrder(int start, int end)
...
@@ -1112,7 +1110,7 @@ static void randomizeOrder(int start, int end)
int
i
;
int
i
;
int
ri
;
int
ri
;
DEBUG
(
"playlist: randomize from %i to %i
\n
"
,
start
,
end
);
g_debug
(
"playlist: randomize from %i to %i
\n
"
,
start
,
end
);
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
&&
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
&&
playlist
.
queued
>=
start
&&
playlist
.
queued
<=
end
)
playlist
.
queued
>=
start
&&
playlist
.
queued
<=
end
)
...
...
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