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->current = current;
[pe setRemoved:[self removed]]; pe->removed = removed;
[pe setStopAfter:[self stopAfter]]; pe->stopAfter = stopAfter;
[pe setQueued:[self queued]]; pe->queued = queued;
[pe setQueuePosition:[self queuePosition]]; pe->queuePosition = queuePosition;
[pe setError:[self error]]; pe->error = error;
[pe setErrorMessage:[self errorMessage]]; pe->errorMessage = [errorMessage copyWithZone:zone];
[pe setURL:[self URL]]; pe->URL = [URL copyWithZone:zone];
[pe setArtist:[self artist]]; pe->artist = [artist copyWithZone:zone];
[pe setAlbumartist:[self albumartist]]; pe->albumartist = [albumartist copyWithZone:zone];
[pe setAlbum:[self album]]; pe->album = [album copyWithZone:zone];
[pe setTitle:[self title]]; pe->title = [title copyWithZone:zone];
[pe setGenre:[self genre]]; pe->genre = [genre copyWithZone:zone];
[pe setYear:[self year]]; pe->year = [year copyWithZone:zone];
[pe setTrack:[self track]]; pe->track = [track copyWithZone:zone];
[pe setCuesheet:[self cuesheet]]; pe->cuesheet = [cuesheet copyWithZone:zone];
[pe setAlbumArtInternal:[self albumArtInternal]]; pe->albumArtInternal = [albumArtInternal copyWithZone:zone];
[pe setReplayGainAlbumGain:[self replayGainAlbumGain]]; pe->replayGainAlbumGain = replayGainAlbumGain;
[pe setReplayGainAlbumPeak:[self replayGainAlbumPeak]]; pe->replayGainAlbumPeak = replayGainAlbumPeak;
[pe setReplayGainTrackGain:[self replayGainTrackGain]]; pe->replayGainTrackGain = replayGainTrackGain;
[pe setReplayGainTrackPeak:[self replayGainTrackPeak]]; pe->replayGainTrackPeak = replayGainTrackPeak;
[pe setVolume:[self volume]]; pe->volume = volume;
[pe setCurrentPosition:[self currentPosition]]; currentPosition = pe->currentPosition;
[pe setTotalFrames:[self totalFrames]]; pe->totalFrames = totalFrames;
[pe setBitrate:[self bitrate]]; pe->bitrate = bitrate;
[pe setChannels:[self channels]]; pe->channels = channels;
[pe setBitsPerSample:[self bitsPerSample]]; pe->bitsPerSample = bitsPerSample;
[pe setFloatingPoint:[self floatingPoint]]; pe->floatingPoint = floatingPoint;
[pe setUnsigned:[self Unsigned]]; pe->Unsigned = Unsigned;
[pe setSampleRate:[self sampleRate]]; pe->sampleRate = sampleRate;
[pe setCodec:[self codec]]; pe->codec = [codec copyWithZone:zone];
[pe setEndian:[self endian]]; pe->endian = [endian copyWithZone:zone];
[pe setSeekable:[self seekable]]; pe->seekable = seekable;
[pe setMetadataLoaded:[self metadataLoaded]]; pe->metadataLoaded = metadataLoaded;
} }
return pe; return pe;