From fb212a8d2f2dabf8be36754f48861be9281165a0 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 16 May 2020 22:57:17 -0700 Subject: [PATCH 1/9] Try supporting back to version 26. --- colorchord2/android/AndroidManifest.xml | 7 +++++-- colorchord2/android/Makefile | 2 +- colorchord2/android/rawdrawandroid | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/colorchord2/android/AndroidManifest.xml b/colorchord2/android/AndroidManifest.xml index 27265e1..8d08c57 100644 --- a/colorchord2/android/AndroidManifest.xml +++ b/colorchord2/android/AndroidManifest.xml @@ -1,12 +1,15 @@ + android:versionCode="6"> + + - + diff --git a/colorchord2/android/Makefile b/colorchord2/android/Makefile index 883f7e4..891bb38 100644 --- a/colorchord2/android/Makefile +++ b/colorchord2/android/Makefile @@ -7,7 +7,7 @@ CFLAGS:=-I. -I.. -Irawdrawandroid/rawdraw -I../cnfa -I../../embeddedcommon \ -ffunction-sections -Os -s -DPRINTF_NO_OVERRIDDE -fvisibility=hidden \ -DRDALOGFNCB=example_log_function -#ANDROIDVERSION=24 +ANDROIDVERSION=28 LDFLAGS:=-s -lOpenSLES diff --git a/colorchord2/android/rawdrawandroid b/colorchord2/android/rawdrawandroid index c9700f4..d2e62b7 160000 --- a/colorchord2/android/rawdrawandroid +++ b/colorchord2/android/rawdrawandroid @@ -1 +1 @@ -Subproject commit c9700f455e17ff3db9bb509c3f4cb54edfff81b0 +Subproject commit d2e62b7ff7dcb317f7a298ea788bdbac4c7b81a1 From 13ab20b1fcf35390b5c19557b640565011a8495f Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 17 May 2020 03:06:42 -0700 Subject: [PATCH 2/9] bump submodule --- colorchord2/android/rawdrawandroid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorchord2/android/rawdrawandroid b/colorchord2/android/rawdrawandroid index d2e62b7..64548dc 160000 --- a/colorchord2/android/rawdrawandroid +++ b/colorchord2/android/rawdrawandroid @@ -1 +1 @@ -Subproject commit d2e62b7ff7dcb317f7a298ea788bdbac4c7b81a1 +Subproject commit 64548dce184f2888a582cf194116c98cb7d3a964 From 4dfeb870b77d83f31ac8c87d91756b66e8e5eaa2 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 17 May 2020 05:11:32 -0700 Subject: [PATCH 3/9] Allow ColorChord to run down to Android 5.1 (SDK 22) --- colorchord2/android/AndroidManifest.xml | 4 ++-- colorchord2/android/Makefile | 3 ++- colorchord2/android/rawdrawandroid | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/colorchord2/android/AndroidManifest.xml b/colorchord2/android/AndroidManifest.xml index 8d08c57..4acec47 100644 --- a/colorchord2/android/AndroidManifest.xml +++ b/colorchord2/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="8"> - diff --git a/colorchord2/android/Makefile b/colorchord2/android/Makefile index 891bb38..b9c3df1 100644 --- a/colorchord2/android/Makefile +++ b/colorchord2/android/Makefile @@ -7,7 +7,8 @@ CFLAGS:=-I. -I.. -Irawdrawandroid/rawdraw -I../cnfa -I../../embeddedcommon \ -ffunction-sections -Os -s -DPRINTF_NO_OVERRIDDE -fvisibility=hidden \ -DRDALOGFNCB=example_log_function -ANDROIDVERSION=28 +ANDROIDVERSION=22 +ANDROIDTARGET=28 LDFLAGS:=-s -lOpenSLES diff --git a/colorchord2/android/rawdrawandroid b/colorchord2/android/rawdrawandroid index 64548dc..aa42f6f 160000 --- a/colorchord2/android/rawdrawandroid +++ b/colorchord2/android/rawdrawandroid @@ -1 +1 @@ -Subproject commit 64548dce184f2888a582cf194116c98cb7d3a964 +Subproject commit aa42f6fcb13e6b3616f671d3164e979cbbf63219 From 9c85dd87f2ec705e4439812fc3dfa76054e08711 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 17 May 2020 05:41:13 -0700 Subject: [PATCH 4/9] TAG FOR RELEASE 8 Fix name of config file. --- .../android/{colorchord-android.conf => colorchord-android.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename colorchord2/android/{colorchord-android.conf => colorchord-android.txt} (100%) diff --git a/colorchord2/android/colorchord-android.conf b/colorchord2/android/colorchord-android.txt similarity index 100% rename from colorchord2/android/colorchord-android.conf rename to colorchord2/android/colorchord-android.txt From df06ca12d724244d924040ef1d640a67cf68c261 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 18 May 2020 14:05:24 -0700 Subject: [PATCH 5/9] Bump to new CNFA subsystem --- colorchord2/cnfa | 2 +- colorchord2/main.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/colorchord2/cnfa b/colorchord2/cnfa index 6c9dd09..8fed9b6 160000 --- a/colorchord2/cnfa +++ b/colorchord2/cnfa @@ -1 +1 @@ -Subproject commit 6c9dd0901ba034577dea72f86756f3ac2f748862 +Subproject commit 8fed9b680a217afabd0d9ce4b459499d370a0719 diff --git a/colorchord2/main.c b/colorchord2/main.c index b80d5e9..a5ed20d 100644 --- a/colorchord2/main.c +++ b/colorchord2/main.c @@ -227,7 +227,7 @@ void HandleMotion( int x, int y, int mask ) { } -void SoundCB( struct CNFADriver * sd, short * in, short * out, int samplesr, int samplesp ) +void SoundCB( struct CNFADriver * sd, short * in, short * out, int framesr, int framesp ) { int channelin = sd->channelsRec; int channelout = sd->channelsPlay; @@ -241,7 +241,7 @@ void SoundCB( struct CNFADriver * sd, short * in, short * out, int samplesr, int if( in ) { - for( i = 0; i < samplesr; i++ ) + for( i = 0; i < framesr; i++ ) { if( sample_channel < 0 ) { @@ -280,17 +280,17 @@ void SoundCB( struct CNFADriver * sd, short * in, short * out, int samplesr, int } } - SoundEventHappened( samplesr, in, 0, channelin ); + SoundEventHappened( framesr, in, 0, channelin ); } if( out ) { - for( j = 0; j < samplesp * channelout; j++ ) + for( j = 0; j < framesp * channelout; j++ ) { out[j] = 0; } - SoundEventHappened( samplesp, out, 1, channelout ); + SoundEventHappened( framesp, out, 1, channelout ); } @@ -407,7 +407,7 @@ int main(int argc, char ** argv) //Initialize Sound sd = CNFAInit( sound_source, "colorchord", &SoundCB, GetParameterI( "samplerate", 44100 ), GetParameterI( "channels", 2 ), GetParameterI( "channels", 2 ), GetParameterI( "buffer", 1024 ), - GetParameterS( "devrecord", 0 ), GetParameterS( "devplay", 0 ) ); + GetParameterS( "devrecord", 0 ), GetParameterS( "devplay", 0 ), 0 ); if( sd ) break; From 911f60ae560b9eca668efdde265ed99ae704f3ee Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 18 May 2020 15:25:20 -0700 Subject: [PATCH 6/9] Update submodules --- colorchord2/android/rawdrawandroid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorchord2/android/rawdrawandroid b/colorchord2/android/rawdrawandroid index aa42f6f..77d3e69 160000 --- a/colorchord2/android/rawdrawandroid +++ b/colorchord2/android/rawdrawandroid @@ -1 +1 @@ -Subproject commit aa42f6fcb13e6b3616f671d3164e979cbbf63219 +Subproject commit 77d3e699fa304462af1a39414deeaac9c24f4131 From 9d11a76f69eaa463155762b9c1b541c530745635 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 18 May 2020 15:29:35 -0700 Subject: [PATCH 7/9] Switch search paths + update CNFA --- colorchord2/cnfa | 2 +- colorchord2/configs.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/colorchord2/cnfa b/colorchord2/cnfa index 8fed9b6..f34087c 160000 --- a/colorchord2/cnfa +++ b/colorchord2/cnfa @@ -1 +1 @@ -Subproject commit 8fed9b680a217afabd0d9ce4b459499d370a0719 +Subproject commit f34087cf216cfa8a885fde616659fef3e862c048 diff --git a/colorchord2/configs.c b/colorchord2/configs.c index dadb57f..419e6b7 100644 --- a/colorchord2/configs.c +++ b/colorchord2/configs.c @@ -48,16 +48,19 @@ void LoadFile( const char * filename ) void SetEnvValues( int force ) { - int i; + static int ifcheck; int hits = 0; - for( i = 0; i < InitialFileCount; i++ ) + + if( InitialFileCount ) { - double ft = OGGetFileTime( InitialFile[i] ); - if( FileTimes[i] != ft ) + //Only check one location per frame. + double ft = OGGetFileTime( InitialFile[ifcheck] ); + if( FileTimes[ifcheck] != ft ) { - FileTimes[i] = ft; + FileTimes[ifcheck] = ft; hits++; } + ifcheck = ( ifcheck + 1 ) % InitialFileCount; } if( !hits && !force ) return; @@ -109,6 +112,7 @@ void SetEnvValues( int force ) printf( "On Android, looking for configuration file in: %s\n", InitialFile[0] ); #endif + int i; for( i = 0; i < InitialFileCount; i++ ) { LoadFile( InitialFile[i] ); @@ -151,8 +155,10 @@ void SetupConfigs() { #ifdef ANDROID InitialFile[0] = "/sdcard/colorchord-android.txt"; - InitialFile[1] = "/sdcard/colorchord-android-overlay.txt"; - InitialFileCount = 2; + InitialFile[1] = "/storage/emulated/0/colorchord-android.txt"; + InitialFile[2] = "/sdcard/colorchord-android-overlay.txt"; + InitialFile[3] = "/storage/emulated/0/colorchord-android-overlay.txt"; + InitialFileCount = 4; #else InitialFile[0] = "default.conf"; #endif From 8449e772a0ef48306f90fc2fce86f17e0d3aa652 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 18 May 2020 15:46:22 -0700 Subject: [PATCH 8/9] Bump submodule --- colorchord2/cnfa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorchord2/cnfa b/colorchord2/cnfa index f34087c..15c95d4 160000 --- a/colorchord2/cnfa +++ b/colorchord2/cnfa @@ -1 +1 @@ -Subproject commit f34087cf216cfa8a885fde616659fef3e862c048 +Subproject commit 15c95d49771c237b90b878b5ced163de575d9406 From 3c2c0d7fc9d87822455909b2ecf1cd31cd19520f Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 18 May 2020 15:47:12 -0700 Subject: [PATCH 9/9] Update .gitignore to ignore object files. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3841a63..6f6ec79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ colorchord2/windows/colorchord.def -colorchord2/colorchord.def \ No newline at end of file +colorchord2/colorchord.def +*.o