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

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