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:
parent
56eee0ae22
commit
9739bdc76a
|
@ -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 &));
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue