kopia lustrzana https://github.com/sh123/codec2_talkie
Refactoring
rodzic
cc83f5add8
commit
6fcf2f38ff
|
@ -10,8 +10,8 @@ android {
|
||||||
applicationId "com.radio.codec2talkie"
|
applicationId "com.radio.codec2talkie"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 166
|
versionCode 167
|
||||||
versionName "1.66"
|
versionName "1.67"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ import com.ustadmobile.codec2.Codec2;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class AudioFrameAggregator implements Protocol {
|
public class AudioCodec2FrameAggregator implements Protocol {
|
||||||
|
|
||||||
private static final String TAG = AudioFrameAggregator.class.getSimpleName();
|
private static final String TAG = AudioCodec2FrameAggregator.class.getSimpleName();
|
||||||
|
|
||||||
private final Protocol _childProtocol;
|
private final Protocol _childProtocol;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class AudioFrameAggregator implements Protocol {
|
||||||
private final SharedPreferences _sharedPreferences;
|
private final SharedPreferences _sharedPreferences;
|
||||||
private ProtocolCallback _parentProtocolCallback;
|
private ProtocolCallback _parentProtocolCallback;
|
||||||
|
|
||||||
public AudioFrameAggregator(Protocol childProtocol, SharedPreferences sharedPreferences) {
|
public AudioCodec2FrameAggregator(Protocol childProtocol, SharedPreferences sharedPreferences) {
|
||||||
_childProtocol = childProtocol;
|
_childProtocol = childProtocol;
|
||||||
_sharedPreferences = sharedPreferences;
|
_sharedPreferences = sharedPreferences;
|
||||||
}
|
}
|
|
@ -107,7 +107,7 @@ public class ProtocolFactory {
|
||||||
proto = new Recorder(proto, sharedPreferences);
|
proto = new Recorder(proto, sharedPreferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
proto = new AudioFrameAggregator(proto, sharedPreferences);
|
proto = new AudioCodec2FrameAggregator(proto, sharedPreferences);
|
||||||
proto = new AudioCodec2(proto, sharedPreferences);
|
proto = new AudioCodec2(proto, sharedPreferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ public class Raw implements Protocol {
|
||||||
public boolean receive() throws IOException {
|
public boolean receive() throws IOException {
|
||||||
int bytesRead = _transport.read(_rxDataBuffer);
|
int bytesRead = _transport.read(_rxDataBuffer);
|
||||||
if (bytesRead > 0) {
|
if (bytesRead > 0) {
|
||||||
|
// NOTE, default data is compressed audio, upper layer should distinguish
|
||||||
_parentProtocolCallback.onReceiveCompressedAudio(null, null, Arrays.copyOf(_rxDataBuffer, bytesRead));
|
_parentProtocolCallback.onReceiveCompressedAudio(null, null, Arrays.copyOf(_rxDataBuffer, bytesRead));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.radio.codec2talkie.R;
|
import com.radio.codec2talkie.R;
|
||||||
import com.radio.codec2talkie.protocol.AudioFrameAggregator;
|
|
||||||
import com.radio.codec2talkie.protocol.aprs.tools.AprsSymbolTable;
|
import com.radio.codec2talkie.protocol.aprs.tools.AprsSymbolTable;
|
||||||
|
|
||||||
public class AprsSymbolSelectionActivity extends AppCompatActivity {
|
public class AprsSymbolSelectionActivity extends AppCompatActivity {
|
||||||
|
|
Ładowanie…
Reference in New Issue