Commit fb51193a authored by CallisteHanriat's avatar CallisteHanriat

Video elicitation has been implemented

parent eefc1fa8
......@@ -119,6 +119,7 @@
<string name="session_submode">submode</string>
<string name="sessionCheckImportFile">checkImportFile</string>
<string name="sessionCheckExportFile">checkExportFile</string>
<string name="nbReadLines">nbReadLine</string>
<string name="sessionInputFile">inputFile</string>
<string name="mexico">Ex : Mexico</string>
<string name="sessionOutputFile">session_output_file</string>
......
......@@ -181,7 +181,6 @@ public class RecordingLig extends Recording {
super.importMov(recordingUUID, getId());
} else {
this.importWav(recordingUUID, WAV_EXT);
}
......@@ -223,12 +222,11 @@ public class RecordingLig extends Recording {
JSONObject jsonObj = FileIO.readJSONObject(metadataFile);
RecordingLig recording = new RecordingLig(read(jsonObj));
String code = (String) jsonObj.get(RecordingMetadataLig.metaRecordLang);
recording.recordLang = code.isEmpty() ? null : new Language(Aikuma.getLanguageCodeMap().get(code), code);
recording.recordLang = code.isEmpty() ? new Language("","") : new Language(Aikuma.getLanguageCodeMap().get(code), code);
JSONArray jsonArray = (JSONArray) jsonObj.get("languages");
recording.languages = Language.decodeJSONArray(jsonArray);
code = (String) jsonObj.get(RecordingMetadataLig.metaMotherTong);
if (code != null)
recording.motherTong = code.isEmpty() ? null : new Language(Aikuma.getLanguageCodeMap().get(code), code);
recording.motherTong = code.isEmpty() ? new Language("", "") : new Language(Aikuma.getLanguageCodeMap().get(code), code);
recording.regionOrigin = (String) jsonObj.get(RecordingMetadataLig.metaOrigin);
recording.speakerName = (String) jsonObj.get(RecordingMetadataLig.metaSpkrName);
long age = (Long) jsonObj.get(RecordingMetadataLig.metaSpkrBirthYr);
......@@ -254,8 +252,7 @@ public class RecordingLig extends Recording {
encodedRecording.put(RecordingMetadataLig.metaSpkrBirthYr, speakerBirthYear);
encodedRecording.put(RecordingMetadataLig.metaSpkrGender, speakerGender);
encodedRecording.put(RecordingMetadataLig.metaRecordLang, this.recordLang.getCode());
if (this.motherTong != null)
encodedRecording.put(RecordingMetadataLig.metaMotherTong, this.motherTong.getCode());
encodedRecording.put(RecordingMetadataLig.metaMotherTong, this.motherTong.getCode());
Log.i(TAG, "encoding metadata into json format");
return encodedRecording;
}
......
......@@ -22,7 +22,7 @@ import org.lp20.aikuma.util.FileIO;
* @author Oliver Adams <oliver.adams@gmail.com>
* @author Florian Hanke <florian.hanke@gmail.com>
*/
public class Segments implements Serializable {
public class Segments {
/**
* Creates an object that represents a mapping of recording segments between
......
......@@ -86,7 +86,7 @@ public class CheckWordVariant extends AikumaActivity {
variantchecked = prefsUserSession.getString(getString(R.string.sessionCheckExportFile),null);
Log.i(TAG, "Selected export file: " + variantchecked);
//retrieve number of lines already handled in the last session
nbReadLines = prefsUserSession.getInt(getString(R.string.sessionProgress),0);
nbReadLines = prefsUserSession.getInt(getString(R.string.nbReadLines),0);
append = true;
// clear the current stored session
......@@ -302,18 +302,21 @@ public class CheckWordVariant extends AikumaActivity {
* + fichier export: String variantchecked
* + date: String date
*/
Toast.makeText(this, "session saved", Toast.LENGTH_SHORT).show();
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
SharedPreferences.Editor ed = prefsUserSession.edit();
ed.putBoolean(getString(R.string.sessionActive), true); //session activated
ed.putInt(getString(R.string.sessionProgress), nbReadLines); //nb lines
ed.putString(getString(R.string.sessionInputFile), variantTextFile); //handled file
ed.putString(getString(R.string.sessionCheckExportFile), variantchecked); //resulting file
ed.putString(getString(R.string.sessionDate), date); //set date
ed.putString(getString(R.string.sessionMode),TAG); //set mode
// ed.putBoolean(getString(R.string.checkVariant), true); //set submode
//save infos
ed.commit();
if((line == null && nbReadLines < totalNumberOfExpressions) || line != null) {
Toast.makeText(this, "session saved", Toast.LENGTH_SHORT).show();
date = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE).format(new Date());
SharedPreferences.Editor ed = prefsUserSession.edit();
ed.putBoolean(getString(R.string.sessionActive), true); //session activated
ed.putInt(getString(R.string.nbReadLines), nbReadLines); //nb lines
ed.putString(getString(R.string.sessionProgress), nbReadLines + "/" + totalNumberOfExpressions);
ed.putString(getString(R.string.sessionInputFile), variantTextFile); //handled file
ed.putString(getString(R.string.sessionCheckExportFile), variantchecked); //resulting file
ed.putString(getString(R.string.sessionDate), date); //set date
ed.putString(getString(R.string.sessionMode),TAG); //set mode
// ed.putBoolean(getString(R.string.checkVariant), true); //set submode
//save infos
ed.commit();
}
} catch (IOException e) {
// TODO Auto-generated catch block
......
......@@ -340,6 +340,7 @@ public class RespeakingMetadataLig extends AikumaActivity implements OnClickList
// intent.putExtra(RecordActivityLig.intent_versionName, versionName);
// intent.putExtra(RespeakingSelection.RESPEAK, respeak);
startActivity(intent);
finish();
}
})
.setNegativeButton("Cancel", null)
......
......@@ -367,6 +367,7 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
fragment.getRespeaker().saveRespeaking();
//fragment.getRespeaker().playOriginal(1);
setRecordingLig();
saveRecordingJsonInNoSync();
saveCurrentState();
try {
......@@ -386,6 +387,7 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
}
})
......@@ -408,6 +410,7 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
Intent intent = new Intent(ThumbRespeakActivityLig.this, RespeakingSelection.class);
startActivity(intent);
finish();
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment