Skip to content

Commit b318d4e

Browse files
committed
Merge branch 'image-rendering' of https://github.com/ospr/FDWaveformView into ospr-image-rendering
* 'image-rendering' of https://github.com/ospr/FDWaveformView: (51 commits) Remove debug variable. Fix name of method in changelog Update changelog. Reorder type buttons and highlight the currently selected one. Add support for changing waveform colors to example. Add public initializers to FDWaveformRenderFormat. Update name of method to plot waveform graph. Remove image output. Remove debug print statements. Guard against cases where stale url is loaded. Add audioURL to error log. Make multiline guard consistent. Handle case where imageSize has a 0 width or height. Handle case where target samples is 0. Move completionHandler to private section. Add note/var regarding image size constraints. Add documentation. Remove todo. Remove todo. Update example app to add buttons for linear/logarithmic. ...
2 parents c146684 + 3c731e7 commit b318d4e

5 files changed

Lines changed: 632 additions & 210 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ All notable changes to this project will be documented in this file.
66

77
## [Master](https://github.com/fulldecent/FDWaveformView/compare/2.1.0...master)
88

9+
#### Added
10+
- Improved accuracy of waveform rendering
11+
- Added by [Kip Nicol](https://github.com/ospr)
12+
- Added support for rendering waveform images outside of a view (See `FDWaveformRenderOperation`)
13+
- Added by [Kip Nicol](https://github.com/ospr)
14+
- Added support for rendering linear waveforms
15+
- Added by [Kip Nicol](https://github.com/ospr)
16+
- Added support for changing `wavesColor` and `progressColor` after waveform was rendered
17+
- Added by [Kip Nicol](https://github.com/ospr)
18+
- Added support for updating waveform type and color to iOS Example app.
19+
- Added by [Kip Nicol](https://github.com/ospr)
20+
21+
#### Fixed
22+
- Fixed waveform rendering for large audio files
23+
- Added by [Kip Nicol](https://github.com/ospr)
24+
- Fixed bug which could prevent waveform from fitting new view size if rendering was in progress during a view resize
25+
- Added by [Kip Nicol](https://github.com/ospr)
26+
- Fixed bug which caused `waveformViewDidLoad()` to not be called after the audio file was loaded
27+
- Added by [Kip Nicol](https://github.com/ospr)
28+
- Fixed bug which caused subsequent waveform renderings for new audioURLs to never complete if there was an error with a previous render
29+
- Added by [Kip Nicol](https://github.com/ospr)
30+
- Fixed bug which could cause a crash (divide by zero error) if the view's width was 0
31+
- Added by [Kip Nicol](https://github.com/ospr)
32+
933
---
1034

1135
## [2.1.0](https://github.com/fulldecent/FDWaveformView/releases/tag/2.1.0)

Example/Source/Base.lproj/Main.storyboard

Lines changed: 82 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="upN-2p-DeK">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="upN-2p-DeK">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
7-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
88
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
@@ -59,38 +59,83 @@
5959
</button>
6060
</subviews>
6161
</stackView>
62-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="j1y-7e-BVW">
63-
<rect key="frame" x="0.0" y="38" width="343" height="12"/>
64-
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
65-
<state key="normal" title="Randomly Set Play Progress">
66-
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
67-
</state>
68-
<connections>
69-
<action selector="doAnimation" destination="upN-2p-DeK" eventType="touchUpInside" id="8is-yA-PRF"/>
70-
</connections>
71-
</button>
72-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SVK-SI-w8z">
73-
<rect key="frame" x="0.0" y="58" width="343" height="30"/>
74-
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
75-
<state key="normal" title="Zoom In">
76-
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
77-
</state>
78-
<connections>
79-
<action selector="doZoomIn" destination="upN-2p-DeK" eventType="touchUpInside" id="S0y-Hu-Y5X"/>
80-
</connections>
81-
</button>
82-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E4r-xb-1qj">
83-
<rect key="frame" x="0.0" y="96" width="343" height="30"/>
84-
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
85-
<state key="normal" title="Zoom Out">
86-
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
87-
</state>
88-
<connections>
89-
<action selector="doZoomOut" destination="upN-2p-DeK" eventType="touchUpInside" id="6Q6-GO-3mm"/>
90-
</connections>
91-
</button>
62+
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="BcZ-fY-in9">
63+
<rect key="frame" x="0.0" y="38" width="343" height="22"/>
64+
<subviews>
65+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="j1y-7e-BVW">
66+
<rect key="frame" x="0.0" y="0.0" width="167.5" height="22"/>
67+
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
68+
<state key="normal" title="Randomize Progress">
69+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
70+
</state>
71+
<connections>
72+
<action selector="doAnimation" destination="upN-2p-DeK" eventType="touchUpInside" id="8is-yA-PRF"/>
73+
</connections>
74+
</button>
75+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="peu-Yh-DqX">
76+
<rect key="frame" x="175.5" y="0.0" width="167.5" height="22"/>
77+
<color key="backgroundColor" red="0.94509803920000002" green="0.76862745099999996" blue="0.058823529409999999" alpha="1" colorSpace="calibratedRGB"/>
78+
<state key="normal" title="Randomize Colors">
79+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
80+
</state>
81+
<connections>
82+
<action selector="doChangeColors" destination="upN-2p-DeK" eventType="touchUpInside" id="NDD-xI-lhl"/>
83+
</connections>
84+
</button>
85+
</subviews>
86+
</stackView>
87+
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="lPz-WR-UxK">
88+
<rect key="frame" x="0.0" y="68" width="343" height="30"/>
89+
<subviews>
90+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SVK-SI-w8z">
91+
<rect key="frame" x="0.0" y="0.0" width="167.5" height="30"/>
92+
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
93+
<state key="normal" title="Zoom In">
94+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
95+
</state>
96+
<connections>
97+
<action selector="doZoomIn" destination="upN-2p-DeK" eventType="touchUpInside" id="S0y-Hu-Y5X"/>
98+
</connections>
99+
</button>
100+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E4r-xb-1qj">
101+
<rect key="frame" x="175.5" y="0.0" width="167.5" height="30"/>
102+
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
103+
<state key="normal" title="Zoom Out">
104+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
105+
</state>
106+
<connections>
107+
<action selector="doZoomOut" destination="upN-2p-DeK" eventType="touchUpInside" id="6Q6-GO-3mm"/>
108+
</connections>
109+
</button>
110+
</subviews>
111+
</stackView>
112+
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="Ivp-WG-1nv">
113+
<rect key="frame" x="0.0" y="106" width="343" height="30"/>
114+
<subviews>
115+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RyM-Vw-vxI">
116+
<rect key="frame" x="0.0" y="0.0" width="167.5" height="30"/>
117+
<color key="backgroundColor" red="0.94509803920000002" green="0.76862745099999996" blue="0.058823529409999999" alpha="1" colorSpace="calibratedRGB"/>
118+
<state key="normal" title="Logarithmic">
119+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
120+
</state>
121+
<connections>
122+
<action selector="doLogarithmic" destination="upN-2p-DeK" eventType="touchUpInside" id="jN8-mB-J6M"/>
123+
</connections>
124+
</button>
125+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4ur-MQ-hmf">
126+
<rect key="frame" x="175.5" y="0.0" width="167.5" height="30"/>
127+
<color key="backgroundColor" red="0.94509803920000002" green="0.76862745099999996" blue="0.058823529409999999" alpha="1" colorSpace="calibratedRGB"/>
128+
<state key="normal" title="Linear">
129+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
130+
</state>
131+
<connections>
132+
<action selector="doLinear" destination="upN-2p-DeK" eventType="touchUpInside" id="6LL-9Q-E0Q"/>
133+
</connections>
134+
</button>
135+
</subviews>
136+
</stackView>
92137
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3PV-7N-GXl">
93-
<rect key="frame" x="0.0" y="134" width="343" height="30"/>
138+
<rect key="frame" x="0.0" y="144" width="343" height="0.0"/>
94139
<color key="backgroundColor" red="0.94509803921568625" green="0.76862745098039209" blue="0.058823529411764705" alpha="1" colorSpace="calibratedRGB"/>
95140
<state key="normal" title="Run Performance Profiling">
96141
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -100,7 +145,7 @@
100145
</connections>
101146
</button>
102147
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="GEb-3P-FO0">
103-
<rect key="frame" x="0.0" y="172" width="343" height="31"/>
148+
<rect key="frame" x="0.0" y="152" width="343" height="31"/>
104149
<subviews>
105150
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Zb-ye-cdK">
106151
<rect key="frame" x="0.0" y="0.0" width="51" height="31"/>
@@ -141,7 +186,7 @@
141186
</subviews>
142187
</stackView>
143188
<view contentMode="scaleToFill" verticalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="IUq-Ru-f0Z" customClass="FDWaveformView" customModule="FDWaveformView">
144-
<rect key="frame" x="0.0" y="211" width="343" height="436"/>
189+
<rect key="frame" x="0.0" y="191" width="343" height="456"/>
145190
<color key="backgroundColor" red="0.74117647058823533" green="0.76470588235294112" blue="0.7803921568627451" alpha="1" colorSpace="calibratedRGB"/>
146191
<userDefinedRuntimeAttributes>
147192
<userDefinedRuntimeAttribute type="color" keyPath="wavesColor">
@@ -164,6 +209,8 @@
164209
</constraints>
165210
</view>
166211
<connections>
212+
<outlet property="linearButton" destination="4ur-MQ-hmf" id="jDg-gy-cpn"/>
213+
<outlet property="logarithmicButton" destination="RyM-Vw-vxI" id="TjV-L8-CRk"/>
167214
<outlet property="waveform" destination="IUq-Ru-f0Z" id="ey9-47-UlE"/>
168215
</connections>
169216
</viewController>

0 commit comments

Comments
 (0)