Skip to content

Commit

Permalink
[ReplayGain / Volume] Fix default volume value
Browse files Browse the repository at this point in the history
Fix the default volume scale reading for newly added tracks, as this
value should be 1 for any files which do not have tags. Also add an
override to the tag applying function, to reset the default on tag
re-read operations.

Please reload the tags or re-add your files to fix them playing
silently.

Signed-off-by: Christopher Snowhill <[email protected]>
  • Loading branch information
kode54 committed Jun 17, 2022
1 parent 3e01312 commit 4e78280
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@
<rect key="frame" x="83" y="3" width="20" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ERj-i9-caa">
<rect key="frame" x="0.0" y="4" width="17" height="11"/>
<constraints>
<constraint firstAttribute="height" constant="11" id="hCf-q7-ikN"/>
</constraints>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ERj-i9-caa">
<rect key="frame" x="0.0" y="3" width="17" height="11"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="8rO-fU-Njw"/>
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5cp-JI-ogI">
Expand Down
2 changes: 1 addition & 1 deletion DataModel.xcdatamodeld/DataModel.xcdatamodel/contents
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<attribute name="trashUrlString" optional="YES" attributeType="String"/>
<attribute name="unSigned" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="urlString" optional="YES" attributeType="String"/>
<attribute name="volume" optional="YES" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="volume" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="YES"/>
<attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
</entity>
<elements>
Expand Down
1 change: 1 addition & 0 deletions Playlist/PlaylistEntry.m
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ - (void)setMetadata:(NSDictionary *)metadata {
self.error = YES;
self.errorMessage = @"Unable to retrieve metadata.";
} else {
self.volume = 1;
[self setValuesForKeysWithDictionary:metadata];
}

Expand Down

0 comments on commit 4e78280

Please sign in to comment.