Commit 7b20bebb authored by hanriaca's avatar hanriaca

remove useless code from ThumbRespeak files

parent 0bab2b20
......@@ -44,7 +44,7 @@ public class ThumbRespeakActivity extends AikumaActivity {
fragment = (ThumbRespeakFragment)
getFragmentManager().findFragmentById(R.id.ThumbRespeakFragment);
setUpThumbRespeaker();
fragment.setThumbRespeaker(respeaker, false);
fragment.setThumbRespeaker(respeaker);
}
// Creates an appropriate ThumbRespeaker for this activity.
......
......@@ -142,7 +142,6 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
dirName = getIntent().getStringExtra("dirname");
duration = 0;
totalAudioLength = 0l;
setMetadataSession();
recordLang = MetadataSession.getMetadataSession().getRecordLanguage();
}
......@@ -230,32 +229,9 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
// ed.putBoolean(getString(R.string.checkTranscript), true); //set submode
//save infos
ed.commit();
ed.commit();
}
/**
* Called to create the metadata session
*/
private void setMetadataSession() {
if (getIntent() != null) {
Intent metadataIntent = getIntent();
Bundle respeakingBundle = metadataIntent.getBundleExtra(RespeakingMetadataLig.metabundle);
String gender = respeakingBundle.getString(RecordingMetadataLig.metaSpkrGender);
Language recordLang = respeakingBundle.getParcelable(RecordingMetadataLig.metaRecordLang);
Language motherTong = respeakingBundle.getParcelable(RecordingMetadataLig.metaMotherTong);
ArrayList<Language> rspkLanguages = respeakingBundle.getParcelableArrayList(RecordingMetadataLig.metaLanguages);
String regionOrigin = respeakingBundle.getString(RecordingMetadataLig.metaOrigin);
String speakerName = respeakingBundle.getString(RecordingMetadataLig.metaSpkrName);
int speakerAge = respeakingBundle.getInt(RecordingMetadataLig.metaSpkrBirthYr);
int speakerGender = gender.compareTo("Male") == 0 ?
RecordingMetadataLig.GENDER_MALE : RecordingMetadataLig.GENDER_FEMALE;
MetadataSession.getMetadataSession().setSession(recordLang, motherTong,
rspkLanguages, regionOrigin, speakerName, speakerAge, speakerGender);
}
}
/**
* function called when we need to save json file into no sync direcory
......@@ -282,6 +258,7 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
recording = RecordingLig.read(metadataFile);
recording.setRecordingUUID(respeakingUUID);
recording.setDeviceName(Aikuma.getDeviceName());
metadataFile.delete();
} catch (IOException e) {
e.printStackTrace();
}
......@@ -356,8 +333,6 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
setRecordingLig();
if (isNewSession)
saveRecordingJsonInNoSync();
try {
// Move the wave file from the nosync directory to
......@@ -367,9 +342,6 @@ public class ThumbRespeakActivityLig extends AikumaActivity {
"Respeaking saved into the file " + recording.getName(),
Toast.LENGTH_LONG)
.show();
File metadataFile = new File(FileIO.getNoSyncPath(),
this.respeakingUUID + RecordingLig.METADATA_SUFFIX);
metadataFile.delete();
} catch (IOException e) {
Toast.makeText(ThumbRespeakActivityLig.this,
"Failed to write the respoken recording metadata:\t" +
......
......@@ -409,12 +409,10 @@ public class ThumbRespeakFragment extends Fragment {
}
public boolean isCommented() {
return isCommented;
}
public void setCommented(boolean isCommented) {
this.isCommented = isCommented;
public void setThumbRespeaker(ThumbRespeaker respeaker) {
this.respeaker = respeaker;
respeaker.getSimplePlayer().setOnCompletionListener(onCompletionListener);
updateDurationTextView();
}
/**
......@@ -423,9 +421,7 @@ public class ThumbRespeakFragment extends Fragment {
* @param respeaker The ThumbRespeaker to use.
*/
public void setThumbRespeaker(ThumbRespeaker respeaker, Boolean newSession) {
this.respeaker = respeaker;
Log.d("respeaker", "currentDuration : " + respeaker.getCurrentMsec());
Log.d("MapperSize : ", "tmp=> setUpThumbRespeaker from FRAG-> mapper size : " + getRespeaker().getMapper().getSegments().getSegmentMap().size());
this.respeaker = respeaker;
respeaker.getSimplePlayer().setOnCompletionListener(onCompletionListener);
updateDurationTextView();
if (!newSession) {
......
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