OpenMPT: Add format info as codec string

CQTexperiment
Christopher Snowhill 2021-12-30 00:07:32 -08:00
parent e4cbdb07f8
commit 112a20132b
2 changed files with 12 additions and 2 deletions

View File

@ -63,6 +63,7 @@
NSString * artist = nil;
//NSString * comment = nil;
NSString * date = nil;
NSString * type = nil;
std::vector<std::string> keys = mod->get_metadata_keys();
@ -75,6 +76,8 @@
comment = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];*/
else if ( *key == "date" )
date = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];
else if ( *key == "type_long" )
type = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];
}
delete mod;
@ -87,8 +90,10 @@
comment = @"";*/
if (date == nil)
date = @"";
if (type == nil)
type = @"";
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", nil];
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", type, @"codec", nil];
} catch (std::exception & /*e*/) {
return 0;
}

View File

@ -63,6 +63,7 @@
NSString * artist = nil;
//NSString * comment = nil;
NSString * date = nil;
NSString * type = nil;
std::vector<std::string> keys = mod->get_metadata_keys();
@ -75,6 +76,8 @@
comment = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];*/
else if ( *key == "date" )
date = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];
else if ( *key == "type_long" )
type = [NSString stringWithUTF8String: mod->get_metadata( *key ).c_str()];
}
delete mod;
@ -87,8 +90,10 @@
comment = @"";*/
if (date == nil)
date = @"";
if (type == nil)
type = @"";
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", nil];
return [NSDictionary dictionaryWithObjectsAndKeys:title, @"title", artist, @"artist", /*comment, @"comment",*/ date, @"year", type, @"codec", nil];
} catch (std::exception & /*e*/) {
return 0;
}