Debug logging: Added logging of playback and tags

Added a logging method that indicates starting playback of a given URL,
and added a debug build only logging of every metadata load event.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-01-29 16:34:43 -08:00
parent 326e9d5970
commit 85fd3836c0
2 changed files with 20 additions and 14 deletions

View File

@ -65,6 +65,8 @@
- (void)play:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary *)rgi startPaused:(BOOL)paused andSeekTo:(double)time
{
ALog(@"Opening file for playback: %@ at seek offset %f%@", url, time, (paused) ? @", starting paused" : @"");
[self waitUntilCallbacksExit];
output = nil;
output = [[OutputNode alloc] initWithController:self previous:nil];

View File

@ -618,6 +618,8 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
progress += progressstep;
[weakLock unlock];
DLog(@"Loading metadata for %@", weakPe.URL);
NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32];
NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:weakPe.URL];
@ -697,20 +699,22 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
}
[load_info_indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop)
{
PlaylistEntry *pe = [entries objectAtIndex:idx];
NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32];
NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:pe.URL];
if (entryProperties == nil)
return;
[entryInfo addEntriesFromDictionary:entryProperties];
[entryInfo addEntriesFromDictionary:[AudioMetadataReader metadataForURL:pe.URL]];
[pe setMetadata:entryInfo];
[store trackUpdate:pe];
{
PlaylistEntry *pe = [entries objectAtIndex:idx];
DLog(@"Loading metadata for %@", pe.URL);
NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32];
NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:pe.URL];
if (entryProperties == nil)
return;
[entryInfo addEntriesFromDictionary:entryProperties];
[entryInfo addEntriesFromDictionary:[AudioMetadataReader metadataForURL:pe.URL]];
[pe setMetadata:entryInfo];
[store trackUpdate:pe];
}];
[self->playlistController updateTotalTime];