Tags: Expose Composer tag through interfaces
Implement the composer field interface to playlist item tag reading and writing. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
1bffcaa429
commit
a3c8149612
4 changed files with 20 additions and 2 deletions
|
@ -79,6 +79,7 @@
|
|||
@property(nonatomic) NSString *_Nullable artist;
|
||||
@property(nonatomic) NSString *_Nullable rawTitle;
|
||||
@property(nonatomic) NSString *_Nullable genre;
|
||||
@property(nonatomic) NSString *_Nullable composer;
|
||||
@property(nonatomic) int32_t disc;
|
||||
@property(nonatomic) int32_t track;
|
||||
@property(nonatomic) int32_t year;
|
||||
|
|
|
@ -686,6 +686,15 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
|||
[self setValue:@"artist" fromString:artist];
|
||||
}
|
||||
|
||||
@dynamic composer;
|
||||
- (NSString *)composer {
|
||||
return [self readAllValuesAsString:@"composer"];
|
||||
}
|
||||
|
||||
- (void)setComposer:(NSString *)composer {
|
||||
[self setValue:@"composer" fromString:composer];
|
||||
}
|
||||
|
||||
@dynamic rawTitle;
|
||||
- (NSString *)rawTitle {
|
||||
return [self readAllValuesAsString:@"title"];
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
const TagLib::Tag *tag = f.tag();
|
||||
|
||||
if(tag) {
|
||||
TagLib::String artist, albumartist, title, album, genre, comment, unsyncedlyrics;
|
||||
TagLib::String artist, albumartist, composer, title, album, genre, comment, unsyncedlyrics;
|
||||
int year, track, disc;
|
||||
float rgAlbumGain, rgAlbumPeak, rgTrackGain, rgTrackPeak;
|
||||
TagLib::String cuesheet;
|
||||
|
@ -68,6 +68,7 @@
|
|||
|
||||
artist = tag->artist();
|
||||
albumartist = tag->albumartist();
|
||||
composer = tag->composer();
|
||||
title = tag->title();
|
||||
album = tag->album();
|
||||
genre = tag->genre();
|
||||
|
@ -117,6 +118,9 @@
|
|||
if(!albumartist.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:albumartist.toCString(true)] forKey:@"albumartist"];
|
||||
|
||||
if(!composer.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:composer.toCString(true)] forKey:@"composer"];
|
||||
|
||||
if(!album.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:album.toCString(true)] forKey:@"album"];
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
const TagLib::Tag *tag = f.tag();
|
||||
|
||||
if(tag) {
|
||||
TagLib::String artist, albumartist, title, album, genre, comment, unsyncedlyrics;
|
||||
TagLib::String artist, albumartist, composer, title, album, genre, comment, unsyncedlyrics;
|
||||
int year, track, disc;
|
||||
float rgAlbumGain, rgAlbumPeak, rgTrackGain, rgTrackPeak;
|
||||
TagLib::String cuesheet;
|
||||
|
@ -81,6 +81,7 @@
|
|||
|
||||
artist = tag->artist();
|
||||
albumartist = tag->albumartist();
|
||||
composer = tag->composer();
|
||||
title = tag->title();
|
||||
;
|
||||
album = tag->album();
|
||||
|
@ -132,6 +133,9 @@
|
|||
if(!albumartist.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:albumartist.toCString(true)] forKey:@"albumartist"];
|
||||
|
||||
if(!composer.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:composer.toCString(true)] forKey:@"composer"];
|
||||
|
||||
if(!album.isEmpty())
|
||||
[dict setObject:[NSString stringWithUTF8String:album.toCString(true)] forKey:@"album"];
|
||||
|
||||
|
|
Loading…
Reference in a new issue