libsaria: Give playlists an apparent_size() function
This will return the number of visible songs, instead of the number of songs in the playlist. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
9980f53f63
commit
d075773682
|
@ -49,6 +49,7 @@ namespace libsaria
|
|||
|
||||
void sort();
|
||||
unsigned int size();
|
||||
unsigned int apparent_size();
|
||||
Track *next();
|
||||
|
||||
/* Iterator functions */
|
||||
|
|
|
@ -42,9 +42,7 @@ namespace libsaria
|
|||
|
||||
unsigned int library::size()
|
||||
{
|
||||
if (index::is_filtered() == true)
|
||||
return index::size();
|
||||
return lib_playlist.size();
|
||||
return lib_playlist.apparent_size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright (c) 2012 Bryan Schumaker.
|
||||
#include <libsaria/files.h>
|
||||
#include <libsaria/index.h>
|
||||
#include <libsaria/library.h>
|
||||
#include <libsaria/playlist.h>
|
||||
|
||||
|
@ -71,4 +72,10 @@ namespace libsaria
|
|||
return plist.size();
|
||||
}
|
||||
|
||||
unsigned int Playlist::apparent_size()
|
||||
{
|
||||
if ( (flags & PL_FILTER) && (index::is_filtered()) )
|
||||
return index::size();
|
||||
return plist.size();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue