Ejemplo n.º 1
0
void c64h156_device::live_abort()
{
	if(!cur_live.tm.is_never() && cur_live.tm > machine().time()) {
		rollback();
		live_run(machine().time());
	}

	stop_writing(cur_live.tm);

	cur_live.tm = attotime::never;
	cur_live.state = IDLE;
	cur_live.next_state = -1;
	cur_live.write_position = 0;
	cur_live.write_start_time = attotime::never;

	cur_live.sync = 1;
	cur_live.byte = 1;
}
Ejemplo n.º 2
0
void c2040_fdc_t::live_abort()
{
	if(!cur_live.tm.is_never() && cur_live.tm > machine().time()) {
		rollback();
		live_run(machine().time());
	}

	stop_writing(cur_live.tm);

	cur_live.tm = attotime::never;
	cur_live.state = IDLE;
	cur_live.next_state = -1;
	cur_live.write_position = 0;
	cur_live.write_start_time = attotime::never;

	cur_live.ready = 1;
	cur_live.sync = 1;
	cur_live.error = 1;
}
Ejemplo n.º 3
0
bool SOUNDFILESAVER_write(float **outputs, int num_frames){
 PaUtil_FullMemoryBarrier();

  if(g_save_state==BEFORE_WRITING && is_playing()==false)
    return true;

  if(g_save_state==AFTER_WRITING)
    return true;

  bool ret=true;
  int i;
  float interleaved_data[num_frames*2];

  int pos=0;
  for(i=0;i<num_frames;i++){
    interleaved_data[pos++] = outputs[0][i];
    interleaved_data[pos++] = outputs[1][i];
  }

  //printf("Writing %d frames\n",num_frames);

  if(sf_writef_float(g_sndfile, interleaved_data, num_frames) != num_frames){
    g_saving_was_successful = false;
    ret = false;
  }

  if(g_save_state==IS_WRITING){
    if(is_playing()==false){
      g_save_state=POST_WRITING;
    }
  }

  if(g_save_state==POST_WRITING){
    g_post_writing_left -= (float)num_frames/MIXER_get_sample_rate();
    if(g_post_writing_left <= 0.0f){
      stop_writing();
      g_save_state=AFTER_WRITING;
    }
  }

  return ret;
}
Ejemplo n.º 4
0
int RecordTransport::keypress_event()
{
	if( record->cron_active() > 0 ) return 0;
	if( window->get_keypress() == ' ' ) {
//printf("RecordTransport::keypress_event 1\n");
		if( record->writing_file ) {
			window->unlock_window();
			stop_writing();
			window->lock_window("RecordTransport::keypress_event 1");
		}
		else {
			window->unlock_window();
			start_writing_file();
			window->lock_window("RecordTransport::keypress_event 2");
		}
//printf("RecordTransport::keypress_event 2\n");
		return 1;
	}
	return 0;
}
Ejemplo n.º 5
0
void c2040_fdc_t::live_sync()
{
	if(!cur_live.tm.is_never()) {
		if(cur_live.tm > machine().time()) {
			rollback();
			live_run(machine().time());
			commit(cur_live.tm);
		} else {
			commit(cur_live.tm);
			if(cur_live.next_state != -1) {
				cur_live.state = cur_live.next_state;
				cur_live.next_state = -1;
			}
			if(cur_live.state == IDLE) {
				stop_writing(cur_live.tm);
				cur_live.tm = attotime::never;
			}
		}
		cur_live.next_state = -1;
		checkpoint();
	}
}