Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

File Class Reference

#include <file.h>

List of all members.

Public Member Functions

 File ()
 ~File ()
int get_options (FormatTools *format, int audio_options, int video_options, int lock_compressor)
int raise_window ()
void close_window ()
int set_processors (int cpus)
int set_preload (int64_t size)
void set_asset (Asset *asset)
void set_cache_frames (int value)
int purge_cache ()
int open_file (Preferences *preferences, Asset *asset, int rd, int wr, int64_t base_samplerate, float base_framerate)
int get_index (char *index_path)
int start_audio_thread (int64_t buffer_size, int ring_buffers)
int stop_audio_thread ()
int start_video_thread (int64_t buffer_size, int color_model, int ring_buffers, int compressed)
int stop_video_thread ()
int lock_read ()
int unlock_read ()
int close_file (int ignore_thread=0)
int set_channel (int channel)
int set_layer (int layer)
int64_t get_audio_length (int64_t base_samplerate=-1)
int64_t get_video_length (float base_framerate=-1)
int64_t get_audio_position (int64_t base_samplerate=-1)
int64_t get_video_position (float base_framerate=-1)
int set_audio_position (int64_t position, float base_samplerate)
int set_video_position (int64_t position, float base_framerate)
int write_samples (double **buffer, int64_t len)
int write_frames (VFrame ***frames, int len)
double ** get_audio_buffer ()
VFrame *** get_video_buffer ()
FrameCacheget_frame_cache ()
int write_audio_buffer (int64_t len)
int write_video_buffer (int64_t len)
int read_samples (double *buffer, int64_t len, int64_t base_samplerate, float *buffer_float=0)
int read_frame (VFrame *frame)
int can_copy_from (Edit *edit, int64_t position, int output_w, int output_h)
int get_render_strategy (ArrayList< int > *render_strategies)
int64_t compressed_frame_size ()
int read_compressed_frame (VFrame *buffer)
int write_compressed_frame (VFrame *buffer)
int get_best_colormodel (int driver)
int colormodel_supported (int colormodel)
int get_memory_usage ()
int bytes_per_sample (int bits)

Static Public Member Functions

static int get_best_colormodel (Asset *asset, int driver)
static int supports_video (ArrayList< PluginServer * > *plugindb, char *format)
static int supports_audio (ArrayList< PluginServer * > *plugindb, char *format)
static int supports_video (int format)
static int supports_audio (int format)
static int strtoformat (char *format)
static char * formattostr (int format)
static int strtoformat (ArrayList< PluginServer * > *plugindb, char *format)
static char * formattostr (ArrayList< PluginServer * > *plugindb, int format)
static int strtobits (char *bits)
static char * bitstostr (int bits)
static int str_to_byteorder (char *string)
static char * byteorder_to_str (int byte_order)

Public Attributes

Assetasset
FileBasefile
FileThreadaudio_thread
FileThreadvideo_thread
VFrame * temp_frame
Resampleresample
Resample_floatresample_float
Condition * write_lock
int cpus
int64_t playback_preload
int64_t current_sample
int64_t current_frame
int current_channel
int current_layer
int64_t normalized_sample
int64_t normalized_sample_rate
Preferencespreferences

Private Member Functions

void reset_parameters ()

Private Attributes

int getting_options
BC_WindowBase * format_window
Mutex * format_completion
FrameCacheframe_cache
int use_cache


Detailed Description

Definition at line 28 of file file.h.


Constructor & Destructor Documentation

File::File  ) 
 

Definition at line 41 of file file.C.

References asset, cpus, format_completion, frame_cache, reset_parameters(), and write_lock.

File::~File  ) 
 

Definition at line 51 of file file.C.

References asset, close_file(), format_completion, format_window, frame_cache, getting_options, reset_parameters(), temp_frame, and write_lock.


Member Function Documentation

char * File::bitstostr int  bits  )  [static]
 

Definition at line 1292 of file file.C.

Referenced by RecordGUI::create_objects(), BitsPopup::create_objects(), and AssetEditWindow::create_objects().

char * File::byteorder_to_str int  byte_order  )  [static]
 

Definition at line 1333 of file file.C.

References _.

Referenced by ByteOrderPopup::create_objects().

int File::bytes_per_sample int  bits  ) 
 

Definition at line 1339 of file file.C.

Referenced by FileBase::get_audio_buffer(), FileBase::raw_to_samples(), and FileBase::samples_to_raw().

int File::can_copy_from Edit edit,
int64_t  position,
int  output_w,
int  output_h
 

Definition at line 1089 of file file.C.

References Edit::asset, FileBase::can_copy_from(), file, Asset::height, and Asset::width.

Referenced by PackageRenderer::direct_copy_possible().

int File::close_file int  ignore_thread = 0  ) 
 

Definition at line 560 of file file.C.

References asset, Asset::audio_length, FileBase::close_file(), current_frame, current_sample, file, resample, resample_float, reset_parameters(), stop_audio_thread(), stop_video_thread(), Asset::video_length, and FileBase::wr.

Referenced by PackageRenderer::close_output(), Record::close_output_file(), IndexFile::create_index(), Record::init_next_file(), MenuEffectThread::run(), RecordEngine::start_over(), Record::start_over(), and ~File().

void File::close_window  ) 
 

Definition at line 100 of file file.C.

References format_window, and getting_options.

Referenced by FormatTools::close_format_windows().

int File::colormodel_supported int  colormodel  ) 
 

Definition at line 1423 of file file.C.

References FileBase::colormodel_supported(), and file.

Referenced by read_frame().

int64_t File::compressed_frame_size  ) 
 

Definition at line 994 of file file.C.

References FileBase::compressed_frame_size(), and file.

char * File::formattostr ArrayList< PluginServer * > *  plugindb,
int  format
[static]
 

Definition at line 1178 of file file.C.

References _, PNG_NAME, and VORBIS_NAME.

char * File::formattostr int  format  )  [static]
 

Definition at line 1173 of file file.C.

Referenced by RecordGUI::create_objects(), FormatTools::create_objects(), AssetEditWindow::create_objects(), RecordEngine::get_format(), FormatTools::update(), and Asset::write().

double ** File::get_audio_buffer  ) 
 

Definition at line 894 of file file.C.

References audio_thread, and FileThread::get_audio_buffer().

Referenced by PackageRenderer::do_audio(), APluginArray::get_buffers(), APluginArray::process_loop(), RecordAudio::run(), and RecordAudio::write_buffer().

int64_t File::get_audio_length int64_t  base_samplerate = -1  ) 
 

Definition at line 682 of file file.C.

References asset, Asset::audio_length, and Asset::sample_rate.

Referenced by IndexFile::create_index(), IndexFile::get_required_scale(), RecordEngine::initialize(), and RecordEngine::start_over().

int64_t File::get_audio_position int64_t  base_samplerate = -1  ) 
 

Definition at line 719 of file file.C.

References asset, current_sample, normalized_sample, normalized_sample_rate, and Asset::sample_rate.

Referenced by Record::current_audio_position(), Resample_float::resample(), and Resample::resample().

int File::get_best_colormodel Asset asset,
int  driver
[static]
 

Definition at line 1374 of file file.C.

References Asset::format, FileTGA::get_best_colormodel(), FilePNG::get_best_colormodel(), FileYUV::get_best_colormodel(), FileEXR::get_best_colormodel(), FileJPEG::get_best_colormodel(), FileMPEG::get_best_colormodel(), FileMOV::get_best_colormodel(), and FileDV::get_best_colormodel().

int File::get_best_colormodel int  driver  ) 
 

Definition at line 1369 of file file.C.

References asset.

Referenced by VDeviceV4L::get_best_colormodel(), VDeviceBase::get_best_colormodel(), and VRender::get_colormodel().

FrameCache * File::get_frame_cache  ) 
 

Definition at line 1443 of file file.C.

References frame_cache.

Referenced by ResourcePixmap::draw_video_resource().

int File::get_index char *  index_path  ) 
 

Definition at line 590 of file file.C.

References file, and FileBase::get_index().

Referenced by MainIndexes::add_next_asset(), and IndexFile::create_index().

int File::get_memory_usage  ) 
 

Definition at line 1432 of file file.C.

References file, frame_cache, FrameCache::get_memory_usage(), FileBase::get_memory_usage(), and temp_frame.

Referenced by CICache::get_memory_usage().

int File::get_options FormatTools format,
int  audio_options,
int  video_options,
int  lock_compressor
 

Definition at line 111 of file file.C.

References _, FormatTools::asset, asset, Asset::format, format_completion, format_window, FileOGG::get_parameters(), FileTIFF::get_parameters(), FileTGA::get_parameters(), FilePNG::get_parameters(), FileYUV::get_parameters(), FileEXR::get_parameters(), FileJPEG::get_parameters(), FileAVI::get_parameters(), FileMPEG::get_parameters(), FileMOV::get_parameters(), FileSndFile::get_parameters(), FileDV::get_parameters(), FileAC3::get_parameters(), getting_options, FormatTools::plugindb, and FormatTools::window.

Referenced by FormatVThread::run(), and FormatAThread::run().

int File::get_render_strategy ArrayList< int > *  render_strategies  ) 
 

VFrame *** File::get_video_buffer  ) 
 

Definition at line 900 of file file.C.

References FileThread::get_video_buffer(), and video_thread.

Referenced by VPluginArray::get_buffers(), VPluginArray::process_loop(), RecordVideo::rewind_file(), RecordVideo::run(), and RecordVideo::write_buffer().

int64_t File::get_video_length float  base_framerate = -1  ) 
 

Definition at line 696 of file file.C.

References asset, Asset::frame_rate, and Asset::video_length.

Referenced by VModule::import_frame(), RecordEngine::initialize(), and RecordEngine::start_over().

int64_t File::get_video_position float  base_framerate = -1  ) 
 

Definition at line 711 of file file.C.

References asset, current_frame, and Asset::frame_rate.

Referenced by Record::current_video_position(), and RecordVideo::run().

int File::lock_read  ) 
 

Definition at line 647 of file file.C.

int File::open_file Preferences preferences,
Asset asset,
int  rd,
int  wr,
int64_t  base_samplerate,
float  base_framerate
 

Definition at line 301 of file file.C.

References FileMOV::check_sig(), FileMPEG::check_sig(), FileVorbis::check_sig(), FileOGG::check_sig(), FileTIFF::check_sig(), FileTGA::check_sig(), FileCR2::check_sig(), FileYUV::check_sig(), FileEXR::check_sig(), FileJPEG::check_sig(), FilePNG::check_sig(), FileSndFile::check_sig(), FileDV::check_sig(), Asset::dither, fclose(), file, fopen(), Asset::format, fread(), FileBase::open_file(), and FileBase::set_dither().

Referenced by MainIndexes::add_next_asset(), CICacheItem::CICacheItem(), PackageRenderer::create_output(), MWindow::load_filenames(), Record::open_output_file(), IndexFile::open_source(), and MenuEffectThread::run().

int File::purge_cache  ) 
 

Definition at line 286 of file file.C.

References FrameCache::delete_oldest(), and frame_cache.

Referenced by CICache::delete_oldest().

int File::raise_window  ) 
 

Definition at line 90 of file file.C.

References format_window, and getting_options.

Referenced by FormatTools::set_audio_options(), and FormatTools::set_video_options().

int File::read_compressed_frame VFrame *  buffer  ) 
 

Definition at line 985 of file file.C.

References current_frame, file, and FileBase::read_compressed_frame().

int File::read_frame VFrame *  frame  ) 
 

Definition at line 1005 of file file.C.

References asset, colormodel_supported(), current_frame, file, frame_cache, Asset::frame_rate, FrameCache::get_frame(), Asset::height, FrameCache::put_frame(), FileBase::read_frame(), temp_frame, use_cache, and Asset::width.

Referenced by AssetPicon::create_objects(), ResourcePixmap::draw_video_resource(), VRender::process_buffer(), and VEdit::read_frame().

int File::read_samples double *  buffer,
int64_t  len,
int64_t  base_samplerate,
float *  buffer_float = 0
 

Definition at line 907 of file file.C.

References asset, Asset::audio_length, Asset::channels, current_channel, current_sample, file, normalized_sample, FileBase::prefer_samples_float(), FileBase::read_samples(), FileBase::read_samples_float(), Resample_float::resample(), Resample::resample(), resample, resample_float, and Asset::sample_rate.

Referenced by IndexFile::create_index(), ResourcePixmap::draw_audio_source(), Resample_float::read_chunk(), Resample::read_chunk(), and AModule::render().

void File::reset_parameters  )  [private]
 

Definition at line 70 of file file.C.

References audio_thread, current_channel, current_frame, current_layer, current_sample, file, format_window, getting_options, normalized_sample, normalized_sample_rate, preferences, resample, resample_float, temp_frame, use_cache, and video_thread.

Referenced by close_file(), File(), and ~File().

void File::set_asset Asset asset  ) 
 

Definition at line 264 of file file.C.

Referenced by CICache::update().

int File::set_audio_position int64_t  position,
float  base_samplerate
 

Definition at line 740 of file file.C.

References asset, current_sample, file, normalized_sample, normalized_sample_rate, REPOSITION, resample, Resample::reset(), Asset::sample_rate, and FileBase::set_audio_position().

Referenced by IndexFile::create_index(), ResourcePixmap::draw_audio_source(), Resample_float::read_chunk(), Resample::read_chunk(), AModule::render(), and Record::rewind_file().

void File::set_cache_frames int  value  ) 
 

Definition at line 281 of file file.C.

References use_cache.

Referenced by VRender::process_buffer(), and VEdit::read_frame().

int File::set_channel int  channel  ) 
 

Definition at line 659 of file file.C.

References asset, Asset::channels, current_channel, and file.

Referenced by IndexFile::create_index(), ResourcePixmap::draw_audio_source(), and AModule::render().

int File::set_layer int  layer  ) 
 

Definition at line 670 of file file.C.

References asset, current_layer, file, and Asset::layers.

Referenced by AssetPicon::create_objects(), ResourcePixmap::draw_video_resource(), and VEdit::read_frame().

int File::set_preload int64_t  size  ) 
 

Definition at line 275 of file file.C.

References playback_preload.

Referenced by CICacheItem::CICacheItem().

int File::set_processors int  cpus  ) 
 

Definition at line 269 of file file.C.

Referenced by CICacheItem::CICacheItem(), PackageRenderer::create_output(), Record::open_output_file(), and MenuEffectThread::run().

int File::set_video_position int64_t  position,
float  base_framerate
 

Definition at line 797 of file file.C.

References asset, current_frame, file, Asset::frame_rate, and FileBase::set_video_position().

Referenced by AssetPicon::create_objects(), ResourcePixmap::draw_video_resource(), RecordEngine::goto_next_label(), RecordEngine::goto_prev_label(), VRender::process_buffer(), VEdit::read_frame(), RecordVideo::rewind_file(), and Record::rewind_file().

int File::start_audio_thread int64_t  buffer_size,
int  ring_buffers
 

Definition at line 601 of file file.C.

References audio_thread, and FileThread::start_writing().

Referenced by APluginArray::create_buffers(), PackageRenderer::create_engine(), and RecordThread::run().

int File::start_video_thread int64_t  buffer_size,
int  color_model,
int  ring_buffers,
int  compressed
 

Definition at line 608 of file file.C.

References FileThread::start_writing(), and video_thread.

Referenced by VPluginArray::create_buffers(), PackageRenderer::create_engine(), RecordVideo::rewind_file(), and RecordThread::run().

int File::stop_audio_thread  ) 
 

Definition at line 623 of file file.C.

References audio_thread, and FileThread::stop_writing().

Referenced by close_file(), RecordThread::run(), PackageRenderer::stop_output(), and APluginArray::~APluginArray().

int File::stop_video_thread  ) 
 

Definition at line 635 of file file.C.

References FileThread::stop_writing(), and video_thread.

Referenced by close_file(), PackageRenderer::direct_frame_copy(), RecordVideo::rewind_file(), RecordThread::run(), PackageRenderer::stop_output(), and VPluginArray::~VPluginArray().

int File::str_to_byteorder char *  string  )  [static]
 

Definition at line 1327 of file file.C.

References _.

Referenced by ByteOrderText::handle_event().

int File::strtobits char *  bits  )  [static]
 

Definition at line 1279 of file file.C.

References _.

Referenced by BitsPopupText::handle_event().

int File::strtoformat ArrayList< PluginServer * > *  plugindb,
char *  format
[static]
 

Definition at line 1109 of file file.C.

References _, PNG_NAME, and VORBIS_NAME.

int File::strtoformat char *  format  )  [static]
 

Definition at line 1104 of file file.C.

Referenced by FormatFormat::handle_event(), AssetEditFormat::handle_event(), Asset::read(), supports_audio(), and supports_video().

int File::supports_audio int  format  )  [static]
 

Definition at line 1500 of file file.C.

int File::supports_audio ArrayList< PluginServer * > *  plugindb,
char *  format
[static]
 

Definition at line 1456 of file file.C.

References strtoformat().

Referenced by Render::check_asset(), FormatCheck::check_format(), and MenuAEffectThread::get_derived_attributes().

int File::supports_video int  format  )  [static]
 

Definition at line 1465 of file file.C.

int File::supports_video ArrayList< PluginServer * > *  plugindb,
char *  format
[static]
 

Definition at line 1448 of file file.C.

References strtoformat().

Referenced by Render::check_asset(), FormatCheck::check_format(), and MenuVEffectThread::get_derived_attributes().

int File::unlock_read  ) 
 

Definition at line 653 of file file.C.

int File::write_audio_buffer int64_t  len  ) 
 

Definition at line 873 of file file.C.

References audio_thread, and FileThread::write_buffer().

Referenced by PackageRenderer::do_audio(), RecordAudio::write_buffer(), and APluginArray::write_buffers().

int File::write_compressed_frame VFrame *  buffer  ) 
 

Definition at line 861 of file file.C.

References asset, current_frame, file, Asset::video_length, FileBase::write_compressed_frame(), and write_lock.

Referenced by FileThread::run().

int File::write_frames VFrame ***  frames,
int  len
 

Definition at line 838 of file file.C.

References asset, current_frame, file, Asset::video_length, FileBase::write_frames(), and write_lock.

Referenced by PackageRenderer::direct_frame_copy(), and FileThread::run().

int File::write_samples double **  buffer,
int64_t  len
 

Definition at line 820 of file file.C.

References asset, Asset::audio_length, current_sample, file, normalized_sample, write_lock, and FileBase::write_samples().

Referenced by FileThread::run().

int File::write_video_buffer int64_t  len  ) 
 

Definition at line 883 of file file.C.

References video_thread, and FileThread::write_buffer().

Referenced by PackageRenderer::direct_frame_copy(), PackageRenderer::stop_output(), RecordVideo::write_buffer(), and VPluginArray::write_buffers().


Member Data Documentation

Asset* File::asset
 

Definition at line 182 of file file.h.

Referenced by CICacheItem::CICacheItem(), FileMPEG::close_file(), close_file(), File(), get_audio_length(), get_audio_position(), get_best_colormodel(), get_options(), get_video_length(), get_video_position(), MWindow::load_filenames(), SigHandler::pull_file(), SigHandler::push_file(), read_frame(), read_samples(), MenuEffectThread::run(), FileThread::run(), set_audio_position(), set_channel(), set_layer(), set_video_position(), FileThread::start_writing(), FileThread::stop_writing(), CICache::update(), write_compressed_frame(), write_frames(), write_samples(), and ~File().

FileThread* File::audio_thread
 

Definition at line 185 of file file.h.

Referenced by get_audio_buffer(), reset_parameters(), start_audio_thread(), stop_audio_thread(), and write_audio_buffer().

int File::cpus
 

Definition at line 197 of file file.h.

Referenced by FileMOV::close_file(), File(), FileMPEG::open_file(), FileMOV::open_file(), FileList::open_file(), FileJPEGList::read_frame(), FileJPEGList::write_frame(), and FileMOV::write_frames().

int File::current_channel
 

Definition at line 206 of file file.h.

Referenced by Resample_float::read_chunk(), Resample::read_chunk(), FileVorbis::read_samples(), FileSndFile::read_samples(), FileOGG::read_samples(), FileMPEG::read_samples(), FileMOV::read_samples(), FileAVI::read_samples(), read_samples(), FileVorbis::read_samples_float(), FileMPEG::read_samples_float(), reset_parameters(), FileMPEG::set_audio_position(), set_channel(), and FileMPEG::to_streamchannel().

int64_t File::current_frame
 

Definition at line 205 of file file.h.

Referenced by close_file(), FileMOV::compressed_frame_size(), FileList::create_path(), get_video_position(), FileList::open_file(), FileMOV::read_compressed_frame(), read_compressed_frame(), FileMOV::read_frame(), FileList::read_frame(), read_frame(), FileMOV::read_raw(), reset_parameters(), set_video_position(), write_compressed_frame(), FileMOV::write_frames(), and write_frames().

int File::current_layer
 

Definition at line 207 of file file.h.

Referenced by FileMOV::compressed_frame_size(), FileMOV::read_compressed_frame(), FileMPEG::read_frame(), FileMOV::read_frame(), FileAVI::read_frame(), FileMOV::read_raw(), reset_parameters(), FileAVI::set_audio_position(), set_layer(), FileMPEG::set_video_position(), FileMOV::set_video_position(), FileAVI::set_video_position(), and FileMOV::write_compressed_frame().

int64_t File::current_sample
 

Definition at line 204 of file file.h.

Referenced by close_file(), get_audio_position(), Resample_float::read_chunk(), Resample::read_chunk(), FileVorbis::read_samples(), FileMPEG::read_samples(), read_samples(), FileVorbis::read_samples_float(), FileMPEG::read_samples_float(), reset_parameters(), set_audio_position(), and write_samples().

FileBase* File::file
 

Definition at line 183 of file file.h.

Referenced by can_copy_from(), close_file(), colormodel_supported(), compressed_frame_size(), get_index(), get_memory_usage(), open_file(), read_compressed_frame(), read_frame(), read_samples(), reset_parameters(), set_audio_position(), set_channel(), set_layer(), set_video_position(), write_compressed_frame(), write_frames(), and write_samples().

Mutex* File::format_completion [private]
 

Definition at line 220 of file file.h.

Referenced by File(), get_options(), and ~File().

BC_WindowBase* File::format_window [private]
 

Definition at line 219 of file file.h.

Referenced by close_window(), get_options(), raise_window(), reset_parameters(), and ~File().

FrameCache* File::frame_cache [private]
 

Definition at line 221 of file file.h.

Referenced by File(), get_frame_cache(), get_memory_usage(), purge_cache(), read_frame(), and ~File().

int File::getting_options [private]
 

Definition at line 218 of file file.h.

Referenced by close_window(), get_options(), raise_window(), reset_parameters(), and ~File().

int64_t File::normalized_sample
 

Definition at line 210 of file file.h.

Referenced by get_audio_position(), read_samples(), reset_parameters(), set_audio_position(), and write_samples().

int64_t File::normalized_sample_rate
 

Definition at line 211 of file file.h.

Referenced by get_audio_position(), reset_parameters(), and set_audio_position().

int64_t File::playback_preload
 

Definition at line 198 of file file.h.

Referenced by set_preload().

Preferences* File::preferences
 

Definition at line 212 of file file.h.

Referenced by FileMPEG::create_index(), and reset_parameters().

Resample* File::resample
 

Definition at line 191 of file file.h.

Referenced by close_file(), read_samples(), reset_parameters(), and set_audio_position().

Resample_float* File::resample_float
 

Definition at line 192 of file file.h.

Referenced by close_file(), read_samples(), and reset_parameters().

VFrame* File::temp_frame
 

Definition at line 188 of file file.h.

Referenced by get_memory_usage(), read_frame(), reset_parameters(), and ~File().

int File::use_cache [private]
 

Definition at line 223 of file file.h.

Referenced by read_frame(), reset_parameters(), and set_cache_frames().

FileThread * File::video_thread
 

Definition at line 185 of file file.h.

Referenced by get_video_buffer(), reset_parameters(), start_video_thread(), stop_video_thread(), and write_video_buffer().

Condition* File::write_lock
 

Definition at line 196 of file file.h.

Referenced by File(), write_compressed_frame(), write_frames(), write_samples(), and ~File().


The documentation for this class was generated from the following files:
Generated on Sun Jan 8 13:39:14 2006 for Cinelerra-svn by  doxygen 1.4.4