Rename LoopMode to RepeatMode, which is generally much clearer
than the previous name.
This changes all non-breaking instances of "loop" in the app with
"repeat".
Rework the asynchronous aspects of MusicStore to rely on a more
conventional callback system.
In preparation for automatic rescanning, it would be more elegant
for music consumers to use a callback, so that updates can be
registered easier than if a co-routine continued to be used.
Convert MusicStore to this new model and rework the accesses of
MusicStore in-app to line up with this new system.
Create a ViewModel for the more complicated navigation pathways.
Normally, navigation was fragmented along a complicated stretch of
fragment hacks and DetailViewModel's navToItem attitbute, both of which
were not really that ideal. Dumpster them for a single, unified
viewmodel for the more complicated navigation situations. This removes
much of the duplicate navigation logic and is likely much more
maintainable for future situations.
Rework the style of all album covers in the app to be more in line with
the new track number style.
This is mostly comprised of adding a new background to all cover views
and rescaling error icons to be smaller than they would normally be.
This also includes a change in the cover/track background color from
colorSurfaceVariant to colorOnSurfaceInverse, which seems to provide
the best visibility in all cases.
These changes also apply to the track number views.
Update the album song layout to be more alike to other songs.
Recently I migrated the TextView in the album songs to use 48dp sizing,
like the other song views. However, this resulted in a lot of empty
space that felt off. Fix this by adding a light background to the track
number, which fills the room it takes up a bit more. It also hopefully
primes the track number to take an indicator once multi-select is
added.
Remove extraneous encodings from ReplayGainAudioProcessor.
According to the ExoPlayer developers, an AudioProcessor is only
provided 16-bit PCM data. This makes all of the other encodings I
had implemented in ReplayGainAudioProcessor useless, as their
cases would never run. Remove those extraneous encodings and just
just 16-bit PCM.
Implement support for positive ReplayGain values.
Turns out the blocker for this with the new AudioProcessor was that
I did not properly clamp PCM data when I manipulated the data,
resulting in target samples like 75491 being truncated to lower
values like 9955, which resulted in popping. This is a niche addition,
but also puts Auxio in a category that no other (FOSS) android music
player currently occupies. Yay.
Resolves#115.
Create an AudioProcessor implementation for ReplayGain.
Now that ExoPlayer handles AudioFocus, the ReplayGain implementation
would conflict with the changes that ducking would make to the volume.
To fix this, migrate the ReplayGain implementation to a dedicated
audio processor. This not only resolves this system, but also opens the
door for positive ReplayGain values in the future. Currently however,
our method for modifying the bitstream results in popping with values
above the reference volume, so some more work must be done in that
regard.
Rework audio focus to rely on the native ExoPlayer implementation
instead of a custom implementation.
Previously, we avoided ExoPlayer's AudioFocus system as it never
played after a transient lost. A few versions later now through,
now it does, so we may as well switch to it. This does introduce
a bug where ReplayGain functionality will conflict with audio
focus, but I hope to eliminate this with #115 as I switch to
an AudioProcessor instead of a callback.
Audit null safety to remove extraneous and stupid calls while
optimizing certain checks here and there.
This commit is primarily centered around the introduction of a new
utility: unlikelyToBeNull. This call uses requireNotNull on debug
builds and !! on release builds, which allows for bug catching in
an easier manner on normal builds while also allowing for
optimizations on the release builds.
Migrate all esoteric adapters to the new RecyclerView framework.
One of the shortcomings with the previous RecyclerView utilities was
how more esoteric adapters with data that does not implement Item
could not use the utlities. The new system, by comparison, is capable
of taking any type of data, so we can no migrate all of the esoteric
adapters to the new system.
Fix an issue where album covers fail to load when not explicitly
specifying a size.
At some point, Coil changed some internal scaling logic to depend on
this weird pseudo-screen size value that caused the bitmap to fail
to load only on in widget creation process. Who knows why. Fix this
by explicitly specifying the size in all cases.
Spin off the data instances into their own class called BackingData.
This is to isolate the sane adapters that rely on one type of diffing
from the insane adapters that use synchronous and asynchronous diffing
simultaniously. It also allows some of the more esoteric adapters to
implement their own backing data without much trouble or leaky
abstractions.
Completely rework the base adapter class to require less boilerplate
and properly handle cases such as diffing. The major adapters have
been migrated to this system, but the other adapters have not been
changed so far.
This is only part 1 of a multi-part rework, as this is an incredibly
complex system.
Remove databinding entirely.
Databinding was a terrible idea for Auxio. I rarely leveraged it, and
when I did, it produced messy code and bloated build times. Dumpster it
for just viewbinding, which is good. This reduces building times by
nearly 2/3, and generally makes the codebase more coherent and usable.
Move all fragment instances to the new ViewBindingFragment paradigm,
which should help immensely with reducing memory leaks from list
bindings and to really alleviate the overloaded onCreate functions.
Rework the playback views to follow the new idioms I want to use for
Auxio.
This change mostly consists of flattening away some of the custom
views, removing databinding, and using a general viewbinding
fragment that I hope to extend to the entire app.
Rework the playback slide up implementation to be more straightfoward.
This is really composed of stylistic improvements, very little in
actual behavior changes. This does re-introduce a regression when
nothing is playing where the scroll position will become off when
rotating, but that desynchronization happens often so unless I were
to completely migrate both the panel and the bar to a view, I don't
really see it as an issue.
Migrate to a centralized constant table for easier management.
Previously, Auxio would tie constants to the class itself, which
led to a largely disjointed system that relied on an internal table
so that it would stay sane. This commit moves all of those constants
to a single table for easier usage and management.
Completely refactor the Sort class to be more efficient and
straightforward.
The original Sort class had *major* shortcomings, it was slow,
poorly organized, and relied on abusing compareBy to implement
special things like article sort. This rework eliminates all of
that in favor of a new system relying on custom comparators and
chaining to achieve something much faster and maintainable.
Make resolvedName the standard name to use across all music items.
Previously, the way Auxio differentiated between names in UIs was to
use name for normal items and resolvedName for parents. This was odd
and disjointed, as it muddled the meanings of the two fields and lead
to a lot of bugs. Fix this by making resolvedName *the* standard name
to use across all music items, even in ones that don't have to resolve
their name.
Switch to the spotless linter with ktfmt used as a backend instead of
ktlint.
This switch was done for two reasons:
1. ktfmt is more thorough than ktlint
2. License headers can be added more effectively with spotless than
the default Android Studio behavior.
Dump all of the changes now so I don't have to deal with it over a long
period of time. I don't care.
Disable the default long-press action in the ItemTouchHelper usages.
ItemTouchHelper provides a long-press action to start an item drag by
default. However, because Auxio adds a drag handle on top of this
action, this actually results in a conflict with the default behavior
in certain cases. Replace it with a custom version of the long-press
action within the viewholders themselves.
Fix a crash that stemmed from the use of the API 30+ database field
CD_TRACK_NUMBER.
I switched to CD_TRACK_NUMBER in 1e39ceb to fix [#88], however I did
not realize that CD_TRACK_NUMBER was actually only supported on API
30 onwards. This led to a load failure on versions before API 30.
Fix an esoteric crash with queue synchronization during the playback
restore process.
Auxio will attempt to re-synchronize the queue index whenever it is
desynchronized, however during the check for if it's desynchronized,
Auxio would do a direct index of the queue, which could result in a
crash in situations where the desynchronized index is outside of the
queue bounds.
Fix this by replacing that unprotected access with a protected access,
which not only fixes the crash but also still correctly detects
desynchronization in that case.
Resolves#89.