Add recovery code to the music indexer in the case that Android doesn't
provide the DISPLAY_NAME field.
Nominally this should never happen, but OEMs will OEM and apparently
this does happen on some devices. Try to recover by grokking DATA for
a file name.
Rework the sort implementation to allow Auxio to leverage it's sorting
capabilities in a more powerful manner.
This is mostly the removal of stupid redunant methods and the change of
Sort overrides to sort in-place. This just gives us the option to avoid
full blown list copies in cases where such is reasonable.
Finalize the disc number implementation within Auxio.
This is probably one of the most widely-requested features outside
of playlisting. This implementation also adds some more fine grained
sorting modes for disc numbers in particular, which actually removes
some of the quirkiness of the Sort class.
Resolves#96.
Change the indexer to parse out the disc number field from
AudioColumns.TRACK.
On newer versions, I hope to further modify the loader to use
the API 30+ CD_TRACK_NUMBER field, as it is more versatile than
TRACK.
Add the UI and data components for a disc number value within the album
detail view.
This is the first-step of a multi-step addition to finally implement
disc numbers.
Make MediaButtonReceiver an empty class without any behavior.
The previous manner in which Auxio would handle media button events
was actually bad, as in certain cases (like a rewind or if there was
no song playing) Auxio would actually crash, as the service would
not start a foreground state in time.
Fix this by removing that functionality. This should hopefully still
retain the current state.
Try to rework the playback service components to reduce race conditions
and improve readability.
This changeset has gone through a number of changes. I originally
wanted to unify all cover loading under a single "Component Manager",
but this turned out to be stupid given that the three service components
are different in nearly every way. Instead I just reworked them all
individually by introducing a new less-data race-prone image loading
framework, and moving around a bunch of code I was planning to move
around.
Do some miscellanious formatting reworks.
1. Remove all instances of m in favor of _. _ is only used when names
collide or if something should be internal.
2. Make fragments apply their own click listeners.
3. Remove instances of inc/dec and replace them with the more
straightfoward + 1 or - 1.
Split off the "songs loaded" about item into it's own card called
"library statistics"
This card includes the song, album, artist, and genre counts,
alongside a total duration of the music library. This is just more
informative and useful to the user.
Resolves#121.
Rework state restore to be more coherent and in line with the new
member layout of the general
This primarily involves making the index the primary database attribute
in favor of song, with the old song id field becoming a sanity check
field.
Fix miscellanious bugs and clean the component code.
Currently the components are in a strange state. They are a big ball of
mud with inconsistent lifecycles and callbacks. I want to find a way to
unify them under a single lifecycle, but the competing nature of them
makes this extremely difficult.
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.