1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00
Commit Graph

99 Commits

Author SHA1 Message Date
Bartłomiej Dach
15d9147edd Ensure equality member consistency for SampleInfo
The previous implementation of `SampleInfo`'s equality members was not
completely correct in its treatment of the `sampleNames` array. While
`Equals()` compared the values of `sampleNames` using `SequenceEqual()`,
therefore performing a structural check that inspects the contents of
both arrays, `GetHashCode()` used `HashCode.Combine()` directly on the
arrays, therefore operating on reference equality. This could cause the
pooling mechanism of samples to fail, as pointed out in #11079.

To resolve, change the `GetHashCode()` implementation such that it also
considers the contents of the array rather than just the reference to
the array itself. This is achieved by leveraging
`StructuralEqualityComparer`.

Additionally, as a bonus, an array sort was added to the constructor of
`SampleInfo`. This is intended to be a "canonicalisation" processing
step for the array of sample names. Thanks to that sort, two instances
of `SampleInfo` that have the same sample names but permutated will also
turn out to be equal and have the same hash codes, given the
implementation of both equality members. This gives `SampleInfo`
set-like semantics.
2020-12-03 23:25:53 +01:00
smoogipoo
e831c797f3 Merge branch 'master' into hit-sample-pooling 2020-12-02 14:45:24 +09:00
smoogipoo
2150cf1c52 Rename parameters 2020-12-02 10:55:48 +09:00
smoogipoo
2840405112 Volume should be 0 by default 2020-12-01 18:14:14 +09:00
smoogipoo
6b4a6c12c8 Fix bad equality comparer implementations 2020-12-01 18:13:53 +09:00
smoogipoo
c61f00525d Ignore lookup types for JSON serialisation 2020-12-01 18:13:53 +09:00
smoogipoo
17560aeeea Volume should be 0 by default 2020-12-01 18:09:28 +09:00
smoogipoo
dda4d76d72 Fix bad equality comparer implementations 2020-12-01 18:09:21 +09:00
smoogipoo
b780fdbe4c Ignore lookup types for JSON serialisation 2020-12-01 18:08:59 +09:00
smoogipoo
2bb7484608 Merge branch 'immutable-hit-samples' into hit-sample-pooling 2020-12-01 16:05:28 +09:00
smoogipoo
199710b941 Implement equality comparers for HitSampleInfo 2020-12-01 16:04:08 +09:00
smoogipoo
5760e1c1fc Make HitSampleInfo immutable 2020-12-01 15:37:51 +09:00
smoogipoo
730b14b5bb Add initial hit sample pooling 2020-11-19 19:51:09 +09:00
Dean Herbert
199043f677 Allow preview tracks to exist without an owner (without hard crashing) 2020-11-15 13:21:09 +09:00
Dean Herbert
0b28cca7e6 Don't force Gameplay prefix on all skin sample lookups 2020-10-30 11:59:40 +09:00
Dean Herbert
c9a85587fb Allow SampleInfo to specify fallback sample lookup names 2020-10-30 11:59:29 +09:00
Dean Herbert
b8e9f19b92 Move common HitSampleInfo lookup to static method 2020-09-25 17:30:31 +09:00
recapitalverb
c753cb46c5 Use [Resolved] wherever possible 2020-02-14 20:14:00 +07:00
Dean Herbert
740bdee125 Apply remaining uncaught changes 2020-01-20 23:59:21 +09:00
smoogipoo
0f8a76afde Remove manual hitobject sample namespacing 2020-01-02 14:27:27 +09:00
Dean Herbert
cf0f0f8a1b Reword comment 2019-11-21 10:37:50 +09:00
iiSaLMaN
d2ce0878bc Change 'current' accessibility to protected 2019-11-14 14:20:29 +03:00
iiSaLMaN
4e79bbad6b Add inline comment 2019-11-14 14:19:42 +03:00
iiSaLMaN
172e777416 Fix preview track manager permanently muting game tracks 2019-11-13 16:16:06 +03:00
iiSaLMaN
47cbd516f3 Revert "Fix preview track manager potentially not updating"
This reverts commit 8f7fd9993d.
2019-11-13 16:11:13 +03:00
iiSaLMaN
8f7fd9993d Fix preview track manager potentially not updating 2019-11-13 14:24:22 +03:00
Dean Herbert
47be20fa37 Private set on track for safety 2019-11-12 15:13:47 +09:00
iiSaLMaN
6d3d7c5d95 Remove unnecessary use of local 2019-11-11 11:57:14 +03:00
iiSaLMaN
8f4916ad2d Add inline comment 2019-11-10 23:53:31 +03:00
iiSaLMaN
9d61d73ced Change Track and TrackManagerPreviewTrack accessibilities 2019-11-10 23:09:04 +03:00
iiSaLMaN
20ed6c4d52 Use track check solution for this 2019-11-10 23:07:51 +03:00
iiSaLMaN
8ef9ccc39e Schedule new track assignment after stopping current track 2019-11-08 13:19:06 +03:00
Dean Herbert
91bcb5d4a7 Merge remote-tracking branch 'upstream/master' into fix-network-stalls 2019-11-06 19:06:28 +09:00
Dean Herbert
c1a6cb1def Fix audio preview muting game audio indefinitely when beatmap panel is off-screen 2019-11-06 15:58:47 +09:00
Dean Herbert
ddd58ea3da Use LongRunningLoad on network load components 2019-11-01 19:40:45 +09:00
Dean Herbert
60ea3d4e1a Fix skinning support for combobreak 2019-06-30 21:58:30 +09:00
Joehu
36f59ec86d Remove unused using 2019-06-21 08:29:45 -07:00
Joehu
74e99b2915 Remove unused parameter 2019-06-21 08:11:10 -07:00
Joehu
1d6b6a7828 Fix audio being dimmed on preview tracks 2019-06-21 08:06:57 -07:00
Dean Herbert
9f740f69bb Fix preview tracks muting themselves
Closes #4937
2019-06-07 11:21:10 +09:00
Dean Herbert
08ab1e5df7 Use new ITrackStore interface 2019-05-29 16:43:15 +09:00
Dean Herbert
a20eda7b5f Fix remaining cases to work without things 2019-05-28 23:54:42 +09:00
Dean Herbert
4ca34bd5e8 Update osu! in line with audio subsystem refactor 2019-05-28 17:06:01 +09:00
Dean Herbert
372c5b081c Fix audio preview buttons not correctly handling load failure states
Closes #4593.
2019-05-23 12:07:49 +09:00
smoogipoo
0bd35ab7bb Turn on warnings, resolve issues 2019-04-25 17:36:17 +09:00
Dean Herbert
26d53d06a9 Fix remaining issues 2019-02-28 13:31:40 +09:00
Dean Herbert
c8793911a8 Enable more stringent inspectcode style inspections 2019-02-27 21:25:40 +09:00
smoogipoo
30815ace62 Fix crossthread operations due to Track.Completed 2019-02-27 16:52:34 +09:00
Roman Kapustin
8b4aa708fa Resolve merge conflict 2019-02-22 23:04:45 +03:00
smoogipoo
d8c55bc729 Adjust namespaces 2019-02-21 19:05:52 +09:00