[vlc-commits] [Git][videolan/vlc][master] macosx: Add pitch adjustment to Audio Effects

David (@dfuhrmann) gitlab at videolan.org
Wed Jun 30 19:40:29 UTC 2021



David pushed to branch master at VideoLAN / VLC


Commits:
f6275d44 by Samuel Bassaly at 2021-06-30T19:20:54+00:00
macosx: Add pitch adjustment to Audio Effects

Add the Advanced Tab to the Audio Effects panel, and include the Adjust
pitch slider.

Update the profile string to include the pitch value, so that the user
doesn't need to set it each time.

Closes: #25543

- - - - -


3 changed files:

- modules/gui/macosx/UI/AudioEffects.xib
- modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
- modules/gui/macosx/panels/VLCAudioEffectsWindowController.m


Changes:

=====================================
modules/gui/macosx/UI/AudioEffects.xib
=====================================
@@ -1,13 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="VLCAudioEffectsWindowController">
             <connections>
+                <outlet property="advancedEnableCheckbox" destination="rjL-0q-isR" id="Tjh-on-9sb"/>
+                <outlet property="advancedPitchLabel" destination="f9i-Ql-mCB" id="9nt-SB-ROX"/>
+                <outlet property="advancedPitchSlider" destination="nTJ-ss-QlS" id="mPt-X9-kEF"/>
+                <outlet property="advancedPitchTextField" destination="8cX-Go-0bh" id="5pd-hu-267"/>
+                <outlet property="advancedResetButton" destination="fI0-dm-MVt" id="Yg0-gT-4je"/>
+                <outlet property="advancedView" destination="L1S-G0-kAE" id="lDO-b5-pKe"/>
                 <outlet property="applyProfileCheckbox" destination="Dqv-cc-ZvK" id="DXd-0m-de4"/>
                 <outlet property="compressorBand1Label" destination="248" id="qCX-jv-cwZ"/>
                 <outlet property="compressorBand1Slider" destination="221" id="mTW-zO-vyb"/>
@@ -95,13 +101,13 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES" HUD="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="254" width="473" height="281"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
             <view key="contentView" id="2">
-                <rect key="frame" x="0.0" y="0.0" width="473" height="281"/>
+                <rect key="frame" x="0.0" y="0.0" width="475" height="281"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <segmentedControl verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jb1-f1-iF3">
-                        <rect key="frame" x="72" y="254" width="330" height="24"/>
+                    <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Jb1-f1-iF3">
+                        <rect key="frame" x="40" y="254" width="395" height="24"/>
                         <segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="ZdJ-0F-LWH">
                             <font key="font" metaFont="system"/>
                             <segments>
@@ -109,6 +115,7 @@
                                 <segment label="Compressor" tag="1"/>
                                 <segment label="Spatializer" tag="2"/>
                                 <segment label="Filter" tag="3"/>
+                                <segment label="Advanced"/>
                             </segments>
                         </segmentedCell>
                         <connections>
@@ -116,18 +123,18 @@
                         </connections>
                     </segmentedControl>
                     <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="EuA-vb-mSS">
-                        <rect key="frame" x="0.0" y="246" width="473" height="5"/>
+                        <rect key="frame" x="0.0" y="246" width="475" height="5"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="1" id="3Ct-NZ-Azh"/>
                         </constraints>
                     </box>
                     <tabView drawsBackground="NO" type="noTabsNoBorder" initialItem="81" translatesAutoresizingMaskIntoConstraints="NO" id="80">
-                        <rect key="frame" x="0.0" y="35" width="473" height="211"/>
+                        <rect key="frame" x="0.0" y="35" width="475" height="211"/>
                         <font key="font" metaFont="system"/>
                         <tabViewItems>
                             <tabViewItem label="Graphic Equalizer" identifier="equalizer" id="81">
                                 <view key="view" id="84">
-                                    <rect key="frame" x="0.0" y="0.0" width="473" height="211"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="475" height="211"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <button horizontalHuggingPriority="750" verticalHuggingPriority="750" mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="192">
@@ -151,7 +158,7 @@
                                             </connections>
                                         </button>
                                         <popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="168">
-                                            <rect key="frame" x="156" y="190" width="310" height="22"/>
+                                            <rect key="frame" x="156" y="190" width="312" height="22"/>
                                             <popUpButtonCell key="cell" type="push" title="headphones" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="181" id="169">
                                                 <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="message" size="11"/>
@@ -219,7 +226,7 @@
                                             </connections>
                                         </popUpButton>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="721">
-                                            <rect key="frame" x="45" y="0.0" width="384" height="181"/>
+                                            <rect key="frame" x="46" y="0.0" width="384" height="181"/>
                                             <subviews>
                                                 <slider horizontalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="196">
                                                     <rect key="frame" x="14" y="31" width="18" height="150"/>
@@ -498,7 +505,7 @@
                             </tabViewItem>
                             <tabViewItem label="Compressor" identifier="compressor" id="82">
                                 <view key="view" id="83">
-                                    <rect key="frame" x="0.0" y="0.0" width="473" height="211"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="475" height="211"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="218">
@@ -512,7 +519,7 @@
                                             </connections>
                                         </button>
                                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="621">
-                                            <rect key="frame" x="424" y="190" width="39" height="17"/>
+                                            <rect key="frame" x="426" y="191" width="39" height="15"/>
                                             <buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" image="buttonCell:622:image" imagePosition="overlaps" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="622">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="miniSystem"/>
@@ -522,7 +529,7 @@
                                             </connections>
                                         </button>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="723">
-                                            <rect key="frame" x="36" y="0.0" width="402" height="178"/>
+                                            <rect key="frame" x="37" y="0.0" width="402" height="178"/>
                                             <subviews>
                                                 <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="755" translatesAutoresizingMaskIntoConstraints="NO" id="220">
                                                     <rect key="frame" x="8" y="30" width="50" height="11"/>
@@ -785,7 +792,7 @@
                             </tabViewItem>
                             <tabViewItem label="Spatializer" identifier="spatializer" id="85">
                                 <view key="view" id="86">
-                                    <rect key="frame" x="0.0" y="0.0" width="473" height="211"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="475" height="211"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="262">
@@ -799,7 +806,7 @@
                                             </connections>
                                         </button>
                                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="618">
-                                            <rect key="frame" x="424" y="190" width="39" height="17"/>
+                                            <rect key="frame" x="426" y="191" width="39" height="15"/>
                                             <buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" image="buttonCell:619:image" imagePosition="overlaps" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="619">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="miniSystem"/>
@@ -809,7 +816,7 @@
                                             </connections>
                                         </button>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="725">
-                                            <rect key="frame" x="92" y="0.0" width="290" height="178"/>
+                                            <rect key="frame" x="93" y="0.0" width="290" height="178"/>
                                             <subviews>
                                                 <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="755" translatesAutoresizingMaskIntoConstraints="NO" id="265">
                                                     <rect key="frame" x="8" y="33" width="50" height="11"/>
@@ -1014,7 +1021,7 @@
                             </tabViewItem>
                             <tabViewItem label="Filter" identifier="filter" id="339">
                                 <view key="view" id="340">
-                                    <rect key="frame" x="0.0" y="0.0" width="473" height="211"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="475" height="211"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="343">
@@ -1028,13 +1035,13 @@
                                             </connections>
                                         </button>
                                         <box borderType="line" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="727">
-                                            <rect key="frame" x="16" y="146" width="440" height="36"/>
+                                            <rect key="frame" x="16" y="143" width="442" height="40"/>
                                             <view key="contentView" id="eB4-KX-Qdy">
-                                                <rect key="frame" x="3" y="3" width="434" height="30"/>
+                                                <rect key="frame" x="3" y="3" width="436" height="34"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <subviews>
                                                     <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="341">
-                                                        <rect key="frame" x="15" y="6" width="82" height="14"/>
+                                                        <rect key="frame" x="15" y="10" width="82" height="14"/>
                                                         <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Maximum level" usesSingleLineMode="YES" id="348">
                                                             <font key="font" metaFont="message" size="11"/>
                                                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -1042,7 +1049,7 @@
                                                         </textFieldCell>
                                                     </textField>
                                                     <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="342">
-                                                        <rect key="frame" x="110" y="5" width="310" height="15"/>
+                                                        <rect key="frame" x="110" y="10" width="308" height="15"/>
                                                         <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" minValue="0.10000000000000001" maxValue="10" doubleValue="5" tickMarkPosition="above" sliderType="linear" id="347"/>
                                                         <connections>
                                                             <action selector="filterVolumeNormSliderUpdated:" target="-2" id="YLf-gK-UkJ"/>
@@ -1060,7 +1067,7 @@
                                             </view>
                                         </box>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="709">
-                                            <rect key="frame" x="14" y="126" width="65" height="18"/>
+                                            <rect key="frame" x="14" y="123" width="65" height="18"/>
                                             <buttonCell key="cell" type="check" title="Karaoke" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="710">
                                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                                 <font key="font" metaFont="message" size="11"/>
@@ -1070,7 +1077,7 @@
                                             </connections>
                                         </button>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="344">
-                                            <rect key="frame" x="14" y="106" width="154" height="18"/>
+                                            <rect key="frame" x="14" y="103" width="154" height="18"/>
                                             <buttonCell key="cell" type="check" title="Headphone virtualization" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="345">
                                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                                 <font key="font" metaFont="message" size="11"/>
@@ -1080,7 +1087,7 @@
                                             </connections>
                                         </button>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="wYr-HG-zA2">
-                                            <rect key="frame" x="14" y="86" width="84" height="18"/>
+                                            <rect key="frame" x="14" y="83" width="84" height="18"/>
                                             <buttonCell key="cell" type="check" title="Scaletempo" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="9yB-r8-GZB">
                                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                                 <font key="font" metaFont="message" size="11"/>
@@ -1090,7 +1097,7 @@
                                             </connections>
                                         </button>
                                         <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="NUi-0U-gqN">
-                                            <rect key="frame" x="14" y="66" width="109" height="18"/>
+                                            <rect key="frame" x="14" y="63" width="109" height="18"/>
                                             <buttonCell key="cell" type="check" title="Stereo Enhancer" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="kvM-H1-VS8">
                                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                                 <font key="font" metaFont="message" size="11"/>
@@ -1112,22 +1119,106 @@
                                         <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="NUi-0U-gqN" secondAttribute="trailing" constant="17" id="N91-oo-QEw"/>
                                         <constraint firstItem="344" firstAttribute="leading" secondItem="340" secondAttribute="leading" constant="17" id="TT3-Ns-bah"/>
                                         <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="343" secondAttribute="trailing" constant="17" id="U6r-dx-G3F"/>
-                                        <constraint firstItem="727" firstAttribute="top" secondItem="343" secondAttribute="bottom" constant="2" id="UzT-9i-b8g"/>
+                                        <constraint firstItem="727" firstAttribute="top" secondItem="343" secondAttribute="bottom" constant="1" id="UzT-9i-b8g"/>
                                         <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="709" secondAttribute="trailing" constant="17" id="XNI-EE-bK7"/>
                                         <constraint firstAttribute="trailing" secondItem="727" secondAttribute="trailing" constant="20" id="fMH-4J-f1L"/>
                                         <constraint firstItem="344" firstAttribute="top" secondItem="709" secondAttribute="bottom" constant="8" id="hm2-YQ-yW3"/>
                                         <constraint firstItem="343" firstAttribute="top" secondItem="340" secondAttribute="top" constant="17" id="io6-vx-Ttr"/>
-                                        <constraint firstItem="eB4-KX-Qdy" firstAttribute="top" secondItem="343" secondAttribute="bottom" constant="1" id="lSW-6i-4TX"/>
+                                        <constraint firstItem="eB4-KX-Qdy" firstAttribute="top" secondItem="343" secondAttribute="bottom" constant="2" id="lSW-6i-4TX"/>
                                         <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="wYr-HG-zA2" secondAttribute="trailing" constant="17" id="qCX-pR-3fB"/>
                                         <constraint firstItem="wYr-HG-zA2" firstAttribute="top" secondItem="344" secondAttribute="bottom" constant="8" id="s4V-di-NZX"/>
                                         <constraint firstItem="709" firstAttribute="top" secondItem="727" secondAttribute="bottom" constant="9" id="yUQ-aD-K7C"/>
                                     </constraints>
                                 </view>
                             </tabViewItem>
+                            <tabViewItem label="Advanced" identifier="advanced" id="UvH-ed-waZ">
+                                <view key="view" id="209-XL-dUD">
+                                    <rect key="frame" x="0.0" y="0.0" width="475" height="211"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <subviews>
+                                        <button mirrorLayoutDirectionWhenInternationalizing="always" translatesAutoresizingMaskIntoConstraints="NO" id="rjL-0q-isR">
+                                            <rect key="frame" x="7" y="190" width="58" height="18"/>
+                                            <buttonCell key="cell" type="check" title="Enable" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="XkH-KA-7ZB">
+                                                <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                                <font key="font" metaFont="message" size="11"/>
+                                            </buttonCell>
+                                            <connections>
+                                                <action selector="advancedEnable:" target="-2" id="0wk-x7-VxI"/>
+                                            </connections>
+                                        </button>
+                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fI0-dm-MVt">
+                                            <rect key="frame" x="426" y="191" width="39" height="15"/>
+                                            <buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" image="buttonCell:rEJ-M5-S37:image" imagePosition="overlaps" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="rEJ-M5-S37">
+                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                <font key="font" metaFont="miniSystem"/>
+                                            </buttonCell>
+                                            <connections>
+                                                <action selector="resetAdvancedValues:" target="-2" id="4hz-0h-Xvl"/>
+                                            </connections>
+                                        </button>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="L1S-G0-kAE">
+                                            <rect key="frame" x="195" y="0.0" width="86" height="178"/>
+                                            <subviews>
+                                                <slider translatesAutoresizingMaskIntoConstraints="NO" id="nTJ-ss-QlS">
+                                                    <rect key="frame" x="34" y="47" width="18" height="131"/>
+                                                    <sliderCell key="cell" controlSize="small" continuous="YES" alignment="left" minValue="-12" maxValue="12" tickMarkPosition="right" numberOfTickMarks="9" sliderType="linear" id="kju-14-quf"/>
+                                                    <connections>
+                                                        <action selector="advancedSliderUpdated:" target="-2" id="yzS-3w-HKN"/>
+                                                    </connections>
+                                                </slider>
+                                                <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="755" translatesAutoresizingMaskIntoConstraints="NO" id="8cX-Go-0bh">
+                                                    <rect key="frame" x="8" y="33" width="70" height="11"/>
+                                                    <textFieldCell key="cell" controlSize="mini" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="center" title="0.0 semitones" usesSingleLineMode="YES" id="Ycq-EF-cb9">
+                                                        <font key="font" metaFont="miniSystem"/>
+                                                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="f9i-Ql-mCB" customClass="VLCWrappableTextField">
+                                                    <rect key="frame" x="8" y="13" width="70" height="11"/>
+                                                    <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Adjust pitch" id="tFs-LA-Bdx">
+                                                        <font key="font" metaFont="miniSystem"/>
+                                                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="nTJ-ss-QlS" firstAttribute="top" secondItem="L1S-G0-kAE" secondAttribute="top" id="6RB-JZ-xWV"/>
+                                                <constraint firstAttribute="trailing" secondItem="8cX-Go-0bh" secondAttribute="trailing" constant="10" id="Jg8-TQ-Djp"/>
+                                                <constraint firstAttribute="bottom" secondItem="f9i-Ql-mCB" secondAttribute="bottom" constant="13" id="brb-yM-ZgX"/>
+                                                <constraint firstItem="nTJ-ss-QlS" firstAttribute="bottom" secondItem="f9i-Ql-mCB" secondAttribute="top" constant="-24" id="eZX-RP-sUs"/>
+                                                <constraint firstItem="8cX-Go-0bh" firstAttribute="leading" secondItem="L1S-G0-kAE" secondAttribute="leading" constant="10" id="hRo-i2-MvS"/>
+                                                <constraint firstItem="nTJ-ss-QlS" firstAttribute="leading" secondItem="L1S-G0-kAE" secondAttribute="leading" constant="34" id="hw4-tY-RXC"/>
+                                                <constraint firstItem="8cX-Go-0bh" firstAttribute="top" secondItem="nTJ-ss-QlS" secondAttribute="bottom" constant="4" id="oit-FY-gc0"/>
+                                                <constraint firstAttribute="trailing" secondItem="f9i-Ql-mCB" secondAttribute="trailing" constant="10" id="rGx-6J-gH4"/>
+                                                <constraint firstItem="f9i-Ql-mCB" firstAttribute="top" secondItem="8cX-Go-0bh" secondAttribute="bottom" constant="9" id="rOG-sZ-pgI"/>
+                                                <constraint firstAttribute="trailing" secondItem="nTJ-ss-QlS" secondAttribute="trailing" constant="34" id="ruG-mu-TTd"/>
+                                                <constraint firstItem="f9i-Ql-mCB" firstAttribute="leading" secondItem="L1S-G0-kAE" secondAttribute="leading" constant="10" id="thK-bH-a3q"/>
+                                            </constraints>
+                                        </customView>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="L1S-G0-kAE" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="209-XL-dUD" secondAttribute="leading" constant="10" id="3r6-Nx-9LO"/>
+                                        <constraint firstItem="L1S-G0-kAE" firstAttribute="top" secondItem="rjL-0q-isR" secondAttribute="bottom" constant="15" id="LbX-hj-NJy"/>
+                                        <constraint firstItem="rjL-0q-isR" firstAttribute="leading" secondItem="209-XL-dUD" secondAttribute="leading" constant="10" id="MNF-lI-670"/>
+                                        <constraint firstAttribute="trailing" secondItem="fI0-dm-MVt" secondAttribute="trailing" constant="10" id="OJI-Rf-3G1"/>
+                                        <constraint firstAttribute="bottom" secondItem="L1S-G0-kAE" secondAttribute="bottom" id="cKC-Jc-Ljo"/>
+                                        <constraint firstItem="L1S-G0-kAE" firstAttribute="centerX" secondItem="209-XL-dUD" secondAttribute="centerX" id="coc-Mz-9PD"/>
+                                        <constraint firstItem="rjL-0q-isR" firstAttribute="top" secondItem="209-XL-dUD" secondAttribute="top" constant="6" id="ecd-Pr-3ZQ"/>
+                                        <constraint firstItem="fI0-dm-MVt" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="rjL-0q-isR" secondAttribute="trailing" constant="10" id="ita-Ge-bQL"/>
+                                        <constraint firstItem="rjL-0q-isR" firstAttribute="centerY" secondItem="fI0-dm-MVt" secondAttribute="centerY" id="lPZ-lq-8OT"/>
+                                        <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="L1S-G0-kAE" secondAttribute="trailing" constant="10" id="qFf-QN-rga"/>
+                                    </constraints>
+                                </view>
+                            </tabViewItem>
                         </tabViewItems>
                     </tabView>
-                    <popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="400" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="701">
+                    <popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="400" translatesAutoresizingMaskIntoConstraints="NO" id="701">
                         <rect key="frame" x="17" y="6" width="175" height="22"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="169" id="XQy-DD-QvZ"/>
+                        </constraints>
                         <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" inset="2" id="702">
                             <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                             <font key="font" metaFont="message" size="11"/>
@@ -1165,6 +1256,7 @@
                     <constraint firstAttribute="trailing" secondItem="80" secondAttribute="trailing" id="KUJ-ZT-T77"/>
                     <constraint firstItem="80" firstAttribute="top" secondItem="EuA-vb-mSS" secondAttribute="bottom" constant="2" id="LZC-Sa-azx"/>
                     <constraint firstItem="Jb1-f1-iF3" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="2" secondAttribute="leading" constant="20" symbolic="YES" id="Qdr-Bj-AK9"/>
+                    <constraint firstItem="Jb1-f1-iF3" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="42" id="Tt2-mR-VID"/>
                     <constraint firstItem="Jb1-f1-iF3" firstAttribute="top" secondItem="2" secondAttribute="top" constant="4" id="ZTA-69-Rbc"/>
                     <constraint firstItem="701" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="20" id="d4T-xa-vp3"/>
                     <constraint firstItem="Jb1-f1-iF3" firstAttribute="centerX" secondItem="2" secondAttribute="centerX" id="iYo-cU-P4u"/>
@@ -1173,7 +1265,7 @@
                     <constraint firstAttribute="trailing" secondItem="Dqv-cc-ZvK" secondAttribute="trailing" constant="20" id="zuf-TG-8LG"/>
                 </constraints>
             </view>
-            <point key="canvasLocation" x="270.5" y="167.5"/>
+            <point key="canvasLocation" x="182.5" y="166.5"/>
         </window>
         <userDefaultsController representsSharedInstance="YES" id="350"/>
     </objects>
@@ -1260,6 +1352,48 @@ L9IqK0BBV05TSW1hZ2WiQC8ACAARABoAJAApADIANwBJAEwAUQBTAGIAaAB1AHwAiwCSAJ8ApgCuALAA
 sgC0ALkAuwC9AMQAyQDUANYA2ADaAN8A4gDkAOYA6ADtAQQBBgEIB1gHXQdoB3EHhAeIB5MHnAehB6kH
 rAexB8AHxAfLB9MH4AflB+cH6QfuB/YH+Qf+CAYAAAAAAAACAQAAAAAAAABCAAAAAAAAAAAAAAAAAAAI
 CQ
+</mutableData>
+        </image>
+        <image name="buttonCell:rEJ-M5-S37:image" width="1" height="1">
+            <mutableData key="keyedArchiveRepresentation">
+YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
+S2V5ZWRBcmNoaXZlctEICVRyb290gAGuCwwZGh8UJCgpMDM2PD9VJG51bGzWDQ4PEBESExQVFhcYVk5T
+U2l6ZV5OU1Jlc2l6aW5nTW9kZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5TUmVwc1dOU0NvbG9ygAIQAIAN
+EiDLAACAA4ALVnsxLCAxfdIbDxweWk5TLm9iamVjdHOhHYAEgArSGw8gI6IhIoAFgAaACdIlDyYnXxAU
+TlNUSUZGUmVwcmVzZW50YXRpb26AB4AITx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lc2VydmVkLgBYWVogAAAAAAAA81EAAQAA
+AAEWzGN1cnYAAAAAAAAAAQHNAADSKissLVokY2xhc3NuYW1lWCRjbGFzc2VzXxAQTlNCaXRtYXBJbWFn
+ZVJlcKMsLi9aTlNJbWFnZVJlcFhOU09iamVjdNIqKzEyV05TQXJyYXmiMS/SKis0NV5OU011dGFibGVB
+cnJheaM0MS/TNzgPOTo7V05TV2hpdGVcTlNDb2xvclNwYWNlRDAgMAAQA4AM0iorPT5XTlNDb2xvcqI9
+L9IqK0BBV05TSW1hZ2WiQC8ACAARABoAJAApADIANwBJAEwAUQBTAGIAaAB1AHwAiwCSAJ8ApgCuALAA
+sgC0ALkAuwC9AMQAyQDUANYA2ADaAN8A4gDkAOYA6ADtAQQBBgEIB1gHXQdoB3EHhAeIB5MHnAehB6kH
+rAexB8AHxAfLB9MH4AflB+cH6QfuB/YH+Qf+CAYAAAAAAAACAQAAAAAAAABCAAAAAAAAAAAAAAAAAAAI
+CQ
 </mutableData>
         </image>
     </resources>


=====================================
modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
=====================================
@@ -116,6 +116,14 @@
 @property (readwrite, weak) IBOutlet NSButton *filterScaleTempoCheckbox;
 @property (readwrite, weak) IBOutlet NSButton *filterStereoEnhancerCheckbox;
 
+/* Advanced */
+ at property (readwrite, weak) IBOutlet NSView *advancedView;
+ at property (readwrite, weak) IBOutlet NSButton *advancedEnableCheckbox;
+ at property (readwrite, weak) IBOutlet NSButton *advancedResetButton;
+ at property (readwrite, weak) IBOutlet NSSlider *advancedPitchSlider;
+ at property (readwrite, weak) IBOutlet NSTextField *advancedPitchTextField;
+ at property (readwrite, weak) IBOutlet NSTextField *advancedPitchLabel;
+
 /* generic */
 - (IBAction)profileSelectorAction:(id)sender;
 - (IBAction)applyProfileCheckboxChanged:(id)sender;
@@ -147,4 +155,9 @@
 - (IBAction)filterEnableScaleTempo:(id)sender;
 - (IBAction)filterEnableStereoEnhancer:(id)sender;
 
+/* Advanced */
+- (IBAction)resetAdvancedValues:(id)sender;
+- (IBAction)advancedEnable:(id)sender;
+- (IBAction)advancedSliderUpdated:(id)sender;
+
 @end


=====================================
modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
=====================================
@@ -104,8 +104,8 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
 
 + (NSString *)defaultProfileString
 {
-    return [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
-            .0,25.,100.,-11.,8.,2.5,7.,.85,1.,.4,.5,.5,2.,0];
+    return [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i;%f",
+            .0,25.,100.,-11.,8.,2.5,7.,.85,1.,.4,.5,.5,2.,0,0.25f];
 }
 
 - (id)init
@@ -123,6 +123,7 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
                 [self resetCompressor];
                 [self resetSpatializer];
                 [self resetAudioFilters];
+                [self resetAdvanced];
 
                 [self loadProfile];
             } else {
@@ -155,11 +156,12 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
     aout_EnableFilter(p_aout, "equalizer", false);
     aout_EnableFilter(p_aout, "compressor", false);
     aout_EnableFilter(p_aout, "spatializer", false);
-    aout_EnableFilter(p_aout, "compressor", false);
+    aout_EnableFilter(p_aout, "scaletempo", false);
     aout_EnableFilter(p_aout, "headphone", false);
     aout_EnableFilter(p_aout, "normvol", false);
     aout_EnableFilter(p_aout, "karaoke", false);
-
+    aout_EnableFilter(p_aout, "scaletempo_pitch", false);
+  
     /* fetch preset */
     NSString *profileString;
     if (profileIndex == 0)
@@ -194,6 +196,18 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
     var_SetFloat(p_aout, "spatializer-damp", [[items objectAtIndex:13] floatValue]);
     var_SetFloat(p_aout, "norm-max-level", [[items objectAtIndex:14] floatValue]);
     var_SetBool(p_aout, "equalizer-2pass", (BOOL)[[items objectAtIndex:15] intValue]);
+    
+    // The old version of the defaults data contains 16 members (without pitch).
+    // These values are used above.
+    // In case the user updates VLC, this check handles the 1 time case that the data
+    // is still in the old format, and sets the pitch value to the default, otherwise
+    // it loads normally the saved pitch value.
+    if (likely(items.count >= 17)) {
+        var_SetFloat(p_aout, "pitch-shift", [[items objectAtIndex:16] floatValue]);
+    } else {
+        var_SetFloat(p_aout, "pitch-shift", 0.25f);
+    }
+    
     var_SetString(p_aout, "equalizer-bands", [[[defaults objectForKey:VLCAudioEffectsEqualizerValuesKey] objectAtIndex:presetIndex] UTF8String]);
     var_SetFloat(p_aout, "equalizer-preamp", [[[defaults objectForKey:VLCAudioEffectsEqualizerPreampValuesKey] objectAtIndex:presetIndex] floatValue]);
     var_SetString(p_aout, "equalizer-preset", [[[defaults objectForKey:VLCAudioEffectsEqualizerProfileNamesKey] objectAtIndex:presetIndex] UTF8String]);
@@ -272,12 +286,19 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
                                                   "suppressing mono (signal common to both channels) "\
                                                   "and by delaying the signal of left into right and vice versa, "\
                                                   "thereby widening the stereo effect.")];
-
+    
+    /* Advanced */
+    [_advancedEnableCheckbox setTitle:_NS("Enable")];
+    [_advancedResetButton setTitle:_NS("Reset")];
+    [_advancedPitchLabel setStringValue:_NS("Adjust pitch")];
+    
+    
     /* generic */
     [_segmentView setLabel:_NS("Equalizer") forSegment:0];
     [_segmentView setLabel:_NS("Compressor") forSegment:1];
     [_segmentView setLabel:_NS("Spatializer") forSegment:2];
     [_segmentView setLabel:_NS("Filter") forSegment:3];
+    [_segmentView setLabel:_NS("Advanced") forSegment:4];
 
     [self.window setTitle:_NS("Audio Effects")];
     [self.window setExcludedFromWindowsMenu:YES];
@@ -288,6 +309,8 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
     [self resetSpatializer];
     [self resetAudioFilters];
     [self resetProfileSelector];
+    [self resetAdvanced];
+
 }
 
 - (void)dealloc
@@ -370,7 +393,7 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
     if (!p_aout)
         return nil;
 
-    return [NSString stringWithFormat:@"%@;%@;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
+    return [NSString stringWithFormat:@"%@;%@;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i;%f",
                      B64EncAndFree(var_GetNonEmptyString(p_aout, "equalizer-preset")),
                      B64EncAndFree(var_InheritString(p_aout, "audio-filter")),
                      var_InheritFloat(p_aout, "compressor-rms-peak"),
@@ -386,7 +409,8 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
                      var_InheritFloat(p_aout, "spatializer-dry"),
                      var_InheritFloat(p_aout, "spatializer-damp"),
                      var_InheritFloat(p_aout, "norm-max-level"),
-                     var_InheritBool(p_aout,"equalizer-2pass")];
+                     var_InheritBool(p_aout, "equalizer-2pass"),
+                     var_InheritFloat(p_aout, "pitch-shift")];
 }
 
 - (void)saveCurrentProfile
@@ -506,6 +530,7 @@ NSString *VLCAudioEffectsProfileNamesKey = @"AudioEffectProfileNames";
     [self resetCompressor];
     [self resetSpatializer];
     [self resetAudioFilters];
+    [self resetAdvanced];
     [self updatePresetSelector];
 }
 
@@ -1191,4 +1216,68 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     [_playerController enableAudioFilterWithName:@"stereo_widen" state:[sender state]];
 }
 
+#pragma mark -
+#pragma mark Advanced
+- (void)resetAdvanced
+{
+    BOOL bEnable_advanced = NO;
+    char *psz_afilters    = NULL;
+    
+    audio_output_t *p_aout = [_playerController mainAudioOutput];
+    if (!p_aout)
+        return;
+
+    psz_afilters = var_InheritString(p_aout, "audio-filter");
+    if (psz_afilters) {
+        bEnable_advanced = strstr(psz_afilters, "scaletempo_pitch") != NULL;
+        free(psz_afilters);
+    }
+
+    [_advancedView enableSubviews:bEnable_advanced];
+    [_advancedEnableCheckbox setState:(bEnable_advanced ? NSOnState : NSOffState)];
+    
+    [_advancedPitchSlider setFloatValue: var_CreateGetFloat(p_aout, "pitch-shift")];
+    [_advancedPitchTextField setStringValue:[NSString localizedStringWithFormat:@"%1.1f semitones", [_advancedPitchSlider floatValue]]];
+
+    aout_Release(p_aout);
+}
+
+- (IBAction)resetAdvancedValues:(id)sender
+{
+    audio_output_t *p_aout = [_playerController mainAudioOutput];
+    if (p_aout) {
+        var_SetFloat(p_aout, "pitch-shift", 0.25f);
+        aout_Release(p_aout);
+    }
+    
+    [self resetAdvanced];
+}
+
+- (IBAction)advancedSliderUpdated:(id)sender
+{
+    char *psz_property = nil;
+    float f_value = [sender floatValue];
+
+    if (sender == _advancedPitchSlider)
+        psz_property = "pitch-shift";
+
+    assert(psz_property);
+
+    audio_output_t *p_aout = [_playerController mainAudioOutput];
+    if (p_aout) {
+        var_SetFloat(p_aout, psz_property, f_value);
+        aout_Release(p_aout);
+    }
+
+    if (sender == _advancedPitchSlider)
+        [_advancedPitchTextField setStringValue:[NSString localizedStringWithFormat:@"%1.1f semitones", f_value]];
+}
+
+- (IBAction)advancedEnable:(id)sender
+{
+    [_advancedView enableSubviews:[sender state]];
+    [_playerController enableAudioFilterWithName:@"scaletempo_pitch" state:[sender state]];
+}
+
+
 @end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f6275d44cf2ffb7bea37cb77657c3f1e4a5f3329

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f6275d44cf2ffb7bea37cb77657c3f1e4a5f3329
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list