Playlist Entry: Made copy contsructor proper

CQTexperiment
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 *rawTitle;
@property NSInteger index;
@property NSInteger shuffleIndex;
@property NSInteger dbIndex;

View File

@ -161,6 +161,12 @@
return title;
}
@synthesize rawTitle;
- (NSString *)rawTitle
{
return title;
}
@dynamic display;
- (NSString *)display
{
@ -393,59 +399,59 @@
PlaylistEntry *pe = [[[self class] allocWithZone:zone] init];
if (pe) {
[pe setIndex:[self index]];
[pe setShuffleIndex:[self shuffleIndex]];
[pe setDbIndex:[self dbIndex]];
[pe setEntryId:[self entryId]];
pe->index = index;
pe->shuffleIndex = shuffleIndex;
pe->dbIndex = dbIndex;
pe->entryId = entryId;
[pe setCurrent:[self current]];
[pe setRemoved:[self removed]];
pe->current = current;
pe->removed = removed;
[pe setStopAfter:[self stopAfter]];
pe->stopAfter = stopAfter;
[pe setQueued:[self queued]];
[pe setQueuePosition:[self queuePosition]];
pe->queued = queued;
pe->queuePosition = queuePosition;
[pe setError:[self error]];
[pe setErrorMessage:[self errorMessage]];
pe->error = error;
pe->errorMessage = [errorMessage copyWithZone:zone];
[pe setURL:[self URL]];
pe->URL = [URL copyWithZone:zone];
[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->artist = [artist copyWithZone:zone];
pe->albumartist = [albumartist copyWithZone:zone];
pe->album = [album copyWithZone:zone];
pe->title = [title copyWithZone:zone];
pe->genre = [genre copyWithZone:zone];
pe->year = [year copyWithZone:zone];
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 setReplayGainAlbumPeak:[self replayGainAlbumPeak]];
[pe setReplayGainTrackGain:[self replayGainTrackGain]];
[pe setReplayGainTrackPeak:[self replayGainTrackPeak]];
[pe setVolume:[self volume]];
pe->replayGainAlbumGain = replayGainAlbumGain;
pe->replayGainAlbumPeak = replayGainAlbumPeak;
pe->replayGainTrackGain = replayGainTrackGain;
pe->replayGainTrackPeak = replayGainTrackPeak;
pe->volume = volume;
[pe setCurrentPosition:[self currentPosition]];
currentPosition = pe->currentPosition;
[pe setTotalFrames:[self totalFrames]];
[pe setBitrate:[self bitrate]];
[pe setChannels:[self channels]];
[pe setBitsPerSample:[self bitsPerSample]];
[pe setFloatingPoint:[self floatingPoint]];
[pe setUnsigned:[self Unsigned]];
[pe setSampleRate:[self sampleRate]];
pe->totalFrames = totalFrames;
pe->bitrate = bitrate;
pe->channels = channels;
pe->bitsPerSample = bitsPerSample;
pe->floatingPoint = floatingPoint;
pe->Unsigned = Unsigned;
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;