Skip to content

Commit 4f37532

Browse files
authored
Merge pull request #26 from orchetect/dev
GitHub CI setup & README update
2 parents e2e9150 + 80331cb commit 4f37532

3 files changed

Lines changed: 91 additions & 31 deletions

File tree

.github/workflows/build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
paths-ignore:
7+
- 'Docs/**' # Docs folder in root of repo
8+
- '**/*.md' # .md files anywhere in the repo
9+
- '**/LICENSE' # LICENSE files anywhere in the repo
10+
- '**/.gitignore' # .gitignore files anywhere in the repo
11+
12+
pull_request:
13+
branches: [main]
14+
paths-ignore:
15+
- 'Docs/**' # Docs folder in root of repo
16+
- '**/*.md' # .md files anywhere in the repo
17+
- '**/LICENSE' # LICENSE files anywhere in the repo
18+
- '**/.gitignore' # .gitignore files anywhere in the repo
19+
20+
workflow_dispatch:
21+
22+
schedule:
23+
- cron: '40 11 * * *' # once a day @ 11:40am UTC (4:40am PST)
24+
25+
jobs:
26+
macOS:
27+
name: macOS
28+
runs-on: macos-latest
29+
steps:
30+
- uses: actions/checkout@main
31+
- name: Build
32+
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS,arch=x86_64"
33+
- name: Unit Tests
34+
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS,arch=x86_64"
35+
36+
macCatalyst:
37+
name: macCatalyst
38+
runs-on: macos-latest
39+
steps:
40+
- uses: actions/checkout@main
41+
- name: Build
42+
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS,variant=Mac Catalyst,arch=x86_64"
43+
- name: Unit Tests
44+
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=macOS,variant=Mac Catalyst,arch=x86_64"
45+
46+
iOS:
47+
name: iOS
48+
runs-on: macos-latest # this must be macos, GitHub does not offer iOS directly but we can use xcodebuild
49+
steps:
50+
- uses: actions/checkout@main
51+
- name: iPhone 12 Simulator - Build
52+
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=iOS Simulator,name=iPhone 12"
53+
- name: iPhone 12 Simulator - Unit Tests
54+
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=iOS Simulator,name=iPhone 12"
55+
56+
tvOS:
57+
name: tvOS
58+
runs-on: macos-latest # this must be macos, GitHub does not offer tvOS directly but we can use xcodebuild
59+
steps:
60+
- uses: actions/checkout@main
61+
- name: Apple TV - Build
62+
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=tvOS Simulator,name=Apple TV"
63+
- name: Apple TV - Unit Tests
64+
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=tvOS Simulator,name=Apple TV"
65+
66+
67+
# xcodebuild test reference:
68+
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/08-automation.html

.swiftpm/xcode/xcshareddata/xcschemes/TimecodeKit.xcscheme renamed to .swiftpm/xcode/xcshareddata/xcschemes/TimecodeKit-CI.xcscheme

File renamed without changes.

README.md

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,36 @@
11
# TimecodeKit
22

3-
<p>
4-
<a href="https://developer.apple.com/swift">
5-
<img src="https://img.shields.io/badge/Swift%205.3-compatible-orange.svg?style=flat"
6-
alt="Swift 5.3 compatible" /></a>
7-
<a href="#installation">
8-
<img src="https://img.shields.io/badge/SPM-compatible-orange.svg?style=flat"
9-
alt="Swift Package Manager (SPM) compatible" /></a>
10-
<a href="https://developer.apple.com/swift">
11-
<img src="https://img.shields.io/badge/platform-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS-green.svg?style=flat"
12-
alt="Platform - macOS | iOS | tvOS | watchOS" /></a>
13-
<a href="#contributions">
14-
<img src="https://img.shields.io/badge/Linux-not%20tested-black.svg?style=flat"
15-
alt="Linux - not tested" /></a>
16-
<a href="https://github.com/orchetect/TimecodeKit/blob/main/LICENSE">
17-
<img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat"
18-
alt="License: MIT" /></a>
19-
</p>
20-
A robust multi-platform Swift library for working with SMPTE timecode supporting 20 industry frame rates, and including methods to convert to/from timecode strings and perform calculations.
21-
22-
## Supported Frame Rates
23-
24-
| NTSC | PAL | HD / Film | Other |
25-
| --------- | ---- | --------- | ------ |
26-
| 29.97 | 25 | 23.976 | 30 |
27-
| 29.97 DF | 50 | 24 | 30 DF |
28-
| 59.94 | 100 | 24.98 | 60 |
29-
| 59.94 DF | | 47.952 | 60 DF |
30-
| 119.88 | | 48 | 120 |
31-
| 119.88 DF | | | 120 DF |
3+
[![CI Build Status](https://github.com/orchetect/TimecodeKit/actions/workflows/build.yml/badge.svg)](https://github.com/orchetect/TimecodeKit/actions/workflows/build.yml) [![Platforms - macOS | iOS | tvOS | watchOS](https://img.shields.io/badge/platforms-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20-lightgrey.svg?style=flat)](https://developer.apple.com/swift) [![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/orchetect/TimecodeKit/blob/main/LICENSE)
4+
5+
A robust and precise Swift library for working with SMPTE timecode supporting 20 industry frame rates, including conversions to/from timecode strings and timecode-based calculations.
6+
7+
## Supported Timecode Frame Rates
8+
9+
The following BITC frame rates are supported. These are used widely in DAWs (digital audio workstation software) and video editing applications.
10+
11+
| Film / ATSC / HD | PAL / SECAM / DVB / ATSC | NTSC / ATSC / PAL-M | NTSC Non-Standard | ATSC |
12+
| ---------------- | ------------------------ | ------------------- | ----------------- | ---- |
13+
| 23.976 | 25 | 29.97 | 30 DF | 30 |
14+
| 24 | 50 | 29.97 DF | 60 DF | 60 |
15+
| 24.98 | 100 | 59.94 | 120 DF | 120 |
16+
| 47.952 | | 59.94 DF | | |
17+
| 48 | | 119.88 | | |
18+
| | | 119.88 DF | | |
3219

3320
## Core Features
3421

3522
- Convert timecode values to timecode display string, and vice-versa
3623
- Convert timecode values to real wall-clock time, and vice-versa
3724
- Convert timecode to # of samples at any audio sample-rate, and vice-versa
3825
- Granular timecode validation
39-
- A `Formatter` object that can format timecode and also provide an `NSAttributedString` showing invalid timecode components using alternate attributes (such as red text color)
4026
- Support for Days as a timecode component (which Cubase supports as part of its timecode format)
4127
- Support for Subframes
4228
- Common math operations between timecodes: add, subtract, multiply, divide
4329
- Form a `Range` or `Stride` between two timecodes
44-
- Exhaustive unit tests ensuring accuracy
4530
- Conforms to `Codable`
31+
- A `Formatter` object that can format timecode and also provide an `NSAttributedString` showing invalid timecode components using alternate attributes (such as red text color)
32+
- A SwiftUI `Text` object showing invalid timecode components using alternate attributes (such as red text color)
33+
- Exhaustive unit tests ensuring accuracy
4634

4735
## Installation
4836

@@ -479,6 +467,10 @@ for tc in stride(from: startTC, to: endTC, by: 5) {
479467
- Workaround: Don't run unit tests for a watchOS target
480468
- The Dev Tests are not meant to be run as routine unit tests, but are designed as a test harness to be used only when altering critical parts of the library to ensure stability of internal calculations.
481469

470+
## References
471+
472+
- Wikipedia: [SMPTE Timecode](https://en.wikipedia.org/wiki/SMPTE_timecode)
473+
482474
## Author
483475

484476
Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself [@orchetect](https://github.com/orchetect).

0 commit comments

Comments
 (0)