blob: d1f8e1c311870eb220b2e12d4803c55279056978 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
package net.surina;
import net.surina.soundtouch.SoundTouch;
import net.surina.soundtouchexample.R;
import net.surina.soundtouchexample.R.id;
import net.surina.soundtouchexample.R.layout;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class ExampleActivity extends Activity
{
TextView textViewConsole;
StringBuilder consoleText = new StringBuilder();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_example);
textViewConsole = (TextView)findViewById(R.id.textViewResult);
// Check soundtouch
checkLibVersion();
}
@Override
protected void onDestroy()
{
textViewConsole = null;
}
/// Append text to console on the activity
public void appendToConsole(String text)
{
if (textViewConsole == null) return;
consoleText.append(text);
consoleText.append("\n");
textViewConsole.setText(consoleText);
}
/// print SoundTouch native library version onto console
protected void checkLibVersion()
{
SoundTouch st = new SoundTouch();
String ver = st.getVersionString();
appendToConsole("SoundTouch native library version = " + ver);
}
}
|