Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

rockbox turn on usb during recoring

By: a guest on Feb 7th, 2011  |  syntax: C  |  size: 1.53 KB  |  views: 107  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  @@ -1712,11 +1697,40 @@
  2.  #endif /*  CONFIG_KEYPAD == RECORDER_PAD */
  3.  
  4.              case SYS_USB_CONNECTED:
  5. +                if ((audio_stat & AUDIO_STATUS_RECORD)) {
  6. +                    // stop the recording to do usb
  7. +                    rec_command(RECORDING_CMD_STOP);
  8. +                    FOR_NB_SCREENS(i)
  9. +                       screens[i].set_viewport(NULL);
  10. +                    next_screen = GO_TO_RECSCREEN;
  11. +                    recording_start_automatic = true;
  12. +                    
  13. +                    done = true;
  14. +                    rec_status |= RCSTAT_BEEN_IN_USB_MODE;
  15. +#ifdef HAVE_FMRADIO_REC
  16. +                    radio_status = FMRADIO_OFF;
  17. +#endif                    
  18. +                   // wait a bit
  19. +                   sleep(20);
  20. +                   while(!(audio_stat & AUDIO_STATUS_RECORD)) {
  21. +                       sleep(20);
  22. +                   }
  23. +
  24. +                    default_event_handler(SYS_USB_CONNECTED);
  25. +                    usb_acknowledge(SYS_USB_CONNECTED_ACK);
  26. +
  27. +
  28. +
  29. +                }
  30. +
  31. +
  32.                  /* Only accept USB connection when not recording */
  33. -                if(!(audio_stat & AUDIO_STATUS_RECORD))
  34. +                else if(!(audio_stat & AUDIO_STATUS_RECORD))
  35.                  {
  36.                      FOR_NB_SCREENS(i)
  37.                          screens[i].set_viewport(NULL);
  38. +                    next_screen = GO_TO_RECSCREEN;
  39. +                    recording_start_automatic = true;
  40.                      default_event_handler(SYS_USB_CONNECTED);
  41.                      done = true;
  42.                      rec_status |= RCSTAT_BEEN_IN_USB_MODE;