Skip to content

Commit 80c8073

Browse files
authored
Merge pull request #106 from Comcast/release/2.2.2
Release/2.2.2
2 parents ee38596 + 69ed6dc commit 80c8073

File tree

16 files changed

+99
-60
lines changed

16 files changed

+99
-60
lines changed

mamba.xcodeproj/project.pbxproj

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

mamba.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>BuildSystemType</key>
6-
<string>Original</string>
75
<key>PreviewsEnabled</key>
86
<false/>
97
</dict>

mamba.xcodeproj/xcshareddata/xcschemes/mamba.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1150"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

mamba.xcodeproj/xcshareddata/xcschemes/mambaMacOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1150"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

mamba.xcodeproj/xcshareddata/xcschemes/mambaTVOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1150"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

mambaSharedFramework/Mamba.swift renamed to mambaSharedFramework/FrameworkInfo.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Mamba.swift
2+
// FrameworkInfo.swift
33
// mamba
44
//
55
// Created by David Coufal on 8/2/16.
@@ -19,8 +19,8 @@
1919

2020
import Foundation
2121

22-
/// Base object representing the Mamba framework
23-
public enum Mamba {
22+
/// Provides information about the framework
23+
public enum FrameworkInfo {
2424

2525
/// returns the version of the mamba framework
2626
public static var version: String {

mambaSharedFramework/Playlist Models/Playlist Structure/MasterPlaylistStructure.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import Foundation
4141
variantTagGroups[2] 3.m3u8
4242
```
4343
*/
44-
public typealias MasterPlaylistStructure = PlaylistStructureCore<MasterPlaylistStructureData, MasterPlaylistStructureDelegate>
44+
public typealias MasterPlaylistStructure = PlaylistStructureCore<MasterPlaylistStructureDelegate>
4545

4646
extension PlaylistStructureCore: MasterPlaylistTagGroupProvider where PSD == MasterPlaylistStructureDelegate {
4747

@@ -68,7 +68,7 @@ public protocol MasterPlaylistTagGroupProvider {
6868
var variantTagGroups: [VariantTagGroup] { get }
6969
}
7070

71-
public struct MasterPlaylistStructureData: EmptyInitializerImplementor {
71+
public struct MasterPlaylistStructureData: PlaylistStructure {
7272
public init() {
7373
self.variantTagGroups = [VariantTagGroup]()
7474
}
@@ -78,7 +78,7 @@ public struct MasterPlaylistStructureData: EmptyInitializerImplementor {
7878
var variantTagGroups: [VariantTagGroup]
7979
}
8080

81-
public final class MasterPlaylistStructureDelegate: PlaylistStructureDelegate, EmptyInitializerImplementor {
81+
public final class MasterPlaylistStructureDelegate: PlaylistStructureDelegate {
8282

8383
public typealias T = MasterPlaylistStructureData
8484

mambaSharedFramework/Playlist Models/Playlist Structure/PlaylistStructureCore.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@
1919

2020
import Foundation
2121

22-
public final class PlaylistStructureCore<T: EmptyInitializerImplementor, PSD: PlaylistStructureDelegate & EmptyInitializerImplementor>: PlaylistStructureInterface where PSD.T == T {
22+
public final class PlaylistStructureCore<PSD: PlaylistStructureDelegate>: PlaylistStructureInterface {
2323

2424
private var structureState: StructureState = .dirtyRequiresRebuild
2525

2626
private var _tags: [PlaylistTag]
2727
private let delegate: PSD
2828

29-
var _structureData: T
29+
var _structureData: PSD.StructureType
3030

3131
private let queue = DispatchQueue(label: "com.comcast.mamba.playliststructurecore",
3232
qos: .userInitiated)
3333

3434
public convenience init(withTags tags: [PlaylistTag]) {
3535
self.init(withTags: tags,
3636
withDelegate: PSD(),
37-
withStructureData: T())
37+
withStructureData: PSD.StructureType())
3838
}
3939

4040
init(withTags tags: [PlaylistTag],
4141
withDelegate delegate: PSD,
42-
withStructureData structureData: T) {
42+
withStructureData structureData: PSD.StructureType) {
4343
self._tags = tags
4444
self.delegate = delegate
4545
self._structureData = structureData
@@ -58,7 +58,7 @@ public final class PlaylistStructureCore<T: EmptyInitializerImplementor, PSD: Pl
5858
}
5959
}
6060

61-
public var structureData: T {
61+
public var structureData: PSD.StructureType {
6262
return queue.sync {
6363
rebuildIfRequired()
6464
return _structureData
@@ -188,7 +188,9 @@ public final class PlaylistStructureCore<T: EmptyInitializerImplementor, PSD: Pl
188188
*/
189189
public protocol PlaylistStructureDelegate: class {
190190

191-
associatedtype T
191+
associatedtype StructureType: PlaylistStructure
192+
193+
init()
192194

193195
/**
194196
Return true if this tag is a marker for structure boundaries in your structure definition.
@@ -205,9 +207,9 @@ public protocol PlaylistStructureDelegate: class {
205207

206208
- parameter usingTagArray: The list of tags that defines our playlist.
207209

208-
- returns: New structure of `T` type
210+
- returns: New structure of `StructureType` type
209211
*/
210-
func rebuild(usingTagArray tags: [PlaylistTag]) -> T
212+
func rebuild(usingTagArray tags: [PlaylistTag]) -> StructureType
211213

212214
/**
213215
`PlaylistStructureCore` has noted a minor change to the tag array and requests that
@@ -223,14 +225,14 @@ public protocol PlaylistStructureDelegate: class {
223225
func changed(numberOfTags alterCount: Int,
224226
atIndex index: Int,
225227
inTagArray tags: [PlaylistTag],
226-
withInitialStructure structure: T) -> PlaylistStructureChangeResult<T>
228+
withInitialStructure structure: StructureType) -> PlaylistStructureChangeResult<StructureType>
227229
}
228230

229-
public struct PlaylistStructureChangeResult<T> {
231+
public struct PlaylistStructureChangeResult<StructureType> {
230232
/// `false` if we were able to fix up ourselves, `true` if we has to rebuild structure from scratch
231233
let hadToRebuildFromScratch: Bool
232234
/// New structure after rebuild
233-
let structure: T
235+
let structure: StructureType
234236
}
235237

236238
struct PlaylistStructureConstructor {
@@ -421,6 +423,6 @@ struct PlaylistStructureConstructor {
421423
}
422424
}
423425

424-
public protocol EmptyInitializerImplementor {
426+
public protocol PlaylistStructure {
425427
init()
426428
}

mambaSharedFramework/Playlist Models/Playlist Structure/VariantPlaylistStructure.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import Foundation
5555
mediaSpans[1] would cover just mediaSegmentGroup[2] (range 2...2). Each media span has its own #EXT-X-KEY tag.
5656

5757
*/
58-
public typealias VariantPlaylistStructure = PlaylistStructureCore<MediaPlaylistStructureData, VariantPlaylistStructureDelegate>
58+
public typealias VariantPlaylistStructure = PlaylistStructureCore<VariantPlaylistStructureDelegate>
5959

6060
extension PlaylistStructureCore: PlaylistTagSource, PlaylistTypeDetermination, VariantPlaylistStructureInterface where PSD == VariantPlaylistStructureDelegate {
6161

@@ -173,7 +173,7 @@ extension VariantPlaylistStructureInterface {
173173
}
174174
}
175175

176-
public struct MediaPlaylistStructureData: EmptyInitializerImplementor, PlaylistTypeDetermination {
176+
public struct MediaPlaylistStructureData: PlaylistStructure, PlaylistTypeDetermination {
177177
public init() {
178178
self.header = nil
179179
self.mediaSegmentGroups = [MediaSegmentPlaylistTagGroup]()
@@ -207,7 +207,7 @@ public struct MediaPlaylistStructureData: EmptyInitializerImplementor, PlaylistT
207207
public var playlistType: PlaylistType
208208
}
209209

210-
public final class VariantPlaylistStructureDelegate: PlaylistStructureDelegate, EmptyInitializerImplementor {
210+
public final class VariantPlaylistStructureDelegate: PlaylistStructureDelegate {
211211

212212
public typealias T = MediaPlaylistStructureData
213213

mambaSharedFramework/PlaylistWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class PlaylistWriter {
4949
try write(string: identityString, toStream: stream)
5050
}
5151
if !suppressMambaIdentityString {
52-
try write(string: " Generated by Mamba(\(Mamba.version)) Copyright (c) 2017 Comcast Corporation", toStream: stream)
52+
try write(string: " Generated by Mamba(\(FrameworkInfo.version)) Copyright (c) 2017 Comcast Corporation", toStream: stream)
5353
}
5454

5555
// write tags

0 commit comments

Comments
 (0)