You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
refactor source tree organization, switch to meson
This commit is contained in:
10
src/api-impl/android/media/AudioManager.java
Normal file
10
src/api-impl/android/media/AudioManager.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package android.media;
|
||||
|
||||
public class AudioManager {
|
||||
public interface OnAudioFocusChangeListener {
|
||||
}
|
||||
|
||||
public int getRingerMode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
78
src/api-impl/android/media/AudioTrack.java
Normal file
78
src/api-impl/android/media/AudioTrack.java
Normal file
@@ -0,0 +1,78 @@
|
||||
package android.media;
|
||||
|
||||
public class AudioTrack {
|
||||
public interface OnPlaybackPositionUpdateListener {
|
||||
void onMarkerReached(AudioTrack track);
|
||||
void onPeriodicNotification(AudioTrack track);
|
||||
}
|
||||
|
||||
int streamType;
|
||||
int sampleRateInHz;
|
||||
int channelConfig;
|
||||
int audioFormat;
|
||||
int bufferSizeInBytes;
|
||||
int mode;
|
||||
|
||||
// for native code's use
|
||||
long pcm_handle;
|
||||
long params;
|
||||
int channels;
|
||||
int period_time;
|
||||
// mostly
|
||||
static int frames;
|
||||
OnPlaybackPositionUpdateListener periodic_update_listener;
|
||||
|
||||
native void native_constructor(int streamType, int sampleRateInHz, int num_channels, int audioFormat, int bufferSizeInBytes, int mode);
|
||||
public AudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes, int mode) {
|
||||
this.streamType = streamType;
|
||||
this.sampleRateInHz = sampleRateInHz;
|
||||
this.channelConfig = channelConfig;
|
||||
this.audioFormat = audioFormat;
|
||||
this.bufferSizeInBytes = bufferSizeInBytes;
|
||||
this.mode = mode;
|
||||
|
||||
System.out.println("\n\n\nAudioTrack("+streamType+", "+sampleRateInHz+", "+channelConfig+", "+audioFormat+", "+bufferSizeInBytes+", "+mode+"); called\n\n\n\n");
|
||||
|
||||
int num_channels;
|
||||
switch(channelConfig) {
|
||||
case 2:
|
||||
num_channels = 1;
|
||||
break;
|
||||
default:
|
||||
num_channels = 1;
|
||||
}
|
||||
|
||||
native_constructor(streamType, sampleRateInHz, num_channels, audioFormat, bufferSizeInBytes, mode);
|
||||
}
|
||||
|
||||
public static native int getMinBufferSize (int sampleRateInHz, int channelConfig, int audioFormat);
|
||||
|
||||
public void setPlaybackPositionUpdateListener(OnPlaybackPositionUpdateListener listener) {
|
||||
this.periodic_update_listener = listener;
|
||||
}
|
||||
|
||||
public int setPositionNotificationPeriod(int periodInFrames) {
|
||||
System.out.println("\n\n\nsetPositionNotificationPeriod("+periodInFrames+"); called\n\n\n\n");
|
||||
return 0; // SUCCESS
|
||||
}
|
||||
|
||||
public int getPositionNotificationPeriod() {
|
||||
return this.frames;
|
||||
}
|
||||
|
||||
public native void play();
|
||||
|
||||
public void stop() {
|
||||
System.out.println("calling stop(), how did this not get reported before DIDREEEEEEEEEEEEEEEEEEEEEEEEE\n");
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
System.out.println("calling flush(), how did this not get reported before DIDREEEEEEEEEEEEEEEEEEEEEEEEE\n");
|
||||
}
|
||||
|
||||
public void release() {
|
||||
System.out.println("calling release(), how did this not get reported before DIDREEEEEEEEEEEEEEEEEEEEEEEEE\n");
|
||||
}
|
||||
|
||||
public native int write (byte[] audioData, int offsetInBytes, int sizeInBytes);
|
||||
}
|
||||
20
src/api-impl/android/media/MediaPlayer.java
Normal file
20
src/api-impl/android/media/MediaPlayer.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package android.media;
|
||||
|
||||
public class MediaPlayer {
|
||||
public interface OnCompletionListener {
|
||||
}
|
||||
public interface OnErrorListener {
|
||||
}
|
||||
public interface OnPreparedListener {
|
||||
}
|
||||
public interface OnBufferingUpdateListener {
|
||||
}
|
||||
public interface OnInfoListener {
|
||||
}
|
||||
public interface OnSeekCompleteListener {
|
||||
}
|
||||
public interface OnVideoSizeChangedListener {
|
||||
}
|
||||
public interface MediaPlayerControl {
|
||||
}
|
||||
}
|
||||
12
src/api-impl/android/media/SoundPool.java
Normal file
12
src/api-impl/android/media/SoundPool.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package android.media;
|
||||
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
|
||||
public class SoundPool {
|
||||
public SoundPool (int maxStreams, int streamType, int srcQuality) {
|
||||
}
|
||||
|
||||
public int load(AssetFileDescriptor afd, int priority) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user