Merge pull request #190 from Aga-C/change-ogg-naming

Added Opus to ogg name on the UI (#189)
This commit is contained in:
Tibor Kaputa 2023-04-26 23:06:20 +02:00 committed by GitHub
commit 9deea1c306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View file

@ -146,7 +146,7 @@ class SettingsActivity : SimpleActivity() {
) )
if (isQPlus()) { if (isQPlus()) {
items.add(RadioItem(EXTENSION_OGG, getString(R.string.ogg))) items.add(RadioItem(EXTENSION_OGG, getString(R.string.ogg_opus)))
} }
RadioGroupDialog(this@SettingsActivity, items, config.extension) { RadioGroupDialog(this@SettingsActivity, items, config.extension) {

View file

@ -48,6 +48,14 @@ class Config(context: Context) : BaseConfig(context) {
set(recordAfterLaunch) = prefs.edit().putBoolean(RECORD_AFTER_LAUNCH, recordAfterLaunch).apply() set(recordAfterLaunch) = prefs.edit().putBoolean(RECORD_AFTER_LAUNCH, recordAfterLaunch).apply()
fun getExtensionText() = context.getString( fun getExtensionText() = context.getString(
when (extension) {
EXTENSION_M4A -> R.string.m4a
EXTENSION_OGG -> R.string.ogg_opus
else -> R.string.mp3
}
)
fun getExtension() = context.getString(
when (extension) { when (extension) {
EXTENSION_M4A -> R.string.m4a EXTENSION_M4A -> R.string.m4a
EXTENSION_OGG -> R.string.ogg EXTENSION_OGG -> R.string.ogg

View file

@ -86,7 +86,7 @@ class RecorderService : Service() {
defaultFolder.absolutePath defaultFolder.absolutePath
} }
currFilePath = "$baseFolder/${getCurrentFormattedDateTime()}.${config.getExtensionText()}" currFilePath = "$baseFolder/${getCurrentFormattedDateTime()}.${config.getExtension()}"
try { try {
recorder = if (recordMp3()) { recorder = if (recordMp3()) {

View file

@ -4,6 +4,7 @@
<string name="m4a">m4a</string> <string name="m4a">m4a</string>
<string name="mp3">mp3</string> <string name="mp3">mp3</string>
<string name="ogg">ogg</string> <string name="ogg">ogg</string>
<string name="ogg_opus">ogg (Opus)</string>
<string name="bitrate_value">%d kbps</string> <string name="bitrate_value">%d kbps</string>
</resources> </resources>