Queue: Clean up queue flags
Reformat the doxygen comments and remove the unused Q_FLAG_MASK constant. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
5a31963e30
commit
a1b6955a1d
|
@ -19,7 +19,7 @@ Queue :: Queue()
|
|||
}
|
||||
|
||||
Queue :: Queue(unsigned int f)
|
||||
: _cur(-1), _flags(f & Q_FLAG_MASK), _length(0)
|
||||
: _cur(-1), _flags(f), _length(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -11,30 +11,18 @@
|
|||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
|
||||
/**
|
||||
* Enum defining queue flags.
|
||||
* Enum defining flags that effect a Queue's behavior.
|
||||
*/
|
||||
enum queue_flags {
|
||||
/** Queue is enabled. */
|
||||
Q_ENABLED = (1 << 0),
|
||||
|
||||
/** Queue will pick songs randomly. */
|
||||
Q_RANDOM = (1 << 1),
|
||||
|
||||
/** Queue will not remove songs when picked. */
|
||||
Q_REPEAT = (1 << 2),
|
||||
|
||||
/** Queue will not be sorted. */
|
||||
Q_NO_SORT = (1 << 3),
|
||||
Q_ENABLED = (1 << 0), /**< Queue is enabled. */
|
||||
Q_RANDOM = (1 << 1), /**< Queue will pick songs randomly. */
|
||||
Q_REPEAT = (1 << 2), /**< Queue will not remove songs when picked. */
|
||||
Q_NO_SORT = (1 << 3), /**< Queue will not be sorted. */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Mask of valid flags.
|
||||
*/
|
||||
static const unsigned int Q_FLAG_MASK = Q_ENABLED | Q_RANDOM | Q_REPEAT | Q_NO_SORT;
|
||||
|
||||
|
||||
/**
|
||||
* Track fields that can be compared.
|
||||
*/
|
||||
|
|
|
@ -43,7 +43,7 @@ void test_default()
|
|||
|
||||
void test_constructor(unsigned int flags)
|
||||
{
|
||||
TestQueue q(flags | (1 << 30));
|
||||
TestQueue q(flags);
|
||||
|
||||
test_equal(q.get_cur(), (unsigned)-1);
|
||||
test_equal(q.get_flags(), flags);
|
||||
|
|
Loading…
Reference in New Issue