libsaria: Introduce playlist numbers

To track where in the deck they are.  Displaying and modifying them
comes next...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-29 20:59:04 -04:00
parent 5194130db4
commit 4e046beb20
5 changed files with 11 additions and 7 deletions

View File

@ -32,6 +32,7 @@ namespace libsaria
class Playlist {
private:
int number;
unsigned int flags;
unsigned int length;
PlaylistType type;
@ -64,7 +65,7 @@ namespace libsaria
virtual Track *next() = 0;
string &get_name();
void rename(string &);
void renumber(int);
unsigned int get_size();
unsigned int get_length();
PlaylistType get_type();

View File

@ -16,7 +16,7 @@ namespace libsaria
PlaylistRenderer(unsigned int);
~PlaylistRenderer();
void set_playlist(Playlist *);
virtual void renamed(string &);
virtual void renumber(int);
bool is_static();
virtual void prepare_for_removal();

View File

@ -46,7 +46,7 @@ static void rename_playlists()
case PLIST_LIST:
new_name = "List (" + itoa(i) + ")";
}
(*it)->rename(new_name);
(*it)->renumber(i);
it++;
}
}

View File

@ -10,6 +10,7 @@ namespace libsaria
Playlist::Playlist(string n, unsigned int f, PlaylistType t)
{
name = n;
number = -1;
flags = f;
type = t;
length = 0;
@ -46,10 +47,12 @@ namespace libsaria
return name;
}
void Playlist::rename(string &s)
void Playlist::renumber(int n)
{
name = s;
RENDER( renamed(name) );
if (number == n)
return;
number = n;
RENDER( renumber(number) );
}
unsigned int Playlist::get_size()

View File

@ -20,7 +20,7 @@ namespace libsaria
playlist->set_renderer(this);
}
void PlaylistRenderer::renamed(string &s)
void PlaylistRenderer::renumber(int)
{
}