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:
Anna Schumaker 2014-01-22 19:34:01 -05:00 committed by Anna Schumaker
parent e94063473e
commit 1cf268c6bf
3 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,9 @@ public:
unsigned int next();
void reset_cur();
#ifdef CONFIG_TEST
void reset();
#endif /* CONFIG_TEST */
};
#endif /* OCARINA_PLAYQUEUE_H */

View File

@ -123,6 +123,7 @@ Playqueue *deck :: get_library_pq()
void deck :: reset()
{
playqueue_deck.clear();
library_playqueue.reset();
}
void deck :: print_info()

View File

@ -139,3 +139,11 @@ void Playqueue :: reset_cur()
{
cur = 0;
}
#ifdef CONFIG_TEST
void Playqueue :: reset()
{
tracks.clear();
reset_cur();
}
#endif /* CONFIG_TEST */