X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Frecord.C;h=3ea53a42ffa4a82da550707c819d252afc8c1ce1;hb=38cb4182e11e57fc426bede3825e825e9d61433b;hp=bf2c32df2048fd321d3d09aec88d54c481dc2e2b;hpb=49f85559268fc040fe7ba5611cc0520793cf728b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/record.C b/cinelerra-5.1/cinelerra/record.C index bf2c32df..3ea53a42 100644 --- a/cinelerra-5.1/cinelerra/record.C +++ b/cinelerra-5.1/cinelerra/record.C @@ -1,21 +1,21 @@ /* * CINELERRA * Copyright (C) 2009-2013 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "asset.h" @@ -163,7 +163,7 @@ Record::Record(MWindow *mwindow, RecordMenuItem *menu_item) Record::~Record() { mwindow->gui->record = 0; - stop(); join(); + stop(); delete blink_status; delete cutads_status; stop_skimming(); @@ -230,6 +230,8 @@ int Record::load_defaults() video_zoom = defaults->get("RECORD_VIDEO_Z", (float)1); picture->load_defaults(); reverse_interlace = defaults->get("REVERSE_INTERLACE", 0); + do_cursor = defaults->get("RECORD_CURSOR", 0); + do_big_cursor = defaults->get("RECORD_BIG_CURSOR", 0); for( int i=0; iget(string, 0); @@ -266,6 +268,8 @@ int Record::save_defaults() defaults->update("RECORD_VIDEO_Z", video_zoom); picture->save_defaults(); defaults->update("REVERSE_INTERLACE", reverse_interlace); + defaults->update("RECORD_CURSOR", do_cursor); + defaults->update("RECORD_BIG_CURSOR", do_big_cursor); for( int i=0; iupdate(string, dc_offset[i]); @@ -369,7 +373,7 @@ void Record::run() if( channel ) video_stream = channel->video_stream; } - stop(); + stop(0); edl->Garbage::remove_user(); if( mwindow->gui->remote_control->deactivate() ) @@ -401,9 +405,10 @@ void Record::run() mwindow->undo->update_undo_before(); // For pasting, clear the active region if(load_mode == LOADMODE_PASTE) - mwindow->clear(0); - - mwindow->paste_edls(&new_edls, load_mode, 0, -1, + mwindow->clear(0, 1); + int loadmode = load_mode == LOADMODE_RESOURCESONLY ? + LOADMODE_ASSETSONLY : load_mode; + mwindow->paste_edls(&new_edls, loadmode, 0, -1, SESSION->labels_follow_edits, SESSION->plugins_follow_edits, SESSION->autos_follow_edits, @@ -433,9 +438,13 @@ void Record::run() default_asset->Garbage::remove_user(); } -void Record::stop() +void Record::stop(int wait) { stop_operation(); + if( record_gui ) + record_gui->set_done(1); + if( wait ) + join(); window_lock->lock("Record::stop"); delete record_thread; record_thread = 0; delete record_monitor; record_monitor = 0; @@ -588,7 +597,6 @@ void Record::start() window_lock->unlock(); } else { - stop(); join(); init_lock->reset(); Thread::start(); } @@ -738,8 +746,8 @@ Channel *Record::get_editing_channel() return batch ? batch->channel : 0; } -ArrayList* Record::get_video_inputs() -{ +ArrayList* Record::get_video_inputs() +{ return default_asset->video_data && vdevice ? vdevice->get_inputs() : 0; } @@ -965,11 +973,11 @@ void Record::open_audio_input() if( adevice ) { int sw_pos = SESSION->record_positioning == RECORD_POS_SOFTWARE; adevice->set_software_positioning(sw_pos); - adevice->open_input(SESSION->aconfig_in, SESSION->vconfig_in, + adevice->open_input(SESSION->aconfig_in, SESSION->vconfig_in, default_asset->sample_rate, get_fragment_samples(), default_asset->channels, SESSION->real_time_record); adevice->start_recording(); - adevice->open_monitor(SESSION->playback_config->aconfig,monitor_audio); + adevice->open_monitor(SESSION->playback_config->aconfig,monitor_audio); adevice->set_vdevice(vdevice); if( vdevice ) vdevice->set_adevice(adevice); } @@ -992,6 +1000,7 @@ void Record::open_video_input() master_channel->copy_usage(vdevice->channel); picture->copy_usage(vdevice->picture); vdevice->set_field_order(reverse_interlace); + vdevice->set_do_cursor(do_cursor, do_big_cursor); vdevice->set_adevice(adevice); if( adevice ) adevice->set_vdevice(vdevice); set_dev_channel(get_current_channel()); @@ -1068,7 +1077,7 @@ int Record::start_toc() Asset *asset = batch->asset; char source_filename[BCTEXTLEN], toc_path[BCTEXTLEN]; IndexFile::get_index_filename(source_filename, - mwindow->preferences->index_directory, + mwindow->preferences->index_directory, toc_path, asset->path,".toc"); if( default_asset->video_data ) return vdevice->start_toc(asset->path, toc_path); @@ -1092,8 +1101,8 @@ void Record::start_writing_file() if( !writing_file ) { written_frames = 0; written_samples = 0; - do_video = File::supports_video(default_asset->format); - do_audio = File::supports_audio(default_asset->format); + do_video = File::renders_video(default_asset); + do_audio = File::renders_audio(default_asset); if( single_frame ) do_audio = 0; if( !do_video && single_frame ) single_frame = 0; @@ -1204,11 +1213,15 @@ void Record::set_power_off(int value) record_gui->power_off->update(value); } -int Record::set_video_picture() +void Record::set_video_picture() { if( default_asset->video_data && vdevice ) vdevice->set_picture(picture); - return 0; +} + +void Record::set_do_cursor() +{ + vdevice->set_do_cursor(do_cursor, do_big_cursor); } void Record::set_translation(int x, int y) @@ -1524,7 +1537,7 @@ display_cut_icon(int x, int y) #ifdef HAVE_DVB DeviceDVBInput *Record:: dvb_device() -{ +{ DeviceDVBInput *dvb_dev = !vdevice ? 0 : (DeviceDVBInput *)vdevice->mpeg_device(); if( !dvb_dev ) dvb_dev = !adevice ? 0 :