Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb873406f9 | ||
|
|
f1f90952d2 |
No files matched your search
@@ -65,17 +65,17 @@ public class AlarmRecorder {
|
|||||||
setVideoPath(videoPath);
|
setVideoPath(videoPath);
|
||||||
setVideoRecorderPreviewHolder(previewHolder);
|
setVideoRecorderPreviewHolder(previewHolder);
|
||||||
|
|
||||||
audioThread = new Thread(audioRecorderRunnable);
|
//audioThread = new Thread(audioRecorderRunnable);
|
||||||
videoThread = new Thread(videoRecorderRunnable);
|
videoThread = new Thread(videoRecorderRunnable);
|
||||||
|
|
||||||
//Threads starten
|
//Threads starten
|
||||||
videoThread.start();
|
videoThread.start();
|
||||||
audioThread.start();
|
//audioThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopRecording(Context context) {
|
public void stopRecording(Context context) {
|
||||||
try {
|
try {
|
||||||
stopAudioRecording();
|
//stopAudioRecording();
|
||||||
stopVideoRecording();
|
stopVideoRecording();
|
||||||
|
|
||||||
Toast.makeText(context, "Video- und Audioaufzeichnung beendet", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Video- und Audioaufzeichnung beendet", Toast.LENGTH_SHORT).show();
|
||||||
@@ -86,7 +86,7 @@ public class AlarmRecorder {
|
|||||||
|
|
||||||
if (videoFile.exists() && audioFile.exists()) {
|
if (videoFile.exists() && audioFile.exists()) {
|
||||||
//Wenn Video- und Audioaufzeichnung gestoppt und abgespeichert sind, beginne mit dem Mergeprozess der beiden
|
//Wenn Video- und Audioaufzeichnung gestoppt und abgespeichert sind, beginne mit dem Mergeprozess der beiden
|
||||||
mergeVideoWithAudio();
|
// mergeVideoWithAudio();
|
||||||
Toast.makeText(context, "Video und Audio erfolgreich zusammengeführt", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Video und Audio erfolgreich zusammengeführt", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, "Dateien wurden nicht gefunden!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Dateien wurden nicht gefunden!", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class AudioRecorder implements Runnable {
|
public class AudioRecorder implements Runnable {
|
||||||
|
|
||||||
private MediaRecorder audioRecorder = null;
|
private MediaRecorder audioRecorder;
|
||||||
private String audioPath;
|
private String audioPath;
|
||||||
public AudioRecorder() {
|
public AudioRecorder() {
|
||||||
|
audioRecorder = new MediaRecorder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAudioPath(String audioPath) {
|
public void setAudioPath(String audioPath) {
|
||||||
|
|||||||
@@ -51,11 +51,6 @@ public class WiFiCommunication {
|
|||||||
if (mDeviceRepository == null) {
|
if (mDeviceRepository == null) {
|
||||||
this.mDeviceRepository = deviceRepository;
|
this.mDeviceRepository = deviceRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
public void setRecievedSting(String rxString) {
|
|
||||||
this.rxString = rxString;
|
|
||||||
mDeviceRepository.getNewReceivedMessage(this.rxString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewMessage(String newMessage, boolean isNewMessage){
|
public void setNewMessage(String newMessage, boolean isNewMessage){
|
||||||
@@ -124,7 +119,7 @@ public class WiFiCommunication {
|
|||||||
rxString = new String(packet.getData(), 0, packet.getLength());
|
rxString = new String(packet.getData(), 0, packet.getLength());
|
||||||
|
|
||||||
if(!previousRxString.equals(rxString)){
|
if(!previousRxString.equals(rxString)){
|
||||||
setRecievedSting(rxString);
|
mDeviceRepository.getNewReceivedMessage(rxString);
|
||||||
|
|
||||||
}
|
}
|
||||||
previousRxString = rxString;
|
previousRxString = rxString;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.example.greenwatch.repositories;
|
package com.example.greenwatch.repositories;
|
||||||
|
|
||||||
|
|
||||||
|
import android.os.Looper;
|
||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import com.example.greenwatch.models.Device;
|
import com.example.greenwatch.models.Device;
|
||||||
@@ -273,8 +275,13 @@ public class DeviceRepository {
|
|||||||
|
|
||||||
private void setMutableLiveDataDeviceList() {
|
private void setMutableLiveDataDeviceList() {
|
||||||
List<Device> list = new ArrayList<>(connectedDevicesList.values());
|
List<Device> list = new ArrayList<>(connectedDevicesList.values());
|
||||||
|
if (Looper.myLooper() == Looper.getMainLooper()){
|
||||||
deviceList.setValue(list);
|
deviceList.setValue(list);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
deviceList.postValue(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setMutableLiveDataAlarmHistoryList() {
|
private void setMutableLiveDataAlarmHistoryList() {
|
||||||
alarmHistoryList.setValue(alarmHistoryDeviceList);
|
alarmHistoryList.setValue(alarmHistoryDeviceList);
|
||||||
|
|||||||
Reference in new issue
Block a user