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
8aa4a66b
Commit
8aa4a66b
authored
Nov 25, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist: move playlist_song_started() into the class
parent
2e7153d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
Playlist.cxx
src/queue/Playlist.cxx
+9
-12
Playlist.hxx
src/queue/Playlist.hxx
+6
-0
No files found.
src/queue/Playlist.cxx
View file @
8aa4a66b
...
...
@@ -63,24 +63,21 @@ playlist_queue_song_order(playlist &playlist, PlayerControl &pc,
pc
.
EnqueueSong
(
new
DetachedSong
(
song
));
}
/**
* Called if the player thread has started playing the "queued" song.
*/
static
void
playlist_song_started
(
playlist
&
playlist
,
PlayerControl
&
pc
)
inline
void
playlist
::
QueuedSongStarted
(
PlayerControl
&
pc
)
{
assert
(
pc
.
next_song
==
nullptr
);
assert
(
playlist
.
queued
>=
-
1
);
assert
(
queued
>=
-
1
);
/* queued song has started: copy queued to current,
and notify the clients */
int
current
=
playlist
.
current
;
playlist
.
current
=
playlist
.
queued
;
playlist
.
queued
=
-
1
;
const
int
old_current
=
current
;
current
=
queued
;
queued
=
-
1
;
if
(
playlist
.
queue
.
consume
)
playlist
.
DeleteOrder
(
pc
,
current
);
if
(
queue
.
consume
)
DeleteOrder
(
pc
,
old_
current
);
idle_add
(
IDLE_PLAYER
);
}
...
...
@@ -185,7 +182,7 @@ playlist::SyncWithPlayer(PlayerControl &pc)
/* check if the player thread has already started
playing the queued song */
if
(
pc_next_song
==
nullptr
&&
queued
!=
-
1
)
playlist_song_started
(
*
this
,
pc
);
QueuedSongStarted
(
pc
);
pc
.
Lock
();
pc_next_song
=
pc
.
next_song
;
...
...
src/queue/Playlist.hxx
View file @
8aa4a66b
...
...
@@ -145,6 +145,12 @@ protected:
*/
void
UpdateQueuedSong
(
PlayerControl
&
pc
,
const
DetachedSong
*
prev
);
/**
* Called when the player thread has started playing the
* "queued" song.
*/
void
QueuedSongStarted
(
PlayerControl
&
pc
);
public
:
void
BeginBulk
();
void
CommitBulk
(
PlayerControl
&
pc
);
...
...
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