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
53e5139b
Commit
53e5139b
authored
Jan 07, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Queue: move queue_shuffle_order_first() into the class
parent
2b8ce83c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
Queue.cxx
src/Queue.cxx
+4
-5
Queue.hxx
src/Queue.hxx
+2
-0
No files found.
src/Queue.cxx
View file @
53e5139b
...
...
@@ -423,10 +423,10 @@ queue::ShuffleOrder()
ShuffleOrderRangeWithPriority
(
0
,
length
);
}
static
void
queue
_shuffle_order_first
(
struct
queue
*
queue
,
unsigned
start
,
unsigned
end
)
void
queue
::
ShuffleOrderFirst
(
unsigned
start
,
unsigned
end
)
{
queue
->
SwapOrders
(
start
,
g_rand_int_range
(
queue
->
rand
,
start
,
end
));
SwapOrders
(
start
,
g_rand_int_range
(
rand
,
start
,
end
));
}
void
...
...
@@ -543,8 +543,7 @@ queue::SetPriority(unsigned position, uint8_t priority, int after_order)
const
unsigned
priority_count
=
queue_count_same_priority
(
this
,
new_order
,
priority
);
assert
(
priority_count
>=
1
);
queue_shuffle_order_first
(
this
,
new_order
,
new_order
+
priority_count
);
ShuffleOrderFirst
(
new_order
,
new_order
+
priority_count
);
return
true
;
}
...
...
src/Queue.hxx
View file @
53e5139b
...
...
@@ -316,6 +316,8 @@ struct queue {
*/
void
ShuffleOrder
();
void
ShuffleOrderFirst
(
unsigned
start
,
unsigned
end
);
/**
* Shuffles the virtual order of the last song in the specified
* (order) range. This is used in random mode after a song has been
...
...
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