Skip to content

Commit

Permalink
Android: Replaced logging tag strings with constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed May 16, 2015
1 parent a54d038 commit f7ac020
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -114,9 +114,9 @@ public static void initialize() {
// Setup
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.v("SDL", "Device: " + android.os.Build.DEVICE);
Log.v("SDL", "Model: " + android.os.Build.MODEL);
Log.v("SDL", "onCreate():" + mSingleton);
Log.v(TAG, "Device: " + android.os.Build.DEVICE);
Log.v(TAG, "Model: " + android.os.Build.MODEL);
Log.v(TAG, "onCreate():" + mSingleton);
super.onCreate(savedInstanceState);

SDLActivity.initialize();
Expand Down Expand Up @@ -178,7 +178,7 @@ public void onClick(DialogInterface dialog,int id) {
// Events
@Override
protected void onPause() {
Log.v("SDL", "onPause()");
Log.v(TAG, "onPause()");
super.onPause();

if (SDLActivity.mBrokenLibraries) {
Expand All @@ -190,7 +190,7 @@ protected void onPause() {

@Override
protected void onResume() {
Log.v("SDL", "onResume()");
Log.v(TAG, "onResume()");
super.onResume();

if (SDLActivity.mBrokenLibraries) {
Expand All @@ -204,7 +204,7 @@ protected void onResume() {
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);
Log.v(TAG, "onWindowFocusChanged(): " + hasFocus);

if (SDLActivity.mBrokenLibraries) {
return;
Expand All @@ -218,7 +218,7 @@ public void onWindowFocusChanged(boolean hasFocus) {

@Override
public void onLowMemory() {
Log.v("SDL", "onLowMemory()");
Log.v(TAG, "onLowMemory()");
super.onLowMemory();

if (SDLActivity.mBrokenLibraries) {
Expand All @@ -230,7 +230,7 @@ public void onLowMemory() {

@Override
protected void onDestroy() {
Log.v("SDL", "onDestroy()");
Log.v(TAG, "onDestroy()");

if (SDLActivity.mBrokenLibraries) {
super.onDestroy();
Expand All @@ -248,11 +248,11 @@ protected void onDestroy() {
try {
SDLActivity.mSDLThread.join();
} catch(Exception e) {
Log.v("SDL", "Problem stopping thread: " + e);
Log.v(TAG, "Problem stopping thread: " + e);
}
SDLActivity.mSDLThread = null;

//Log.v("SDL", "Finished waiting for SDL thread");
//Log.v(TAG, "Finished waiting for SDL thread");
}

super.onDestroy();
Expand Down Expand Up @@ -542,7 +542,7 @@ public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, i
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);

Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
Log.v(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");

// Let the user pick a larger buffer if they really want -- but ye
// gods they probably shouldn't, the minimums are horrifyingly high
Expand All @@ -558,15 +558,15 @@ public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, i
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()

if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
Log.e("SDL", "Failed during initialization of Audio Track");
Log.e(TAG, "Failed during initialization of Audio Track");
mAudioTrack = null;
return -1;
}

mAudioTrack.play();
}

Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
Log.v(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");

return 0;
}
Expand All @@ -586,7 +586,7 @@ public static void audioWriteShortBuffer(short[] buffer) {
// Nom nom
}
} else {
Log.w("SDL", "SDL audio: error return from write(short)");
Log.w(TAG, "SDL audio: error return from write(short)");
return;
}
}
Expand All @@ -607,7 +607,7 @@ public static void audioWriteByteBuffer(byte[] buffer) {
// Nom nom
}
} else {
Log.w("SDL", "SDL audio: error return from write(byte)");
Log.w(TAG, "SDL audio: error return from write(byte)");
return;
}
}
Expand Down

0 comments on commit f7ac020

Please sign in to comment.