Skip to content

Commit

Permalink
Swift5 update, asset playback premature cutoff temp fix (roundware#34)
Browse files Browse the repository at this point in the history
* auto-update to Swift 5

* add arbitrary 1.5s to asset playback duration to compensate for timer and audio playback being out-of-sync - effective hack, but only temporary

* clean-up
  • Loading branch information
hburgund authored and loafofpiecrust committed Jul 30, 2019
1 parent 6dc45a1 commit b94b773
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RWFramework/RWFramework/Playlist/AudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private class PlayingAsset: TimedTrackState {
self.asset = asset
fadeOutDuration = min(Double(track.fadeOutTime.random()), duration / 2)
// duration of the asset excluding any fades
let fullVolumeDuration = duration - fadeOutDuration
let fullVolumeDuration = duration - fadeOutDuration + 1.5
super.init(duration: fullVolumeDuration)
}

Expand Down
2 changes: 1 addition & 1 deletion RWFramework/RWFramework/RWFrameworkAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ extension RWFramework {
return try Speaker.from(data: data)
}.catch { error in
self.rwGetSpeakersFailure(error)
self.apiProcessError(nil, error: error, caller: "apiGetAssets")
self.apiProcessError(nil, error: error, caller: "apiGetSpeakers")
}
}

Expand Down
4 changes: 2 additions & 2 deletions RWFramework/RWFramework/RWFrameworkMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ extension RWFramework {
}

func encode(with aCoder: NSCoder) {
aCoder.encode(MediaType.allCases.index(of: mediaType)!, forKey: "mediaType")
aCoder.encode(MediaStatus.allCases.index(of: mediaStatus)!, forKey: "mediaStatus")
aCoder.encode(MediaType.allCases.firstIndex(of: mediaType)!, forKey: "mediaType")
aCoder.encode(MediaStatus.allCases.firstIndex(of: mediaStatus)!, forKey: "mediaStatus")
aCoder.encode(string, forKey: "string")
aCoder.encode(desc, forKey: "desc")
aCoder.encode(latitude, forKey: "latitude")
Expand Down

0 comments on commit b94b773

Please sign in to comment.