Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Init cp/r
Browse files Browse the repository at this point in the history
  • Loading branch information
bradfloodx committed Aug 16, 2024
1 parent a07ea87 commit 66db4b2
Show file tree
Hide file tree
Showing 31 changed files with 402 additions and 409 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: DoubleSymmetry
github: evergrace-co
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Run Tests
run: xcodebuild test -scheme SwiftAudioEx ${{ matrix.destination }} -enableCodeCoverage YES
run: xcodebuild test -scheme SwiftAudioPro ${{ matrix.destination }} -enableCodeCoverage YES
- name: Upload coverage to Codecov
if: matrix.target == 'macos'
uses: codecov/codecov-action@v4
Expand Down
18 changes: 9 additions & 9 deletions Example/SwiftAudio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
9B8819712BC866A300E20DCE /* AudioController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B88196C2BC866A300E20DCE /* AudioController.swift */; };
9B8819742BC866A300E20DCE /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B88196F2BC866A300E20DCE /* Extensions.swift */; };
9B8819752BC866A300E20DCE /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B8819702BC866A300E20DCE /* PlayerView.swift */; };
9B8819782BC866E800E20DCE /* SwiftAudioEx in Frameworks */ = {isa = PBXBuildFile; productRef = 9B8819772BC866E800E20DCE /* SwiftAudioEx */; };
9B8819782BC866E800E20DCE /* SwiftAudioPro in Frameworks */ = {isa = PBXBuildFile; productRef = 9B8819772BC866E800E20DCE /* SwiftAudioPro */; };
9B88197A2BC9883200E20DCE /* PlayerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B8819792BC9883200E20DCE /* PlayerViewModel.swift */; };
9B88197C2BC98F5000E20DCE /* QueueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B88197B2BC98F5000E20DCE /* QueueView.swift */; };
/* End PBXBuildFile section */
Expand All @@ -24,7 +24,7 @@
9B8819602BC8657B00E20DCE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9B8819622BC8657B00E20DCE /* SwiftAudio.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SwiftAudio.entitlements; sourceTree = "<group>"; };
9B8819642BC8657B00E20DCE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
9B88196B2BC865E100E20DCE /* SwiftAudioEx */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = SwiftAudioEx; path = ..; sourceTree = "<group>"; };
9B88196B2BC865E100E20DCE /* SwiftAudioPro */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = SwiftAudioPro; path = ..; sourceTree = "<group>"; };
9B88196C2BC866A300E20DCE /* AudioController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioController.swift; sourceTree = "<group>"; };
9B88196F2BC866A300E20DCE /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
9B8819702BC866A300E20DCE /* PlayerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = "<group>"; };
Expand All @@ -37,7 +37,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9B8819782BC866E800E20DCE /* SwiftAudioEx in Frameworks */,
9B8819782BC866E800E20DCE /* SwiftAudioPro in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -47,7 +47,7 @@
9B8819502BC8657A00E20DCE = {
isa = PBXGroup;
children = (
9B88196B2BC865E100E20DCE /* SwiftAudioEx */,
9B88196B2BC865E100E20DCE /* SwiftAudioPro */,
9B88195B2BC8657A00E20DCE /* SwiftAudio */,
9B88195A2BC8657A00E20DCE /* Products */,
9B8819762BC866E800E20DCE /* Frameworks */,
Expand Down Expand Up @@ -110,7 +110,7 @@
);
name = SwiftAudio;
packageProductDependencies = (
9B8819772BC866E800E20DCE /* SwiftAudioEx */,
9B8819772BC866E800E20DCE /* SwiftAudioPro */,
);
productName = SwiftAudio;
productReference = 9B8819592BC8657A00E20DCE /* SwiftAudio.app */;
Expand Down Expand Up @@ -320,7 +320,7 @@
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.doublesymmetry.SwiftAudio;
PRODUCT_BUNDLE_IDENTIFIER = co.evergrace.SwiftAudioPro;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
Expand Down Expand Up @@ -358,7 +358,7 @@
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.doublesymmetry.SwiftAudio;
PRODUCT_BUNDLE_IDENTIFIER = co.evergrace.SwiftAudioPro;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
Expand Down Expand Up @@ -392,9 +392,9 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
9B8819772BC866E800E20DCE /* SwiftAudioEx */ = {
9B8819772BC866E800E20DCE /* SwiftAudioPro */ = {
isa = XCSwiftPackageProductDependency;
productName = SwiftAudioEx;
productName = SwiftAudioPro;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
12 changes: 6 additions & 6 deletions Example/SwiftAudio/AudioController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
//

import Foundation
import SwiftAudioEx
import SwiftAudioPro

class AudioController {

static let shared = AudioController()
let player: QueuedAudioPlayer

let sources: [AudioItem] = [
DefaultAudioItem(audioUrl: "https://rntp.dev/example/Longing.mp3", artist: "David Chavez", title: "Longing", sourceType: .stream, artwork: #imageLiteral(resourceName: "22AMI")),
DefaultAudioItem(audioUrl: "https://rntp.dev/example/Soul%20Searching.mp3", artist: "David Chavez", title: "Soul Searching (Demo)", sourceType: .stream, artwork: #imageLiteral(resourceName: "22AMI")),
Expand All @@ -23,7 +23,7 @@ class AudioController {
DefaultAudioItem(audioUrl: "https://ais-sa5.cdnstream1.com/b75154_128mp3", artist: "New York, NY", title: "Smooth Jazz 24/7", sourceType: .stream, artwork: #imageLiteral(resourceName: "cover")),
DefaultAudioItem(audioUrl: "https://traffic.libsyn.com/atpfm/atp545.mp3", title: "Chapters", sourceType: .stream, artwork: #imageLiteral(resourceName: "22AMI")),
]

init() {
let controller = RemoteCommandController()
player = QueuedAudioPlayer(remoteCommandController: controller)
Expand All @@ -36,11 +36,11 @@ class AudioController {
.previous,
.changePlaybackPosition
]

player.repeatMode = .queue
DispatchQueue.main.async {
self.player.add(items: self.sources)
}
}

}
4 changes: 2 additions & 2 deletions Example/SwiftAudio/PlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI
import SwiftAudioEx
import SwiftAudioPro

struct PlayerView: View {
@ObservedObject var viewModel: ViewModel
Expand Down Expand Up @@ -78,7 +78,7 @@ struct PlayerView: View {
} else {
Text("Live Stream")
.padding(.top, 35)
}
}

HStack {
Button(action: controller.player.previous, label: {
Expand Down
2 changes: 1 addition & 1 deletion Example/SwiftAudio/PlayerViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by David Chavez on 4/12/24.
//

import SwiftAudioEx
import SwiftAudioPro

#if os(macOS)
import AppKit
Expand Down
2 changes: 1 addition & 1 deletion Example/SwiftAudio/QueueView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI
import SwiftAudioEx
import SwiftAudioPro

struct QueueView: View {
let controller = AudioController.shared
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
MIT License

Copyright (c) 2024 Brad Flood

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Copyright (c) 2021 Double Symmetry

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
import PackageDescription

let package = Package(
name: "SwiftAudioEx",
name: "SwiftAudioPro",
platforms: [.iOS(.v11), .macOS(.v11)],
products: [
.library(
name: "SwiftAudioEx",
targets: ["SwiftAudioEx"]),
name: "SwiftAudioPro",
targets: ["SwiftAudioPro"]),
],
dependencies: [],
targets: [
.target(
name: "SwiftAudioEx",
name: "SwiftAudioPro",
dependencies: []),
.testTarget(
name: "SwiftAudioExTests",
dependencies: ["SwiftAudioEx"],
name: "SwiftAudioProTests",
dependencies: ["SwiftAudioPro"],
resources: [
.process("Resources")
]
Expand Down
49 changes: 11 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
![logo](Images/original-horizontal.png)
# SwiftAudioPro

# SwiftAudioEx
[![License](https://img.shields.io/cocoapods/l/SwiftAudioPro.svg?style=flat)](http://cocoapods.org/pods/SwiftAudioPro)
[![Platform](https://img.shields.io/cocoapods/p/SwiftAudioPro.svg?style=flat)](http://cocoapods.org/pods/SwiftAudioPro)

[![codecov](https://codecov.io/gh/doublesymmetry/SwiftAudioEx/graph/badge.svg?token=FD5THGSHM5)](https://codecov.io/gh/doublesymmetry/SwiftAudioEx)
[![License](https://img.shields.io/cocoapods/l/SwiftAudioEx.svg?style=flat)](http://cocoapods.org/pods/SwiftAudioEx)
[![Platform](https://img.shields.io/cocoapods/p/SwiftAudioEx.svg?style=flat)](http://cocoapods.org/pods/SwiftAudioEx)

SwiftAudioEx is an audio player written in Swift, making it simpler to work with audio playback from streams and files.

<div align="left" valign="middle">
<a href="https://runblaze.dev">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://www.runblaze.dev/logo_dark.png">
<img align="right" src="https://www.runblaze.dev/logo_light.png" height="102px"/>
</picture>
</a>

<br style="display: none;"/>

_[Blaze](https://runblaze.dev) sponsors SwiftAudioEx by providing super fast Apple Silicon based macOS Github Action Runners. Use the discount code `RNTP50` at checkout to get 50% off your first year._

</div>
SwiftAudioPro is an audio player written in Swift, making it simpler to work with audio playback from streams and files.

## Example

Expand All @@ -40,41 +23,31 @@ iOS 11.0+

[Swift Package Manager](https://swift.org/package-manager/) (SwiftPM) is a tool for managing the distribution of Swift code as well as C-family dependency. From Xcode 11, SwiftPM got natively integrated with Xcode.

SwiftAudioEx supports SwiftPM from version 0.12.0. To use SwiftPM, you should use Xcode 11 to open your project. Click `File` -> `Swift Packages` -> `Add Package Dependency`, enter [SwiftAudioEx repo's URL](https://github.com/doublesymmetry/SwiftAudio.git). Or you can login Xcode with your GitHub account and just type `SwiftAudioEx` to search.
SwiftAudioPro supports SwiftPM from version 0.12.0. To use SwiftPM, you should use Xcode 11 to open your project. Click `File` -> `Swift Packages` -> `Add Package Dependency`, enter [SwiftAudioPro repo's URL](https://github.com/evergrace-co/swift-audio-pro.git). Or you can login Xcode with your GitHub account and just type `SwiftAudioPro` to search.

After select the package, you can choose the dependency type (tagged version, branch or commit). Then Xcode will setup all the stuff for you.

If you're a framework author and use SwiftAudioEx as a dependency, update your `Package.swift` file:
If you're a framework author and use SwiftAudioPro as a dependency, update your `Package.swift` file:

```swift
let package = Package(
// 0.12.0 ..< 1.0.0
dependencies: [
.package(url: "https://github.com/doublesymmetry/SwiftAudio.git", from: "1.0.0")
.package(url: "https://github.com/evergrace-co/swift-audio-pro.git", from: "1.0.0")
],
// ...
)
```

### CocoaPods

SwiftAudioEx is available through [CocoaPods](http://cocoapods.org). To install
SwiftAudioPro is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'SwiftAudioEx', '~> 1.0.0'
pod 'SwiftAudioPro', '~> 1.0.0'
```

### Carthage

SwiftAudioEx supports [Carthage](https://github.com/Carthage/Carthage). Add this to your Cartfile:

```ruby
github "doublesymmetry/SwiftAudioEx" ~> 1.0.0
```

Then follow the rest of Carthage instructions on [adding a framework](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).

## Usage

### AudioPlayer
Expand Down Expand Up @@ -234,8 +207,8 @@ Make your `AudioItem`-subclass conform to `InitialTiming` to be able to start pl

## Author

Originally: Jørgen Henrichsen now extended by David Chavez and other contributors.
Originally: Jørgen Henrichsen, extended by David Chavez and other contributors.

## License

SwiftAudioEx is available under the MIT license. See the LICENSE file for more info.
SwiftAudioPro is available under the MIT license. See the LICENSE file for more info.
Loading

0 comments on commit 66db4b2

Please sign in to comment.