Commit graph

885 commits

Author SHA1 Message Date
OxygenCobalt
059652d2f1
all: fix misc issues
Fix miscellanious issues with documentation and the playback system
2022-05-20 11:30:56 -06:00
OxygenCobalt
9edc113ebb
Merge branch 'enricocid-it_translations' into dev
Update italian translations
2022-05-19 19:32:42 -06:00
OxygenCobalt
28cedd1240
music: attempt to handle bad DISPLAY_NAME [#120]
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.
2022-05-19 17:37:19 -06:00
OxygenCobalt
0b9141d474
sort: rework implementation
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.
2022-05-19 17:16:33 -06:00
OxygenCobalt
c522af546c
detail: add full disc number support
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.
2022-05-19 16:43:01 -06:00
OxygenCobalt
04f254f91b
music: add disc number indexing
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.
2022-05-18 20:03:45 -06:00
OxygenCobalt
6f2a0d66c6
detail: add framework for disc number items
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.
2022-05-18 17:30:50 -06:00
OxygenCobalt
5381e9f9a2
playback: remove media button reciever impl
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.
2022-05-17 06:29:55 -06:00
OxygenCobalt
4a79de455a
playback: rework service components
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.
2022-05-16 20:37:42 -06:00
Enrico D'Ortenzio
e785f5a3a5
Update it translations 2022-05-15 16:03:16 +02:00
OxygenCobalt
d296a3aed9
all: rework formatting
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.
2022-05-11 19:03:56 -06:00
OxygenCobalt
1a9e55e73b
about: add full library statistics
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.
2022-05-04 20:20:47 -06:00
OxygenCobalt
ac6a471318
playback: fix index bug
Fix some index bugs by using inc/dec instead of ++/--.
2022-05-02 18:35:26 -06:00
OxygenCobalt
e451bc9859
playback: rework state restore
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.
2022-05-02 17:43:01 -06:00
OxygenCobalt
1e7a439c31
deps: switch material to 1.6.0-rc01
Switch material components to the more stable 1.6.0-rc01. Have to deal
with android complaining, but whatever.
2022-05-01 17:54:37 -06:00
OxygenCobalt
0d9d6b153b
Merge branch 'enricocid-it_translations' into dev
Update italian translations
2022-05-01 17:50:57 -06:00
enricocid
ece5dc06c0 Italian translations
Signed-off-by: enricocid <enrico2588@gmail.com>
2022-05-01 21:44:13 +02:00
OxygenCobalt
a645c3a217
deps: upgrade deps
aaaaaaa
coil -> 2.0.0-rc03
material -> 1.7.0-alpha01
leakcanary -> 2.9.1
navigation -> 2.4.2
kotlin -> 1.6.21
agp -> 7.1.3
2022-04-29 20:14:17 -06:00
OxygenCobalt
d57f980148
playback: cleanup components
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.
2022-04-29 19:53:58 -06:00
OxygenCobalt
6adc5f8715
playback: fix service state issues
Fix a bunch of miscellanious state issues with the playback fragment.
2022-04-29 16:17:26 -06:00
OxygenCobalt
8e849feb7d
playback: rename loopmode to repeatmode
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".
2022-04-29 14:52:33 -06:00
OxygenCobalt
c80af01d5c
playback: rework fields
Rework the playback fields.

The new fields are more coherent, better-named, and less prone to state
failure.
2022-04-29 14:29:56 -06:00
OxygenCobalt
2bdbe212df
playback: decouple fields and callback
Decouple the callback notifying code and the field code. This makes
code more reasonable for future changes.
2022-04-29 12:07:14 -06:00
OxygenCobalt
60367c45c3
nit: fix typos
Fix miscellanious typos.
2022-04-28 22:03:15 -06:00
OxygenCobalt
3d03bf9b7e
playback: fix position polling bug
Fix a bug where position polling would stop when the audio focus
state changed.
2022-04-28 20:04:10 -06:00
OxygenCobalt
bcec9272d3
Merge branch 'dev' of github.com:OxygenCobalt/Auxio into dev 2022-04-28 19:59:11 -06:00
OxygenCobalt
3d70028bd2
playback: remove playbackmode field
Remove the useless PlaybackMode field.

Parent does the same job, but better.
2022-04-28 19:58:39 -06:00
Alex
b9b2e9aeec
Merge branch 'Gsset/dev' into dev
Update russian translation
2022-04-11 09:07:40 -06:00
User_Name
21335859b2
updated translation 2022-04-09 01:34:59 +03:00
OxygenCobalt
180faa6f50
music: rework callback configuration
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.
2022-04-07 20:18:25 -06:00
OxygenCobalt
3a19d822ce
music: rework name heirarchy
Once again rework the naming system for music, this time with it being
much easier to localize (hopefully).
2022-04-03 12:54:29 -06:00
OxygenCobalt
ab194c14c2
ui: create viewmodel for navigation
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.
2022-04-02 20:21:06 -06:00
OxygenCobalt
74f5962844
ui: rework cover style
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.
2022-04-02 18:18:10 -06:00
OxygenCobalt
e387e72b2c
detail: update album song layout
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.
2022-03-29 20:08:57 -06:00
OxygenCobalt
0107d9ff32
playback: remove extraneous encodings
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.
2022-03-29 06:27:42 -06:00
OxygenCobalt
59a56090e8
playback: add positive replaygain values
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.
2022-03-28 19:58:25 -06:00
OxygenCobalt
b4abad26cd
playback: migrate replaygain to audioprocessor
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.
2022-03-27 20:33:01 -06:00
OxygenCobalt
b748d73abb
playback: rework audio focus
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.
2022-03-27 11:51:58 -06:00
OxygenCobalt
e54a58c612
ui: audit null safety
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.
2022-03-27 11:23:07 -06:00
OxygenCobalt
05a5ef5c3f
ui: migrate esoteric adapters to framework
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.
2022-03-27 09:59:35 -06:00
OxygenCobalt
2406c371db
widgets: work around new coil scaling behavior
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.
2022-03-26 11:43:48 -06:00
OxygenCobalt
8100f294d7
recycler: spin off data into separate class
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.
2022-03-26 11:32:54 -06:00
OxygenCobalt
ee1a234e76
ui: rework base adapter class
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.
2022-03-26 10:16:36 -06:00
OxygenCobalt
595a982d59
all: cleanup
Clean up the project after the previous changes and update some
dependencies.
2022-03-23 12:27:49 -06:00
OxygenCobalt
d79592e029
all: remove databinding
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.
2022-03-23 10:59:01 -06:00
OxygenCobalt
95057ec357
all: move all fragments to ViewBindingFragment
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.
2022-03-23 09:18:08 -06:00
OxygenCobalt
8f38ed6ee5
playback: rework view implementations
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.
2022-03-21 20:15:42 -06:00
OxygenCobalt
e4d4266e35
playback: rework playback slide up implementation
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.
2022-03-20 12:33:49 -06:00
OxygenCobalt
608112a7ac
all: migrate to centralized constant table
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.
2022-03-19 20:05:57 -06:00
OxygenCobalt
6d9da35de0
Merge branch 'kontillion-dev' into dev
Updated German translation
2022-03-19 18:49:15 -06:00