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
9af470c9
Commit
9af470c9
authored
Nov 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist: add method SongStarted()
Empty currently, but code will be added song.
parent
ac8c1d0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
Playlist.cxx
src/queue/Playlist.cxx
+10
-0
Playlist.hxx
src/queue/Playlist.hxx
+13
-1
No files found.
src/queue/Playlist.cxx
View file @
9af470c9
...
@@ -60,6 +60,12 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order)
...
@@ -60,6 +60,12 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order)
pc
.
EnqueueSong
(
new
DetachedSong
(
song
));
pc
.
EnqueueSong
(
new
DetachedSong
(
song
));
}
}
void
playlist
::
SongStarted
()
{
assert
(
current
>=
0
);
}
inline
void
inline
void
playlist
::
QueuedSongStarted
(
PlayerControl
&
pc
)
playlist
::
QueuedSongStarted
(
PlayerControl
&
pc
)
{
{
...
@@ -78,6 +84,8 @@ playlist::QueuedSongStarted(PlayerControl &pc)
...
@@ -78,6 +84,8 @@ playlist::QueuedSongStarted(PlayerControl &pc)
DeleteOrder
(
pc
,
old_current
);
DeleteOrder
(
pc
,
old_current
);
idle_add
(
IDLE_PLAYER
);
idle_add
(
IDLE_PLAYER
);
SongStarted
();
}
}
const
DetachedSong
*
const
DetachedSong
*
...
@@ -152,6 +160,8 @@ playlist::PlayOrder(PlayerControl &pc, int order)
...
@@ -152,6 +160,8 @@ playlist::PlayOrder(PlayerControl &pc, int order)
pc
.
Play
(
new
DetachedSong
(
song
));
pc
.
Play
(
new
DetachedSong
(
song
));
current
=
order
;
current
=
order
;
SongStarted
();
}
}
void
void
...
...
src/queue/Playlist.hxx
View file @
9af470c9
...
@@ -135,6 +135,17 @@ protected:
...
@@ -135,6 +135,17 @@ protected:
void
OnModified
();
void
OnModified
();
/**
/**
* Called when playback of a new song starts. Unlike
* QueuedSongStarted(), this also gets called when the user
* manually switches to another song. It may be used for
* playlist fixups.
*
* The song being started is specified by the #current
* attribute.
*/
void
SongStarted
();
/**
* Updates the "queued song". Calculates the next song
* Updates the "queued song". Calculates the next song
* according to the current one (if MPD isn't playing, it
* according to the current one (if MPD isn't playing, it
* takes the first song), and queues this song. Clears the
* takes the first song), and queues this song. Clears the
...
@@ -152,7 +163,8 @@ protected:
...
@@ -152,7 +163,8 @@ protected:
/**
/**
* Called when the player thread has started playing the
* Called when the player thread has started playing the
* "queued" song.
* "queued" song, i.e. it has switched from one song to the
* next automatically.
*/
*/
void
QueuedSongStarted
(
PlayerControl
&
pc
);
void
QueuedSongStarted
(
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