Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd74ec0bc9 | ||
|
|
46bad17ccc | ||
|
|
e2ed1b9f9f | ||
|
|
8baa7e81f0 | ||
|
|
722d8538b2 | ||
|
|
e11823cadc | ||
|
|
0d1e6caeb4 | ||
|
|
2f66466ff8 | ||
|
|
ed1564da24 | ||
|
|
7543d78fd8 | ||
|
|
7ae492e1e5 |
No files matched your search
@@ -1 +1,2 @@
|
||||
unpackaged_assets/**/*.ogg filter=lfs diff=lfs merge=lfs -text
|
||||
test-fixtures/audio/*.mp3 filter=lfs diff=lfs merge=lfs -text
|
||||
@@ -1,4 +1,16 @@
|
||||
# Changelog
|
||||
## [1.9.3] - 2026-08-17
|
||||
### Added
|
||||
- Custom MP3 music can be imported and selected independently for Wim Hof, Meditation and Sun Salutation practices.
|
||||
|
||||
### Changed
|
||||
- Running sessions now provide separate top-left controls for sound effects and background-music volume.
|
||||
|
||||
### Fixed
|
||||
- Custom MP3 tracks now decode and play during Wim Hof sessions, including after restarting the app; previewing music no longer starts a practice.
|
||||
- Music download failures now offer clear Cancel and Retry actions instead of ambiguous buttons.
|
||||
- Daily break progress and skipped state persist across app restarts and reset only at the configured daily boundary.
|
||||
|
||||
## [1.9.2] - 2026-08-17
|
||||
### Added
|
||||
- Breathing Patterns with Box, 4-7-8, coherent, extended-exhale and custom timed breathing sessions.
|
||||
|
||||
@@ -397,11 +397,11 @@ endif
|
||||
KRYON_RAYLIB_AUDIO_PERIOD_CONFIG := $(if $(strip $(KRYON_RAYLIB_AUDIO_PERIOD_FRAMES)),-DAUDIO_DEVICE_PERIOD_SIZE_IN_FRAMES=$(KRYON_RAYLIB_AUDIO_PERIOD_FRAMES),)
|
||||
KRYON_RAYLIB_AUDIO_PERIODS_CONFIG := $(if $(strip $(KRYON_RAYLIB_AUDIO_PERIODS)),-DAUDIO_DEVICE_PERIODS=$(KRYON_RAYLIB_AUDIO_PERIODS),)
|
||||
APP_RAYLIB_CONFIG := $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT_PNG=0 -DSUPPORT_FILEFORMAT_JPG=0 -DSUPPORT_FILEFORMAT_OGG=0 -DSUPPORT_FILEFORMAT_MP3=%,$(RAY_RAYLIB_CONFIG)) -DSUPPORT_MODULE_RAUDIO=1 -DSUPPORT_FILEFORMAT_JPG=1 -DSUPPORT_FILEFORMAT_OGG=1 -DSUPPORT_FILEFORMAT_MP3=0 $(KRYON_RAYLIB_AUDIO_PERIOD_CONFIG) $(KRYON_RAYLIB_AUDIO_PERIODS_CONFIG)
|
||||
COMMON_CFLAGS := -Wall -Wextra -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DUI_EMBEDDED_ONLY=1
|
||||
COMMON_CFLAGS := -Wall -Wextra -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DUI_EMBEDDED_ONLY=1 -DUI_WINDOW_HAVE_SDL
|
||||
CFLAGS := $(COMMON_CFLAGS) -std=c99 $(RUNTIME_ASSET_CFLAGS) $(SYSTEM_THEME_CFLAGS) $(DESKTOP_TRAY_CFLAGS) $(KRYON_NOTIFICATION_CPPFLAGS) $(KRYON_NOTIFICATION_CFLAGS)
|
||||
NATIVE_SYSTEM_LDLIBS := $(KRYON_NOTIFICATION_LDLIBS) -lm -lpthread $(if $(filter linux,$(NATIVE_PLATFORM)),-ldl -lrt,) $(SYSTEM_THEME_LDLIBS)
|
||||
WINDOWS_CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DUI_EMBEDDED_ONLY=1
|
||||
WEB_CFLAGS := $(filter-out -Os,$(COMMON_CFLAGS)) -O1 -std=gnu99
|
||||
WEB_CFLAGS := $(filter-out -Os -DUI_WINDOW_HAVE_SDL,$(COMMON_CFLAGS)) -O1 -std=gnu99
|
||||
CLICK_CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DUI_EMBEDDED_ONLY=1 -DINBE_DISABLE_KRYON_FILE_DIALOG -DHAS_LIBCURL=1 $(AARCH64_KRYON_CURL_CFLAGS)
|
||||
LDFLAGS := -Wl,--gc-sections -s
|
||||
WINDOWS_LDFLAGS := -Wl,--gc-sections -static -static-libgcc -mwindows
|
||||
@@ -479,7 +479,7 @@ MEDITATION_AUDIO_TRACKS := \
|
||||
|
||||
include $(KRYON_DIR)/mk/package-freebsd.mk
|
||||
|
||||
.PHONY: all native kryon-host install install-user uninstall stage package-freebsd deb package-deb deb-check rpm package-rpm rpm-check snap package-snap snap-cache-clean flatpak package-flatpak podman-check validate-desktop run run-fresh screenshot test ci dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows font-subsets font-bundle-check clean clean-linux clean-native clean-vendor-builds android-avd android-check-keystore android-copy-assets android-copy-debug-apks android-copy-release-apks android-copy-bundle android-smoke android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean validate-meditation-audio package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web web-tools-check web-smoke-test web-smoke-test-firefox web-smoke-test-librewolf site chrome-web-store firefox-addons firefox-addons-lint firefox-addons-source-zip verify-firefox-addons
|
||||
.PHONY: all native kryon-host install install-user uninstall stage package-freebsd deb package-deb deb-check rpm package-rpm rpm-check snap package-snap snap-cache-clean flatpak package-flatpak podman-check validate-desktop run run-fresh screenshot test ci dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows font-subsets font-bundle-check clean clean-linux clean-native clean-vendor-builds android-avd android-audio-e2e android-check-keystore android-copy-assets android-copy-debug-apks android-copy-release-apks android-copy-bundle android-smoke android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean validate-meditation-audio package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web web-tools-check web-smoke-test web-smoke-test-firefox web-smoke-test-librewolf site chrome-web-store firefox-addons firefox-addons-lint firefox-addons-source-zip verify-firefox-addons
|
||||
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle click deb package-deb rpm package-rpm snap package-snap flatpak package-flatpak
|
||||
|
||||
all: native
|
||||
@@ -586,14 +586,14 @@ screenshot: $(TARGET)
|
||||
./scripts/generate-screenshots.sh "$(TARGET)"
|
||||
|
||||
|
||||
.SILENT: test $(TESTS) font-bundle-check
|
||||
.SILENT: test $(TESTS) font-bundle-check audio-test-fixture-check
|
||||
|
||||
## Local parity with the ci.yml gate: unit tests plus the web build (emcc).
|
||||
## Run before pushing to catch web-only breakage -- e.g. code under
|
||||
## #if defined(PLATFORM_WEB) -- that `make test` (desktop-native) misses.
|
||||
ci: test web
|
||||
|
||||
test: $(TESTS) font-bundle-check
|
||||
test: $(TESTS) font-bundle-check audio-test-fixture-check
|
||||
echo "== Inbe tests =="; \
|
||||
status=0; \
|
||||
for test_bin in $(TESTS); do \
|
||||
@@ -618,6 +618,11 @@ test: $(TESTS) font-bundle-check
|
||||
fi; \
|
||||
exit "$$status"
|
||||
|
||||
audio-test-fixture-check:
|
||||
printf '%s %s\n' \
|
||||
d1f25feccd8af5cfe22ca1ed6afa901a5f97cbf976b93fc46096a2bd83315034 \
|
||||
test-fixtures/audio/autumn-sunset.mp3 | sha256sum -c - >/dev/null
|
||||
|
||||
font-bundle-check:
|
||||
for font in $(FONT_FILES); do \
|
||||
case "$$font" in \
|
||||
@@ -1423,6 +1428,9 @@ android-smoke:
|
||||
@mkdir -p build/android
|
||||
sh scripts/android-smoke-test.sh "$(ANDROID_SDK)" "$(ANDROID_APP_ID)" "$(ANDROID_ACTIVITY)"
|
||||
|
||||
android-audio-e2e:
|
||||
bash scripts/android-audio-e2e.sh
|
||||
|
||||
android-clean:
|
||||
$(GRADLE) -p droid clean $(ANDROID_GRADLE_ARGS)
|
||||
rm -rf $(ANDROID_BUILD_DIR)
|
||||
|
||||
@@ -39,8 +39,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
versionCode 101
|
||||
versionName "1.9.2"
|
||||
versionCode 102
|
||||
versionName "1.9.3"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
if (System.getProperty('os.name').toLowerCase().contains('freebsd')) {
|
||||
|
||||
@@ -57,7 +57,10 @@ public class MainActivity extends NativeActivity {
|
||||
|
||||
/** Fired by the home-screen widget, the quick-settings tile and the launcher shortcuts. */
|
||||
public static final String ACTION_START_PRACTICE = "xyz.waozi.inbe.action.START_PRACTICE";
|
||||
public static final String ACTION_AUDIO_E2E_IMPORT = "xyz.waozi.inbe.action.AUDIO_E2E_IMPORT";
|
||||
public static final String ACTION_AUDIO_E2E_DOWNLOAD = "xyz.waozi.inbe.action.AUDIO_E2E_DOWNLOAD";
|
||||
public static final String EXTRA_PRACTICE_ID = "practice_id";
|
||||
public static final String EXTRA_AUDIO_FILE_NAME = "audio_file_name";
|
||||
|
||||
static {
|
||||
System.loadLibrary("main");
|
||||
@@ -96,6 +99,8 @@ public class MainActivity extends NativeActivity {
|
||||
private native void nativeTextInputEnter();
|
||||
private native void nativeInvalidateGraphicsResources();
|
||||
private native boolean nativeStartPractice(int practiceId);
|
||||
private native boolean nativeDebugImportMusicForPractice(String path, int practiceId);
|
||||
private native boolean nativeDebugStartMusicDownload();
|
||||
|
||||
private void requestNotificationPermissionIfNeeded() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
@@ -505,6 +510,32 @@ public class MainActivity extends NativeActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleAudioE2EIntent(Intent intent) {
|
||||
boolean debuggable = (getApplicationInfo().flags &
|
||||
android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) != 0;
|
||||
if (!debuggable || intent == null ||
|
||||
(!ACTION_AUDIO_E2E_IMPORT.equals(intent.getAction()) &&
|
||||
!ACTION_AUDIO_E2E_DOWNLOAD.equals(intent.getAction()))) {
|
||||
return;
|
||||
}
|
||||
if (ACTION_AUDIO_E2E_DOWNLOAD.equals(intent.getAction())) {
|
||||
Log.i(TAG, "AUDIO_E2E: download " +
|
||||
(nativeDebugStartMusicDownload() ? "started" : "failed"));
|
||||
return;
|
||||
}
|
||||
String fileName = sanitizeFileName(intent.getStringExtra(EXTRA_AUDIO_FILE_NAME));
|
||||
int practiceId = intent.getIntExtra(EXTRA_PRACTICE_ID, 0);
|
||||
if (fileName == null) {
|
||||
Log.e(TAG, "AUDIO_E2E: invalid fixture file name");
|
||||
return;
|
||||
}
|
||||
File file = new File(getFilesDir(), fileName);
|
||||
boolean imported = file.isFile() &&
|
||||
nativeDebugImportMusicForPractice(file.getAbsolutePath(), practiceId);
|
||||
Log.i(TAG, "AUDIO_E2E: import " + (imported ? "ready" : "failed") +
|
||||
" practice=" + practiceId + " path=" + file.getAbsolutePath());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
@@ -734,6 +765,7 @@ public class MainActivity extends NativeActivity {
|
||||
|
||||
// Widget/tile/shortcut launch: the intent that started this activity.
|
||||
handleStartPracticeIntent(getIntent());
|
||||
handleAudioE2EIntent(getIntent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -972,6 +1004,7 @@ public class MainActivity extends NativeActivity {
|
||||
requestInsetRefresh();
|
||||
syncLifecycleState("onNewIntent");
|
||||
handleStartPracticeIntent(intent);
|
||||
handleAudioE2EIntent(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Added
|
||||
---
|
||||
- Custom MP3 music can be imported and selected independently for Wim Hof, Meditation and Sun Salutation practices.
|
||||
Changed
|
||||
---
|
||||
- Running sessions now provide separate top-left controls for sound effects and background-music volume.
|
||||
Fixed
|
||||
---
|
||||
- Custom MP3 tracks now decode and play during Wim Hof sessions, including after restarting the app; previewing music no longer starts a practice.
|
||||
- Music download failures now offer clear Cancel and Retry actions instead of ambiguous buttons.
|
||||
- Daily break progress and skipped state persist across app restarts and reset only at the configured daily boundary.
|
||||
+9
-3
@@ -285,6 +285,15 @@ Přeskočit
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Zkusit znovu
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Importovat hudbu pro toto cvičení
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Hudba importována a vybrána
|
||||
---
|
||||
[save_button]
|
||||
Uložit
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Abbrechen
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Erneut versuchen
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Musik für diese Übung importieren
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Musik importiert und ausgewählt
|
||||
---
|
||||
[save_button]
|
||||
Speichern
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -288,6 +288,15 @@ Skip
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Retry
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Import music for this practice
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Music imported and selected
|
||||
---
|
||||
[save_button]
|
||||
Save
|
||||
---
|
||||
@@ -447,9 +456,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Omitir
|
||||
[ok_button]
|
||||
Aceptar
|
||||
---
|
||||
[retry_button]
|
||||
Reintentar
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Importar música para esta práctica
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Música importada y seleccionada
|
||||
---
|
||||
[save_button]
|
||||
Guardar
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Ignorer
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Réessayer
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Importer de la musique pour cette pratique
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Musique importée et sélectionnée
|
||||
---
|
||||
[save_button]
|
||||
Enregistrer
|
||||
---
|
||||
@@ -1245,9 +1254,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Lewati
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Coba lagi
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Impor musik untuk latihan ini
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Musik diimpor dan dipilih
|
||||
---
|
||||
[save_button]
|
||||
Simpan
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Salta
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Riprova
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Importa musica per questa pratica
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Musica importata e selezionata
|
||||
---
|
||||
[save_button]
|
||||
Salva
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Finish
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
再試行
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
この練習用の音楽をインポート
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
音楽をインポートして選択しました
|
||||
---
|
||||
[save_button]
|
||||
保存
|
||||
---
|
||||
@@ -1248,9 +1257,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Finish
|
||||
[ok_button]
|
||||
확인
|
||||
---
|
||||
[retry_button]
|
||||
다시 시도
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
이 연습용 음악 가져오기
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
음악을 가져와 선택했습니다
|
||||
---
|
||||
[save_button]
|
||||
저장
|
||||
---
|
||||
@@ -1245,9 +1254,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Pular
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Tentar novamente
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Importar música para esta prática
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Música importada e selecionada
|
||||
---
|
||||
[save_button]
|
||||
Salvar
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -288,6 +288,15 @@ Finish
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[retry_button]
|
||||
Повторить
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
Импортировать музыку для этой практики
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
Музыка импортирована и выбрана
|
||||
---
|
||||
[save_button]
|
||||
Сохранить
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
+9
-3
@@ -285,6 +285,15 @@ Finish
|
||||
[ok_button]
|
||||
确定
|
||||
---
|
||||
[retry_button]
|
||||
重试
|
||||
---
|
||||
[audio_import_music_for_practice_button]
|
||||
为此练习导入音乐
|
||||
---
|
||||
[audio_imported_and_selected]
|
||||
音乐已导入并选择
|
||||
---
|
||||
[save_button]
|
||||
保存
|
||||
---
|
||||
@@ -1246,9 +1255,6 @@ Import audio
|
||||
[audio_import_sound_button]
|
||||
Import sound
|
||||
---
|
||||
[audio_import_music_button]
|
||||
Import music
|
||||
---
|
||||
[audio_imported]
|
||||
Audio imported
|
||||
---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Package: inbe.waozi
|
||||
Version: 1.9.2
|
||||
Version: 1.9.3
|
||||
Architecture: arm64
|
||||
Maintainer: Waozi <[email protected]>
|
||||
Click-Version: 0.4
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="1.9.2" date="2026-08-17"/>
|
||||
<release version="1.9.3" date="2026-08-17"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "inbe",
|
||||
"title": "Inner Breeze",
|
||||
"version": "1.9.2",
|
||||
"version": "1.9.3",
|
||||
"architecture": "arm64",
|
||||
"framework": "ubuntu-sdk-20.04",
|
||||
"description": "Syncable breathing, meditation, and habit practice app.",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "Inner Breeze",
|
||||
"short_name": "Inbe",
|
||||
"version": "1.9.2",
|
||||
"version": "1.9.3",
|
||||
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
|
||||
"permissions": [
|
||||
"contextMenus"
|
||||
|
||||
Executable
+111
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
app_id=xyz.waozi.inbe
|
||||
activity=xyz.waozi.inbe.MainActivity
|
||||
avd_name=inbe-audio-test-api30
|
||||
emulator_port=${ANDROID_AUDIO_E2E_PORT:-5580}
|
||||
serial="emulator-$emulator_port"
|
||||
work_dir=build/android-audio-e2e
|
||||
fixture=test-fixtures/audio/autumn-sunset.mp3
|
||||
fixture_sha256=d1f25feccd8af5cfe22ca1ed6afa901a5f97cbf976b93fc46096a2bd83315034
|
||||
capture_device=
|
||||
recorder_pid=
|
||||
previous_sink=
|
||||
|
||||
for command in adb ffmpeg ffprobe pactl parec python3 sha256sum; do
|
||||
command -v "$command" >/dev/null || { echo "android audio e2e: missing $command"; exit 2; }
|
||||
done
|
||||
|
||||
cleanup() {
|
||||
if [ -n "$recorder_pid" ]; then kill "$recorder_pid" 2>/dev/null || true; fi
|
||||
adb -s "$serial" emu kill >/dev/null 2>&1 || true
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
mkdir -p "$work_dir"
|
||||
printf '%s %s\n' "$fixture_sha256" "$fixture" | sha256sum -c -
|
||||
ffprobe -v error -select_streams a:0 \
|
||||
-show_entries stream=codec_name,channels,sample_rate,bit_rate \
|
||||
-of default=nw=1 "$fixture" | tee "$work_dir/fixture.txt"
|
||||
grep -q '^codec_name=mp3$' "$work_dir/fixture.txt"
|
||||
grep -q '^channels=2$' "$work_dir/fixture.txt"
|
||||
grep -q '^bit_rate=128000$' "$work_dir/fixture.txt"
|
||||
|
||||
previous_sink=$(pactl get-default-sink)
|
||||
capture_device="$previous_sink.monitor"
|
||||
if ! pactl list short sources | grep -q "[[:space:]]$capture_device[[:space:]]"; then
|
||||
echo "android audio e2e: default output has no monitor source: $previous_sink"
|
||||
exit 2
|
||||
fi
|
||||
unset PULSE_SINK QEMU_PA_SINK
|
||||
export QEMU_AUDIO_DRV=pa
|
||||
export AVD_NAME="$avd_name"
|
||||
export ANDROID_EMULATOR_PORT="$emulator_port"
|
||||
export ANDROID_EMULATOR_AUDIO_BACKEND=pulse
|
||||
export ANDROID_API=30
|
||||
export ANDROID_AVD_RAM_MB=2048
|
||||
export ANDROID_AVD_HEAP_MB=512
|
||||
export ANDROID_EMULATOR_RAM_MB=2048
|
||||
export ANDROID_SYSTEM_IMAGE_TYPE=google_apis
|
||||
bash scripts/emulator.sh
|
||||
|
||||
adb -s "$serial" wait-for-device
|
||||
adb -s "$serial" logcat -c
|
||||
make android-debug
|
||||
apk=droid/app/build/outputs/apk/debug/app-x86_64-debug.apk
|
||||
if [ ! -f "$apk" ]; then apk=droid/app/build/outputs/apk/debug/app-debug.apk; fi
|
||||
adb -s "$serial" install -r "$apk"
|
||||
adb -s "$serial" shell pm clear "$app_id" >/dev/null
|
||||
adb -s "$serial" shell am start -n "$app_id/$activity" >/dev/null
|
||||
sleep 5
|
||||
adb -s "$serial" shell cmd media_session volume --stream 3 --set 10 >/dev/null
|
||||
|
||||
adb -s "$serial" push "$fixture" /data/local/tmp/inbe-audio-e2e.mp3 >/dev/null
|
||||
adb -s "$serial" shell run-as "$app_id" cp /data/local/tmp/inbe-audio-e2e.mp3 files/inbe-audio-e2e.mp3
|
||||
adb -s "$serial" shell am start -n "$app_id/$activity" \
|
||||
-a xyz.waozi.inbe.action.AUDIO_E2E_IMPORT \
|
||||
--es audio_file_name inbe-audio-e2e.mp3 --ei practice_id 0 >/dev/null
|
||||
|
||||
for _ in $(seq 1 30); do
|
||||
if adb -s "$serial" logcat -d | grep -q 'AUDIO_E2E: import ready'; then break; fi
|
||||
sleep 1
|
||||
done
|
||||
adb -s "$serial" logcat -d > "$work_dir/logcat-import.txt"
|
||||
grep -q 'AUDIO_E2E: import ready' "$work_dir/logcat-import.txt"
|
||||
sleep 2
|
||||
|
||||
ffmpeg -y -v error -i "$fixture" -t 10 -ac 1 -ar 8000 -c:a pcm_s16le "$work_dir/source.wav"
|
||||
capture_practice_audio() {
|
||||
label=$1
|
||||
parec --device="$capture_device" --file-format=wav "$work_dir/capture-$label-raw.wav" &
|
||||
recorder_pid=$!
|
||||
adb -s "$serial" shell am start -n "$app_id/$activity" \
|
||||
-a xyz.waozi.inbe.action.START_PRACTICE --ei practice_id 0 >/dev/null
|
||||
sleep 12
|
||||
kill "$recorder_pid" 2>/dev/null || true
|
||||
wait "$recorder_pid" 2>/dev/null || true
|
||||
recorder_pid=
|
||||
ffmpeg -y -v error -i "$work_dir/capture-$label-raw.wav" \
|
||||
-ac 1 -ar 8000 -c:a pcm_s16le "$work_dir/capture-$label.wav"
|
||||
adb -s "$serial" logcat -d > "$work_dir/logcat-$label.txt"
|
||||
pactl list short sink-inputs > "$work_dir/sink-inputs-$label.txt"
|
||||
python3 scripts/audio-envelope-match.py "$work_dir/source.wav" \
|
||||
"$work_dir/capture-$label.wav" | tee "$work_dir/audio-match-$label.txt"
|
||||
}
|
||||
|
||||
capture_practice_audio initial
|
||||
|
||||
adb -s "$serial" logcat -d > "$work_dir/logcat-playback.txt"
|
||||
if grep -E 'Could not start track|session music is not playing|FATAL EXCEPTION|Fatal signal' "$work_dir/logcat-playback.txt"; then
|
||||
echo "android audio e2e: playback error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
adb -s "$serial" shell am force-stop "$app_id"
|
||||
adb -s "$serial" shell am start -n "$app_id/$activity" >/dev/null
|
||||
sleep 4
|
||||
capture_practice_audio relaunch
|
||||
adb -s "$serial" logcat -d > "$work_dir/logcat-relaunch.txt"
|
||||
|
||||
echo "android audio e2e: PASS; artifacts in $work_dir"
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare two mono PCM WAV files by their short-window amplitude envelopes."""
|
||||
|
||||
import math
|
||||
import struct
|
||||
import sys
|
||||
import wave
|
||||
|
||||
|
||||
def envelope(path: str, window_ms: int = 100) -> list[float]:
|
||||
with wave.open(path, "rb") as wav:
|
||||
if wav.getnchannels() != 1 or wav.getsampwidth() != 2:
|
||||
raise ValueError(f"{path}: expected mono 16-bit PCM")
|
||||
rate = wav.getframerate()
|
||||
raw = wav.readframes(wav.getnframes())
|
||||
samples = struct.unpack(f"<{len(raw) // 2}h", raw)
|
||||
window = max(1, rate * window_ms // 1000)
|
||||
return [
|
||||
math.sqrt(sum(value * value for value in samples[i:i + window]) /
|
||||
max(1, len(samples[i:i + window])))
|
||||
for i in range(0, len(samples), window)
|
||||
]
|
||||
|
||||
|
||||
def normalized(values: list[float]) -> list[float]:
|
||||
mean = sum(values) / max(1, len(values))
|
||||
centered = [value - mean for value in values]
|
||||
scale = math.sqrt(sum(value * value for value in centered)) or 1.0
|
||||
return [value / scale for value in centered]
|
||||
|
||||
|
||||
def best_correlation(source: list[float], capture: list[float]) -> float:
|
||||
source = normalized(source)
|
||||
best = -1.0
|
||||
minimum = min(30, len(source))
|
||||
for offset in range(max(1, len(capture) - minimum + 1)):
|
||||
count = min(len(source), len(capture) - offset)
|
||||
if count < minimum:
|
||||
continue
|
||||
candidate = normalized(capture[offset:offset + count])
|
||||
score = sum(source[i] * candidate[i] for i in range(count))
|
||||
best = max(best, score)
|
||||
return best
|
||||
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
raise SystemExit("usage: audio-envelope-match.py SOURCE.wav CAPTURE.wav")
|
||||
|
||||
source_envelope = envelope(sys.argv[1])
|
||||
capture_envelope = envelope(sys.argv[2])
|
||||
capture_rms = math.sqrt(sum(value * value for value in capture_envelope) /
|
||||
max(1, len(capture_envelope)))
|
||||
correlation = best_correlation(source_envelope, capture_envelope)
|
||||
print(f"capture_rms={capture_rms:.1f} envelope_correlation={correlation:.3f}")
|
||||
if capture_rms < 80 or correlation < 0.20:
|
||||
raise SystemExit(1)
|
||||
+29
-9
@@ -57,6 +57,11 @@ image_dir_ready() {
|
||||
}
|
||||
|
||||
image_specs() {
|
||||
if [ -n "${ANDROID_SYSTEM_IMAGE_TYPE:-}" ]; then
|
||||
printf '%s x86_64\n%s arm64-v8a\n' "$ANDROID_SYSTEM_IMAGE_TYPE" "$ANDROID_SYSTEM_IMAGE_TYPE"
|
||||
return
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
google_apis_playstore_ps16k x86_64
|
||||
google_apis_ps16k x86_64
|
||||
@@ -89,17 +94,32 @@ find_system_image() {
|
||||
}
|
||||
|
||||
install_system_image() {
|
||||
if command -v sdkmanager >/dev/null 2>&1; then
|
||||
SDKMANAGER=sdkmanager
|
||||
elif [ -x "$ANDROID_SDK_ROOT/cmdline-tools/11.0/bin/sdkmanager" ]; then
|
||||
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/11.0/bin/sdkmanager"
|
||||
elif [ -x "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" ]; then
|
||||
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
|
||||
else
|
||||
SDKMANAGER=""
|
||||
for candidate in \
|
||||
"$ANDROID_SDK_ROOT/cmdline-tools/latest-2/bin/sdkmanager" \
|
||||
"$ORIGINAL_SDK_ROOT/cmdline-tools/latest-2/bin/sdkmanager"; do
|
||||
if [ -x "$candidate" ]; then
|
||||
SDKMANAGER="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$SDKMANAGER" ]; then
|
||||
while IFS= read -r candidate; do
|
||||
[ -x "$candidate" ] && SDKMANAGER="$candidate"
|
||||
done < <(find -L "$ANDROID_SDK_ROOT/cmdline-tools" "$ORIGINAL_SDK_ROOT/cmdline-tools" \
|
||||
-mindepth 3 -maxdepth 3 -type f -path '*/bin/sdkmanager' 2>/dev/null | sort -V)
|
||||
fi
|
||||
|
||||
if [ -z "$SDKMANAGER" ] && command -v sdkmanager >/dev/null 2>&1; then
|
||||
SDKMANAGER="$(command -v sdkmanager)"
|
||||
fi
|
||||
if [ -z "$SDKMANAGER" ]; then
|
||||
echo "❌ Error: sdkmanager not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "📦 Using sdkmanager: $SDKMANAGER"
|
||||
|
||||
while read -r type abi; do
|
||||
[ -n "$type" ] || continue
|
||||
package="system-images;android-$ANDROID_API;$type;$abi"
|
||||
@@ -164,8 +184,8 @@ hw.lcd.height=2960
|
||||
hw.lcd.width=1440
|
||||
hw.gpu.enabled=yes
|
||||
hw.gpu.mode=host
|
||||
hw.ramSize=4096
|
||||
vm.heapSize=1024
|
||||
hw.ramSize=${ANDROID_AVD_RAM_MB:-4096}
|
||||
vm.heapSize=${ANDROID_AVD_HEAP_MB:-1024}
|
||||
hw.sdCard=yes
|
||||
hw.sdCard.size=2048MB
|
||||
disk.cachePartition=yes
|
||||
|
||||
+50
-14
@@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
AVD_NAME="${AVD_NAME:-inbe-test}"
|
||||
EMULATOR_PORT="${ANDROID_EMULATOR_PORT:-}"
|
||||
UNAME_S="$(uname -s)"
|
||||
KERNEL_R="$(uname -r 2>/dev/null || true)"
|
||||
SOFT_EMULATOR=0
|
||||
@@ -64,6 +65,32 @@ if [ ! -x "$ADB_CMD" ]; then
|
||||
ADB_CMD="$(command -v adb)"
|
||||
fi
|
||||
|
||||
if [ -n "$EMULATOR_PORT" ]; then
|
||||
EMULATOR_SERIAL="emulator-$EMULATOR_PORT"
|
||||
ADB_ARGS=(-s "$EMULATOR_SERIAL")
|
||||
PORT_ARGS=(-port "$EMULATOR_PORT")
|
||||
else
|
||||
EMULATOR_SERIAL=""
|
||||
ADB_ARGS=(-e)
|
||||
PORT_ARGS=()
|
||||
fi
|
||||
|
||||
if [ -n "${ANDROID_EMULATOR_AUDIO_BACKEND:-}" ]; then
|
||||
AUDIO_ARGS=(-audio "$ANDROID_EMULATOR_AUDIO_BACKEND")
|
||||
elif [ "$SOFT_EMULATOR" -eq 1 ]; then
|
||||
AUDIO_ARGS=(-no-audio)
|
||||
else
|
||||
AUDIO_ARGS=()
|
||||
fi
|
||||
|
||||
if [ -n "${ANDROID_EMULATOR_RAM_MB:-}" ]; then
|
||||
MEMORY_ARGS=(-memory "$ANDROID_EMULATOR_RAM_MB")
|
||||
QEMU_MEMORY_ARGS=(-m "$ANDROID_EMULATOR_RAM_MB")
|
||||
else
|
||||
MEMORY_ARGS=()
|
||||
QEMU_MEMORY_ARGS=()
|
||||
fi
|
||||
|
||||
EMULATOR_CMD="${ANDROID_SDK_ROOT}/emulator/emulator"
|
||||
if [ ! -x "$EMULATOR_CMD" ]; then
|
||||
EMULATOR_CMD="$(command -v emulator)"
|
||||
@@ -77,7 +104,11 @@ if [ "$UNAME_S" = "FreeBSD" ] && command -v brandelf >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
# Check if emulator is already running
|
||||
if "$ADB_CMD" devices | grep -q '^emulator-[0-9][0-9]*[[:space:]]*device'; then
|
||||
if [ -n "$EMULATOR_SERIAL" ] && "$ADB_CMD" devices | grep -q "^$EMULATOR_SERIAL[[:space:]]*device"; then
|
||||
echo "✅ Emulator already running"
|
||||
"$ADB_CMD" devices
|
||||
exit 0
|
||||
elif [ -z "$EMULATOR_SERIAL" ] && "$ADB_CMD" devices | grep -q '^emulator-[0-9][0-9]*[[:space:]]*device'; then
|
||||
echo "✅ Emulator already running"
|
||||
"$ADB_CMD" devices
|
||||
exit 0
|
||||
@@ -100,7 +131,9 @@ export ANDROID_SDK_ROOT="$ANDROID_SDK_ROOT"
|
||||
if [ "$SOFT_EMULATOR" -eq 1 ]; then
|
||||
LD_LIBRARY_PATH="$EMULATOR_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$EMULATOR_CMD" @"$AVD_NAME" \
|
||||
-no-window \
|
||||
-no-audio \
|
||||
"${AUDIO_ARGS[@]}" \
|
||||
"${PORT_ARGS[@]}" \
|
||||
"${MEMORY_ARGS[@]}" \
|
||||
-gpu off \
|
||||
-no-accel \
|
||||
-no-snapshot-load \
|
||||
@@ -108,12 +141,15 @@ if [ "$SOFT_EMULATOR" -eq 1 ]; then
|
||||
-verbose > /tmp/emulator.log 2>&1 &
|
||||
else
|
||||
LD_LIBRARY_PATH="$EMULATOR_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$EMULATOR_CMD" @"$AVD_NAME" \
|
||||
"${AUDIO_ARGS[@]}" \
|
||||
"${PORT_ARGS[@]}" \
|
||||
"${MEMORY_ARGS[@]}" \
|
||||
-gpu host \
|
||||
-skin 1440x2960 \
|
||||
-no-snapshot-load \
|
||||
-no-boot-anim \
|
||||
-verbose \
|
||||
-qemu -enable-kvm > /tmp/emulator.log 2>&1 &
|
||||
-qemu "${QEMU_MEMORY_ARGS[@]}" -enable-kvm > /tmp/emulator.log 2>&1 &
|
||||
fi
|
||||
|
||||
echo "⏳ Waiting for boot (this may take a while)..."
|
||||
@@ -123,8 +159,8 @@ if [ "$SOFT_EMULATOR" -eq 1 ]; then
|
||||
fi
|
||||
elapsed=0
|
||||
|
||||
timeout 20 "$ADB_CMD" -e wait-for-device >/dev/null 2>&1 || true
|
||||
while ! "$ADB_CMD" -e shell getprop sys.boot_completed 2>/dev/null | grep -q "1"; do
|
||||
timeout 20 "$ADB_CMD" "${ADB_ARGS[@]}" wait-for-device >/dev/null 2>&1 || true
|
||||
while ! "$ADB_CMD" "${ADB_ARGS[@]}" shell getprop sys.boot_completed 2>/dev/null | grep -q "1"; do
|
||||
if [ $elapsed -ge $timeout_seconds ]; then
|
||||
echo "❌ Timeout waiting for boot. Check /tmp/emulator.log"
|
||||
exit 1
|
||||
@@ -148,20 +184,20 @@ done
|
||||
echo "✅ Pixel 8 Pro emulator ready!"
|
||||
|
||||
echo "🎯 Enabling punch-hole display cutout overlay if available..."
|
||||
if "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.hole"; then
|
||||
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.hole || true
|
||||
elif "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.corner"; then
|
||||
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.corner || true
|
||||
elif "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.tall"; then
|
||||
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.tall || true
|
||||
if "$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.hole"; then
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.hole || true
|
||||
elif "$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.corner"; then
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.corner || true
|
||||
elif "$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.tall"; then
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.tall || true
|
||||
else
|
||||
echo " No display cutout emulation overlay found on this image"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "📱 Device info:"
|
||||
"$ADB_CMD" -e shell getprop ro.product.model
|
||||
"$ADB_CMD" -e shell getprop ro.build.version.release
|
||||
"$ADB_CMD" -e shell getprop ro.build.version.sdk
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell getprop ro.product.model
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell getprop ro.build.version.release
|
||||
"$ADB_CMD" "${ADB_ARGS[@]}" shell getprop ro.build.version.sdk
|
||||
echo ""
|
||||
echo " Connect with: $ADB_CMD -e shell"
|
||||
+1
-7
@@ -1,9 +1,3 @@
|
||||
@font-face {
|
||||
font-family: departure;
|
||||
src: url('/web-assets/fonts/DepartureMono-Regular.otf');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--bg: #f3f1ea;
|
||||
--surface: #fdfcf8;
|
||||
@@ -33,7 +27,7 @@
|
||||
--ink: var(--ink-strong);
|
||||
--muted: var(--ink-soft);
|
||||
--panel-shadow: rgba(0, 0, 0, 0.10);
|
||||
--font-main: departure, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
|
||||
--font-main: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
|
||||
--radius: 10px;
|
||||
--radius-sm: 6px;
|
||||
--maxw: 1080px;
|
||||
|
||||
+59
-5
@@ -46,8 +46,10 @@
|
||||
#endif
|
||||
|
||||
#if ANDROID_BUILD
|
||||
#include <android/log.h>
|
||||
#include "android_wakelock.h"
|
||||
#include "android_device.h"
|
||||
#include "android_insets.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB) || ANDROID_BUILD
|
||||
@@ -1343,10 +1345,15 @@ draw_global_modal(InbeApp *app)
|
||||
if(app->modal.type == UIModalMeditationNetworkError) {
|
||||
modal_result = Modal(GetLocaleText("meditation_music_network_error_title"),
|
||||
GetLocaleText("meditation_music_network_error_message"),
|
||||
GetLocaleText("ok_button"),
|
||||
GetLocaleText("ok_button"));
|
||||
if(modal_result != 0) {
|
||||
GetLocaleText("cancel_button"),
|
||||
GetLocaleText("retry_button"));
|
||||
if(modal_result == 1) {
|
||||
TraceLog(LOG_INFO, "AUDIO: Network error download cancelled");
|
||||
app_close_modal(app);
|
||||
} else if(modal_result == 2) {
|
||||
TraceLog(LOG_INFO, "AUDIO: Network error download retry requested");
|
||||
app_close_modal(app);
|
||||
meditation_music_start_download(app);
|
||||
}
|
||||
}
|
||||
if(app->modal.type == UIModalThemePicker)
|
||||
@@ -1462,6 +1469,54 @@ updateapp(InbeApp *app)
|
||||
int content_input_clip_active = 0;
|
||||
int bottom_input_reserved = 0;
|
||||
|
||||
#if ANDROID_BUILD
|
||||
{
|
||||
int practice_id = android_take_pending_practice_start();
|
||||
if(practice_id >= 0) {
|
||||
int active_break;
|
||||
const PracticeDefinition *practice;
|
||||
|
||||
app->exercise_type = practice_clamp_id(practice_id);
|
||||
if(app->modal.active)
|
||||
app_close_modal(app);
|
||||
active_break = break_engine_active_break(&app->breaks);
|
||||
if(active_break >= 0) {
|
||||
app_breaks_start_practice(app, active_break, app->exercise_type);
|
||||
} else {
|
||||
app->main_tab = APP_MAIN_TAB_PRACTICE;
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
practice = practice_get(app->exercise_type);
|
||||
TraceLog(LOG_WARNING,
|
||||
"AUDIO_E2E: main-thread start practice=%d track=%d mask=%d",
|
||||
app->exercise_type,
|
||||
app->meditation.music_practice_tracks[app->exercise_type],
|
||||
app->meditation.music_practice_mask);
|
||||
__android_log_print(ANDROID_LOG_WARN, "INBE_AUDIO_E2E",
|
||||
"main-thread start practice=%d track=%d mask=%d",
|
||||
app->exercise_type,
|
||||
app->meditation.music_practice_tracks[app->exercise_type],
|
||||
app->meditation.music_practice_mask);
|
||||
if(practice != NULL && practice->start != NULL)
|
||||
practice->start(app);
|
||||
TraceLog(LOG_WARNING,
|
||||
"AUDIO_E2E: music loaded=%d playing=%d test=%d volume=%d",
|
||||
app->meditation.music_loaded,
|
||||
app->meditation.music_playing,
|
||||
app->meditation.music_test_playing,
|
||||
app->music_volume);
|
||||
__android_log_print(ANDROID_LOG_WARN, "INBE_AUDIO_E2E",
|
||||
"music loaded=%d playing=%d test=%d volume=%d valid=%d stream=%d",
|
||||
app->meditation.music_loaded,
|
||||
app->meditation.music_playing,
|
||||
app->meditation.music_test_playing,
|
||||
app->music_volume,
|
||||
IsMusicValid(app->meditation.music),
|
||||
IsMusicStreamPlaying(app->meditation.music));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
|
||||
app_update_desktop_background_state(app);
|
||||
#endif
|
||||
@@ -1775,8 +1830,7 @@ app_destroy(void *vapp)
|
||||
CloseUIWindow(app->break_hud);
|
||||
app->break_hud = NULL;
|
||||
|
||||
if(app->settings_dirty || app->settings_save_delay_ticks > 0)
|
||||
save_settings(app);
|
||||
save_settings(app);
|
||||
habits_flush_save(app);
|
||||
|
||||
if(!IsUIInspectActive())
|
||||
|
||||
@@ -538,6 +538,7 @@ struct InbeApp {
|
||||
int desktop_close_action; /* INBE_CLOSE_* (desktop only) */
|
||||
char results_path[FS_PATH_MAX];
|
||||
int volume_popup_active;
|
||||
int music_volume_popup_active;
|
||||
InbeModal modal;
|
||||
int play_circle_hover;
|
||||
float play_circle_scale;
|
||||
|
||||
@@ -84,6 +84,9 @@
|
||||
X("break_daily_postpone") \
|
||||
X("break_daily_max_prompts") \
|
||||
X("break_daily_show_skip") \
|
||||
X("break_daily_show_postpone")
|
||||
X("break_daily_show_postpone") \
|
||||
X("break_daily_state_day") \
|
||||
X("break_daily_state_active") \
|
||||
X("break_daily_state_skipped")
|
||||
|
||||
#endif
|
||||
@@ -328,6 +328,11 @@ save_settings :: (app: InbeApp*) {
|
||||
break_timer_setting_key(t, "show_postpone", key, sizeof(key))
|
||||
save_setting_int(key, timer->show_postpone ? 1 : 0)
|
||||
}
|
||||
save_setting_int("break_daily_state_day", app->breaks.day_key)
|
||||
save_setting_int("break_daily_state_active",
|
||||
app->breaks.timers[BREAK_DAILY].active_s)
|
||||
save_setting_int("break_daily_state_skipped",
|
||||
app->breaks.timers[BREAK_DAILY].skipped_today ? 1 : 0)
|
||||
|
||||
storage_set_setting_text("language",
|
||||
(app->language_selected && app->language[0] != '\0') ? app->language : "")
|
||||
@@ -549,6 +554,14 @@ app_load_settings :: (app: InbeApp*) -> int {
|
||||
load_bool_setting(&settings_cache, &timer->show_postpone, key,
|
||||
timer->show_postpone)
|
||||
}
|
||||
load_clamped_setting(&settings_cache, &app->breaks.day_key,
|
||||
"break_daily_state_day", 0, 0, 999999999)
|
||||
load_clamped_setting(&settings_cache,
|
||||
&app->breaks.timers[BREAK_DAILY].active_s,
|
||||
"break_daily_state_active", 0, 0, 86400)
|
||||
load_bool_setting(&settings_cache,
|
||||
&app->breaks.timers[BREAK_DAILY].skipped_today,
|
||||
"break_daily_state_skipped", 0)
|
||||
#if ANDROID || WEB {
|
||||
app->on_screen_keyboard_enabled = 1
|
||||
}
|
||||
|
||||
@@ -362,6 +362,7 @@ int
|
||||
app_audio_import_custom_music_ex(InbeApp *app, const char *path, int *error_code)
|
||||
{
|
||||
int index;
|
||||
Music probe;
|
||||
|
||||
if(error_code)
|
||||
*error_code = AUDIO_IMPORT_ERROR_UNKNOWN;
|
||||
@@ -379,6 +380,19 @@ app_audio_import_custom_music_ex(InbeApp *app, const char *path, int *error_code
|
||||
app_audio_music_file_valid, error_code);
|
||||
if(index < 0)
|
||||
return 0;
|
||||
probe = LoadMusicStream(app->audio_custom_music[index].path);
|
||||
if(!IsMusicValid(probe)) {
|
||||
TraceLog(LOG_ERROR, "AUDIO: Imported music could not be decoded: %s",
|
||||
app->audio_custom_music[index].path);
|
||||
remove(app->audio_custom_music[index].path);
|
||||
memset(&app->audio_custom_music[index], 0,
|
||||
sizeof(app->audio_custom_music[index]));
|
||||
app->audio_custom_music_count = index;
|
||||
if(error_code)
|
||||
*error_code = AUDIO_IMPORT_ERROR_INVALID_FORMAT;
|
||||
return 0;
|
||||
}
|
||||
UnloadMusicStream(probe);
|
||||
app->meditation.music_track = INBE_AUDIO_BUILTIN_MUSIC_COUNT + index;
|
||||
app_audio_music_sanitize_selection(app);
|
||||
app_audio_library_save(app);
|
||||
|
||||
@@ -35,6 +35,13 @@ break_day_key :: () -> int #private {
|
||||
return key
|
||||
}
|
||||
|
||||
break_persist_daily_state :: (app: InbeApp*) #private {
|
||||
if app == nil {
|
||||
return
|
||||
}
|
||||
app->settings_dirty = 1
|
||||
}
|
||||
|
||||
break_fallback_input_seen :: () -> int #private {
|
||||
wheel := (int)(GetMouseWheelMove() * 1000.0f)
|
||||
if wheel != 0 {
|
||||
@@ -100,7 +107,14 @@ break_engine_open_window :: (app: InbeApp*, t: int) #private {
|
||||
# possibly hidden to tray - is left completely alone. Only the keyboard
|
||||
# block for strict block modes is applied on top.
|
||||
#if DESKTOP {
|
||||
if app->break_block_mode >= 1 {
|
||||
# Wayland intentionally does not permit a global keyboard grab, but
|
||||
# Kryon's SDL UIWindow backend can create a real secondary Wayland
|
||||
# surface for the break just like the X11 backend did.
|
||||
if inbe_activity_is_wayland() {
|
||||
ClearWindowState(FLAG_WINDOW_HIDDEN)
|
||||
RestoreWindow()
|
||||
SetWindowFocused()
|
||||
} else if app->break_block_mode >= 1 {
|
||||
inbe_break_set_input_blocked(1)
|
||||
}
|
||||
}
|
||||
@@ -117,7 +131,9 @@ break_engine_close_window :: (app: InbeApp*) #private {
|
||||
app->break_window = nil
|
||||
}
|
||||
#if DESKTOP {
|
||||
inbe_break_set_input_blocked(0)
|
||||
if !inbe_activity_is_wayland() {
|
||||
inbe_break_set_input_blocked(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,6 +372,7 @@ app_breaks_update :: (app: InbeApp*) {
|
||||
if break_engine_set_day(&app->breaks, day) {
|
||||
storage_break_flush_day(&app->breaks)
|
||||
break_engine_reset_day_stats(&app->breaks)
|
||||
break_persist_daily_state(app)
|
||||
app->break_stats_flush_s = 0
|
||||
}
|
||||
|
||||
@@ -367,6 +384,7 @@ app_breaks_update :: (app: InbeApp*) {
|
||||
if app->break_stats_flush_s >= BreakStatsFlushS {
|
||||
app->break_stats_flush_s = 0
|
||||
storage_break_flush_day(&app->breaks)
|
||||
break_persist_daily_state(app)
|
||||
}
|
||||
|
||||
for int i = 0; i < BreakEventQueueMax; i++ {
|
||||
@@ -384,11 +402,13 @@ app_breaks_update :: (app: InbeApp*) {
|
||||
break_play_cue(app, 1.0f)
|
||||
} else if event == BreakEventTaken || event == BreakEventNatural {
|
||||
break_engine_close_window(app)
|
||||
break_persist_daily_state(app)
|
||||
if t != BREAK_DAILY {
|
||||
break_play_cue(app, 1.2f)
|
||||
}
|
||||
} else if event == BreakEventSkipped || event == BreakEventPostponed {
|
||||
break_engine_close_window(app)
|
||||
break_persist_daily_state(app)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#define INBE_VERSION_MAJOR 1
|
||||
#define INBE_VERSION_MINOR 9
|
||||
#define INBE_VERSION_PATCH 2
|
||||
#define INBE_VERSION_STRING "1.9.2"
|
||||
#define INBE_VERSION_PATCH 3
|
||||
#define INBE_VERSION_STRING "1.9.3"
|
||||
|
||||
#endif
|
||||
@@ -44,6 +44,7 @@ static volatile struct {
|
||||
} current_insets = {0};
|
||||
static pthread_mutex_t insets_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static volatile int insets_initialized = 0;
|
||||
static int pending_practice_start = -1;
|
||||
|
||||
static void nativeSetInsets(JNIEnv *env, jobject thiz,
|
||||
jint status_bar, jint nav_bar,
|
||||
@@ -160,24 +161,71 @@ static jboolean nativeStartPractice(JNIEnv *env, jobject thiz, jint practice_id)
|
||||
if(app == NULL)
|
||||
return JNI_FALSE;
|
||||
|
||||
if(practice_id >= 0)
|
||||
app->exercise_type = practice_clamp_id(practice_id);
|
||||
if(app->modal.active)
|
||||
app_close_modal(app);
|
||||
{
|
||||
int active_break = break_engine_active_break(&app->breaks);
|
||||
const PracticeDefinition *practice;
|
||||
pthread_mutex_lock(&insets_mutex);
|
||||
pending_practice_start = practice_id >= 0
|
||||
? practice_clamp_id(practice_id)
|
||||
: practice_clamp_id(app->exercise_type);
|
||||
pthread_mutex_unlock(&insets_mutex);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
if(active_break >= 0) {
|
||||
app_breaks_start_practice(app, active_break, app->exercise_type);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
app->main_tab = APP_MAIN_TAB_PRACTICE;
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
practice = practice_get(app->exercise_type);
|
||||
if(practice != NULL && practice->start != NULL)
|
||||
practice->start(app);
|
||||
int android_take_pending_practice_start(void)
|
||||
{
|
||||
int practice_id;
|
||||
|
||||
pthread_mutex_lock(&insets_mutex);
|
||||
practice_id = pending_practice_start;
|
||||
pending_practice_start = -1;
|
||||
pthread_mutex_unlock(&insets_mutex);
|
||||
return practice_id;
|
||||
}
|
||||
|
||||
static jboolean
|
||||
nativeDebugImportMusicForPractice(JNIEnv *env, jobject thiz, jstring path,
|
||||
jint practice_id)
|
||||
{
|
||||
InbeApp *app = get_global_inbe_app();
|
||||
const char *native_path;
|
||||
int error_code = AUDIO_IMPORT_ERROR_UNKNOWN;
|
||||
int track;
|
||||
|
||||
(void)thiz;
|
||||
if(app == NULL || path == NULL)
|
||||
return JNI_FALSE;
|
||||
native_path = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if(native_path == NULL)
|
||||
return JNI_FALSE;
|
||||
app_audio_ensure_ready(app);
|
||||
if(!app_audio_import_custom_music_ex(app, native_path, &error_code)) {
|
||||
TraceLog(LOG_ERROR, "AUDIO_E2E: import failed error=%d path=%s",
|
||||
error_code, native_path);
|
||||
(*env)->ReleaseStringUTFChars(env, path, native_path);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
(*env)->ReleaseStringUTFChars(env, path, native_path);
|
||||
|
||||
practice_id = practice_clamp_id(practice_id);
|
||||
track = INBE_AUDIO_BUILTIN_MUSIC_COUNT + app->audio_custom_music_count - 1;
|
||||
app->meditation.music_practice_tracks[practice_id] = track;
|
||||
app->meditation.music_track = track;
|
||||
app_audio_music_sanitize_selection(app);
|
||||
app->sound_volume = 0;
|
||||
app->music_volume = 100;
|
||||
save_settings(app);
|
||||
TraceLog(LOG_INFO,
|
||||
"AUDIO_E2E: imported and selected track=%d practice=%d path=%s",
|
||||
track, (int)practice_id, app->audio_custom_music[track - INBE_AUDIO_BUILTIN_MUSIC_COUNT].path);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
static jboolean nativeDebugStartMusicDownload(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
InbeApp *app = get_global_inbe_app();
|
||||
(void)env;
|
||||
(void)thiz;
|
||||
if(app == NULL)
|
||||
return JNI_FALSE;
|
||||
meditation_music_start_download(app);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
@@ -201,6 +249,8 @@ static const JNINativeMethod g_methods[] = {
|
||||
{"nativeTextInputEnter", "()V", (void*)android_device_native_text_input_enter},
|
||||
{"nativeInvalidateGraphicsResources", "()V", (void*)nativeInvalidateGraphicsResources},
|
||||
{"nativeStartPractice", "(I)Z", (void*)nativeStartPractice},
|
||||
{"nativeDebugImportMusicForPractice", "(Ljava/lang/String;I)Z", (void*)nativeDebugImportMusicForPractice},
|
||||
{"nativeDebugStartMusicDownload", "()Z", (void*)nativeDebugStartMusicDownload},
|
||||
};
|
||||
|
||||
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
@@ -234,6 +284,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
void android_insets_init(void) {
|
||||
pthread_mutex_lock(&insets_mutex);
|
||||
memset((void *)¤t_insets, 0, sizeof(current_insets));
|
||||
pending_practice_start = -1;
|
||||
insets_initialized = 0;
|
||||
pthread_mutex_unlock(&insets_mutex);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ void android_insets_init(void);
|
||||
void android_insets_get(AndroidInsets *out);
|
||||
int android_insets_is_initialized(void);
|
||||
int android_get_system_top_reserved(void);
|
||||
int android_take_pending_practice_start(void);
|
||||
void android_wakelock_set_activity(JNIEnv *env, jobject activity);
|
||||
#else
|
||||
typedef struct {
|
||||
@@ -34,6 +35,7 @@ static inline int android_get_system_top_reserved(void) { return 0; }
|
||||
static inline void android_insets_init(void) {}
|
||||
static inline void android_insets_get(AndroidInsets *out) { if(out) memset(out, 0, sizeof(AndroidInsets)); }
|
||||
static inline int android_insets_is_initialized(void) { return 0; }
|
||||
static inline int android_take_pending_practice_start(void) { return -1; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(KRYON_NOTIFICATION_GDBUS)
|
||||
#include <gio/gio.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Minimal X declarations for the dlopen'd calls. Types mirror the X headers
|
||||
* (XID/Window are unsigned long everywhere we ship; Display is opaque).
|
||||
@@ -52,6 +57,93 @@ static int g_inited;
|
||||
static int g_available;
|
||||
static int g_blocked;
|
||||
|
||||
#if defined(KRYON_NOTIFICATION_GDBUS)
|
||||
enum {
|
||||
InbeWaylandIdleNone = 0,
|
||||
InbeWaylandIdleMutter,
|
||||
InbeWaylandIdleScreenSaver
|
||||
};
|
||||
static GDBusConnection *g_wayland_bus;
|
||||
static int g_wayland_idle_backend;
|
||||
|
||||
static long
|
||||
wayland_idle_call(const char *bus_name, const char *object_path,
|
||||
const char *interface_name, const char *method)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GVariant *reply;
|
||||
GVariant *value;
|
||||
guint64 idle = 0;
|
||||
|
||||
if(g_wayland_bus == NULL)
|
||||
return -1;
|
||||
reply = g_dbus_connection_call_sync(g_wayland_bus, bus_name, object_path,
|
||||
interface_name, method, NULL,
|
||||
NULL,
|
||||
G_DBUS_CALL_FLAGS_NONE, 500, NULL,
|
||||
&error);
|
||||
if(reply == NULL) {
|
||||
if(error != NULL)
|
||||
g_error_free(error);
|
||||
return -1;
|
||||
}
|
||||
if(g_variant_n_children(reply) != 1) {
|
||||
g_variant_unref(reply);
|
||||
return -1;
|
||||
}
|
||||
value = g_variant_get_child_value(reply, 0);
|
||||
if(g_variant_is_of_type(value, G_VARIANT_TYPE_UINT64))
|
||||
idle = g_variant_get_uint64(value);
|
||||
else if(g_variant_is_of_type(value, G_VARIANT_TYPE_UINT32))
|
||||
idle = g_variant_get_uint32(value);
|
||||
else {
|
||||
g_variant_unref(value);
|
||||
g_variant_unref(reply);
|
||||
return -1;
|
||||
}
|
||||
g_variant_unref(value);
|
||||
g_variant_unref(reply);
|
||||
return idle > LONG_MAX ? LONG_MAX : (long)idle;
|
||||
}
|
||||
|
||||
static void
|
||||
wayland_idle_init(void)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_wayland_bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
|
||||
if(g_wayland_bus == NULL) {
|
||||
if(error != NULL)
|
||||
g_error_free(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if(wayland_idle_call("org.gnome.Mutter.IdleMonitor",
|
||||
"/org/gnome/Mutter/IdleMonitor/Core",
|
||||
"org.gnome.Mutter.IdleMonitor", "GetIdletime") >= 0) {
|
||||
g_wayland_idle_backend = InbeWaylandIdleMutter;
|
||||
return;
|
||||
}
|
||||
if(wayland_idle_call("org.freedesktop.ScreenSaver", "/ScreenSaver",
|
||||
"org.freedesktop.ScreenSaver", "GetSessionIdleTime") >= 0) {
|
||||
g_wayland_idle_backend = InbeWaylandIdleScreenSaver;
|
||||
}
|
||||
}
|
||||
|
||||
static long
|
||||
wayland_idle_get_ms(void)
|
||||
{
|
||||
if(g_wayland_idle_backend == InbeWaylandIdleMutter)
|
||||
return wayland_idle_call("org.gnome.Mutter.IdleMonitor",
|
||||
"/org/gnome/Mutter/IdleMonitor/Core",
|
||||
"org.gnome.Mutter.IdleMonitor", "GetIdletime");
|
||||
if(g_wayland_idle_backend == InbeWaylandIdleScreenSaver)
|
||||
return wayland_idle_call("org.freedesktop.ScreenSaver", "/ScreenSaver",
|
||||
"org.freedesktop.ScreenSaver", "GetSessionIdleTime");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *
|
||||
resolve(void *handle, const char *name)
|
||||
{
|
||||
@@ -80,6 +172,7 @@ static int
|
||||
session_is_wayland(void)
|
||||
{
|
||||
const char *type = getenv("XDG_SESSION_TYPE");
|
||||
const char *wayland_display = getenv("WAYLAND_DISPLAY");
|
||||
|
||||
/*
|
||||
* XWayland's idle counter only sees input delivered to X clients, so a
|
||||
@@ -87,7 +180,14 @@ session_is_wayland(void)
|
||||
* the X counter on real X sessions (or when the session type is unset,
|
||||
* e.g. started from a tty).
|
||||
*/
|
||||
return type != NULL && strcmp(type, "wayland") == 0;
|
||||
return (type != NULL && strcmp(type, "wayland") == 0) ||
|
||||
(wayland_display != NULL && wayland_display[0] != '\0');
|
||||
}
|
||||
|
||||
int
|
||||
inbe_activity_is_wayland(void)
|
||||
{
|
||||
return session_is_wayland();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -101,8 +201,13 @@ inbe_activity_monitor_init(void)
|
||||
return;
|
||||
g_inited = 1;
|
||||
|
||||
if(session_is_wayland())
|
||||
if(session_is_wayland()) {
|
||||
#if defined(KRYON_NOTIFICATION_GDBUS)
|
||||
wayland_idle_init();
|
||||
g_available = g_wayland_idle_backend != InbeWaylandIdleNone;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
g_x11 = load_library(x11_names);
|
||||
g_xss = load_library(xss_names);
|
||||
@@ -149,6 +254,11 @@ inbe_activity_get_idle_ms(void)
|
||||
if(!inbe_activity_available())
|
||||
return -1;
|
||||
|
||||
#if defined(KRYON_NOTIFICATION_GDBUS)
|
||||
if(session_is_wayland())
|
||||
return wayland_idle_get_ms();
|
||||
#endif
|
||||
|
||||
info = g_ss_alloc();
|
||||
if(info == NULL)
|
||||
return -1;
|
||||
@@ -205,6 +315,12 @@ inbe_activity_monitor_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
inbe_activity_is_wayland(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
inbe_activity_available(void)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
/* Idempotent; also called lazily by the getters. Cheap when unsupported. */
|
||||
void inbe_activity_monitor_init(void);
|
||||
|
||||
/* 1 when this process runs in a native Wayland desktop session. This is
|
||||
* deliberately separate from availability: Wayland may gain a system idle
|
||||
* provider in the future, while X11-only auxiliary windows and input grabs
|
||||
* must remain disabled under Wayland regardless. */
|
||||
int inbe_activity_is_wayland(void);
|
||||
|
||||
/* 1 when system-wide idle detection works on this platform/session. */
|
||||
int inbe_activity_available(void);
|
||||
|
||||
|
||||
@@ -510,13 +510,13 @@ load_track :: (app: InbeApp*, track: int) -> int #private {
|
||||
|
||||
meditation_music_unload(app)
|
||||
if !app_audio_music_path(app, track, path, sizeof(path)) ||
|
||||
!audio_file_looks_valid(path) {
|
||||
!app_audio_music_file_valid(path) {
|
||||
set_status(app, "Track is not installed")
|
||||
return 0
|
||||
}
|
||||
|
||||
app->meditation.music = LoadMusicStream(path)
|
||||
if app->meditation.music.ctxData == nil {
|
||||
if !IsMusicValid(app->meditation.music) {
|
||||
TraceLog(LOG_ERROR, "AUDIO: Could not load meditation track: %s", path)
|
||||
set_status(app, "Could not load track")
|
||||
app->meditation.music_loaded = 0
|
||||
@@ -552,10 +552,6 @@ test_track :: (app: InbeApp*) #private {
|
||||
}
|
||||
|
||||
PlayMusicStream(app->meditation.music)
|
||||
if !IsMusicStreamPlaying(app->meditation.music) {
|
||||
TraceLog(LOG_ERROR,
|
||||
"AUDIO: PlayMusicStream returned but test music is not playing")
|
||||
}
|
||||
app->meditation.music_playing = 1
|
||||
app->meditation.music_test_playing = 1
|
||||
set_status(app, "Playing test audio")
|
||||
@@ -579,10 +575,6 @@ meditation_music_start_session :: (app: InbeApp*) {
|
||||
return
|
||||
}
|
||||
PlayMusicStream(app->meditation.music)
|
||||
if !IsMusicStreamPlaying(app->meditation.music) {
|
||||
TraceLog(LOG_ERROR,
|
||||
"AUDIO: PlayMusicStream returned but session music is not playing")
|
||||
}
|
||||
app->meditation.music_playing = 1
|
||||
app->meditation.music_test_playing = 0
|
||||
}
|
||||
@@ -618,6 +610,8 @@ meditation_music_update :: (app: InbeApp*) {
|
||||
if is_network_download_error(&app->meditation.music_download) {
|
||||
set_status(app, GetLocaleText("meditation_music_network_error_title"))
|
||||
if !app->meditation.music_network_error_notified && !app->modal.active {
|
||||
TraceLog(LOG_INFO,
|
||||
"AUDIO: Showing network error dialog with Cancel and Retry")
|
||||
app_open_modal(app, UIModalMeditationNetworkError)
|
||||
app->meditation.music_network_error_notified = 1
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ sound_icon_for_volume :: (app: InbeApp*) -> Texture2D #private {
|
||||
return app->icons[UI_ICON_TYPE_SOUND3]
|
||||
}
|
||||
|
||||
music_icon_for_volume :: (app: InbeApp*) -> Texture2D #private {
|
||||
return app->icons[UI_ICON_TYPE_MUSIC]
|
||||
}
|
||||
|
||||
start :: (app: InbeApp*, seconds: int) #private {
|
||||
if app == nil {
|
||||
return
|
||||
@@ -422,7 +426,7 @@ draw_sound_controls :: (app: InbeApp*) #private {
|
||||
|
||||
if IconSliderPopup((IconSliderPopupProps){
|
||||
.id = 501,
|
||||
.x = view_width - ScaleUIPx(76),
|
||||
.x = ScaleUIPx(8),
|
||||
.y = (title_h - (ScaleUIPx(18) + ScaleUIPx(5) * 2)) / 2,
|
||||
.icon_size = ScaleUIPx(18),
|
||||
.icon_padding = ScaleUIPx(5),
|
||||
@@ -437,6 +441,24 @@ draw_sound_controls :: (app: InbeApp*) #private {
|
||||
app->settings_dirty = 1
|
||||
save_settings(app)
|
||||
}
|
||||
|
||||
if IconSliderPopup((IconSliderPopupProps){
|
||||
.id = 503,
|
||||
.x = ScaleUIPx(48),
|
||||
.y = (title_h - (ScaleUIPx(18) + ScaleUIPx(5) * 2)) / 2,
|
||||
.icon_size = ScaleUIPx(18),
|
||||
.icon_padding = ScaleUIPx(5),
|
||||
.icon = music_icon_for_volume(app),
|
||||
.open = &app->music_volume_popup_active,
|
||||
.value = &app->music_volume,
|
||||
.min = SETTINGS_VOLUME_MIN,
|
||||
.max = SETTINGS_VOLUME_MAX,
|
||||
.popup_width = ScaleUIPx(40),
|
||||
.popup_height = ScaleUIPx(176)
|
||||
}) {
|
||||
app->settings_dirty = 1
|
||||
save_settings(app)
|
||||
}
|
||||
}
|
||||
|
||||
draw_extend_controls :: (app: InbeApp*, center_x: int, y: int) #private {
|
||||
|
||||
@@ -40,10 +40,10 @@ text_color_for_background :: (background: Color) -> Color #private {
|
||||
}
|
||||
|
||||
set_circle_bounds :: (inbe: Inbe*, rmin: int, rmax: int) #private {
|
||||
int old_rmin
|
||||
int old_rmax
|
||||
int old_span
|
||||
int new_span
|
||||
old_rmin: int
|
||||
old_rmax: int
|
||||
old_span: int
|
||||
new_span: int
|
||||
|
||||
if inbe == nil {
|
||||
return
|
||||
@@ -89,8 +89,8 @@ set_circle_bounds :: (inbe: Inbe*, rmin: int, rmax: int) #private {
|
||||
session_update_circle_bounds_for_view :: (inbe: Inbe*, top_reserve: int, bottom_reserve: int) {
|
||||
available_w: int = view_width - CIRCLE_SIDE_PAD * 2
|
||||
available_h: int = view_height - top_reserve - bottom_reserve - CIRCLE_SIDE_PAD * 2
|
||||
int rmax
|
||||
int rmin
|
||||
rmax: int
|
||||
rmin: int
|
||||
|
||||
if available_w < 0 {
|
||||
available_w = 0
|
||||
@@ -119,8 +119,8 @@ session_update_circle_bounds_for_view :: (inbe: Inbe*, top_reserve: int, bottom_
|
||||
|
||||
update_preview_bounds :: (inbe: Inbe*, content_w: int, content_h: int) {
|
||||
span: int = content_w
|
||||
int rmax
|
||||
int rmin
|
||||
rmax: int
|
||||
rmin: int
|
||||
|
||||
if content_h > 0 && content_h < span {
|
||||
span = content_h
|
||||
@@ -205,7 +205,7 @@ update_retention_marker :: (app: InbeApp*, phase_changed: int) #private {
|
||||
#if ANDROID {
|
||||
session_update_notification :: (app: InbeApp*) #private {
|
||||
text: [96] char = ""
|
||||
int count
|
||||
count: int
|
||||
|
||||
if app == nil {
|
||||
return
|
||||
@@ -300,8 +300,8 @@ session_background_start :: (app: InbeApp*) {
|
||||
}
|
||||
|
||||
session_advance_elapsed :: (app: InbeApp*, elapsed_ms: int) {
|
||||
int elapsed_total
|
||||
int frame_count
|
||||
elapsed_total: int
|
||||
frame_count: int
|
||||
|
||||
if app == nil || elapsed_ms <= 0 {
|
||||
return
|
||||
@@ -366,7 +366,7 @@ session_start :: (app: InbeApp*) {
|
||||
}
|
||||
|
||||
collect_result_rounds :: (app: InbeApp*, round_times: int*, max_rounds: int) -> int #private {
|
||||
int rounds
|
||||
rounds: int
|
||||
count: int = 0
|
||||
|
||||
if app == nil || round_times == nil || max_rounds <= 0 {
|
||||
@@ -395,8 +395,8 @@ collect_result_rounds :: (app: InbeApp*, round_times: int*, max_rounds: int) ->
|
||||
}
|
||||
|
||||
session_ensure_results_saved :: (app: InbeApp*) -> int {
|
||||
int round_times[MaxRounds]
|
||||
int rounds
|
||||
round_times: [MaxRounds] int
|
||||
rounds: int
|
||||
|
||||
if app == nil {
|
||||
return 0
|
||||
@@ -439,7 +439,7 @@ session_discard_saved_results :: (app: InbeApp*) {
|
||||
}
|
||||
|
||||
session_has_completed_rounds :: (app: InbeApp*) -> int {
|
||||
int round_times[MaxRounds]
|
||||
round_times: [MaxRounds] int
|
||||
return collect_result_rounds(app, round_times, MaxRounds) > 0
|
||||
}
|
||||
|
||||
@@ -616,14 +616,14 @@ session_step_forward :: (app: InbeApp*) #private {
|
||||
}
|
||||
|
||||
draw_session_counter :: (app: InbeApp*, center_x: int, center_y: int) #private {
|
||||
char text[CountSize]
|
||||
int count
|
||||
text: [CountSize] char
|
||||
count: int
|
||||
font: int = UI_TEXT_24
|
||||
text_color: Color = text_color_for_background(GetThemeCircle())
|
||||
|
||||
if app->inbe.phase == InbePhaseStarting {
|
||||
total_seconds: int = inbe_effective_pause_seconds(&app->inbe)
|
||||
int remaining
|
||||
remaining: int
|
||||
|
||||
if total_seconds <= 0 {
|
||||
remaining = 0
|
||||
@@ -743,17 +743,17 @@ draw_session_progress_circle :: (app: InbeApp*, center_x: int, center_y: int, ra
|
||||
countdown: int = 0
|
||||
progress: float = 0.0f
|
||||
gap: int = ScaleUIPx(5)
|
||||
int band_width
|
||||
int thickness
|
||||
float inner_radius
|
||||
float outer_radius
|
||||
band_width: int
|
||||
thickness: int
|
||||
inner_radius: float
|
||||
outer_radius: float
|
||||
circle: Color = GetThemeCircle()
|
||||
contrast: Color = text_color_for_background(circle)
|
||||
Color band_bg
|
||||
Color band_fill
|
||||
Color tick_done
|
||||
Color tick_pending
|
||||
Color ring
|
||||
band_bg: Color
|
||||
band_fill: Color
|
||||
tick_done: Color
|
||||
tick_pending: Color
|
||||
ring: Color
|
||||
|
||||
if app == nil {
|
||||
return
|
||||
@@ -855,8 +855,8 @@ session_draw_start_preview :: (app: InbeApp*, center_x: int, center_y: int) -> i
|
||||
practice_text: const char* = practice_label(app->exercise_type)
|
||||
font: int = UI_TEXT_16
|
||||
practice_font: int = GetUIFontSize()
|
||||
int practice_w
|
||||
int practice_y
|
||||
practice_w: int
|
||||
practice_y: int
|
||||
scale: float = 1.0f
|
||||
|
||||
radius: int = ScaleUIPx(44)
|
||||
@@ -941,7 +941,7 @@ session_draw_round_title_bar :: (app: InbeApp*, title: const char*, height: int)
|
||||
side_reserved: int = view_width - close_x + ScaleUIPx(8)
|
||||
font: int = UI_TEXT_24
|
||||
max_w: int = view_width - side_reserved * 2
|
||||
int title_w
|
||||
title_w: int
|
||||
|
||||
if title == nil {
|
||||
title = ""
|
||||
@@ -990,6 +990,10 @@ sound_icon_for_volume :: (app: InbeApp*) -> Texture2D #private {
|
||||
return app->icons[UI_ICON_TYPE_SOUND3]
|
||||
}
|
||||
|
||||
music_icon_for_volume :: (app: InbeApp*) -> Texture2D #private {
|
||||
return app->icons[UI_ICON_TYPE_MUSIC]
|
||||
}
|
||||
|
||||
stop_android_background_session :: (app: InbeApp*) #private {
|
||||
meditation_music_stop(app)
|
||||
practice_active_background_stop(app)
|
||||
@@ -1008,7 +1012,7 @@ session_request_exit :: (app: InbeApp*) #private {
|
||||
}
|
||||
|
||||
session_handle_exit_modal :: (app: InbeApp*) -> int #private {
|
||||
SessionExitModalResult result
|
||||
result: SessionExitModalResult
|
||||
|
||||
if app == nil || !app->modal.active ||
|
||||
app->modal.type != UIModalConfirmExitSession {
|
||||
@@ -1035,7 +1039,7 @@ session_handle_exit_modal :: (app: InbeApp*) -> int #private {
|
||||
session_update_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: int*) {
|
||||
breath_max_y: int = view_height - ScaleUIPx(44)
|
||||
title_h: int = UIGetNodeHeight(UINodeTitleBar(0))
|
||||
char title[32]
|
||||
title: [32] char
|
||||
|
||||
session_round_label(app, title, sizeof(title))
|
||||
if session_draw_round_title_bar(app, title, title_h) {
|
||||
@@ -1049,7 +1053,7 @@ session_update_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: in
|
||||
|
||||
if IconSliderPopup((IconSliderPopupProps){
|
||||
.id = 500,
|
||||
.x = view_width - ScaleUIPx(76),
|
||||
.x = ScaleUIPx(8),
|
||||
.y = (title_h - (ScaleUIPx(18) + ScaleUIPx(5) * 2)) / 2,
|
||||
.icon_size = ScaleUIPx(18),
|
||||
.icon_padding = ScaleUIPx(5),
|
||||
@@ -1066,6 +1070,24 @@ session_update_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: in
|
||||
save_settings(app)
|
||||
}
|
||||
|
||||
if IconSliderPopup((IconSliderPopupProps){
|
||||
.id = 502,
|
||||
.x = ScaleUIPx(48),
|
||||
.y = (title_h - (ScaleUIPx(18) + ScaleUIPx(5) * 2)) / 2,
|
||||
.icon_size = ScaleUIPx(18),
|
||||
.icon_padding = ScaleUIPx(5),
|
||||
.icon = music_icon_for_volume(app),
|
||||
.open = &app->music_volume_popup_active,
|
||||
.value = &app->music_volume,
|
||||
.min = SETTINGS_VOLUME_MIN,
|
||||
.max = SETTINGS_VOLUME_MAX,
|
||||
.popup_width = ScaleUIPx(40),
|
||||
.popup_height = ScaleUIPx(176)
|
||||
}) {
|
||||
app->settings_dirty = 1
|
||||
save_settings(app)
|
||||
}
|
||||
|
||||
if app->advanced_session_controls {
|
||||
min_view_dim: int = view_width < view_height ? view_width : view_height
|
||||
controls: [3] UIIconRowItem = {
|
||||
@@ -1138,7 +1160,7 @@ session_update_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: in
|
||||
breath_w: int = MeasureUIText(breath_label, breath_font) + ScaleUIPx(72)
|
||||
breath_h: int = GetUITextLineHeight(breath_font) + ScaleUIPx(28)
|
||||
breath_y: int = center_y + app->inbe.rmax - ScaleUIPx(42)
|
||||
int breath_x
|
||||
breath_x: int
|
||||
breath_hover: int = 0
|
||||
|
||||
if app->double_tap_to_breathe {
|
||||
@@ -1187,20 +1209,20 @@ session_update_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: in
|
||||
}
|
||||
|
||||
session_draw_results_screen :: (app: InbeApp*, center_x: int, center_y: int, hover: int*) {
|
||||
int box_x
|
||||
box_x: int
|
||||
box_y: int = ScaleUIPx(78)
|
||||
int box_w
|
||||
box_w: int
|
||||
row_y: int = ScaleUIPx(215)
|
||||
row_h: int = ScaleUIPx(32)
|
||||
total: int = 0
|
||||
best: int = -1
|
||||
int round_times[MaxRounds]
|
||||
round_times: [MaxRounds] int
|
||||
rounds: int = collect_result_rounds(app, round_times, MaxRounds)
|
||||
discard_hover: int = 0
|
||||
save_hover: int = 0
|
||||
action_y: int = view_height - ScaleUIPx(40)
|
||||
int title_font
|
||||
int title_w
|
||||
title_font: int
|
||||
title_w: int
|
||||
|
||||
unused center_y
|
||||
|
||||
@@ -1232,8 +1254,8 @@ session_draw_results_screen :: (app: InbeApp*, center_x: int, center_y: int, hov
|
||||
}
|
||||
|
||||
{
|
||||
char lines[3][64]
|
||||
UIInfoRow rows[3]
|
||||
lines: [3][64] char
|
||||
rows: [3] UIInfoRow
|
||||
summary_font: int = UI_TEXT_16
|
||||
|
||||
FormatLocaleText(lines[0], sizeof(lines[0]), "results_rounds", rounds)
|
||||
@@ -1264,8 +1286,8 @@ session_draw_results_screen :: (app: InbeApp*, center_x: int, center_y: int, hov
|
||||
(float)box_w, (float)ScaleUIPx(28)},
|
||||
GetUIFontSize(), DarkenUIColor(GetThemeText(), 20))
|
||||
for int i = 0; i < rounds; i++ {
|
||||
char row[48]
|
||||
UIInfoRow info_row
|
||||
row: [48] char
|
||||
info_row: UIInfoRow
|
||||
row_font: int = GetUIFontSize()
|
||||
FormatLocaleText(row, sizeof(row), "round_result_label", i + 1, round_times[i])
|
||||
info_row = (UIInfoRow){row, row_font, GetThemeText()}
|
||||
|
||||
@@ -53,11 +53,13 @@ static audio_preview_sound: Sound = {0}
|
||||
static audio_preview_music: Music = {0}
|
||||
static audio_preview_music_loaded: int = 0
|
||||
static audio_status_action: int = SETTINGS_AUDIO_ACTION_NONE
|
||||
static audio_status_practice: int = -1
|
||||
static audio_status_type: int = 0
|
||||
static audio_status: [256] char = ""
|
||||
|
||||
#if ANDROID || WEB {
|
||||
static audio_import_action: int = SETTINGS_AUDIO_ACTION_NONE
|
||||
static audio_import_practice: int = -1
|
||||
static audio_dialog_origin: SettingsAudioDialogOrigin = {0}
|
||||
}
|
||||
|
||||
@@ -115,12 +117,13 @@ settings_audio_file_dialog_available :: () -> int #private {
|
||||
}
|
||||
}
|
||||
|
||||
settings_audio_dialog_begin :: (app: InbeApp*, action: int) #private {
|
||||
settings_audio_dialog_begin :: (app: InbeApp*, action: int, practice: int) #private {
|
||||
#if ANDROID || WEB {
|
||||
if app == nil {
|
||||
return
|
||||
}
|
||||
audio_import_action = action
|
||||
audio_import_practice = practice
|
||||
app->file_dialog_active = 1
|
||||
audio_dialog_origin.active = 1
|
||||
audio_dialog_origin.screen = app->inbe.screen
|
||||
@@ -143,6 +146,7 @@ settings_audio_dialog_finish :: (app: InbeApp*) -> int #private {
|
||||
}
|
||||
audio_dialog_origin.active = 0
|
||||
audio_import_action = SETTINGS_AUDIO_ACTION_NONE
|
||||
audio_import_practice = -1
|
||||
if app != nil {
|
||||
app->file_dialog_active = 0
|
||||
}
|
||||
@@ -383,10 +387,30 @@ audio_import_path :: (app: InbeApp*, action: int, path: const char*) -> int #pri
|
||||
return 0
|
||||
}
|
||||
|
||||
settings_audio_start_import :: (app: InbeApp*, action: int) #private {
|
||||
settings_audio_select_imported_music :: (app: InbeApp*, action: int,
|
||||
practice: int) #private {
|
||||
if app == nil || action != SETTINGS_AUDIO_ACTION_MUSIC ||
|
||||
practice < 0 || practice >= practice_count() ||
|
||||
app->audio_custom_music_count <= 0 {
|
||||
return
|
||||
}
|
||||
track := INBE_AUDIO_BUILTIN_MUSIC_COUNT + app->audio_custom_music_count - 1
|
||||
app->meditation.music_practice_tracks[practice] = track
|
||||
app->meditation.music_track = track
|
||||
app_audio_music_sanitize_selection(app)
|
||||
save_settings(app)
|
||||
settings_audio_set_status_success(action,
|
||||
GetLocaleText("audio_imported_and_selected"))
|
||||
TraceLog(LOG_INFO,
|
||||
"AUDIO: Imported custom music and selected track %d for practice %d",
|
||||
track, practice)
|
||||
}
|
||||
|
||||
settings_audio_start_import :: (app: InbeApp*, action: int, practice: int) #private {
|
||||
settings_audio_stop_preview(app)
|
||||
audio_status_practice = practice
|
||||
#if ANDROID {
|
||||
settings_audio_dialog_begin(app, action)
|
||||
settings_audio_dialog_begin(app, action, practice)
|
||||
if android_import_open_picker_for(audio_android_kind(action),
|
||||
android_audio_mime_types) {
|
||||
settings_audio_set_status_success(action, GetLocaleText("audio_import_title"))
|
||||
@@ -400,7 +424,7 @@ settings_audio_start_import :: (app: InbeApp*, action: int) #private {
|
||||
}
|
||||
InitFileDialog(&audio_web_dialog)
|
||||
audio_web_dialog_ready = 1
|
||||
settings_audio_dialog_begin(app, action)
|
||||
settings_audio_dialog_begin(app, action, practice)
|
||||
BeginLoadFilteredFileDialog(&audio_web_dialog,
|
||||
GetLocaleText("audio_import_title"),
|
||||
settings_audio_import_filter(action))
|
||||
@@ -413,7 +437,9 @@ settings_audio_start_import :: (app: InbeApp*, action: int) #private {
|
||||
}
|
||||
InitFileDialog(&dlg)
|
||||
if LoadFileDialog(&dlg, GetLocaleText("audio_import_title")) {
|
||||
audio_import_path(app, action, GetFileDialogPath(&dlg))
|
||||
if audio_import_path(app, action, GetFileDialogPath(&dlg)) {
|
||||
settings_audio_select_imported_music(app, action, practice)
|
||||
}
|
||||
} else {
|
||||
settings_audio_set_status_error(action, GetLocaleText("audio_import_cancelled"))
|
||||
}
|
||||
@@ -421,6 +447,7 @@ settings_audio_start_import :: (app: InbeApp*, action: int) #private {
|
||||
} #else {
|
||||
unused app
|
||||
unused action
|
||||
unused practice
|
||||
settings_audio_set_status_error(action, GetLocaleText("audio_import_failed"))
|
||||
}
|
||||
}
|
||||
@@ -430,6 +457,7 @@ settings_audio_handle_import :: (app: InbeApp*) {
|
||||
path: [FS_PATH_MAX] char = {0}
|
||||
result: int
|
||||
action := audio_import_action
|
||||
practice := audio_import_practice
|
||||
|
||||
if action == SETTINGS_AUDIO_ACTION_NONE {
|
||||
return
|
||||
@@ -444,11 +472,14 @@ settings_audio_handle_import :: (app: InbeApp*) {
|
||||
settings_audio_set_status_error(action, GetLocaleText("audio_import_cancelled"))
|
||||
return
|
||||
}
|
||||
audio_import_path(app, action, path)
|
||||
if audio_import_path(app, action, path) {
|
||||
settings_audio_select_imported_music(app, action, practice)
|
||||
}
|
||||
} #else_if WEB {
|
||||
result: int
|
||||
path: const char*
|
||||
action: int
|
||||
practice := audio_import_practice
|
||||
|
||||
if !audio_web_dialog_ready || !audio_web_dialog.active {
|
||||
return
|
||||
@@ -462,7 +493,9 @@ settings_audio_handle_import :: (app: InbeApp*) {
|
||||
if result == 0 {
|
||||
settings_audio_set_status_error(action, GetLocaleText("audio_import_cancelled"))
|
||||
} else {
|
||||
audio_import_path(app, action, path)
|
||||
if audio_import_path(app, action, path) {
|
||||
settings_audio_select_imported_music(app, action, practice)
|
||||
}
|
||||
}
|
||||
CloseFileDialog(&audio_web_dialog)
|
||||
audio_web_dialog_ready = 0
|
||||
@@ -592,8 +625,8 @@ settings_audio_content_height :: (app: InbeApp*, content_w: int) -> int {
|
||||
}
|
||||
}
|
||||
}
|
||||
height += practice_total_h
|
||||
height += settings_audio_import_button_height(SETTINGS_AUDIO_ACTION_MUSIC)
|
||||
height += practice_total_h +
|
||||
practice_n * settings_audio_import_button_height(SETTINGS_AUDIO_ACTION_MUSIC)
|
||||
|
||||
if custom_music_count > 0 {
|
||||
height += ScaleUIPx(30) + ScaleUIPx(42) * custom_music_count
|
||||
@@ -603,14 +636,17 @@ settings_audio_content_height :: (app: InbeApp*, content_w: int) -> int {
|
||||
return height
|
||||
}
|
||||
|
||||
draw_import_button :: (app: InbeApp*, x: int, w: int, y: int*, label: const char*, action: int) #private {
|
||||
draw_import_button :: (app: InbeApp*, x: int, w: int, y: int*, label: const char*, action: int, practice: int) #private {
|
||||
hover := 0
|
||||
if GenericButton(880 + action, x, *y, w, ScaleUIPx(36), label,
|
||||
button_id := 880 + action + (practice >= 0 ? (practice + 1) * 16 : 0)
|
||||
if GenericButton(button_id, x, *y, w, ScaleUIPx(36), label,
|
||||
UI_BUTTON_STYLE_SECONDARY, 0, &hover) {
|
||||
settings_audio_start_import(app, action)
|
||||
settings_audio_start_import(app, action, practice)
|
||||
}
|
||||
*y += ScaleUIPx(42)
|
||||
settings_audio_draw_status(x, y, action)
|
||||
if action != SETTINGS_AUDIO_ACTION_MUSIC || practice == audio_status_practice {
|
||||
settings_audio_draw_status(x, y, action)
|
||||
}
|
||||
*y += ScaleUIPx(6)
|
||||
}
|
||||
|
||||
@@ -653,7 +689,7 @@ draw_cue_selector :: (app: InbeApp*, x: int, w: int, y: int*, cue: int,
|
||||
}
|
||||
*y += ScaleUIPx(76)
|
||||
draw_import_button(app, x, w, y, GetLocaleText("audio_import_sound_button"),
|
||||
action)
|
||||
action, -1)
|
||||
}
|
||||
|
||||
draw_custom_sound_list :: (app: InbeApp*, x: int, w: int, y: int*) #private {
|
||||
@@ -766,11 +802,11 @@ draw_music_list :: (app: InbeApp*, x: int, w: int, y: int*) #private {
|
||||
*y += ScaleUIPx(48)
|
||||
draw_music_attribution(x, w, app->meditation.music_practice_tracks[p], y)
|
||||
*y += ScaleUIPx(6)
|
||||
draw_import_button(app, x, w, y,
|
||||
GetLocaleText("audio_import_music_for_practice_button"),
|
||||
SETTINGS_AUDIO_ACTION_MUSIC, p)
|
||||
}
|
||||
|
||||
draw_import_button(app, x, w, y, GetLocaleText("audio_import_music_button"),
|
||||
SETTINGS_AUDIO_ACTION_MUSIC)
|
||||
|
||||
if app->audio_custom_music_count <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Android audio test fixture
|
||||
|
||||
`autumn-sunset.mp3` is used only by the automated Android audio end-to-end
|
||||
test. It is stored with Git LFS so CI runs do not depend on a third-party
|
||||
download remaining available.
|
||||
|
||||
- Title: Autumn Sunset
|
||||
- Author: Jason Shaw (Audionautix)
|
||||
- Source: https://commons.wikimedia.org/wiki/File:Audionautix-com-ccby-autumnsunset.mp3
|
||||
- License: Creative Commons Attribution 3.0 Unported
|
||||
- Attribution: Music by Audionautix.com
|
||||
- Format: MP3, stereo, 44.1 kHz, 128 kbps
|
||||
- SHA-256: `d1f25feccd8af5cfe22ca1ed6afa901a5f97cbf976b93fc46096a2bd83315034`
|
||||
|
||||
The fixture must not be packaged in application releases.
|
||||
Binary file not shown.
@@ -37,8 +37,9 @@ test_idle_matches_availability(void)
|
||||
int available = inbe_activity_available();
|
||||
long idle = inbe_activity_get_idle_ms();
|
||||
|
||||
printf("activity monitor: %s\n",
|
||||
available ? "system-wide (X idle counter)" : "unavailable");
|
||||
printf("activity monitor: %s%s\n",
|
||||
available ? "system-wide (X idle counter)" : "unavailable",
|
||||
inbe_activity_is_wayland() ? " (Wayland session)" : "");
|
||||
|
||||
if(available) {
|
||||
expect(idle >= 0, "available monitor reports a non-negative idle");
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/kryon updated: ffd53ee65a...ed5925418b.
Binary file not shown.
+4
-4
@@ -3,8 +3,8 @@
|
||||
IDI_APP_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,9,2,0
|
||||
PRODUCTVERSION 1,9,2,0
|
||||
FILEVERSION 1,9,3,0
|
||||
PRODUCTVERSION 1,9,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -21,11 +21,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "1.9.2"
|
||||
VALUE "FileVersion", "1.9.3"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "1.9.2"
|
||||
VALUE "ProductVersion", "1.9.3"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Reference in new issue
Block a user