Skip to content

Commit

Permalink
Merge pull request #40 from vadymmarkov/refactor/transform-strategy
Browse files Browse the repository at this point in the history
Refactor/transform strategy
  • Loading branch information
vadymmarkov authored Oct 25, 2016
2 parents 0192a7d + 23109a7 commit af70b02
Show file tree
Hide file tree
Showing 56 changed files with 508 additions and 1,255 deletions.
4 changes: 0 additions & 4 deletions .slather.yml

This file was deleted.

1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0
39 changes: 39 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
included: # paths to include during linting. `--path` is ignored if present.
- Source
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
disabled_rules:
- type_name

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 200
# they can set both implicitly with an array
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 3 # only warning
max_length: # warning and error
warning: 40
error: 50
excluded: iPhone # excluded via string
variable_name:
min_length: # only min_length
error: 2 # only error
excluded: # excluded via string array
- x
- y
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
osx_image: xcode8
language: objective-c
cache: cocoapods
before_install: gem install cocoapods obcd slather -N

# Use when you don't have third party dependencies
script: xctool -project Pod/Pod.xcodeproj -scheme Tests -sdk iphonesimulator build test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES clean test
before_install:
- brew update
- if brew outdated | grep -qx carthage; then brew upgrade carthage; fi
- travis_wait 35 carthage bootstrap --platform iOS

# Use when you have third party dependencies (CocoaPods generates a workspace)
# podfile: Pod/Podfile
# script: xctool -workspace Pod/Pod.xcworkspace -scheme Tests -sdk iphonesimulator build test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES clean test
script:
- xcodebuild clean build -project Beethoven.xcodeproj -scheme "Beethoven-iOS" -sdk iphonesimulator | xcpretty && exit ${PIPESTATUS[0]}
- xcodebuild test -project Beethoven.xcodeproj -scheme "Beethoven-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' | xcpretty && exit ${PIPESTATUS[0]}

after_success: slather
notifications:
email: false
4 changes: 3 additions & 1 deletion Beethoven.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Beethoven"
s.summary = "A maestro of pitch detection"
s.version = "2.0.0"
s.version = "3.0.0"
s.homepage = "https://github.com/vadymmarkov/Beethoven"
s.license = 'MIT'
s.author = { "Vadym Markov" => "[email protected]" }
Expand All @@ -18,4 +18,6 @@ Pod::Spec.new do |s|

s.frameworks = 'Foundation', 'AVFoundation', 'Accelerate'
s.dependency 'Pitchy'

s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
end
318 changes: 150 additions & 168 deletions Beethoven.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
20 changes: 0 additions & 20 deletions BeethovenTests/Spec/Transform/TransformFactorySpec.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v4.1.0"
github "Quick/Quick" "v0.9.3"
github "Quick/Nimble" "v5.1.0"
github "Quick/Quick" "v0.10.0"
github "vadymmarkov/Pitchy" "2.0.1"
1 change: 1 addition & 0 deletions Example/GuitarTuner/.swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0
2 changes: 1 addition & 1 deletion Example/GuitarTuner/GuitarTuner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
1962EBAD1F8E34314E982594 /* [CP] Check Pods Manifest.lock */ = {
Expand Down
15 changes: 6 additions & 9 deletions Example/GuitarTuner/GuitarTuner/Source/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ViewController: UIViewController {
return label
}()

lazy var offsetLabel: UILabel = { [unowned self] in
lazy var offsetLabel: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 28)
label.textColor = UIColor.white
Expand All @@ -43,10 +43,8 @@ class ViewController: UIViewController {
return button
}()

lazy var pitchEngine: PitchEngine = { [unowned self] in
var config = Config()
config.transformStrategy = .yin
config.estimationStrategy = .yin
lazy var pitchEngine: PitchEngine = { [weak self] in
var config = Config(estimationStrategy: .yin)
let pitchEngine = PitchEngine(config: config, delegate: self)
pitchEngine.levelThreshold = -30.0

Expand Down Expand Up @@ -85,7 +83,7 @@ class ViewController: UIViewController {
offsetLabel.isHidden = !pitchEngine.active
}

// MARK: - Constrains
// MARK: - Layout

func setupLayout() {
let totalSize = UIScreen.main.bounds
Expand Down Expand Up @@ -140,7 +138,7 @@ extension ViewController: PitchEngineDelegate {
let offsetPercentage = pitch.closestOffset.percentage
let absOffsetPercentage = abs(offsetPercentage)

NSLog("pitch : \(pitch.note.string) - percentage : \(offsetPercentage)")
print("pitch : \(pitch.note.string) - percentage : \(offsetPercentage)")

guard absOffsetPercentage > 1.0 else {
return
Expand All @@ -159,7 +157,6 @@ extension ViewController: PitchEngineDelegate {
}

public func pitchEngineWentBelowLevelThreshold(_ pitchEngine: PitchEngine) {

print("Below level threshold")
}

}
8 changes: 4 additions & 4 deletions Example/GuitarTuner/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Beethoven (2.0.0):
- Beethoven (3.0.0):
- Pitchy
- Cartography (1.0.1)
- Hue (2.0.0)
Expand All @@ -12,7 +12,7 @@ DEPENDENCIES:

EXTERNAL SOURCES:
Beethoven:
:path: ../../
:path: "../../"
Hue:
:git: https://github.com/hyperoslo/Hue

Expand All @@ -22,11 +22,11 @@ CHECKOUT OPTIONS:
:git: https://github.com/hyperoslo/Hue

SPEC CHECKSUMS:
Beethoven: 8dedb982e34b53a1a2c5c79ee879929d65710869
Beethoven: 70d27286285b8d2a80c253b3da7db9b0d1157425
Cartography: c1460e99395b824d9d75360b0382faeb0b33dcd7
Hue: 2b317616a04cc5d7cccdb024c88e6d143e2b9cf1
Pitchy: 00dbe7cb7ac87fd9c32cb2aa6ce50d11f931289f

PODFILE CHECKSUM: 1e153b4e2c75610a8ffdfdf508f1f60b13da109d

COCOAPODS: 1.0.1
COCOAPODS: 1.1.0.rc.3
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import PackageDescription
let package = Package(
name: "Beethoven",
dependencies: [
.Package(url: "https://github.com/vadymmarkov/Pitchy.git", majorVersion: 1),
.Package(url: "https://github.com/vadymmarkov/Pitchy.git", majorVersion: 2),
]
)
7 changes: 0 additions & 7 deletions Pod/Podfile

This file was deleted.

25 changes: 0 additions & 25 deletions Pod/Podfile.lock

This file was deleted.

24 changes: 0 additions & 24 deletions Pod/Tests/Info.plist

This file was deleted.

Loading

0 comments on commit af70b02

Please sign in to comment.