-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
223 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import AVFoundation | ||
|
||
/// Audio information | ||
public struct AudioInfo: MediaInfo { | ||
/// Public initializer | ||
public init( | ||
url: URL, | ||
duration: Double, | ||
codec: CompressionAudioCodec?, | ||
bitrate: Int?, | ||
extendedInfo: ExtendedFileInfo? | ||
) { | ||
self.url = url | ||
self.duration = duration | ||
self.codec = codec | ||
self.bitrate = bitrate | ||
self.extendedInfo = extendedInfo | ||
} | ||
|
||
/// Audio file path | ||
public let url: URL | ||
|
||
/// Audio duration, in seconds | ||
public let duration: Double | ||
|
||
/// Audio codec | ||
public let codec: CompressionAudioCodec? | ||
|
||
/// Audio bitrate | ||
public let bitrate: Int? | ||
|
||
/// Extended media information | ||
public let extendedInfo: ExtendedFileInfo? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import AVFoundation | ||
import CoreLocation | ||
|
||
/// Additional media information | ||
public struct ExtendedFileInfo { | ||
/// Public initializer | ||
public init( | ||
// date: Date?, | ||
location: CLLocation?, | ||
whereFrom: [String]?, | ||
originalFilename: String? | ||
// filesize: Int64? | ||
) { | ||
// self.date = date | ||
self.location = location | ||
self.whereFrom = whereFrom | ||
self.originalFilename = originalFilename | ||
// self.filesize = filesize | ||
} | ||
|
||
// Original date | ||
// public let date: Date? | ||
|
||
/// Location | ||
public let location: CLLocation? | ||
|
||
/// Where from | ||
public let whereFrom: [String]? | ||
|
||
/// Original file name | ||
public let originalFilename: String? | ||
|
||
// File size | ||
// public let filesize: Int64? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Foundation | ||
|
||
/// Media info protocol type | ||
public protocol MediaInfo { | ||
/// Media file path | ||
var url: URL { get } | ||
|
||
/// Extended media information | ||
var extendedInfo: ExtendedFileInfo? { get } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.