Readd Headphone plug and Bluetooth listeners

This commit is contained in:
tzugen 2022-05-04 11:24:07 +02:00
parent 34e0178db3
commit 4a00494647
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
24 changed files with 358 additions and 0 deletions

View File

@ -83,6 +83,14 @@
<action android:name="org.moire.ultrasonic.CMD_PROCESS_KEYCODE"/>
</intent-filter>
</receiver>
<receiver android:name=".receiver.BluetoothIntentReceiver">
<intent-filter>
<action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
<action android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED"/>
<action android:name="android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED"/>
</intent-filter>
</receiver>
<receiver
android:name=".provider.UltrasonicAppWidgetProvider4X1"
android:label="Ultrasonic (4x1)">

View File

@ -0,0 +1,100 @@
/*
This file is part of Subsonic.
Subsonic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Subsonic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2010 (C) Sindre Mehus
*/
package org.moire.ultrasonic.receiver;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import org.moire.ultrasonic.util.Constants;
import org.moire.ultrasonic.util.Settings;
import timber.log.Timber;
/**
* Resume or pause playback on Bluetooth A2DP connect/disconnect.
*
* @author Sindre Mehus
*/
@SuppressLint("MissingPermission")
public class BluetoothIntentReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
String action = intent.getAction();
String name = device != null ? device.getName() : "Unknown";
String address = device != null ? device.getAddress() : "Unknown";
Timber.d("A2DP State: %d; Action: %s; Device: %s; Address: %s", state, action, name, address);
boolean actionBluetoothDeviceConnected = false;
boolean actionBluetoothDeviceDisconnected = false;
boolean actionA2dpConnected = false;
boolean actionA2dpDisconnected = false;
if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action))
{
actionBluetoothDeviceConnected = true;
}
else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) || BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED.equals(action))
{
actionBluetoothDeviceDisconnected = true;
}
if (state == android.bluetooth.BluetoothA2dp.STATE_CONNECTED) actionA2dpConnected = true;
else if (state == android.bluetooth.BluetoothA2dp.STATE_DISCONNECTED) actionA2dpDisconnected = true;
boolean resume = false;
boolean pause = false;
switch (Settings.getResumeOnBluetoothDevice())
{
case Constants.PREFERENCE_VALUE_ALL: resume = actionA2dpConnected || actionBluetoothDeviceConnected;
break;
case Constants.PREFERENCE_VALUE_A2DP: resume = actionA2dpConnected;
break;
}
switch (Settings.getPauseOnBluetoothDevice())
{
case Constants.PREFERENCE_VALUE_ALL: pause = actionA2dpDisconnected || actionBluetoothDeviceDisconnected;
break;
case Constants.PREFERENCE_VALUE_A2DP: pause = actionA2dpDisconnected;
break;
}
if (resume)
{
Timber.i("Connected to Bluetooth device %s address %s, resuming playback.", name, address);
context.sendBroadcast(new Intent(Constants.CMD_RESUME_OR_PLAY).setPackage(context.getPackageName()));
}
if (pause)
{
Timber.i("Disconnected from Bluetooth device %s address %s, requesting pause.", name, address);
context.sendBroadcast(new Intent(Constants.CMD_PAUSE).setPackage(context.getPackageName()));
}
}
}

View File

@ -12,6 +12,7 @@ import android.os.Bundle
import android.provider.DocumentsContract
import android.provider.SearchRecentSuggestions
import android.view.View
import androidx.annotation.StringRes
import androidx.fragment.app.DialogFragment
import androidx.preference.CheckBoxPreference
import androidx.preference.EditTextPreference
@ -78,6 +79,8 @@ class SettingsFragment :
private var sharingDefaultDescription: EditTextPreference? = null
private var sharingDefaultGreeting: EditTextPreference? = null
private var sharingDefaultExpiration: TimeSpanPreference? = null
private var resumeOnBluetoothDevice: Preference? = null
private var pauseOnBluetoothDevice: Preference? = null
private var debugLogToFile: CheckBoxPreference? = null
private var customCacheLocation: CheckBoxPreference? = null
@ -113,6 +116,9 @@ class SettingsFragment :
sharingDefaultGreeting = findPreference(Constants.PREFERENCES_KEY_DEFAULT_SHARE_GREETING)
sharingDefaultExpiration =
findPreference(Constants.PREFERENCES_KEY_DEFAULT_SHARE_EXPIRATION)
resumeOnBluetoothDevice =
findPreference(Constants.PREFERENCES_KEY_RESUME_ON_BLUETOOTH_DEVICE)
pauseOnBluetoothDevice = findPreference(Constants.PREFERENCES_KEY_PAUSE_ON_BLUETOOTH_DEVICE)
debugLogToFile = findPreference(Constants.PREFERENCES_KEY_DEBUG_LOG_TO_FILE)
showArtistPicture = findPreference(Constants.PREFERENCES_KEY_SHOW_ARTIST_PICTURE)
customCacheLocation = findPreference(Constants.PREFERENCES_KEY_CUSTOM_CACHE_LOCATION)
@ -120,6 +126,7 @@ class SettingsFragment :
sharingDefaultGreeting?.text = shareGreeting
setupClearSearchPreference()
setupCacheLocationPreference()
setupBluetoothDevicePreferences()
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
@ -253,6 +260,70 @@ class SettingsFragment :
startActivityForResult(intent, SELECT_CACHE_ACTIVITY)
}
private fun setupBluetoothDevicePreferences() {
val resumeSetting = Settings.resumeOnBluetoothDevice
val pauseSetting = Settings.pauseOnBluetoothDevice
resumeOnBluetoothDevice!!.summary = bluetoothDevicePreferenceToString(resumeSetting)
pauseOnBluetoothDevice!!.summary = bluetoothDevicePreferenceToString(pauseSetting)
resumeOnBluetoothDevice!!.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
showBluetoothDevicePreferenceDialog(
R.string.settings_playback_resume_on_bluetooth_device,
Settings.resumeOnBluetoothDevice
) { choice: Int ->
Settings.resumeOnBluetoothDevice = choice
resumeOnBluetoothDevice!!.summary = bluetoothDevicePreferenceToString(choice)
}
true
}
pauseOnBluetoothDevice!!.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
showBluetoothDevicePreferenceDialog(
R.string.settings_playback_pause_on_bluetooth_device,
Settings.pauseOnBluetoothDevice
) { choice: Int ->
Settings.pauseOnBluetoothDevice = choice
pauseOnBluetoothDevice!!.summary = bluetoothDevicePreferenceToString(choice)
}
true
}
}
private fun showBluetoothDevicePreferenceDialog(
@StringRes title: Int,
defaultChoice: Int,
onChosen: (Int) -> Unit
) {
val choice = intArrayOf(defaultChoice)
AlertDialog.Builder(activity).setTitle(title)
.setSingleChoiceItems(
R.array.bluetoothDeviceSettingNames, defaultChoice
) { _: DialogInterface?, i: Int -> choice[0] = i }
.setNegativeButton(R.string.common_cancel) { dialogInterface: DialogInterface, _: Int ->
dialogInterface.cancel()
}
.setPositiveButton(R.string.common_ok) { dialogInterface: DialogInterface, _: Int ->
onChosen(choice[0])
dialogInterface.dismiss()
}
.create().show()
}
private fun bluetoothDevicePreferenceToString(preferenceValue: Int): String {
return when (preferenceValue) {
Constants.PREFERENCE_VALUE_ALL -> {
getString(R.string.settings_playback_bluetooth_all)
}
Constants.PREFERENCE_VALUE_A2DP -> {
getString(R.string.settings_playback_bluetooth_a2dp)
}
Constants.PREFERENCE_VALUE_DISABLED -> {
getString(R.string.settings_playback_bluetooth_disabled)
}
else -> ""
}
}
private fun setupClearSearchPreference() {
val clearSearchPreference =
findPreference<Preference>(Constants.PREFERENCES_KEY_CLEAR_SEARCH_HISTORY)

View File

@ -7,12 +7,18 @@
package org.moire.ultrasonic.service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.media.AudioManager
import android.view.KeyEvent
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import org.moire.ultrasonic.app.UApp.Companion.applicationContext
import org.moire.ultrasonic.util.CacheCleaner
import org.moire.ultrasonic.util.Constants
import org.moire.ultrasonic.util.Settings
import org.moire.ultrasonic.util.Util.ifNotNull
import timber.log.Timber
@ -24,6 +30,7 @@ class MediaPlayerLifecycleSupport : KoinComponent {
private val mediaPlayerController by inject<MediaPlayerController>()
private var created = false
private var headsetEventReceiver: BroadcastReceiver? = null
fun onCreate() {
onCreate(false, null)
@ -40,6 +47,8 @@ class MediaPlayerLifecycleSupport : KoinComponent {
restoreLastSession(autoPlay, afterRestore)
}
registerHeadsetReceiver()
CacheCleaner().clean()
created = true
Timber.i("LifecycleSupport created")
@ -73,6 +82,7 @@ class MediaPlayerLifecycleSupport : KoinComponent {
)
mediaPlayerController.clear(false)
applicationContext().unregisterReceiver(headsetEventReceiver)
mediaPlayerController.onDestroy()
created = false
@ -98,6 +108,42 @@ class MediaPlayerLifecycleSupport : KoinComponent {
}
}
/**
* The Headset Intent Receiver is responsible for resuming playback when a headset is inserted
* and pausing it when it is removed.
* Unfortunately this Intent can't be registered in the AndroidManifest, so it works only
* while Ultrasonic is running.
*/
private fun registerHeadsetReceiver() {
headsetEventReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val extras = intent.extras ?: return
Timber.i("Headset event for: %s", extras["name"])
val state = extras.getInt("state")
if (state == 0) {
if (!mediaPlayerController.isJukeboxEnabled) {
mediaPlayerController.pause()
}
} else if (state == 1) {
if (!mediaPlayerController.isJukeboxEnabled &&
Settings.resumePlayOnHeadphonePlug && !mediaPlayerController.isPlaying
) {
mediaPlayerController.prepare()
mediaPlayerController.play()
}
}
}
}
val headsetIntentFilter = IntentFilter(AudioManager.ACTION_HEADSET_PLUG)
applicationContext().registerReceiver(headsetEventReceiver, headsetIntentFilter)
}
@Suppress("MagicNumber", "ComplexMethod")
private fun handleKeyEvent(event: KeyEvent) {

View File

@ -100,8 +100,13 @@ object Constants {
const val PREFERENCES_KEY_HARDWARE_OFFLOAD = "use_hw_offload"
const val PREFERENCES_KEY_CATEGORY_NOTIFICATIONS = "notificationsCategory"
const val PREFERENCES_KEY_FIRST_RUN_EXECUTED = "firstRunExecuted"
const val PREFERENCES_KEY_RESUME_ON_BLUETOOTH_DEVICE = "resumeOnBluetoothDevice"
const val PREFERENCES_KEY_PAUSE_ON_BLUETOOTH_DEVICE = "pauseOnBluetoothDevice"
const val PREFERENCES_KEY_DEBUG_LOG_TO_FILE = "debugLogToFile"
const val PREFERENCES_KEY_OVERRIDE_LANGUAGE = "overrideLanguage"
const val PREFERENCE_VALUE_ALL = 0
const val PREFERENCE_VALUE_A2DP = 1
const val PREFERENCE_VALUE_DISABLED = 2
const val FILENAME_PLAYLIST_SER = "downloadstate.ser"
const val ALBUM_ART_FILE = "folder.jpeg"
const val STARRED = "starred"

View File

@ -131,6 +131,20 @@ object Settings {
@JvmStatic
var mediaButtonsEnabled
by BooleanSetting(Constants.PREFERENCES_KEY_MEDIA_BUTTONS, true)
var resumePlayOnHeadphonePlug
by BooleanSetting(R.string.setting_keys_resume_play_on_headphones_plug, true)
@JvmStatic
var resumeOnBluetoothDevice by IntSetting(
Constants.PREFERENCES_KEY_RESUME_ON_BLUETOOTH_DEVICE,
Constants.PREFERENCE_VALUE_DISABLED
)
@JvmStatic
var pauseOnBluetoothDevice by IntSetting(
Constants.PREFERENCES_KEY_PAUSE_ON_BLUETOOTH_DEVICE,
Constants.PREFERENCE_VALUE_A2DP
)
@JvmStatic
var showNowPlaying

View File

@ -76,4 +76,8 @@ class BooleanSetting(private val key: String, private val defaultValue: Boolean
override fun setValue(thisRef: Any, property: KProperty<*>, value: Boolean) =
sharedPreferences.edit { putBoolean(key, value) }
constructor(stringId: Int, defaultValue: Boolean = false) : this(
Util.appContext().getString(stringId), defaultValue
)
}

View File

@ -222,6 +222,8 @@
<string name="settings.preload_3">3 skladby</string>
<string name="settings.preload_5">5 skladeb</string>
<string name="settings.preload_unlimited">Neomezeně</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Pokračovat po připojení sluchátek</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Aplikace spustí pozastavené přehrávání po připojení kabelu sluchátek do přístroje.</string>
<string name="settings.search_1">1</string>
<string name="settings.search_10">10</string>
<string name="settings.search_100">100</string>
@ -310,6 +312,11 @@
<string name="download.menu_show_artist">Zobrazit umělce</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Vícenásobné roky</string>
<string name="settings.playback.resume_on_bluetooth_device">Pokračovat v přehrávání po připojení bluetooth přístroje</string>
<string name="settings.playback.pause_on_bluetooth_device">Pozastavení přehrávání při odpojení bluetooth přístroje</string>
<string name="settings.playback.bluetooth_all">Všechny bluetooth přístroje</string>
<string name="settings.playback.bluetooth_a2dp">Pouze audio (A2DP) přístroje</string>
<string name="settings.playback.bluetooth_disabled">Vypnuto</string>
<string name="settings.debug.title">Možnosti ladění aplikace</string>
<string name="settings.debug.log_to_file">Zapisovat logy ladění do souboru</string>
<string name="settings.debug.log_path">Soubory logů jsou dostupné v %1$s/%2$s</string>

View File

@ -260,6 +260,8 @@
<string name="settings.preload_3">3 Titel</string>
<string name="settings.preload_5">5 Titel</string>
<string name="settings.preload_unlimited">Unbegrenzt</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Fortsetzen mit Kopfhörer</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Die App setzt eine pausierte Wiedergabe beim Anschließen der Kopfhörer fort.</string>
<string name="settings.scrobble_summary">Benutzername und Passwort des Scrobble Service(s) müssen im Server gesetzt sein</string>
<string name="settings.scrobble_title">Gespielte Musik scrobbeln</string>
<string name="settings.search_1">1</string>
@ -360,6 +362,11 @@
<string name="download.menu_show_artist">Künstler*in anzeigen</string>
<string name="albumArt">Album Cover</string>
<string name="common_multiple_years">Mehrere Jahre</string>
<string name="settings.playback.resume_on_bluetooth_device">Wiedergabe fortsetzen, wenn ein Bluetooth Gerät verbunden wurde</string>
<string name="settings.playback.pause_on_bluetooth_device">Wiedergabe pausieren, wenn ein Bluetooth Gerät getrennt wurde</string>
<string name="settings.playback.bluetooth_all">Alle Bluetooth Geräte</string>
<string name="settings.playback.bluetooth_a2dp">Nur Audio (A2DP) Geräte</string>
<string name="settings.playback.bluetooth_disabled">Deaktiviert</string>
<string name="settings.debug.title">Debug Optionen</string>
<string name="settings.debug.log_to_file">Schreibe Debug Log in Datei</string>
<string name="settings.debug.log_path">Die Log Dateien sind unter %1$s/%2$s verfügbar</string>

View File

@ -260,6 +260,8 @@
<string name="settings.preload_3">3 canciónes</string>
<string name="settings.preload_5">5 canciónes</string>
<string name="settings.preload_unlimited">Ilimitado</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Reanudar al insertar los auriculares</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">La aplicación reanudará la reproducción en pausa al insertar los auriculares en el dispositivo.</string>
<string name="settings.scrobble_summary">Recuerda configurar tu nombre de usuario y contraseña en los servicios de Scrobble en el servidor</string>
<string name="settings.scrobble_title">Hacer Scrobble de mis reproducciones</string>
<string name="settings.search_1">1</string>
@ -360,6 +362,11 @@
<string name="download.menu_show_artist">Mostrar artista</string>
<string name="albumArt">Caratula del Álbum</string>
<string name="common_multiple_years">Múltiples años</string>
<string name="settings.playback.resume_on_bluetooth_device">Reanudar al conectar un dispositivo Bluetooth</string>
<string name="settings.playback.pause_on_bluetooth_device">Pausar al desconectar un dispositivo Bluetooth</string>
<string name="settings.playback.bluetooth_all">Todos los dispositivos Bluetooth</string>
<string name="settings.playback.bluetooth_a2dp">Solo dispositivos de audio (A2DP)</string>
<string name="settings.playback.bluetooth_disabled">Deshabilitado</string>
<string name="settings.debug.title">Opciones de depuración</string>
<string name="settings.debug.log_to_file">Escribir registro de depuración en un archivo</string>
<string name="settings.debug.log_path">Los archivos de registro están disponibles en %1$s/%2$s</string>

View File

@ -240,6 +240,8 @@
<string name="settings.preload_3">3 morceaux</string>
<string name="settings.preload_5">5 morceaux</string>
<string name="settings.preload_unlimited">Illimité</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Reprise à l\'insertion des écouteurs</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">L\'application reprendra la lecture lors de l\'insertion du casque dans l\'appareil.</string>
<string name="settings.scrobble_summary">Pensez à configurer votre nom dutilisateur et votre mot de passe dans le(s) service(s) Scrobble sur le serveur.</string>
<string name="settings.scrobble_title">Scrobbler mes lectures</string>
<string name="settings.search_1">1</string>
@ -337,6 +339,11 @@
<string name="download.menu_show_artist">Afficher l\'artiste</string>
<string name="albumArt">Pochette d\'album</string>
<string name="common_multiple_years">Années multiples</string>
<string name="settings.playback.resume_on_bluetooth_device">Reprendre lorsquun appareil Bluetooth se connecte</string>
<string name="settings.playback.pause_on_bluetooth_device">Mettre en pause lorsquun appareil Bluetooth se déconnecte</string>
<string name="settings.playback.bluetooth_all">Tous les appareils Bluetooth</string>
<string name="settings.playback.bluetooth_a2dp">Seulement les appareils audio (A2DP)</string>
<string name="settings.playback.bluetooth_disabled">Désactivé</string>
<string name="settings.debug.title">Paramètres de debug</string>
<string name="settings.debug.log_to_file">Enregistrer les logs de debug dans des fichiers</string>
<string name="settings.debug.log_path">Les fichiers de log sont disponibles dans %1$s/%2$s</string>

View File

@ -228,6 +228,8 @@
<string name="settings.preload_3">3 dal</string>
<string name="settings.preload_5">5 dal</string>
<string name="settings.preload_unlimited">Korlátlan</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Folytatás a fejhallgató behelyezésekor</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Az alkalmazás folytatja a szüneteltetett lejátszást a fejhallgató behelyezésekor a készülékbe.</string>
<string name="settings.scrobble_summary">Ne felejtsd el beállítani a Scrobble szolgáltatónál használt felhasználóneved és jelszavad a szervereden</string>
<string name="settings.scrobble_title">Scrobble engedélyezése</string>
<string name="settings.search_1">1</string>
@ -318,6 +320,11 @@
<string name="download.menu_show_artist">Ugrás az előadóhoz</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Több év</string>
<string name="settings.playback.resume_on_bluetooth_device">Folytatás Bluetooth eszköz csatlakozásakor</string>
<string name="settings.playback.pause_on_bluetooth_device">Szünet Bluetooth eszköz kikapcsolásakor</string>
<string name="settings.playback.bluetooth_all">Minden Bluetooth eszköz</string>
<string name="settings.playback.bluetooth_a2dp">Csak audio (A2DP) eszközök</string>
<string name="settings.playback.bluetooth_disabled">Kikapcsolva</string>
<string name="settings.debug.title">Hibakeresési lehetőségek</string>
<string name="settings.debug.log_to_file">Hibakeresési napló írása fájlba</string>
<string name="settings.debug.log_path">A naplófájlok elérhetőek a következő helyen: %1$s/%2$s</string>

View File

@ -217,6 +217,7 @@
<string name="settings.preload_3">3 canzoni</string>
<string name="settings.preload_5">5 canzoni</string>
<string name="settings.preload_unlimited">Illimitato</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Riprendi all\'inserimento delle cuffie</string>
<string name="settings.search_1">1</string>
<string name="settings.search_10">10</string>
<string name="settings.search_100">100</string>
@ -278,6 +279,7 @@
<string name="share_comment">Commenta</string>
<string name="download_song_removed">\"%s\" è stato rimosso dalla playlist</string>
<string name="share_via">Condividi canzoni via</string>
<string name="settings.playback.bluetooth_disabled">Disabilitato</string>
<string name="server_menu.delete">Elimina</string>
<string name="api.subsonic.trial_period_is_over">Il periodo di prova è terminato.</string>
</resources>

View File

@ -260,6 +260,8 @@
<string name="settings.preload_3">3 nummers</string>
<string name="settings.preload_5">5 nummers</string>
<string name="settings.preload_unlimited">Ongelimiteerd</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Hervatten bij aansluiten van hoofdtelefoon</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Het afspelen wordt hervat zodra er een hoofdtelefoon wordt aangesloten.</string>
<string name="settings.scrobble_summary">Let op: stel je gebruikersnaam en wachtwoord van je scrobble-dienst(en) in op je Subsonic-server</string>
<string name="settings.scrobble_title">Scrobbelen</string>
<string name="settings.search_1">1</string>
@ -360,6 +362,11 @@
<string name="download.menu_show_artist">Artiest tonen</string>
<string name="albumArt">Albumhoes</string>
<string name="common_multiple_years">Meerdere jaren</string>
<string name="settings.playback.resume_on_bluetooth_device">Hervatten bij verbinding met bluetoothapparaat</string>
<string name="settings.playback.pause_on_bluetooth_device">Pauzeren als verbinding met bluetoothapparaat verbroken is</string>
<string name="settings.playback.bluetooth_all">Alle bluetoothapparaten</string>
<string name="settings.playback.bluetooth_a2dp">Alleen audio-apparaten (AD2P)</string>
<string name="settings.playback.bluetooth_disabled">Uitgeschakeld</string>
<string name="settings.debug.title">Foutopsporingsopties</string>
<string name="settings.debug.log_to_file">Foutopsporingslogboek bijhouden</string>
<string name="settings.debug.log_path">De logboeken worden opgeslagen in %1$s/%2$s</string>

View File

@ -222,6 +222,8 @@
<string name="settings.preload_3">3 utwory</string>
<string name="settings.preload_5">5 utworów</string>
<string name="settings.preload_unlimited">Bez limitu</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Wznawiaj po podłączeniu słuchawek</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Aplikacja wznowi zatrzymane odtwarzanie po podpięciu słuchawek.</string>
<string name="settings.search_1">1</string>
<string name="settings.search_10">10</string>
<string name="settings.search_100">100</string>
@ -307,6 +309,11 @@
<string name="download.menu_show_artist">Wyświetlaj artystę</string>
<string name="albumArt">Okładka</string>
<string name="common_multiple_years">Z różnych lat</string>
<string name="settings.playback.resume_on_bluetooth_device">Resume when a Bluetooth device is connected</string>
<string name="settings.playback.pause_on_bluetooth_device">Pause when a Bluetooth device is disconnected</string>
<string name="settings.playback.bluetooth_all">All Bluetooth devices</string>
<string name="settings.playback.bluetooth_a2dp">Only audio (A2DP) devices</string>
<string name="settings.playback.bluetooth_disabled">Wyłączone</string>
<string name="server_selector.label">Configured servers</string>
<string name="server_selector.delete_confirmation">Are you sure you want to delete the server?</string>
<string name="server_editor.label">Editing server</string>

View File

@ -235,6 +235,8 @@
<string name="settings.preload_3">3 músicas</string>
<string name="settings.preload_5">5 músicas</string>
<string name="settings.preload_unlimited">Ilimitado</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Retomar ao Inserir Fone de Ouvido</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">O aplicativo retomará a reprodução em pausa na inserção dos fones de ouvido no dispositivo</string>
<string name="settings.scrobble_summary">Lembre-se de configurar usuário e senha nos serviços Scrobble do servidor</string>
<string name="settings.scrobble_title">Registrar Minhas Músicas</string>
<string name="settings.search_1">1</string>
@ -329,6 +331,11 @@
<string name="download.menu_show_artist">Mostrar Artista</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Anos Múltiplos</string>
<string name="settings.playback.resume_on_bluetooth_device">Retomar ao Conectar Dispositivo Bluetooth</string>
<string name="settings.playback.pause_on_bluetooth_device">Pausar ao Desconectar Dispositivo Bluetooth</string>
<string name="settings.playback.bluetooth_all">Todos os dispositivos Bluetooth</string>
<string name="settings.playback.bluetooth_a2dp">Somente dispositivos de áudio (A2DP)</string>
<string name="settings.playback.bluetooth_disabled">Desativado</string>
<string name="settings.debug.title">Opções de Depuração</string>
<string name="settings.debug.log_to_file">Log de Depuração em Arquivo</string>
<string name="settings.debug.log_path">Os arquivos com log estão disponíveis em %1$s/%2$s</string>

View File

@ -222,6 +222,8 @@
<string name="settings.preload_3">3 músicas</string>
<string name="settings.preload_5">5 músicas</string>
<string name="settings.preload_unlimited">Ilimitado</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Retomar ao inserir Auscultadores</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">O aplicativo retomará a reprodução em pausa na inserção dos auscultadores no dispositivo.</string>
<string name="settings.search_1">1</string>
<string name="settings.search_10">10</string>
<string name="settings.search_100">100</string>
@ -307,6 +309,11 @@
<string name="download.menu_show_artist">Mostrar Artista</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Múltiplos Anos</string>
<string name="settings.playback.resume_on_bluetooth_device">Resume when a Bluetooth device is connected</string>
<string name="settings.playback.pause_on_bluetooth_device">Pause when a Bluetooth device is disconnected</string>
<string name="settings.playback.bluetooth_all">All Bluetooth devices</string>
<string name="settings.playback.bluetooth_a2dp">Only audio (A2DP) devices</string>
<string name="settings.playback.bluetooth_disabled">Disabilitando</string>
<string name="server_selector.label">Configured servers</string>
<string name="server_selector.delete_confirmation">Are you sure you want to delete the server?</string>
<string name="server_editor.label">Editing server</string>

View File

@ -246,6 +246,8 @@
<string name="settings.preload_3">3 песни</string>
<string name="settings.preload_5">5 песен</string>
<string name="settings.preload_unlimited">Неограниченный</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Возобновить подключение наушников</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">Приложение возобновит приостановленное воспроизведение после того, как в устройство будут вставлены проводные наушники.</string>
<string name="settings.scrobble_summary">Не забудьте установить своего пользователя и пароль в Скроббл сервисах на сервере.</string>
<string name="settings.scrobble_title">Скробблить мои воспроизведения</string>
<string name="settings.search_1">1</string>
@ -336,6 +338,11 @@
<string name="download.menu_show_artist">Показать исполнителей</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Несколько лет</string>
<string name="settings.playback.resume_on_bluetooth_device">Возобновить при подключении устройства Bluetooth</string>
<string name="settings.playback.pause_on_bluetooth_device">Пауза при отключении устройства Bluetooth</string>
<string name="settings.playback.bluetooth_all">Все устройства Bluetooth</string>
<string name="settings.playback.bluetooth_a2dp">Только аудио (A2DP) устройства</string>
<string name="settings.playback.bluetooth_disabled">Отключено</string>
<string name="settings.debug.title">Настройки отладки</string>
<string name="settings.debug.log_to_file">Записать журнал отладки в файл</string>
<string name="settings.debug.log_path">Файлы журнала доступны по адресу %1$s/%2$s</string>

View File

@ -240,6 +240,8 @@
<string name="settings.preload_3">3 首歌</string>
<string name="settings.preload_5">5 首歌</string>
<string name="settings.preload_unlimited">不限制</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">插入耳机时恢复播放</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">应用将在有线耳机插入设备时恢复已暂停的播放。</string>
<string name="settings.scrobble_summary">请记得在服务器上的 Scrobble 服务中设置您的用户名和密码</string>
<string name="settings.scrobble_title">Scrobble我的播放列表</string>
<string name="settings.search_1">1</string>
@ -337,6 +339,11 @@
<string name="download.menu_show_artist">显示艺术家</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Multiple Years</string>
<string name="settings.playback.resume_on_bluetooth_device">连接蓝牙设备时恢复播放</string>
<string name="settings.playback.pause_on_bluetooth_device">断开蓝牙设备时暂停播放</string>
<string name="settings.playback.bluetooth_all">所有蓝牙设备</string>
<string name="settings.playback.bluetooth_a2dp">仅音频 (A2DP) 设备</string>
<string name="settings.playback.bluetooth_disabled">已禁用</string>
<string name="settings.debug.title">调试选项</string>
<string name="settings.debug.log_to_file">将调试日志写入文件</string>
<string name="settings.debug.log_path">日志文件可在 %1$s/%2$s 获取</string>

View File

@ -54,5 +54,6 @@
<string name="settings.server_name">名稱</string>
<string name="time_span_disabled">已停用</string>
<string name="share_comment">註記</string>
<string name="settings.playback.bluetooth_disabled">已停用</string>
<string name="server_menu.delete">刪除</string>
</resources>

View File

@ -231,6 +231,11 @@
<item>@string/settings.share_hours</item>
<item>@string/settings.share_days</item>
</string-array>
<string-array name="bluetoothDeviceSettingNames" translatable="false">
<item>@string/settings.playback.bluetooth_all</item>
<item>@string/settings.playback.bluetooth_a2dp</item>
<item>@string/settings.playback.bluetooth_disabled</item>
</string-array>
<string-array name="languageNames" translatable="false">
<item>@string/language.default</item>
<item>@string/language.zh_CN</item>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="setting_keys.resume_play_on_headphones_plug" translatable="false">playback.resume_play_on_headphones_plug</string>
</resources>

View File

@ -256,6 +256,13 @@
<string name="settings.override_language">Override the language</string>
<string name="settings.override_language_summary">You need to restart the app after changing the language</string>
<string name="settings.playback_control_title">Playback Control Settings</string>
<string name="settings.playback.resume_on_bluetooth_device">Resume when a Bluetooth device is connected</string>
<string name="settings.playback.pause_on_bluetooth_device">Pause when a Bluetooth device is disconnected</string>
<string name="settings.playback.bluetooth_all">All Bluetooth devices</string>
<string name="settings.playback.bluetooth_a2dp">Only audio (A2DP) devices</string>
<string name="settings.playback.bluetooth_disabled">Disabled</string>
<string name="settings.playback.resume_play_on_headphones_plug.title">Resume on headphones insertion</string>
<string name="settings.playback.resume_play_on_headphones_plug.summary">App will resume paused playback on wired headphones insertion into device.</string>
<string name="settings.preload">Songs To Preload</string>
<string name="settings.preload_1">1 song</string>
<string name="settings.preload_10">10 songs</string>

View File

@ -90,6 +90,20 @@
a:key="incrementTime"
a:title="@string/settings.increment_time"
app:iconSpaceReserved="false"/>
<CheckBoxPreference
a:defaultValue="false"
a:key="@string/setting_keys.resume_play_on_headphones_plug"
a:title="@string/settings.playback.resume_play_on_headphones_plug.title"
a:summary="@string/settings.playback.resume_play_on_headphones_plug.summary"
app:iconSpaceReserved="false"/>
<Preference
a:key="resumeOnBluetoothDevice"
a:title="@string/settings.playback.resume_on_bluetooth_device"
app:iconSpaceReserved="false"/>
<Preference
a:key="pauseOnBluetoothDevice"
a:title="@string/settings.playback.pause_on_bluetooth_device"
app:iconSpaceReserved="false"/>
<CheckBoxPreference
a:defaultValue="false"
a:key="use_five_star_rating"