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 - (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]; [self waitUntilCallbacksExit];
output = nil; output = nil;
output = [[OutputNode alloc] initWithController:self previous: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; progress += progressstep;
[weakLock unlock]; [weakLock unlock];
DLog(@"Loading metadata for %@", weakPe.URL);
NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32]; NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32];
NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:weakPe.URL]; 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) [load_info_indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop)
{ {
PlaylistEntry *pe = [entries objectAtIndex:idx]; PlaylistEntry *pe = [entries objectAtIndex:idx];
NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32]; DLog(@"Loading metadata for %@", pe.URL);
NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:pe.URL]; NSMutableDictionary *entryInfo = [NSMutableDictionary dictionaryWithCapacity:32];
if (entryProperties == nil)
return; NSDictionary *entryProperties = [AudioPropertiesReader propertiesForURL:pe.URL];
if (entryProperties == nil)
[entryInfo addEntriesFromDictionary:entryProperties]; return;
[entryInfo addEntriesFromDictionary:[AudioMetadataReader metadataForURL:pe.URL]];
[entryInfo addEntriesFromDictionary:entryProperties];
[pe setMetadata:entryInfo]; [entryInfo addEntriesFromDictionary:[AudioMetadataReader metadataForURL:pe.URL]];
[store trackUpdate:pe];
[pe setMetadata:entryInfo];
[store trackUpdate:pe];
}]; }];
[self->playlistController updateTotalTime]; [self->playlistController updateTotalTime];