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
704be54c
Commit
704be54c
authored
Aug 31, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistControl: move code to new method SeekSongOrder()
parent
24061525
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
Playlist.hxx
src/Playlist.hxx
+4
-0
PlaylistControl.cxx
src/PlaylistControl.cxx
+15
-7
No files found.
src/Playlist.hxx
View file @
704be54c
...
@@ -234,6 +234,10 @@ public:
...
@@ -234,6 +234,10 @@ public:
void
PlayPrevious
(
PlayerControl
&
pc
);
void
PlayPrevious
(
PlayerControl
&
pc
);
PlaylistResult
SeekSongOrder
(
PlayerControl
&
pc
,
unsigned
song_order
,
float
seek_time
);
PlaylistResult
SeekSongPosition
(
PlayerControl
&
pc
,
PlaylistResult
SeekSongPosition
(
PlayerControl
&
pc
,
unsigned
song_position
,
unsigned
song_position
,
float
seek_time
);
float
seek_time
);
...
...
src/PlaylistControl.cxx
View file @
704be54c
...
@@ -190,17 +190,12 @@ playlist::PlayPrevious(PlayerControl &pc)
...
@@ -190,17 +190,12 @@ playlist::PlayPrevious(PlayerControl &pc)
}
}
PlaylistResult
PlaylistResult
playlist
::
SeekSong
Position
(
PlayerControl
&
pc
,
unsigned
song
,
float
seek_time
)
playlist
::
SeekSong
Order
(
PlayerControl
&
pc
,
unsigned
i
,
float
seek_time
)
{
{
if
(
!
queue
.
IsValidPosition
(
song
))
assert
(
queue
.
IsValidOrder
(
i
));
return
PlaylistResult
::
BAD_RANGE
;
const
Song
*
queued_song
=
GetQueuedSong
();
const
Song
*
queued_song
=
GetQueuedSong
();
unsigned
i
=
queue
.
random
?
queue
.
PositionToOrder
(
song
)
:
song
;
pc
.
ClearError
();
pc
.
ClearError
();
stop_on_error
=
true
;
stop_on_error
=
true
;
error_count
=
0
;
error_count
=
0
;
...
@@ -229,6 +224,19 @@ playlist::SeekSongPosition(PlayerControl &pc, unsigned song, float seek_time)
...
@@ -229,6 +224,19 @@ playlist::SeekSongPosition(PlayerControl &pc, unsigned song, float seek_time)
}
}
PlaylistResult
PlaylistResult
playlist
::
SeekSongPosition
(
PlayerControl
&
pc
,
unsigned
song
,
float
seek_time
)
{
if
(
!
queue
.
IsValidPosition
(
song
))
return
PlaylistResult
::
BAD_RANGE
;
unsigned
i
=
queue
.
random
?
queue
.
PositionToOrder
(
song
)
:
song
;
return
SeekSongOrder
(
pc
,
i
,
seek_time
);
}
PlaylistResult
playlist
::
SeekSongId
(
PlayerControl
&
pc
,
unsigned
id
,
float
seek_time
)
playlist
::
SeekSongId
(
PlayerControl
&
pc
,
unsigned
id
,
float
seek_time
)
{
{
int
song
=
queue
.
IdToPosition
(
id
);
int
song
=
queue
.
IdToPosition
(
id
);
...
...
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