Merge branch 'dev' into gapless-playback
This commit is contained in:
+2
-2
@@ -21,8 +21,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId namespace
|
||||
versionName "3.3.0"
|
||||
versionCode 37
|
||||
versionName "3.3.3"
|
||||
versionCode 40
|
||||
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.oxycblt.auxio.music.info.Date
|
||||
import org.oxycblt.auxio.music.metadata.correctWhitespace
|
||||
import org.oxycblt.auxio.music.metadata.splitEscaped
|
||||
|
||||
@Database(entities = [CachedSong::class], version = 36, exportSchema = false)
|
||||
@Database(entities = [CachedSong::class], version = 38, exportSchema = false)
|
||||
abstract class CacheDatabase : RoomDatabase() {
|
||||
abstract fun cachedSongsDao(): CachedSongsDao
|
||||
}
|
||||
|
||||
@@ -137,12 +137,12 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) :
|
||||
val path = paths[i]
|
||||
val volume = path.volume.components ?: continue
|
||||
template +=
|
||||
if (i == 0) {
|
||||
if (args.isEmpty()) {
|
||||
"${MediaStore.Audio.AudioColumns.DATA} LIKE ?"
|
||||
} else {
|
||||
" OR ${MediaStore.Audio.AudioColumns.DATA} LIKE ?"
|
||||
}
|
||||
args.add("${volume}${path.components}%")
|
||||
args.add("/${volume}/${path.components}%")
|
||||
}
|
||||
|
||||
if (template.isEmpty()) {
|
||||
@@ -216,8 +216,8 @@ private constructor(private val cursor: Cursor, volumeManager: VolumeManager) :
|
||||
var template = ""
|
||||
for (i in paths.indices) {
|
||||
val path = paths[i]
|
||||
template =
|
||||
if (i == 0) {
|
||||
template +=
|
||||
if (args.isEmpty()) {
|
||||
"(${MediaStore.Audio.AudioColumns.VOLUME_NAME} LIKE ? " +
|
||||
"AND ${MediaStore.Audio.AudioColumns.RELATIVE_PATH} LIKE ?)"
|
||||
} else {
|
||||
|
||||
@@ -105,12 +105,15 @@ private class TagWorkerImpl(
|
||||
format.initializationData.isNotEmpty() &&
|
||||
format.initializationData[0].size >= 18) {
|
||||
val header = format.initializationData[0]
|
||||
val gain = header[1].toInt() or ((header[0].toInt() shl 8) and 0xFF)
|
||||
logD("Obtained opus base gain: ${gain / 256f} dB")
|
||||
rawSong.replayGainTrackAdjustment =
|
||||
rawSong.replayGainTrackAdjustment?.plus(gain / 256f)
|
||||
rawSong.replayGainAlbumAdjustment =
|
||||
rawSong.replayGainAlbumAdjustment?.plus(gain / 256f)
|
||||
val gain = (((header[16]).toInt() and 0xFF) or ((header[17].toInt() shl 8))) / 256f
|
||||
logD("Obtained opus base gain: $gain dB")
|
||||
if (gain != 0f) {
|
||||
logD("Applying opus base gain")
|
||||
rawSong.replayGainTrackAdjustment =
|
||||
(rawSong.replayGainTrackAdjustment ?: 0f) + gain
|
||||
rawSong.replayGainAlbumAdjustment =
|
||||
(rawSong.replayGainAlbumAdjustment ?: 0f) + gain
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logD("No metadata could be extracted for ${rawSong.name}")
|
||||
|
||||
@@ -104,7 +104,10 @@ class PlaybackPanelFragment :
|
||||
}
|
||||
|
||||
binding.playbackCover.onSwipeListener = this
|
||||
binding.playbackSong.setOnClickListener { navigateToCurrentSong() }
|
||||
binding.playbackSong.apply {
|
||||
isSelected = true
|
||||
setOnClickListener { navigateToCurrentSong() }
|
||||
}
|
||||
binding.playbackArtist.setOnClickListener { navigateToCurrentArtist() }
|
||||
binding.playbackAlbum.setOnClickListener { navigateToCurrentAlbum() }
|
||||
|
||||
@@ -130,6 +133,7 @@ class PlaybackPanelFragment :
|
||||
override fun onDestroyBinding(binding: FragmentPlaybackPanelBinding) {
|
||||
equalizerLauncher = null
|
||||
coverAdapter = null
|
||||
binding.playbackSong.isSelected = false
|
||||
binding.playbackToolbar.setOnMenuItemClickListener(null)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user