Playlist Entry: Made copy contsructor proper

This commit is contained in:
Christopher Snowhill 2022-01-20 14:54:42 -08:00
parent 34942a0ffa
commit 6f0f9d7617
2 changed files with 60 additions and 52 deletions

View file

@ -84,6 +84,8 @@
@property(readonly) NSString *lengthText; @property(readonly) NSString *lengthText;
@property(readonly) NSString *rawTitle;
@property NSInteger index; @property NSInteger index;
@property NSInteger shuffleIndex; @property NSInteger shuffleIndex;
@property NSInteger dbIndex; @property NSInteger dbIndex;

View file

@ -161,6 +161,12 @@
return title; return title;
} }
@synthesize rawTitle;
- (NSString *)rawTitle
{
return title;
}
@dynamic display; @dynamic display;
- (NSString *)display - (NSString *)display
{ {
@ -393,59 +399,59 @@
PlaylistEntry *pe = [[[self class] allocWithZone:zone] init]; PlaylistEntry *pe = [[[self class] allocWithZone:zone] init];
if (pe) { if (pe) {
[pe setIndex:[self index]]; pe->index = index;
[pe setShuffleIndex:[self shuffleIndex]]; pe->shuffleIndex = shuffleIndex;
[pe setDbIndex:[self dbIndex]]; pe->dbIndex = dbIndex;
[pe setEntryId:[self entryId]]; pe->entryId = entryId;
[pe setCurrent:[self current]];
[pe setRemoved:[self removed]];
[pe setStopAfter:[self stopAfter]];
[pe setQueued:[self queued]];
[pe setQueuePosition:[self queuePosition]];
[pe setError:[self error]];
[pe setErrorMessage:[self errorMessage]];
[pe setURL:[self URL]];
[pe setArtist:[self artist]];
[pe setAlbumartist:[self albumartist]];
[pe setAlbum:[self album]];
[pe setTitle:[self title]];
[pe setGenre:[self genre]];
[pe setYear:[self year]];
[pe setTrack:[self track]];
[pe setCuesheet:[self cuesheet]];
[pe setAlbumArtInternal:[self albumArtInternal]]; pe->current = current;
pe->removed = removed;
[pe setReplayGainAlbumGain:[self replayGainAlbumGain]];
[pe setReplayGainAlbumPeak:[self replayGainAlbumPeak]]; pe->stopAfter = stopAfter;
[pe setReplayGainTrackGain:[self replayGainTrackGain]];
[pe setReplayGainTrackPeak:[self replayGainTrackPeak]]; pe->queued = queued;
[pe setVolume:[self volume]]; pe->queuePosition = queuePosition;
[pe setCurrentPosition:[self currentPosition]]; pe->error = error;
pe->errorMessage = [errorMessage copyWithZone:zone];
[pe setTotalFrames:[self totalFrames]];
[pe setBitrate:[self bitrate]]; pe->URL = [URL copyWithZone:zone];
[pe setChannels:[self channels]];
[pe setBitsPerSample:[self bitsPerSample]]; pe->artist = [artist copyWithZone:zone];
[pe setFloatingPoint:[self floatingPoint]]; pe->albumartist = [albumartist copyWithZone:zone];
[pe setUnsigned:[self Unsigned]]; pe->album = [album copyWithZone:zone];
[pe setSampleRate:[self sampleRate]]; pe->title = [title copyWithZone:zone];
pe->genre = [genre copyWithZone:zone];
[pe setCodec:[self codec]]; pe->year = [year copyWithZone:zone];
pe->track = [track copyWithZone:zone];
[pe setEndian:[self endian]];
pe->cuesheet = [cuesheet copyWithZone:zone];
[pe setSeekable:[self seekable]];
pe->albumArtInternal = [albumArtInternal copyWithZone:zone];
[pe setMetadataLoaded:[self metadataLoaded]];
pe->replayGainAlbumGain = replayGainAlbumGain;
pe->replayGainAlbumPeak = replayGainAlbumPeak;
pe->replayGainTrackGain = replayGainTrackGain;
pe->replayGainTrackPeak = replayGainTrackPeak;
pe->volume = volume;
currentPosition = pe->currentPosition;
pe->totalFrames = totalFrames;
pe->bitrate = bitrate;
pe->channels = channels;
pe->bitsPerSample = bitsPerSample;
pe->floatingPoint = floatingPoint;
pe->Unsigned = Unsigned;
pe->sampleRate = sampleRate;
pe->codec = [codec copyWithZone:zone];
pe->endian = [endian copyWithZone:zone];
pe->seekable = seekable;
pe->metadataLoaded = metadataLoaded;
} }
return pe; return pe;