libsaria: Library get_info() returns TrackTag

I simplify the function by removing the function pointer call and
letting callers deal with the TrackTag pointer it now returns.
This commit is contained in:
Bryan Schumaker 2011-12-11 16:14:53 -05:00
parent 56eee0ae22
commit 9739bdc76a
2 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,7 @@ namespace libsaria
void add_path(string);
void remove_path(string);
void play_id(ino_t &);
bool get_info(ino_t &, void(*)(Track &));
TrackTag *get_info(ino_t &);
void for_each(SourceModel *);
void for_each_path(void (*)(struct PathInfo &));

View File

@ -18,6 +18,7 @@ namespace libsaria
void current_track(void (*func)(Track &))
{
ino_t inode;
TrackTag *tag;
if (current_inode(inode) < 0) {
Track blank;
@ -25,9 +26,9 @@ namespace libsaria
return;
}
if (!library::get_info(inode, func)) {
TrackTag tag(libsaria::audio::get_current_file(), inode);
Track track(&tag);
tag = libsaria::library::get_info(inode);
if (tag != NULL) {
Track track(tag);
func(track);
}
}