playqueue: Implement a reset() function
Only available when CONFIG_TESTING is enabled. Used to test clearing the library and library playqueue for testing. Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
e94063473e
commit
1cf268c6bf
|
@ -42,6 +42,9 @@ public:
|
|||
|
||||
unsigned int next();
|
||||
void reset_cur();
|
||||
#ifdef CONFIG_TEST
|
||||
void reset();
|
||||
#endif /* CONFIG_TEST */
|
||||
};
|
||||
|
||||
#endif /* OCARINA_PLAYQUEUE_H */
|
||||
|
|
|
@ -123,6 +123,7 @@ Playqueue *deck :: get_library_pq()
|
|||
void deck :: reset()
|
||||
{
|
||||
playqueue_deck.clear();
|
||||
library_playqueue.reset();
|
||||
}
|
||||
|
||||
void deck :: print_info()
|
||||
|
|
|
@ -139,3 +139,11 @@ void Playqueue :: reset_cur()
|
|||
{
|
||||
cur = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TEST
|
||||
void Playqueue :: reset()
|
||||
{
|
||||
tracks.clear();
|
||||
reset_cur();
|
||||
}
|
||||
#endif /* CONFIG_TEST */
|
||||
|
|
Loading…
Reference in New Issue