void debriefing_editor_dlg::OnInsertStage() 
{
	int i, z;

	if (Debriefing->num_stages >= MAX_DEBRIEF_STAGES)
		return;

	if (!Debriefing->num_stages) {
		OnAddStage();
		return;
	}

	z = m_cur_stage;
	m_cur_stage = -1;
	update_data(1);
	for (i=Debriefing->num_stages; i>z; i--) {
		copy_stage(i - 1, i);
	}

	Debriefing->num_stages++;
	copy_stage(z, z + 1);
	Debriefing->stages[z].formula = -1;
	m_cur_stage = z;
	update_data(0);
}
예제 #2
0
void cmd_brief_dlg::OnInsertStage() 
{
	int i, z;

	if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
		return;

	if (!Cur_cmd_brief->num_stages) {
		OnAddStage();
		return;
	}

	audiostream_close_file(m_wave_id, 0);
	m_wave_id = -1;

	z = m_cur_stage;
	m_cur_stage = -1;
	update_data(1);
	for (i=Cur_cmd_brief->num_stages; i>z; i--)
		Cur_cmd_brief->stage[i] = Cur_cmd_brief->stage[i - 1];

	Cur_cmd_brief->num_stages++;
	copy_stage(z, z + 1);
	m_cur_stage = z;
	m_last_stage = -1;
	update_data(0);
}
void debriefing_editor_dlg::OnAddStage() 
{
	int i;

	if (Debriefing->num_stages >= MAX_DEBRIEF_STAGES)
		return;

	m_cur_stage = i = Debriefing->num_stages++;
	copy_stage(i - 1, i, 1);
	update_data(1);
}
예제 #4
0
void cmd_brief_dlg::OnAddStage() 
{
	int i;

	if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
		return;

	m_cur_stage = i = Cur_cmd_brief->num_stages++;
	copy_stage(i - 1, i);
	update_data(1);
}
예제 #5
0
void cmd_brief_dlg::OnAddStage() 
{
	int i;

	if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
		return;

	audiostream_close_file(m_wave_id, 0);
	m_wave_id = -1;

	m_cur_stage = i = Cur_cmd_brief->num_stages++;
	copy_stage(i - 1, i);
	update_data(1);
}
void briefing_editor_dlg::OnInsertStage() 
{
	int i, z;

	if (Briefing->num_stages >= MAX_BRIEF_STAGES)
		return;

	if (!Briefing->num_stages) {
		OnAddStage();
		return;
	}

	z = m_cur_stage;
	m_cur_stage = -1;
	update_data(1);
	for (i=Briefing->num_stages; i>z; i--)	{
		copy_stage(i-1, i);
	}

	Briefing->num_stages++;
	copy_stage(z, z + 1);
	m_cur_stage = z;
	update_data(0);
}
void debriefing_editor_dlg::OnDeleteStage() 
{
	int i, z;

	if (m_cur_stage < 0)
		return;
	
	Assert(Debriefing->num_stages);
	z = m_cur_stage;
	m_cur_stage = -1;
	update_data(1);
	for (i=z+1; i<Debriefing->num_stages; i++) {
		copy_stage(i, i - 1);
	}

	Debriefing->num_stages--;
	m_cur_stage = z;
	if (m_cur_stage >= Debriefing->num_stages)
		m_cur_stage = Debriefing->num_stages - 1;

	update_data(0);
}
예제 #8
0
void cmd_brief_dlg::OnInsertStage() 
{
	int i, z;

	if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
		return;

	if (!Cur_cmd_brief->num_stages) {
		OnAddStage();
		return;
	}

	z = m_cur_stage;
	m_cur_stage = -1;
	update_data(1);
	for (i=Cur_cmd_brief->num_stages; i>z; i--)
		Cur_cmd_brief->stage[i] = Cur_cmd_brief->stage[i - 1];

	Cur_cmd_brief->num_stages++;
	copy_stage(z, z + 1);
	m_cur_stage = z;
	update_data(0);
}
예제 #9
0
파일: main.c 프로젝트: Edgeworth/mergedirs
int
main(int argc, char* argv[]) {
	enum COPY_STRATEGY strategy = UNKNOWN;
	const char* ignore_pattern = NULL;
	bool verbose_flag = false;


	int result = 0, strategy_set_count = 0;
	while ((result = getopt(argc, argv, "ci:lmv")) != -1) {
		switch (result) {
			case 'c':
				strategy_set_count++;
				strategy = CONTENTS;
				break;

			case 'l':
				strategy_set_count++;
				strategy = LARGEST;
				break;

			case 'm':
				strategy_set_count++;
				strategy = MOST_RECENT;
				break;

			case 'v':
				verbose_flag = true;
				break;

			case 'i':
				ignore_pattern = optarg;
				break;

			case '?':
				error_and_die("getopt() failed");
				break; //never executes

			default:
				error_and_die("Unknown option %c", (char) result);
				break; //never executes
		}
	}

	if (strategy_set_count > 1) {
		error_and_die("can only provide zero or one of options -l, -m, -c");
	}

	if (strategy == UNKNOWN) {
		strategy = MOST_RECENT; //assume -m if none given
	}

	if (argc-optind < 2) {
		error_and_die("Require at least one input and output directory.\n"
			"Usage mergedirs [options] indirectory1 [indirectory2 ....] outdirectory");
	}

	const char* output_dir = argv[argc-1];
	argv[argc-1] = NULL; //analysis_stage expects a NULL sentinel'd array of strings

	char** file_list = analysis_stage((const char**)(argv+optind), ignore_pattern, strategy);

	if (strategy != CONTENTS) { //We don't copy if it's -c
		copy_stage((const char**)file_list, output_dir, verbose_flag);
	}


	//not strictly necessary, but it's nice to have valgrind pat us on the back
	for (int i = 0; file_list[i] != NULL; ++i) {
		free(file_list[i]);
	}
	free(file_list);

	return 0;
}