-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from designe/v0.8
master branch with v0.8
- Loading branch information
Showing
171 changed files
with
5,765 additions
and
3,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
ext.kotlin_version = '1.3.41' | ||
repositories { | ||
mavenCentral() | ||
google() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
google() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.2.1' | ||
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' | ||
if(gradle.language.equals("kotlin")) classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
classpath 'com.android.tools.build:gradle:4.2.2' | ||
|
||
// for mavenCentral publish | ||
//classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' | ||
} | ||
} | ||
|
||
/* | ||
* mavenCentral publish script | ||
* | ||
apply plugin: 'io.github.gradle-nexus.publish-plugin' | ||
apply from: file("publish-root.gradle") | ||
*/ | ||
|
||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
google() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
google() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
euphony/src/androidTest/java/co/euphony/tx/EuTxManagerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package co.euphony.tx; | ||
|
||
import androidx.test.core.app.ApplicationProvider; | ||
import androidx.test.filters.SmallTest; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
|
||
import co.euphony.util.EuOption; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
@RunWith(Parameterized.class) | ||
@SmallTest | ||
public class EuTxManagerTest { | ||
private static final String TX_TAG = "EU_TXMANAGER_TAG"; | ||
|
||
String code; | ||
String expectedASCIICode; | ||
String expectedGenCode; | ||
int expectedStreamLength; | ||
int expectedBufferLength; | ||
|
||
EuTxManager txManager = null; | ||
public EuTxManagerTest(String code, String asciiCode, String expectedGenCode, int expectedStreamLength, int expectedBufferLength) { | ||
this.code = code; | ||
this.expectedASCIICode = asciiCode; | ||
this.expectedGenCode = expectedGenCode; | ||
this.expectedStreamLength = expectedStreamLength; | ||
this.expectedBufferLength = expectedBufferLength; | ||
} | ||
|
||
@Before | ||
public void setup() { | ||
txManager = new EuTxManager(ApplicationProvider.getApplicationContext()); | ||
} | ||
|
||
@Test | ||
public void getCode() { | ||
txManager.setCode(code); | ||
|
||
String activeResult = txManager.getCode(); | ||
assertEquals(expectedASCIICode, activeResult); | ||
} | ||
|
||
@Test | ||
public void getGenCode() { | ||
txManager.setCode(code); | ||
|
||
String activeResult = txManager.getGenCode(); | ||
assertEquals(expectedGenCode, activeResult); | ||
} | ||
|
||
@Test | ||
public void setGetCodeTest() { | ||
txManager.setCode("a"); | ||
String activeResult = txManager.getGenCode(); | ||
assertEquals("S6197", activeResult); | ||
|
||
txManager.setCode("b"); | ||
activeResult = txManager.getGenCode(); | ||
assertEquals("S6284", activeResult); | ||
|
||
} | ||
|
||
@Test | ||
public void getGenWaveSource() { | ||
txManager.setCode(code); | ||
txManager.setMode(EuOption.ModeType.DEFAULT); | ||
float[] waveSourceData = txManager.getOutStream(); | ||
assertEquals(waveSourceData.length, expectedStreamLength); | ||
} | ||
|
||
@Test | ||
public void testRun() { | ||
txManager.callEuPI(18000, EuTxManager.EuPIDuration.LENGTH_SHORT); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Iterable<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{"a", "61", "S6197", 5*2048, 5*8}, | ||
{"b", "62", "S6284", 5*2048, 5*8}, | ||
{"c", "63", "S6375", 5*2048, 5*8}, | ||
{"abc", "616263", "S61626386", 9*2048, 9*8}, | ||
{"Abc", "416263", "S416263a4", 9*2048, 9*8}, | ||
{"lmno", "6c6d6e6f", "S6c6d6e6f20", 11*2048, 11*8}, | ||
{"efg", "656667", "S656667c2", 9*2048, 9*8}, | ||
{"abcdefghijklmnopqrstuvwxyz", "6162636465666768696a6b6c6d6e6f707172737475767778797a", "S6162636465666768696a6b6c6d6e6f707172737475767778797aaa", 55*2048, 55*8}, | ||
{"ABC", "414243", "S414243e4", 9*2048, 9*8}, | ||
{"ABCDEFGHIJKLMNOPQRSTUVWXYZ", "4142434445464748494a4b4c4d4e4f505152535455565758595a", "S4142434445464748494a4b4c4d4e4f505152535455565758595aea", 55*2048, 55*8}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="euphony.lib" | ||
package="co.euphony" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<application /> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
cmake_minimum_required(VERSION 3.4.1) | ||
|
||
project(euphony | ||
VERSION 0.8) | ||
|
||
# Legacy JNI | ||
set(LEGACY_SRC | ||
arms/kiss_fft.c | ||
arms/kiss_fftr.c | ||
native-legacy.cpp | ||
) | ||
|
||
find_library( log-lib log ) | ||
add_library( native-legacy SHARED ${LEGACY_SRC} ) | ||
target_compile_definitions(native-legacy PUBLIC FIXED_POINT=16) | ||
target_link_libraries( | ||
native-legacy | ||
${log-lib} | ||
-fopenmp | ||
-static-openmp | ||
) | ||
|
||
# Rearchitectured Euphony Native | ||
set(EUPHONY_SRC | ||
arms/kiss_fft.c | ||
arms/kiss_fftr.c | ||
core/source/AudioStreamCallback.cpp | ||
core/source/ASCIICharset.cpp | ||
core/source/Base2.cpp | ||
core/source/Base16.cpp | ||
core/source/Base16Exception.cpp | ||
core/source/DefaultCharset.cpp | ||
core/source/EuPIOscillator.cpp | ||
core/source/EuPIRenderer.cpp | ||
core/source/FFTModel.cpp | ||
core/source/FFTProcessor.cpp | ||
core/source/FSK.cpp | ||
core/source/HexVector.cpp | ||
core/source/Packet.cpp | ||
core/source/PacketBuilder.cpp | ||
core/source/PacketErrorDetector.cpp | ||
core/source/TxEngine.cpp | ||
core/source/Wave.cpp | ||
core/source/WaveBuilder.cpp | ||
core/source/WaveRenderer.cpp | ||
native-connector.cpp | ||
) | ||
|
||
set(EUPHONY_HDR core) | ||
set(DEBUG_HELPER debug-helper) | ||
set(DEBUG_HELPER_SRC debug-helper/Trace.cpp) | ||
set(SL_HEADERS arms/sl-headers) | ||
|
||
include_directories( ${EUPHONY_HDR} ${SL_HEADERS} ${DEBUG_HELPER}) | ||
|
||
add_library(euphony SHARED ${EUPHONY_SRC} ${DEBUG_HELPER_SRC}) | ||
target_compile_definitions(euphony PUBLIC FIXED_POINT=16) | ||
|
||
find_package( | ||
oboe REQUIRED CONFIG | ||
) | ||
|
||
target_link_libraries( | ||
euphony | ||
${log-lib} | ||
OpenSLES | ||
oboe::oboe | ||
-fopenmp | ||
-static-openmp | ||
) | ||
|
||
# for c++ unit-test (gtest) | ||
add_subdirectory(tests) |
File renamed without changes.
Oops, something went wrong.