Tema grabación de sonidos finalizado (falta hacer más pruebas)

parent fffdcd97
......@@ -177,15 +177,14 @@ public class EditPictoActivity extends Activity {
protected void onCancelled(){
stopRecording();
botonReproducir.setEnabled(tiempoGrabado > 1 ? true : false);
botonReproducir.setEnabled(tiempoGrabado > 1);
layoutPreview.setVisibility(tiempoGrabado > 1 ? View.VISIBLE : View.GONE);
layoutGrabacion.setVisibility(tiempoGrabado > 1 ? View.GONE : View.VISIBLE);
tiempoTotal = tiempoGrabado-1;
textoTTotal.setText(tiempoTotal == 10 ? "00:00 | 00:" + tiempoTotal : "00:00 | 00:0" + tiempoTotal );
barraReproducir.setMax(tiempoTotal);
botonGrabar.PhidePressedRing();
if(tiempoGrabado >= 1) hayGrabacion = true ;
else hayGrabacion = false;
hayGrabacion = (tiempoGrabado>=1 ? true : false); //Si lo grabado es al menos 1s => hay grabacion
if(hayGrabacion)
assignFileToPlayer(new File(previewAudioPath));
reiniciarGrabacion();
}
......@@ -500,7 +499,7 @@ public class EditPictoActivity extends Activity {
case MotionEvent.ACTION_UP:
tareaGrabacion.cancel(true);
gifRecord.setBackgroundResource(R.color.white);
assignFileToPlayer(new File(previewAudioPath));
recordSoundOff.play(MediaActionSound.FOCUS_COMPLETE);
return true;
......@@ -606,6 +605,7 @@ public class EditPictoActivity extends Activity {
tiempoTotal = Math.round(mPlayer.getDuration()/1000);
textoTTotal.setText("00:00 | 00:"+(tiempoTotal == 10 ? tiempoTotal : "0" + tiempoTotal));
barraReproducir.setMax(tiempoTotal);
Log.i(DEBUG_MESSAGE,"Assign.."+tiempoTotal);
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalStateException e){
......@@ -661,7 +661,6 @@ public class EditPictoActivity extends Activity {
private void reiniciarGrabacion(){
tiempoGrabado = 0;
textoTGrabacion.setText("00:00 | 00:10");
//hayGrabacion = false;
}
private void reiniciarReproducción(){
......@@ -670,6 +669,8 @@ public class EditPictoActivity extends Activity {
reproduciendo = false;
botonReproducir.setImageResource(android.R.drawable.ic_media_play);
textoTTotal.setText("00:00 | 00:"+(tiempoTotal == 10 ? tiempoTotal : "0" + tiempoTotal));
Log.i(DEBUG_MESSAGE,"Reinic.."+tiempoTotal);
barraReproducir.setMax(tiempoTotal);
}
@Override
......
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 sign in to comment