"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinelerra/recordengine.C" between
cin_5.1.20220531.src.tgz and cin_5.1.20220630.src.tgz

About: Cinelerra GG Infinity is an advanced non-linear video editor and compositor (a Cinelerra fork).

recordengine.C  (cin_5.1.20220531.src.tgz):recordengine.C  (cin_5.1.20220630.src.tgz)
skipping to change at line 126 skipping to change at line 126
jump_delay[1] = 50; jump_delay[1] = 50;
jump_delay[2] = 25; jump_delay[2] = 25;
jump_delay[3] = 10; jump_delay[3] = 10;
jump_delay[4] = 5; jump_delay[4] = 5;
current_jump_jumps[0] = 20; current_jump_jumps[0] = 20;
current_jump_jumps[1] = 40; current_jump_jumps[1] = 40;
current_jump_jumps[2] = 60; current_jump_jumps[2] = 60;
current_jump_jumps[3] = 80; current_jump_jumps[3] = 80;
current_jump_jumps[4] = 100; current_jump_jumps[4] = 100;
return 0;
} }
int RecordEngine::run_script(FileXML *script) int RecordEngine::run_script(FileXML *script)
{ {
int result = 0, script_result = 0; int result = 0, script_result = 0;
char string[1024]; char string[1024];
while(!result && !script_result) while(!result && !script_result)
{ {
result = script->read_tag(); result = script->read_tag();
skipping to change at line 198 skipping to change at line 199
// ============================================= accounting // ============================================= accounting
long RecordEngine::get_dc_offset(int offset) long RecordEngine::get_dc_offset(int offset)
{ {
return record->dc_offset[offset]; return record->dc_offset[offset];
} }
int RecordEngine::set_dc_offset(long new_offset, int number) int RecordEngine::set_dc_offset(long new_offset, int number)
{ {
adevice->set_dc_offset(new_offset, number); adevice->set_dc_offset(new_offset, number);
return 0;
} }
long int RecordEngine::get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc _offset_text) long int RecordEngine::get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc _offset_text)
{ {
return adevice->get_dc_offset(dc_offset, dc_offset_text); return adevice->get_dc_offset(dc_offset, dc_offset_text);
} }
int RecordEngine::set_gui(RecordGUI *gui) int RecordEngine::set_gui(RecordGUI *gui)
{ {
this->gui = gui; this->gui = gui;
update_position(current_position); update_position(current_position);
return 0;
} }
int RecordEngine::get_duplex_enable() int RecordEngine::get_duplex_enable()
{ {
return record->enable_duplex(); return record->enable_duplex();
} }
// ================================================ operations // ================================================ operations
int RecordEngine::open_input_devices(int duplex) int RecordEngine::open_input_devices(int duplex)
skipping to change at line 484 skipping to change at line 487
{ {
if(record->do_audio) if(record->do_audio)
adevice->close_all(); adevice->close_all();
// Video is already open for monitoring // Video is already open for monitoring
return 0; return 0;
} }
int RecordEngine::lock_window() int RecordEngine::lock_window()
{ {
gui->lock_window(); gui->lock_window();
return 0;
} }
int RecordEngine::unlock_window() int RecordEngine::unlock_window()
{ {
gui->unlock_window(); gui->unlock_window();
return 0;
} }
int RecordEngine::update_position(long new_position) int RecordEngine::update_position(long new_position)
{ {
if(new_position < 0) new_position = 0; // fread error in filepcm if(new_position < 0) new_position = 0; // fread error in filepcm
current_position = new_position; current_position = new_position;
gui->update_position(new_position); gui->update_position(new_position);
if(new_position > total_length) if(new_position > total_length)
skipping to change at line 516 skipping to change at line 521
prev_label = labels->get_prev_label(new_position); prev_label = labels->get_prev_label(new_position);
gui->update_prev_label(prev_label); gui->update_prev_label(prev_label);
} }
if(next_label != labels->get_next_label(new_position)) if(next_label != labels->get_next_label(new_position))
{ {
next_label = labels->get_next_label(new_position); next_label = labels->get_next_label(new_position);
gui->update_next_label(next_label); gui->update_next_label(next_label);
} }
return 0;
} }
int RecordEngine::goto_prev_label() int RecordEngine::goto_prev_label()
{ {
if(!is_saving) if(!is_saving)
{ {
stop_operation(); stop_operation();
long new_position; long new_position;
new_position = labels->goto_prev_label(current_position); new_position = labels->goto_prev_label(current_position);
if(new_position != -1) if(new_position != -1)
{ {
// if(record->do_audio) file->set_audio_position(new_positio n); // if(record->do_audio) file->set_audio_position(new_positio n);
if(record->do_video) file->set_video_position(Units::tofr ames(new_position, record->get_samplerate(), record->get_framerate()), record->g et_framerate()); if(record->do_video) file->set_video_position(Units::tofr ames(new_position, record->get_samplerate(), record->get_framerate()), record->g et_framerate());
update_position(new_position); update_position(new_position);
} }
} }
return 0;
} }
int RecordEngine::goto_next_label() int RecordEngine::goto_next_label()
{ {
if(!is_saving) if(!is_saving)
{ {
stop_operation(); stop_operation();
long new_position; long new_position;
new_position = labels->goto_next_label(current_position); new_position = labels->goto_next_label(current_position);
skipping to change at line 581 skipping to change at line 588
if(record->do_audio) if(record->do_audio)
{ {
set_dc_offset(new_value, channel); set_dc_offset(new_value, channel);
record->dc_offset[channel] = new_value; record->dc_offset[channel] = new_value;
} }
return 0; return 0;
} }
int RecordEngine::reset_over() int RecordEngine::reset_over()
{ {
return 0;
} }
int RecordEngine::set_done(int value) int RecordEngine::set_done(int value)
{ {
stop_operation(1); stop_operation(1);
stop_monitor(); stop_monitor();
gui->set_done(value); gui->set_done(value);
return 0;
} }
int RecordEngine::start_over() int RecordEngine::start_over()
{ {
if((record->do_audio && file->get_audio_length() > 0) || if((record->do_audio && file->get_audio_length() > 0) ||
(record->do_video && file->get_video_length(record->get_framerate ()) > 0)) (record->do_video && file->get_video_length(record->get_framerate ()) > 0))
{ {
RecConfirmDelete dialog(mwindow); RecConfirmDelete dialog(mwindow);
dialog.create_objects(_("start over")); dialog.create_objects(_("start over"));
int result = dialog.run_window(); int result = dialog.run_window();
skipping to change at line 615 skipping to change at line 624
// start the engine over // start the engine over
labels->delete_new_labels(); labels->delete_new_labels();
update_position(0); update_position(0);
total_length = 0; total_length = 0;
// gui->update_total_length(0); // gui->update_total_length(0);
record->startsource_sample = 0; record->startsource_sample = 0;
record->startsource_frame = 0; record->startsource_frame = 0;
} }
} }
return 0;
} }
int RecordEngine::change_channel(Channel *channel) int RecordEngine::change_channel(Channel *channel)
{ {
if(record->do_video && vdevice) if(record->do_video && vdevice)
return vdevice->set_channel(channel); return vdevice->set_channel(channel);
else else
return 0; return 0;
} }
skipping to change at line 640 skipping to change at line 650
return 0; return 0;
} }
int RecordEngine::get_vu_format() { return record->get_vu_format(); } int RecordEngine::get_vu_format() { return record->get_vu_format(); }
int RecordEngine::get_dither() { return record->default_asset->dither * record-> default_asset->bits; } int RecordEngine::get_dither() { return record->default_asset->dither * record-> default_asset->bits; }
int RecordEngine::get_input_channels() { return asset->channels; } int RecordEngine::get_input_channels() { return asset->channels; }
int RecordEngine::get_format(char *string) int RecordEngine::get_format(char *string)
{ {
File file; File file;
strcpy(string, file.formattostr(mwindow->plugindb, asset->format)); strcpy(string, file.formattostr(mwindow->plugindb, asset->format));
return 0;
} }
int RecordEngine::get_samplerate() { return asset->rate; } int RecordEngine::get_samplerate() { return asset->rate; }
int RecordEngine::get_bits() { return asset->bits; } int RecordEngine::get_bits() { return asset->bits; }
int RecordEngine::get_time_format() { return record->get_time_format(); } int RecordEngine::get_time_format() { return record->get_time_format(); }
float RecordEngine::get_frame_rate() { return record->get_frame_rate(); } float RecordEngine::get_frame_rate() { return record->get_frame_rate(); }
int RecordEngine::get_loop_hr() { return record->loop_duration / asset->rate / 3 600; } int RecordEngine::get_loop_hr() { return record->loop_duration / asset->rate / 3 600; }
int RecordEngine::get_loop_min() { return record->loop_duration / asset->rate / 60 - (long)get_loop_hr() * 60; } int RecordEngine::get_loop_min() { return record->loop_duration / asset->rate / 60 - (long)get_loop_hr() * 60; }
int RecordEngine::get_loop_sec() { return record->loop_duration / asset->rate - (long)get_loop_hr() * 3600 - (long)get_loop_min() * 60; } int RecordEngine::get_loop_sec() { return record->loop_duration / asset->rate - (long)get_loop_hr() * 3600 - (long)get_loop_min() * 60; }
long RecordEngine::get_loop_duration() { return record->loop_duration; } long RecordEngine::get_loop_duration() { return record->loop_duration; }
float RecordEngine::get_min_db() { return record->get_min_db(); } float RecordEngine::get_min_db() { return record->get_min_db(); }
int RecordEngine::get_meter_over_hold(int divisions) { return divisions * 15; } int RecordEngine::get_meter_over_hold(int divisions) { return divisions * 15; }
int RecordEngine::get_meter_peak_hold(int divisions) { return divisions * 2; } int RecordEngine::get_meter_peak_hold(int divisions) { return divisions * 2; }
int RecordEngine::get_meter_speed() { return record->get_meter_speed(); } int RecordEngine::get_meter_speed() { return record->get_meter_speed(); }
float RecordEngine::get_frames_per_foot() { /* return mwindow->preferences->fram es_per_foot; */ } float RecordEngine::get_frames_per_foot() { /* return mwindow->preferences->fram es_per_foot; */ }
int RecordEngine::set_monitor_video(int value) int RecordEngine::set_monitor_video(int value)
{ {
return 0;
} }
int RecordEngine::set_monitor_audio(int value) int RecordEngine::set_monitor_audio(int value)
{ {
return 0;
} }
int RecordEngine::set_record_mode(char *text) int RecordEngine::set_record_mode(char *text)
{ {
record->record_mode = text_to_mode(text); record->record_mode = text_to_mode(text);
return 0;
} }
int RecordEngine::get_record_mode(char *text) int RecordEngine::get_record_mode(char *text)
{ {
mode_to_text(text, record->record_mode); mode_to_text(text, record->record_mode);
return 0;
} }
int RecordEngine::get_record_mode() int RecordEngine::get_record_mode()
{ {
return record->record_mode; return record->record_mode;
return 0;
} }
int RecordEngine::mode_to_text(char *string, int mode) int RecordEngine::mode_to_text(char *string, int mode)
{ {
switch(mode) switch(mode)
{ {
case 0: sprintf(string, _("Untimed")); break; case 0: sprintf(string, _("Untimed")); break;
case 1: sprintf(string, _("Timed")); break; case 1: sprintf(string, _("Timed")); break;
case 2: sprintf(string, _("Loop")); break; case 2: sprintf(string, _("Loop")); break;
} }
return 0;
} }
int RecordEngine::text_to_mode(char *string) int RecordEngine::text_to_mode(char *string)
{ {
if(!strcasecmp(string, _("Untimed"))) return 0; if(!strcasecmp(string, _("Untimed"))) return 0;
if(!strcasecmp(string, _("Timed"))) return 1; if(!strcasecmp(string, _("Timed"))) return 1;
if(!strcasecmp(string, _("Loop"))) return 2; if(!strcasecmp(string, _("Loop"))) return 2;
return 0;
} }
long RecordEngine::get_current_delay() long RecordEngine::get_current_delay()
{ {
if(current_jump_jump > 0) current_jump_jump--; if(current_jump_jump > 0) current_jump_jump--;
if(current_jump_jump == 0 && current_jump_delay < /*JUMP_DELAYS*/ 1) if(current_jump_jump == 0 && current_jump_delay < /*JUMP_DELAYS*/ 1)
{ {
current_jump_delay++; current_jump_delay++;
current_jump_jump = current_jump_jumps[current_jump_delay]; current_jump_jump = current_jump_jumps[current_jump_delay];
} }
return jump_delay[current_jump_delay]; return jump_delay[current_jump_delay];
} }
int RecordEngine::reset_current_delay() int RecordEngine::reset_current_delay()
{ {
current_jump_delay = 0; current_jump_delay = 0;
current_jump_jump = current_jump_jumps[current_jump_delay]; current_jump_jump = current_jump_jumps[current_jump_delay];
return 0;
} }
int RecordEngine::set_loop_duration() int RecordEngine::set_loop_duration()
{ {
record->set_loop_duration((long)record->get_samplerate() * (atol(gui->loo p_sec->get_text()) + atol(gui->loop_min->get_text()) * 60 + atol(gui->loop_hr->g et_text()) * 3600)); record->set_loop_duration((long)record->get_samplerate() * (atol(gui->loo p_sec->get_text()) + atol(gui->loop_min->get_text()) * 60 + atol(gui->loop_hr->g et_text()) * 3600));
return 0;
} }
// Remember to change meters if you change this. // Remember to change meters if you change this.
// Return the size of the fragments to read from the audio device. // Return the size of the fragments to read from the audio device.
int RecordEngine::get_in_length() int RecordEngine::get_in_length()
{ {
long fragment_size = 1; long fragment_size = 1;
while(fragment_size < asset->rate / record->get_meter_speed()) fragment_s ize *= 2; while(fragment_size < asset->rate / record->get_meter_speed()) fragment_s ize *= 2;
fragment_size /= 2; fragment_size /= 2;
return fragment_size; return fragment_size;
 End of changes. 20 change blocks. 
0 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)