r841: Merge 2.1 A Whole Heap of Whitespace
authorPierre Dumuid <pierre.dumuid@adelaide.edu.au>
Thu, 31 Aug 2006 07:41:53 +0000 (07:41 +0000)
committerPierre Dumuid <pierre.dumuid@adelaide.edu.au>
Thu, 31 Aug 2006 07:41:53 +0000 (07:41 +0000)
 - A whole heap of whitespace.
 - This also makes plugins/chromakeyhsv/chromakey.* diverge in difference
   between SVN and 2.1, but another patch will be applied that makes them
   closer again!!(git reference 0097c622893c2042de481aaea35ae39bb05bbe63)

This revision should match GIT::96ab32c2f0b9b7a427f415ba1d3107231a76462c

194 files changed:
cinelerra/aboutprefs.C
cinelerra/adeviceprefs.h
cinelerra/adeviceprefs.inc
cinelerra/amodule.C
cinelerra/arender.C
cinelerra/asset.C
cinelerra/assetedit.h
cinelerra/assetpopup.C
cinelerra/audioalsa.C
cinelerra/audioalsa.h
cinelerra/audiodevice.C
cinelerra/audiodevice.h
cinelerra/audioodevice.C
cinelerra/audiooss.C
cinelerra/autos.C
cinelerra/avc1394transport.C
cinelerra/awindowgui.C
cinelerra/batch.C
cinelerra/batchrender.C
cinelerra/cache.C
cinelerra/cache.h
cinelerra/canvas.h
cinelerra/channel.h
cinelerra/channeledit.C
cinelerra/channelpicker.C
cinelerra/cwindow.C
cinelerra/cwindowgui.C
cinelerra/dcraw.c
cinelerra/device1394output.C
cinelerra/device1394output.h
cinelerra/edit.C
cinelerra/edl.C
cinelerra/edlsession.h
cinelerra/fadeengine.h
cinelerra/file.C
cinelerra/file.h
cinelerra/file.inc
cinelerra/fileac3.C
cinelerra/filecr2.C
cinelerra/fileexr.C
cinelerra/filejpeg.C
cinelerra/filelist.C
cinelerra/filemov.C
cinelerra/filempeg.C
cinelerra/fileogg.C
cinelerra/filesndfile.C
cinelerra/filetga.C
cinelerra/filethread.C
cinelerra/filethread.h
cinelerra/filexml.C
cinelerra/floatautos.C
cinelerra/formatpopup.C
cinelerra/formatpresets.C
cinelerra/formattools.C
cinelerra/indexfile.C
cinelerra/loadfile.C
cinelerra/main.C
cinelerra/maincursor.C
cinelerra/mainsession.h
cinelerra/maskengine.C
cinelerra/maskengine.h
cinelerra/meterpanel.C
cinelerra/module.C
cinelerra/mtimebar.C
cinelerra/mwindow.C
cinelerra/mwindow.h
cinelerra/mwindowedit.C
cinelerra/mwindowgui.C
cinelerra/mwindowgui.h
cinelerra/mwindowmove.C
cinelerra/new.C
cinelerra/overlayframe.C
cinelerra/packagerenderer.C
cinelerra/patchbay.C
cinelerra/performanceprefs.C
cinelerra/picture.h
cinelerra/playbackengine.C
cinelerra/playbackprefs.C
cinelerra/playbackprefs.h
cinelerra/playtransport.C
cinelerra/playtransport.h
cinelerra/pluginclient.C
cinelerra/pluginclient.h
cinelerra/plugindialog.C
cinelerra/pluginserver.C
cinelerra/pluginserver.h
cinelerra/pluginvclient.h
cinelerra/preferences.h
cinelerra/preferencesthread.C
cinelerra/record.C
cinelerra/record.h
cinelerra/recordaudio.C
cinelerra/recordgui.C
cinelerra/recordmonitor.C
cinelerra/recordprefs.C
cinelerra/recordthread.C
cinelerra/recordvideo.C
cinelerra/render.C
cinelerra/renderfarm.C
cinelerra/renderfarm.h
cinelerra/renderfarmclient.C
cinelerra/renderfarmclient.h
cinelerra/resourcepixmap.C
cinelerra/setformat.C
cinelerra/setformat.h
cinelerra/timebar.C
cinelerra/track.C
cinelerra/trackcanvas.C
cinelerra/trackcanvas.h
cinelerra/vdeviceprefs.C
cinelerra/vdevicev4l.C
cinelerra/vdevicev4l2.C
cinelerra/vdevicex11.C
cinelerra/videodevice.C
cinelerra/videodevice.h
cinelerra/virtualaconsole.C
cinelerra/virtualvconsole.C
cinelerra/virtualvconsole.h
cinelerra/virtualvnode.C
cinelerra/vmodule.C
cinelerra/vrender.C
cinelerra/vrender.h
cinelerra/vtrack.C
cinelerra/vwindow.C
cinelerra/vwindowgui.C
doc/apatches.png [new file with mode: 0644]
doc/cinelerra.texi
doc/compress.png [new file with mode: 0644]
doc/vpatches.png [new file with mode: 0644]
guicast/arraylist.h
guicast/bcbitmap.C
guicast/bcbutton.C
guicast/bcfilebox.C
guicast/bclistbox.C
guicast/bclistbox.h
guicast/bcmenu.C
guicast/bcmenubar.C
guicast/bcpan.C
guicast/bcpixmap.h
guicast/bcpopupmenu.C
guicast/bcresources.C
guicast/bcresources.h
guicast/bcsignals.C
guicast/bcslider.C
guicast/bctextbox.C
guicast/bctimer.h
guicast/bctoggle.C
guicast/bcwindowbase.C
guicast/bcwindowbase.h
guicast/bcwindowdraw.C
guicast/condition.h
guicast/filesystem.C
guicast/filesystem.h
guicast/units.C
guicast/units.h
guicast/vframe.C
guicast/vframe.inc
libmpeg3/audio/layer2.c
libmpeg3/audio/mpeg3audio.c
libmpeg3/docs/index.html
libmpeg3/libmpeg3.c
libmpeg3/libmpeg3.h
libmpeg3/mpeg3cat.c
libmpeg3/mpeg3demux.c
libmpeg3/mpeg3ifo.c
libmpeg3/mpeg3private.h
libmpeg3/mpeg3protos.h
libmpeg3/mpeg3toc.c
libmpeg3/mpeg3tocutil.c
libmpeg3/mpeg3vtrack.c
libmpeg3/video/getpicture.c
libmpeg3/video/headers.c
libmpeg3/video/mpeg3video.c
libmpeg3/video/mpeg3video.h
libmpeg3/video/seek.c
mpeg2enc/mmx.h
mpeg2enc/quantize.c
mpeg2enc/quantize_x86.c
plugins/Makefile.am
plugins/chromakey/chromakey.C
plugins/chromakeyhsv/chromakey.C
plugins/colors/plugincolors.C
plugins/compressor/compressor.C
plugins/framefield/framefield.C
plugins/histogram/histogram.C
plugins/motion/affine.C
plugins/motion/motion.C
plugins/motion/motionwindow.C
plugins/motionblur/motionblur.C
quicktime/colormodels.c
quicktime/colormodels.h
quicktime/qtdv.c
quicktime/qtffmpeg.c
quicktime/quicktime.c

index ab6edeb..e2eb167 100644 (file)
@@ -44,7 +44,7 @@ int AboutPrefs::create_objects()
        y += get_text_height(LARGEFONT);
        char license2[BCTEXTLEN];
        sprintf(license2, "%s%s%s", 
-               _("(c) 2005 Heroine Virtual Ltd.\n\n"),
+               _("(C) 2006 Heroine Virtual Ltd.\n\n"),
                _("Build date: "), 
                BUILDDATE);
        set_font(MEDIUMFONT);
@@ -76,21 +76,30 @@ mpeg3_release());
 
        char credits[BCTEXTLEN];
        sprintf(credits,
+
+"Jack Crossfire\n"
 "Richard Baverstock\n"
 "Karl Bielefeldt\n"
 "Kevin Brosius\n"
-"Jack Crossfire\n"
+"Jean-Luc Coulon\n"
 "Jean-Michel POURE\n"
+"Jerome Cornet\n"
 "Pierre Marc Dumuid\n"
 "Alex Ferrer\n"
 "Jan Gerber\n"
 "Koen Muylkens\n"
+"Stefan de Konink\n"
+"Nathan Kurz\n"
+"Greg Mekkes\n"
 "Eric Seigne\n"
+"Joe Stewart\n"
+"Dan Streetman\n"
 "Gustavo IƱiguez\n"
 "Johannes Sixt\n"
 "Mark Taraba\n"
-"Nathan Kurz\n"
 "Andraz Tori\n"
+"Jonas Wulff\n"
+
 );
        draw_text(x, y, credits);
 
index c92cb1d..8e42f39 100644 (file)
@@ -1,12 +1,6 @@
 #ifndef ADEVICEPREFS_H
 #define ADEVICEPREFS_H
 
-// Modes
-#ifndef MODEPLAY
-#define MODEPLAY 0
-#define MODERECORD 1
-#define MODEDUPLEX 2
-#endif
 
 class OSSEnable;
 class ALSADevice;
index f540368..33a117c 100644 (file)
@@ -2,5 +2,11 @@
 #define ADEVICEPREFS_INC
 
 class ADevicePrefs;
+#ifndef MODEPLAY
+#define MODEPLAY 0
+#define MODERECORD 1
+#define MODEDUPLEX 2
+#endif
+
 
 #endif
index 60684da..00c9a3a 100644 (file)
@@ -136,12 +136,10 @@ int AModule::render(double *buffer,
                end_project -= input_len;
        }
 
-SET_TRACE
 
 // Clear buffer
        bzero(buffer, input_len * sizeof(double));
 
-SET_TRACE
 // The EDL is normalized to the requested sample rate because the requested rate may
 // be the project sample rate and a sample rate 
 // might as well be directly from the source rate to the requested rate.
@@ -165,28 +163,24 @@ SET_TRACE
 
 
 
-SET_TRACE
 
 
 
 // Fill output one fragment at a time
        while(start_project < end_project)
        {
-SET_TRACE
                int64_t fragment_len = input_len;
 
 
                if(fragment_len + start_project > end_project)
                        fragment_len = end_project - start_project;
 
-SET_TRACE
 // Normalize position here since update_transition is a boolean operation.
                update_transition(start_project * 
                                edl_rate / 
                                sample_rate, 
                        PLAY_FORWARD);
 
-SET_TRACE
                if(playable_edit)
                {
 // Normalize EDL positions to requested rate
@@ -245,7 +239,6 @@ SET_TRACE
 
 
 
-SET_TRACE
 
 
 // Read transition into temp and render
@@ -339,13 +332,11 @@ SET_TRACE
                                                transition->length);
                                }
                        }
-SET_TRACE
 
                        if(playable_edit && start_project + fragment_len >= edit_endproject)
                                playable_edit = (AEdit*)playable_edit->next;
                }
 
-SET_TRACE
                buffer_offset += fragment_len;
                start_project += fragment_len;
        }
@@ -355,7 +346,6 @@ SET_TRACE
        if(direction == PLAY_REVERSE)
                reverse_buffer(buffer, input_len);
 
-SET_TRACE
 
        return result;
 }
index 495ffa5..2031527 100644 (file)
@@ -91,6 +91,7 @@ int ARender::init_meters()
        if(level_samples) delete [] level_samples;
        calculate_history_size();
        level_samples = new int64_t[total_peaks];
+
        for(int i = 0; i < MAXCHANNELS;i++)
        {
                current_level[i] = 0;
index c794cb9..d979a2b 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "asset.h"
 #include "defaults.h"
 #include "assets.h"
index a5267e6..15eba64 100644 (file)
@@ -66,7 +66,13 @@ public:
 class AssetEditPath : public BrowseButton
 {
 public:
-       AssetEditPath(MWindow *mwindow, AssetEditWindow *fwindow, BC_TextBox *textbox, int y, char *text, char *window_title = "2000: Path", char *window_caption = _("Select a file"));
+       AssetEditPath(MWindow *mwindow, 
+               AssetEditWindow *fwindow, 
+               BC_TextBox *textbox, 
+               int y, 
+               char *text, 
+               char *window_title = "2000: Path", 
+               char *window_caption = _("Select a file"));
        ~AssetEditPath();
        
        AssetEditWindow *fwindow;
index 66f750c..ac0c229 100644 (file)
@@ -304,3 +304,7 @@ int AssetPopupDiskRemove::handle_event()
        mwindow->awindow->asset_remove->start();
        return 1;
 }
+
+
+
+
index b87bc14..bf87193 100644 (file)
@@ -53,13 +53,13 @@ void AudioALSA::list_devices(ArrayList<char*> *devices, int pcm_title)
 
                if((err = snd_ctl_open(&handle, name, 0)) < 0)
                {
-                       printf("AudioALSA::list_devices (%i): %s\n", card, snd_strerror(err));
+                       printf("AudioALSA::list_devices card=%i: %s\n", card, snd_strerror(err));
                        continue;
                }
 
                if((err = snd_ctl_card_info(handle, info)) < 0)
                {
-                       printf("AudioALSA::list_devices (%i): %s\n", card, snd_strerror(err));
+                       printf("AudioALSA::list_devices card=%i: %s\n", card, snd_strerror(err));
                        snd_ctl_close(handle);
                        continue;
                }
@@ -82,7 +82,7 @@ void AudioALSA::list_devices(ArrayList<char*> *devices, int pcm_title)
                        if((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) 
                        {
                                if(err != -ENOENT)
-                                       printf("AudioALSA::list_devices (%i): %s\n", card, snd_strerror(err));
+                                       printf("AudioALSA::list_devices card=%i: %s\n", card, snd_strerror(err));
                                continue;
                        }
 
@@ -254,6 +254,7 @@ int AudioALSA::open_input()
        device->in_bits = device->in_config->alsa_in_bits;
 
        translate_name(pcm_name, device->in_config->alsa_in_device);
+//printf("AudioALSA::open_input %s\n", pcm_name);
 
        err = snd_pcm_open(&dsp_in, pcm_name, stream, open_mode);
 
index 8474535..059ed29 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef AUDIOALSA_H
 #define AUDIOALSA_H
 
+#include "adeviceprefs.inc"
 #include "arraylist.h"
 #include "audiodevice.h"
 
index 0e47e84..b714842 100644 (file)
@@ -14,7 +14,6 @@
 #include "sema.h"
 
 
-
 AudioLowLevel::AudioLowLevel(AudioDevice *device)
 {
        this->device = device;
@@ -82,7 +81,9 @@ int AudioDevice::initialize()
        arm_buffer_num = 0;
        is_playing_back = 0;
        is_recording = 0;
-       last_buffer_size = total_samples = position_correction = 0;
+       last_buffer_size = 0;
+       total_samples = 0;
+       position_correction = 0;
        last_position = 0;
        interrupt = 0;
        lowlevel_in = lowlevel_out = lowlevel_duplex = 0;
@@ -145,7 +146,6 @@ int AudioDevice::open_input(AudioInConfig *config,
        duplex_init = 0;
        this->in_config->copy_from(config);
        this->vconfig->copy_from(vconfig);
-//printf("AudioDevice::open_input %s\n", this->in_config->oss_in_device[0]);
        in_samplerate = rate;
        in_samples = samples;
        create_lowlevel(lowlevel_in, config->driver);
@@ -207,7 +207,7 @@ int AudioDevice::close_all()
        if(input_buffer) 
        {
                delete [] input_buffer; 
-               input_buffer = 0; 
+               input_buffer = 0;
        }
        
        is_recording = 0;
@@ -223,16 +223,19 @@ int AudioDevice::close_all()
                delete lowlevel_in;
                lowlevel_in = 0;
        }
+
        if(lowlevel_out)
        {
                delete lowlevel_out;
                lowlevel_out = 0;
        }
+
        if(lowlevel_duplex)
        {
                delete lowlevel_duplex;
                lowlevel_duplex = 0;
        }
+
        return 0;
 }
 
@@ -296,7 +299,8 @@ int AudioDevice::get_irate()
 int AudioDevice::get_orealtime()
 {
        if(w) return out_realtime;
-       else if(d) return duplex_realtime;
+       else 
+       if(d) return duplex_realtime;
        return 0;
 }
 
index 05cd736..f2cefb2 100644 (file)
@@ -115,6 +115,9 @@ public:
 
 // start the thread processing buffers
        int start_playback();
+
+
+
 // interrupt the playback thread
        int interrupt_playback();
        int set_play_dither(int status);
index 1d4c369..bc1c071 100644 (file)
@@ -398,3 +398,11 @@ void AudioDevice::run()
                }
        }
 }
+
+
+
+
+
+
+
+
index b4aeb96..7bac1d1 100644 (file)
@@ -162,7 +162,6 @@ int AudioOSS::open_input()
 
                        set_cloexec_flag(dsp_in[i], 1);
 
-//printf("AudioOSS::open_input %d %d %d\n", device->in_samples, device->in_config->oss_in_channels[i], device->in_config->oss_in_bits);
 // For the ice1712 the buffer must be maximum or no space will be allocated.
                        if(device->driver == AUDIO_OSS_ENVY24) buffer_info = 0x7fff000f;
                        if(ioctl(dsp_in[i], SNDCTL_DSP_SETFRAGMENT, &buffer_info)) printf("SNDCTL_DSP_SETFRAGMENT failed.\n");
@@ -185,7 +184,6 @@ int AudioOSS::open_input()
 
 int AudioOSS::open_output()
 {
-//printf("AudioOSS::open_output 1\n");
        device->out_channels = 0;
        
        for(int i = 0; i < MAXDEVICES; i++)
index 4e2e503..5385f41 100644 (file)
@@ -344,7 +344,6 @@ Auto* Autos::insert_auto(int64_t position)
                ;
        }
 
-//printf("Autos::insert_auto %p\n", current);
 // Insert new
        if(!current)
        {
index 04e8a66..0828e95 100644 (file)
@@ -30,19 +30,14 @@ void AVC1394TransportThread::run()
        while(!done)
        {
                Thread::disable_cancel();
-SET_TRACE
                text = avc->timecode();
-SET_TRACE
                label->lock_window("AVC1394TransportThread::run 1");
-SET_TRACE
 // Sometimes text is set to NULL for some reason...
                if(text == NULL)
                        label->update("Unknown");
                else
                        label->update(text);
-SET_TRACE
                label->unlock_window();
-SET_TRACE
                Thread::enable_cancel();
                usleep(POLL_INTERVAL);
        }
index f9e6533..c665215 100644 (file)
@@ -6,6 +6,7 @@
 #include "awindowgui.inc"
 #include "awindow.h"
 #include "awindowmenu.h"
+#include "bcsignals.h"
 #include "cache.h"
 #include "colormodels.h"
 #include "cursors.h"
@@ -349,10 +350,13 @@ int AWindowGUI::create_objects()
        int x, y;
        AssetPicon *picon;
 
+SET_TRACE
 //printf("AWindowGUI::create_objects 1\n");
        asset_titles[0] = _("Title");
        asset_titles[1] = _("Comments");
 
+SET_TRACE
+
        set_icon(mwindow->theme->get_image("awindow_icon"));
        file_icon = new BC_Pixmap(this, 
                BC_WindowBase::get_resources()->type_to_icon[ICON_UNKNOWN],
@@ -370,10 +374,14 @@ int AWindowGUI::create_objects()
                BC_WindowBase::get_resources()->type_to_icon[ICON_FILM],
                PIXMAP_ALPHA);
 
+SET_TRACE
+
        clip_icon = new BC_Pixmap(this, 
                mwindow->theme->get_image("clip_icon"),
                PIXMAP_ALPHA);
 
+SET_TRACE
+
 // Mandatory folders
        folders.append(picon = new AssetPicon(mwindow,
                this,
@@ -397,25 +405,38 @@ int AWindowGUI::create_objects()
        picon->persistent = 1;
 
        create_label_folder();
+
+SET_TRACE
+
        create_persistent_folder(&aeffects, 1, 0, 1, 0);
        create_persistent_folder(&veffects, 0, 1, 1, 0);
        create_persistent_folder(&atransitions, 1, 0, 0, 1);
        create_persistent_folder(&vtransitions, 0, 1, 0, 1);
 
+SET_TRACE
+
        mwindow->theme->get_awindow_sizes(this);
+
+SET_TRACE
        add_subwindow(asset_list = new AWindowAssets(mwindow,
                this,
                mwindow->theme->alist_x, 
        mwindow->theme->alist_y, 
        mwindow->theme->alist_w, 
        mwindow->theme->alist_h));
+
+SET_TRACE
        add_subwindow(divider = new AWindowDivider(mwindow,
                this,
                mwindow->theme->adivider_x,
                mwindow->theme->adivider_y,
                mwindow->theme->adivider_w,
                mwindow->theme->adivider_h));
+
+SET_TRACE
        divider->set_cursor(HSEPARATE_CURSOR);
+
+SET_TRACE
        add_subwindow(folder_list = new AWindowFolders(mwindow,
                this,
                mwindow->theme->afolders_x, 
@@ -423,9 +444,13 @@ int AWindowGUI::create_objects()
        mwindow->theme->afolders_w, 
        mwindow->theme->afolders_h));
        
+SET_TRACE
+
        x = mwindow->theme->abuttons_x;
        y = mwindow->theme->abuttons_y;
 
+SET_TRACE
+
        newfolder_thread = new NewFolderThread(mwindow, this);
 
        add_subwindow(asset_menu = new AssetPopup(mwindow, this));
@@ -434,13 +459,21 @@ int AWindowGUI::create_objects()
        add_subwindow(label_menu = new LabelPopup(mwindow, this));
        label_menu->create_objects();
 
+SET_TRACE
+
        add_subwindow(assetlist_menu = new AssetListMenu(mwindow, this));
+
+SET_TRACE
        assetlist_menu->create_objects();
 
+SET_TRACE
+
        add_subwindow(folderlist_menu = new FolderListMenu(mwindow, this));
        folderlist_menu->create_objects();
 //printf("AWindowGUI::create_objects 2\n");
 
+SET_TRACE
+
        return 0;
 }
 
index cadd0af..cd604c8 100644 (file)
@@ -180,10 +180,15 @@ Channel* Batch::get_current_channel_struct()
 
 char* Batch::get_source_text()
 {
-       // Driver sensitive
+// Driver sensitive
        Channel *channel = get_current_channel_struct();
+
+
        if(channel)
+       {
+//printf("Batch::get_source_text 1 %s\n", channel->title);
                return channel->title;
+       }
        else
                return "";
 }
index 2c82cf2..89a9db4 100644 (file)
@@ -1309,7 +1309,7 @@ BatchRenderCancel::BatchRenderCancel(BatchRenderThread *thread,
        int y)
  : BC_GenericButton(x, 
        y, 
-       _("Cancel"))
+       _("Close"))
 {
        this->thread = thread;
 }
index 287f3a1..59da1d0 100644 (file)
@@ -1,5 +1,6 @@
 #include "asset.h"
 #include "assets.h"
+#include "bcsignals.h"
 #include "cache.h"
 #include "datatype.h"
 #include "edl.h"
@@ -303,6 +304,7 @@ CICacheItem::CICacheItem(CICache *cache, Asset *asset)
        this->cache = cache;
        checked_out = 0;
 
+
        file = new File;
        file->set_processors(cache->preferences->processors);
        file->set_preload(cache->edl->session->playback_preload);
@@ -315,9 +317,12 @@ CICacheItem::CICacheItem(CICache *cache, Asset *asset)
 
        if(result = file->open_file(cache->preferences, this->asset, 1, 0, -1, -1))
        {
+SET_TRACE
                delete file;
+SET_TRACE
                file = 0;
        }
+
 }
 
 // File already opened
index 99a4346..4c4e626 100644 (file)
@@ -73,6 +73,7 @@ public:
 // deletes oldest assets until under the memory limit
        int age();
 
+
        int dump();
 
        ArrayList<PluginServer*> *plugindb;
index 74e1954..08a6017 100644 (file)
@@ -195,7 +195,6 @@ public:
        ~CanvasXScroll();
 
        int handle_event();
-
        Canvas *canvas;
        EDL *edl;
 };
index 8d1d1ea..6d6ba40 100644 (file)
@@ -40,7 +40,12 @@ public:
        char title[BCTEXTLEN];
 // Name given by device for the channel
        char device_name[BCTEXTLEN];
+
+
+
+
 // Number of the table entry in the appropriate freqtable
+// or channel number.
        int entry;
 // Table to use
        int freqtable;
index 6b2b273..733f811 100644 (file)
@@ -1,4 +1,5 @@
 #include "batch.h"
+#include "bcsignals.h"
 #include "channel.h"
 #include "channeldb.h"
 #include "channeledit.h"
@@ -38,7 +39,6 @@ ChannelEditThread::ChannelEditThread(MWindow *mwindow,
 }
 ChannelEditThread::~ChannelEditThread()
 {
-       printf("ST: %i\n", scan_thread);
        if(channel_picker->get_subwindow())
                channel_picker->get_subwindow()->unlock_window();
        delete scan_thread;
@@ -964,9 +964,13 @@ int ChannelEditEditThread::set_freqtable(int value)
 
 void ChannelEditEditThread::run()
 {
+SET_TRACE
        ChannelEditEditWindow edit_window(this, window, channel_picker);
+SET_TRACE
        edit_window.create_objects(&new_channel);
+SET_TRACE
        this->edit_window = &edit_window;
+SET_TRACE
        int result = edit_window.run_window();
        this->edit_window = 0;
 
@@ -1020,6 +1024,7 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
        Channel *channel_usage = channel_picker->get_channel_usage();
        title_text = 0;
 
+SET_TRACE
        int x = 10, y = 10;
        if(!channel_usage ||
                (!channel_usage->use_frequency && 
@@ -1039,6 +1044,7 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
 
        if(channel_usage && channel_usage->use_frequency)
        {
+SET_TRACE
                add_subwindow(new BC_Title(x, y, _("Channel:")));
                y += 20;
                add_subwindow(thread->source_text = new ChannelEditEditSource(x, y, thread));
@@ -1055,6 +1061,7 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
                y += 30;
        }
 
+SET_TRACE
        if(channel_usage && channel_usage->use_fine)
        {
                add_subwindow(new BC_Title(x, y, _("Fine:")));
@@ -1062,6 +1069,7 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
                y += 30;
        }
 
+SET_TRACE
        if(channel_usage && channel_usage->use_norm)
        {
                add_subwindow(new BC_Title(x, y, _("Norm:")));
@@ -1073,6 +1081,7 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
                norm->add_items();
                y += 30;
        }
+SET_TRACE
 
        if(channel_usage && channel_usage->use_input)
        {
@@ -1086,10 +1095,12 @@ int ChannelEditEditWindow::create_objects(Channel *channel)
                y += 30;
        }
 
+SET_TRACE
        add_subwindow(new BC_OKButton(this));
        x += 200;
        add_subwindow(new BC_CancelButton(this));
        show_window();
+SET_TRACE
        return 0;
 }
 
@@ -1377,13 +1388,20 @@ int ChannelEditPictureThread::edit_picture()
 
 void ChannelEditPictureThread::run()
 {
+SET_TRACE
        ChannelEditPictureWindow edit_window(this, 
                channel_picker);
+SET_TRACE
        edit_window.create_objects();
+SET_TRACE
        this->edit_window = &edit_window;
+SET_TRACE
        int result = edit_window.run_window();
+SET_TRACE
        this->edit_window = 0;
+SET_TRACE
        completion->unlock();
+SET_TRACE
        in_progress = 0;
 }
 
@@ -1450,7 +1468,9 @@ int ChannelEditPictureWindow::create_objects()
        int pad = BC_Pot::calculate_h();
 #define SWAP_X x1 ^= x2; x2 ^= x1; x1 ^= x2;
 
+SET_TRACE
        PictureConfig *picture_usage = channel_picker->get_picture_usage();
+SET_TRACE
 
        if(!picture_usage ||
                (!picture_usage->use_brightness &&
@@ -1464,6 +1484,7 @@ int ChannelEditPictureWindow::create_objects()
                y += 50;
        }
 
+SET_TRACE
        if(picture_usage && picture_usage->use_brightness)
        {
                add_subwindow(new BC_Title(x, y + 10, _("Brightness:")));
@@ -1473,6 +1494,7 @@ int ChannelEditPictureWindow::create_objects()
                
        }
 
+SET_TRACE
        if(picture_usage && picture_usage->use_contrast)
        {
                add_subwindow(new BC_Title(x, y + 10, _("Contrast:")));
@@ -1481,6 +1503,7 @@ int ChannelEditPictureWindow::create_objects()
                SWAP_X
        }
 
+SET_TRACE
        if(picture_usage && picture_usage->use_color)
        {
                add_subwindow(new BC_Title(x, y + 10, _("Color:")));
@@ -1489,6 +1512,7 @@ int ChannelEditPictureWindow::create_objects()
                SWAP_X
        }
 
+SET_TRACE
        if(picture_usage && picture_usage->use_hue)
        {
                add_subwindow(new BC_Title(x, y + 10, _("Hue:")));
@@ -1497,6 +1521,7 @@ int ChannelEditPictureWindow::create_objects()
                SWAP_X
        }
 
+SET_TRACE
        if(picture_usage && picture_usage->use_whiteness)
        {
                add_subwindow(new BC_Title(x, y + 10, _("Whiteness:")));
@@ -1505,6 +1530,7 @@ int ChannelEditPictureWindow::create_objects()
                SWAP_X
        }
 
+SET_TRACE
        for(int i = 0; i < channel_picker->get_controls(); i++)
        {
                add_subwindow(new BC_Title(x, 
@@ -1518,6 +1544,7 @@ int ChannelEditPictureWindow::create_objects()
                SWAP_X
        }
 
+SET_TRACE
 
        y += pad;
        add_subwindow(new BC_OKButton(this));
index 22013e6..707e00d 100644 (file)
@@ -195,7 +195,6 @@ ChannelPicker::~ChannelPicker()
 
 void ChannelPicker::update_channel_list()
 {
-//printf("ChannelPicker::update_channel_list 1\n");
        channel_listitems.remove_all_objects();
        for(int i = 0; i < channeldb->size(); i++)
        {
@@ -204,7 +203,6 @@ void ChannelPicker::update_channel_list()
 
        if(channel_text)
                channel_text->update_list(&channel_listitems);
-//printf("ChannelPicker::update_channel_list 2\n");
 }
 
 
index 50e415d..1f47e33 100644 (file)
@@ -183,22 +183,18 @@ void CWindow::update(int position,
        int operation,
        int timebar)
 {
-//TRACE("CWindow::update 1");
 
        if(position)
        {
-//printf("CWindow::update 2\n");
                gui->lock_window("CWindow::update 1");
                gui->slider->set_position();
                gui->unlock_window();
-//printf("CWindow::update 2\n");
+
                playback_engine->que->send_command(CURRENT_FRAME, 
                        CHANGE_NONE,
                        mwindow->edl,
                        1);
-//printf("CWindow::update 3\n");
        }
-//TRACE("CWindow::update 4");
 
        gui->lock_window("CWindow::update 2");
 
@@ -209,7 +205,6 @@ void CWindow::update(int position,
                gui->set_operation(mwindow->edl->session->cwindow_operation);
        }
 
-//TRACE("CWindow::update 5");
 
 // Updated by video device.
        if(overlays && !position)
@@ -217,7 +212,6 @@ void CWindow::update(int position,
                gui->canvas->draw_refresh();
        }
 
-//TRACE("CWindow::update 5");
 // Update tool parameters
 // Never updated by someone else
        if(tool_window || position)
@@ -230,24 +224,20 @@ void CWindow::update(int position,
                gui->timebar->update(1, 1);
        }
 
-//TRACE("CWindow::update 6");
        if(!mwindow->edl->session->cwindow_scrollbars)
                gui->zoom_panel->update(AUTO_ZOOM);
        else
                gui->zoom_panel->update(mwindow->edl->session->cwindow_zoom);
-//printf("CWindow::update 6\n");
 
        gui->canvas->update_zoom(mwindow->edl->session->cwindow_xscroll,
                        mwindow->edl->session->cwindow_yscroll, 
                        mwindow->edl->session->cwindow_zoom);
-//printf("CWindow::update 6\n");
        gui->canvas->reposition_window(mwindow->edl, 
                        mwindow->theme->ccanvas_x,
                        mwindow->theme->ccanvas_y,
                        mwindow->theme->ccanvas_w,
                        mwindow->theme->ccanvas_h);
 
-//printf("CWindow::update 6\n");
 
 
 
@@ -256,7 +246,6 @@ void CWindow::update(int position,
 
 
 
-//printf("CWindow::update 7\n");
 }
 
 
index caa8bef..8f03eed 100644 (file)
@@ -100,19 +100,14 @@ CWindowGUI::~CWindowGUI()
 
 int CWindowGUI::create_objects()
 {
-SET_TRACE
        set_icon(mwindow->theme->get_image("cwindow_icon"));
 
        active = new BC_Pixmap(this, mwindow->theme->get_image("cwindow_active"));
        inactive = new BC_Pixmap(this, mwindow->theme->get_image("cwindow_inactive"));
 
-SET_TRACE
        mwindow->theme->get_cwindow_sizes(this, mwindow->session->cwindow_controls);
-SET_TRACE
        mwindow->theme->draw_cwindow_bg(this);
-SET_TRACE
        flash();
-SET_TRACE
 
 // Meters required by composite panel
        meters = new CWindowMeters(mwindow, 
@@ -121,7 +116,6 @@ SET_TRACE
                mwindow->theme->cmeter_y,
                mwindow->theme->cmeter_h);
        meters->create_objects();
-SET_TRACE
 
 
        composite_panel = new CPanel(mwindow, 
@@ -132,10 +126,8 @@ SET_TRACE
                mwindow->theme->ccomposite_h);
        composite_panel->create_objects();
 
-SET_TRACE
        canvas = new CWindowCanvas(mwindow, this);
        canvas->create_objects(mwindow->edl);
-SET_TRACE
 
 
        add_subwindow(timebar = new CTimeBar(mwindow,
@@ -146,7 +138,6 @@ SET_TRACE
                mwindow->theme->ctimebar_h));
        timebar->create_objects();
 
-SET_TRACE
        add_subwindow(slider = new CWindowSlider(mwindow, 
                cwindow, 
                mwindow->theme->cslider_x,
@@ -160,13 +151,9 @@ SET_TRACE
        transport->create_objects();
        transport->set_slider(slider);
 
-SET_TRACE
        edit_panel = new CWindowEditing(mwindow, cwindow);
-SET_TRACE
        edit_panel->set_meters(meters);
-SET_TRACE
        edit_panel->create_objects();
-SET_TRACE
 
 //     add_subwindow(clock = new MainClock(mwindow, 
 //             mwindow->theme->ctime_x, 
@@ -197,7 +184,6 @@ SET_TRACE
 
        draw_status();
 
-SET_TRACE
        return 0;
 }
 
@@ -267,13 +253,18 @@ void CWindowGUI::draw_status()
        if(canvas->canvas && 
                canvas->canvas->get_video_on() ||
                canvas->is_processing)
+       {
                draw_pixmap(active, 
                        mwindow->theme->cstatus_x, 
                        mwindow->theme->cstatus_y);
+       }
        else
+       {
                draw_pixmap(inactive, 
                        mwindow->theme->cstatus_x, 
                        mwindow->theme->cstatus_y);
+       }
+       
        flash(mwindow->theme->cstatus_x,
                mwindow->theme->cstatus_y,
                active->get_w(),
@@ -776,14 +767,11 @@ void CWindowCanvas::draw_refresh()
 {
        if(!canvas->video_is_on())
        {
-//printf("CWindowCanvas::draw_refresh 1 %f\n", mwindow->edl->session->cwindow_zoom);
                canvas->clear_box(0, 0, canvas->get_w(), canvas->get_h());
-//printf("CWindowCanvas::draw_refresh 2\n");
 
                if(refresh_frame)
                {
                        int in_x, in_y, in_w, in_h, out_x, out_y, out_w, out_h;
-//printf("CWindowCanvas::draw_refresh 3 %d\n", refresh_frame->get_color_model());
                        get_transfers(mwindow->edl, 
                                in_x, 
                                in_y, 
@@ -794,13 +782,10 @@ void CWindowCanvas::draw_refresh()
                                out_w, 
                                out_h);
 
-
 // printf("CWindowCanvas::draw_refresh %d %d %d %d -> %d %d %d %d\n", 
 // in_x, in_y, in_w, in_h, out_x, out_y, out_w, out_h);
-//canvas->clear_box(0, 0, canvas->get_w(), canvas->get_h());
 
 
-//printf("CWindowCanvas::draw_refresh 5\n");
                        if(out_w > 0 && out_h > 0 && in_w > 0 && in_h > 0)
                                canvas->draw_vframe(refresh_frame,
                                                out_x, 
@@ -812,16 +797,12 @@ void CWindowCanvas::draw_refresh()
                                                in_w, 
                                                in_h,
                                                0);
-//printf("CWindowCanvas::draw_refresh 6\n");
                }
                else
                {
-//printf("CWindowCanvas::draw_refresh 7\n");
                        canvas->clear_box(0, 0, canvas->get_w(), canvas->get_h());
-//printf("CWindowCanvas::draw_refresh 8\n");
                }
 
-//printf("CWindowCanvas::draw_refresh 9\n");
                draw_overlays();
                canvas->flash();
                canvas->flush();
@@ -1484,9 +1465,7 @@ int CWindowCanvas::do_eyedrop(int &rerender, int button_press)
 
        if(gui->current_operation == CWINDOW_EYEDROP)
        {
-SET_TRACE
                canvas_to_output(mwindow->edl, 0, cursor_x, cursor_y);
-SET_TRACE
 
 // Get color out of frame.
 // Doesn't work during playback because that bypasses the refresh frame.
@@ -1523,7 +1502,6 @@ SET_TRACE
        } \
 }
 
-SET_TRACE
                        switch(refresh_frame->get_color_model())
                        {
                                case BC_YUV888:
@@ -1551,7 +1529,6 @@ SET_TRACE
                                        GET_COLOR(float, 4, 1.0, 0);
                                        break;
                        }
-SET_TRACE
                }
                else
                {
@@ -1560,12 +1537,10 @@ SET_TRACE
                        mwindow->edl->local_session->blue = 0;
                }
 
-SET_TRACE
 
                gui->update_tool();             
 
 
-SET_TRACE
 
                result = 1;
 // Can't rerender since the color value is from the output of any effect it
@@ -1578,7 +1553,6 @@ SET_TRACE
 
 void CWindowCanvas::draw_overlays()
 {
-//printf("CWindowCanvas::draw_overlays 1\n");
        if(mwindow->edl->session->safe_regions)
        {
                draw_safe_regions();
index 028f852..07d8f27 100644 (file)
@@ -70,7 +70,7 @@ typedef unsigned short ushort;
 
 
 
-// Cinelerra
+// CINELERRA
 char dcraw_info[1024];
 float **dcraw_data;
 int dcraw_alpha;
@@ -396,14 +396,11 @@ void CLASS crw_init_tables (unsigned table)
   static const uchar first_tree[3][29] = {
     { 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0,
       0x04,0x03,0x05,0x06,0x02,0x07,0x01,0x08,0x09,0x00,0x0a,0x0b,0xff  },
-
     { 0,2,2,3,1,1,1,1,2,0,0,0,0,0,0,0,
       0x03,0x02,0x04,0x01,0x05,0x00,0x06,0x07,0x09,0x08,0x0a,0x0b,0xff  },
-
     { 0,0,6,3,1,1,2,0,0,0,0,0,0,0,0,0,
       0x06,0x05,0x07,0x04,0x08,0x03,0x09,0x02,0x00,0x0a,0x01,0x0b,0xff  },
   };
-
   static const uchar second_tree[3][180] = {
     { 0,2,2,2,1,4,2,1,2,5,1,1,0,0,0,139,
       0x03,0x04,0x02,0x05,0x01,0x06,0x07,0x08,
@@ -420,7 +417,6 @@ void CLASS crw_init_tables (unsigned table)
       0xe1,0x4a,0x6a,0xe6,0xb3,0xf1,0xd3,0xa5,0x8a,0xb2,0x9a,0xba,
       0x84,0xa4,0x63,0xe5,0xc5,0xf3,0xd2,0xc4,0x82,0xaa,0xda,0xe4,
       0xf2,0xca,0x83,0xa3,0xa2,0xc3,0xea,0xc2,0xe2,0xe3,0xff,0xff  },
-
     { 0,2,2,1,4,1,4,1,3,3,1,0,0,0,0,140,
       0x02,0x03,0x01,0x04,0x05,0x12,0x11,0x06,
       0x13,0x07,0x08,0x14,0x22,0x09,0x21,0x00,0x23,0x15,0x31,0x32,
@@ -436,7 +432,6 @@ void CLASS crw_init_tables (unsigned table)
       0xa2,0xa3,0xe3,0xc2,0x66,0x67,0x93,0xaa,0xd4,0xd5,0xe7,0xf8,
       0x88,0x9a,0xd7,0x77,0xc4,0x64,0xe2,0x98,0xa5,0xca,0xda,0xe8,
       0xf3,0xf6,0xa9,0xb2,0xb3,0xf2,0xd2,0x83,0xba,0xd3,0xff,0xff  },
-
     { 0,0,6,2,1,3,3,2,5,1,2,2,8,10,0,117,
       0x04,0x05,0x03,0x06,0x02,0x07,0x01,0x08,
       0x09,0x12,0x13,0x14,0x11,0x15,0x0a,0x16,0x17,0xf0,0x00,0x22,
@@ -453,7 +448,6 @@ void CLASS crw_init_tables (unsigned table)
       0xd3,0xaa,0xc4,0xca,0xf2,0xb1,0xe4,0xd1,0x83,0x63,0xea,0xc3,
       0xe2,0x82,0xf1,0xa3,0xc2,0xa1,0xc1,0xe3,0xa2,0xe1,0xff,0xff  }
   };
-
   if (table > 2) table = 2;
   init_decoder();
   make_decoder ( first_tree[table], 0);
@@ -499,7 +493,6 @@ void CLASS canon_compressed_load_raw()
   fseek (ifp, 540 + lowbits*raw_height*raw_width/4, SEEK_SET);
   zero_after_ff = 1;
   getbits(-1);
-
   for (row = 0; row < raw_height; row += 8) {
     for (block=0; block < raw_width >> 3; block++) {
       memset (diffbuf, 0, sizeof diffbuf);
@@ -528,7 +521,7 @@ void CLASS canon_compressed_load_raw()
       }
     }
     if (lowbits) {
-      save = ftell(ifp);                       /* Don't lose our place */
+      save = ftell(ifp);
       fseek (ifp, 26 + row*raw_width/4, SEEK_SET);
       for (prow=pixel, i=0; i < raw_width*2; i++) {
        c = fgetc(ifp);
@@ -1331,8 +1324,7 @@ void CLASS kodak_dc120_load_raw()
   uchar pixel[848];
   int row, shift, col;
 
-  for (row=0; row < height; row++)
-  {
+  for (row=0; row < height; row++) {
     fread (pixel, 848, 1, ifp);
     shift = row * mul[row & 3] + add[row & 3];
     for (col=0; col < width; col++)
@@ -2540,8 +2532,7 @@ void CLASS vng_interpolate()
     for (col=0; col < 2; col++) 
        {
       ip = code[row][col];
-      for (cp=terms, t=0; t < 64; t++) 
-         {
+      for (cp=terms, t=0; t < 64; t++) {
        y1 = *cp++;  x1 = *cp++;
        y2 = *cp++;  x2 = *cp++;
        weight = *cp++;
@@ -2569,27 +2560,12 @@ void CLASS vng_interpolate()
       }
     }
   }
-
-
-
-
   brow[4] = calloc (width*3, sizeof **brow);
   merror (brow[4], "vng_interpolate()");
   for (row=0; row < 3; row++)
     brow[row] = brow[4] + row*width;
-
-/* Do VNG interpolation */
-  for (row=2; row < height-2; row++) 
-  {            
-
-
-
-
-
-    for (col=2; col < width-2; col++) 
-       {
-
-
+  for (row=2; row < height-2; row++) {         /* Do VNG interpolation */
+    for (col=2; col < width-2; col++) {
       pix = image[row*width+col];
       ip = code[row & 7][col & 1];
       memset (gval, 0, sizeof gval);
@@ -2607,23 +2583,14 @@ void CLASS vng_interpolate()
                                 gval[g] += diff;
       }
       ip++;
-
-
-
       gmin = gmax = gval[0];                   /* Choose a threshold */
-      for (g=1; g < 8; g++) 
-         {
-                       if (gmin > gval[g]) gmin = gval[g];
-                       if (gmax < gval[g]) gmax = gval[g];
+      for (g=1; g < 8; g++) {
+       if (gmin > gval[g]) gmin = gval[g];
+       if (gmax < gval[g]) gmax = gval[g];
       }
-
-
-
-
-      if (gmax == 0) 
-         {
-                       memcpy (brow[2][col], pix, sizeof *image);
-                       continue;
+      if (gmax == 0) {
+       memcpy (brow[2][col], pix, sizeof *image);
+       continue;
       }
 
 
@@ -2684,14 +2651,6 @@ void CLASS vng_interpolate()
     for (g=0; g < 4; g++)
       brow[(g-1) & 3] = brow[g];
   }
-
-
-
-
-
-
-
-
   memcpy (image[(row-2)*width+2], brow[0]+2, (width-4)*sizeof *image);
   memcpy (image[(row-1)*width+2], brow[1]+2, (width-4)*sizeof *image);
   free(brow[4]);
@@ -2779,7 +2738,6 @@ void CLASS nef_parse_makernote()
   int base=0, offset=0, entries, tag, type, len, val, save;
   short sorder;
   char buf[10];
-
 /*
    The MakerNote might have its own TIFF header (possibly with
    its own byte-order!), or it might just be a table.
@@ -4132,13 +4090,13 @@ konica_400z:
     } else if (!strcmp(model,"Digital Camera 40")) {
       strcpy (model, "DC40");
       height = 512;
-      width = 768;
+      width  = 768;
       data_offset = 1152;
       load_raw = kodak_radc_load_raw;
     } else if (strstr(model,"DC50")) {
       strcpy (model, "DC50");
       height = 512;
-      width = 768;
+      width  = 768;
       data_offset = 19712;
       load_raw = kodak_radc_load_raw;
     } else if (strstr(model,"DC120")) {
@@ -4918,11 +4876,10 @@ int CLASS dcraw_main (int argc, char **argv)
     fprintf (stderr, "No files to process.\n");
     return 1;
   }
-  if (write_to_stdout) {
-
 
 
-// Cinelerra
+  if (write_to_stdout) {
+// CINELERRA
     if (0 /* isatty(1) */) {
       fprintf (stderr, "Will not write an image to the terminal!\n");
       return 1;
@@ -4939,14 +4896,14 @@ int CLASS dcraw_main (int argc, char **argv)
 #endif
   }
 
-  for ( ; arg < argc; arg++)
-  {
+
+  for ( ; arg < argc; arg++) {
     status = 1;
     image = NULL;
     if (setjmp (failure)) {
       if (fileno(ifp) > 2) fclose(ifp);
       if (fileno(ofp) > 2) fclose(ofp);
-      if (image) free(image);
+      if (image) free (image);
       status = 1;
       continue;
     }
@@ -5033,16 +4990,14 @@ int CLASS dcraw_main (int argc, char **argv)
        goto cleanup;
       }
     }
-
-
     if (verbose)
       fprintf (stderr, "Writing data to %s...\n", ofname);
     (*write_fun)(ofp);
     if (ofp != stdout)
       fclose(ofp);
 cleanup:
-    free(ofname);
-    free(image);
+    free (ofname);
+    free (image);
   }
   return status;
 }
index 800f554..9017d7e 100644 (file)
@@ -152,11 +152,11 @@ void Device1394Output::reset()
        temp_frame2 = 0;
        audio_position = 0;
        interrupted = 0;
+       position_presented = 0;
        have_video = 0;
        adevice = 0;
        vdevice = 0;
        is_pal = 0;
-       position_presented = 0;
 }
 
 int Device1394Output::get_dv1394()
@@ -178,11 +178,10 @@ int Device1394Output::open(char *path,
        this->bits = bits;
        this->samplerate = samplerate;
        this->total_buffers = length;
-       
        if (get_dv1394())
        {
-               // dv1394 syt is given in frames and limited to 2 or 3, default is 3
-               // Needs to be accurate to calculate presentation time
+// dv1394 syt is given in frames and limited to 2 or 3, default is 3
+// Needs to be accurate to calculate presentation time
                if (syt < 2 || syt > 3)
                        syt = 3;
        }
@@ -390,9 +389,9 @@ void Device1394Output::run()
 
                                if (get_dv1394())
                                {
-                                       // When this frame is being uploaded to the 1394 device,
-                                       // the frame actually playing on the device will be the one
-                                       // uploaded syt frames before.
+// When this frame is being uploaded to the 1394 device,
+// the frame actually playing on the device will be the one
+// uploaded syt frames before.
                                        position_presented[status.first_clear_frame] = 
                                                audio_position - syt * samples_per_frame;
                                        if (position_presented[status.first_clear_frame] < 0)
@@ -769,8 +768,8 @@ long Device1394Output::get_audio_position()
        long result = audio_position;
        if (get_dv1394())
        {
-               // Take delay between placing in buffer and presentation 
-               // on device into account for dv1394
+// Take delay between placing in buffer and presentation 
+// on device into account for dv1394
                result = position_presented[status.active_frame];
        }
        position_lock->unlock();
index 73a0024..06cf726 100644 (file)
@@ -135,9 +135,10 @@ public:
    int video1394_talk_wait_buffer;
    int video1394_listen_poll_buffer;
 
-       // To keep track of the delay between putting the audio in the buffer
-       // and when it is actually presented on the DV device
+// To keep track of the delay between putting the audio in the buffer
+// and when it is actually presented on the DV device
        long *position_presented;
+
 };
 
 
index 53e3291..4130894 100644 (file)
@@ -283,12 +283,16 @@ double Edit::frames_per_picon()
 
 double Edit::frame_w()
 {
-       return track->from_units(1) * edl->session->sample_rate / edl->local_session->zoom_sample;
+       return track->from_units(1) * 
+               edl->session->sample_rate / 
+               edl->local_session->zoom_sample;
 }
 
 double Edit::picon_w()
 {
-       return (double)edl->local_session->zoom_track * asset->width / asset->height;
+       return (double)edl->local_session->zoom_track * 
+               asset->width / 
+               asset->height;
 }
 
 int Edit::picon_h()
index ccd6cc4..8d25f57 100644 (file)
@@ -36,9 +36,13 @@ EDL::EDL(EDL *parent_edl)
        vwindow_edl = 0;
        vwindow_edl_shared = 0;
 
+
        folders.set_array_delete();
+
        new_folder(CLIP_FOLDER);
+
        new_folder(MEDIA_FOLDER);
+
        id = next_id();
        project_path[0] = 0;
 }
@@ -46,7 +50,7 @@ EDL::EDL(EDL *parent_edl)
 
 EDL::~EDL()
 {
-//printf("EDL::~EDL 1\n");
+
        if(tracks)
        {
                delete tracks;
@@ -73,7 +77,6 @@ EDL::~EDL()
 
        folders.remove_all_objects();
        clips.remove_all_objects();
-//printf("EDL::~EDL 2\n");
 }
 
 
@@ -150,6 +153,7 @@ int EDL::load_xml(ArrayList<PluginServer*> *plugindb,
 // Track numbering offset for replacing undo data.
        int track_offset = 0;
 
+
        folders.remove_all_objects();
 
 // Search for start of master EDL.
@@ -299,10 +303,8 @@ int EDL::load_xml(ArrayList<PluginServer*> *plugindb,
                                }
                        }
                }while(!result);
-//printf("EDL::load_xml 4\n");
        }
        boundaries();
-//printf("EDL::load_xml 6 %p\n", parent_edl);
 //dump();
 
        return 0;
index 296c112..4dbf168 100644 (file)
@@ -105,7 +105,7 @@ public:
        float frames_per_foot;
 // Number of highlighted track
        int highlighted_track;
-// From edl.inc
+// Enumeration for how to scale from edl.inc.
        int interpolation_type;
 // labels follow edits during editing
        int labels_follow_edits;
index a5ae3ed..23aa2d7 100644 (file)
@@ -33,7 +33,9 @@ class FadeEngine : public LoadServer
 public:
        FadeEngine(int cpus);
        ~FadeEngine();
-       
+
+// the input pointer is never different than the output pointer in any
+// of the callers
        void do_fade(VFrame *output, VFrame *input, float alpha);
        
        void init_packages();
index 4663416..3f56cea 100644 (file)
@@ -310,8 +310,6 @@ int File::open_file(Preferences *preferences,
        file = 0;
 
 
-SET_TRACE
-//printf("File::open_file 1 %s %d\n", asset->path, asset->format);
        switch(this->asset->format)
        {
 // get the format now
@@ -423,10 +421,8 @@ SET_TRACE
                                test[0] == '<' && test[1] == 'H' && test[2] == 'T' && test[3] == 'A' && test[4] == 'L' && test[5] == '>' ||
                                test[0] == '<' && test[1] == '?' && test[2] == 'x' && test[3] == 'm' && test[4] == 'l')
                        {
-SET_TRACE
 // XML file
                                fclose(stream);
-SET_TRACE
                                return FILE_IS_XML;
                        }    // can't load project file
                        else
@@ -530,16 +526,13 @@ SET_TRACE
                        return 1;
                        break;
        }
-//printf("File::open_file 2\n");
 
 // Reopen file with correct parser and get header.
        if(file->open_file(rd, wr))
        {
-//printf("File::open_file 2.5\n");
                delete file;
                file = 0;
        }
-//printf("File::open_file 3\n");
 
 
 // Set extra writing parameters to mandatory settings.
@@ -548,6 +541,7 @@ SET_TRACE
                if(this->asset->dither) file->set_dither();
        }
 
+
 // Synchronize header parameters
        *asset = *this->asset;
 
@@ -611,18 +605,15 @@ int File::start_video_thread(int64_t buffer_size,
        int compressed)
 {
        video_thread = new FileThread(this, 0, 1);
-//printf("File::start_video_thread 1\n");
        video_thread->start_writing(buffer_size, 
                color_model, 
                ring_buffers, 
                compressed);
-//printf("File::start_video_thread 2\n");
        return 0;
 }
 
 int File::stop_audio_thread()
 {
-//printf("File::stop_audio_thread 1\n");
        if(audio_thread)
        {
                audio_thread->stop_writing();
@@ -634,7 +625,6 @@ int File::stop_audio_thread()
 
 int File::stop_video_thread()
 {
-//printf("File::stop_video_thread 1\n");
        if(video_thread)
        {
                video_thread->stop_writing();
@@ -672,7 +662,6 @@ int File::set_layer(int layer)
        if(file && layer < asset->layers)
        {
                current_layer = layer;
-//printf("File::set_layer 1 %d\n", layer);
                return 0; 
        }
        else
@@ -907,7 +896,6 @@ VFrame*** File::get_video_buffer()
 int File::read_samples(double *buffer, int64_t len, int64_t base_samplerate, float *buffer_float)
 {
        int result = 0;
-//printf("File::read_samples 1\n");
 
 // Never try to read more samples than exist in the file
        if (current_sample + len > asset->audio_length) {
@@ -1009,29 +997,35 @@ int File::read_frame(VFrame *frame)
                int supported_colormodel = colormodel_supported(frame->get_color_model());
                int advance_position = 1;
 
-
-               // Test cache
+// Test cache
                if(use_cache &&
-                  frame_cache->get_frame(frame,
-                                         current_frame,
-                                         asset->frame_rate)) {
-                       // Can't advance position if cache used.
+                       frame_cache->get_frame(frame,
+                               current_frame,
+                               asset->frame_rate))
+               {
+// Can't advance position if cache used.
                        advance_position = 0;
                }
-               else if(frame->get_color_model() != BC_COMPRESSED &&
+               else
+// Need temp
+               if(frame->get_color_model() != BC_COMPRESSED &&
                        (supported_colormodel != frame->get_color_model() ||
-                        frame->get_w() != asset->width ||
-                        frame->get_h() != asset->height)) {
-                       // Need temp                            
-                       // Can't advance position here because it needs to be added to cache
-                       if(temp_frame) {
-                               if(!temp_frame->params_match(asset->width, asset->height, supported_colormodel)) {
+                       frame->get_w() != asset->width ||
+                       frame->get_h() != asset->height))
+               {
+
+// Can't advance position here because it needs to be added to cache
+                       if(temp_frame)
+                       {
+                               if(!temp_frame->params_match(asset->width, asset->height, supported_colormodel))
+                               {
                                        delete temp_frame;
                                        temp_frame = 0;
                                }
                        }
-                       
-                       if(!temp_frame) {
+
+                       if(!temp_frame)
+                       {
                                temp_frame = new VFrame(0,
                                                        asset->width,
                                                        asset->height,
@@ -1039,10 +1033,6 @@ int File::read_frame(VFrame *frame)
                        }
                        
                        file->read_frame(temp_frame);
-                       //struct timeval start_time;
-                       //gettimeofday(&start_time, 0);
-                       //printf("tarnsfering from : %i to %i\n", frame->get_color_model(),temp_frame->get_color_model());
-
 // FUTURE: convert from YUV planar if cmodel_is_planar(temp_frame)
                        cmodel_transfer(frame->get_rows(), 
                                        temp_frame->get_rows(),
@@ -1065,20 +1055,20 @@ int File::read_frame(VFrame *frame)
                                        0,
                                        temp_frame->get_w(),
                                        frame->get_w());
-                       //      int64_t dif= get_difference(&start_time);
-                       //      printf("diff: %lli\n", dif);
-                       
                }
-               else {
+               else
+               {
                        // Can't advance position here because it needs to be added to cache
                        file->read_frame(frame);
                }
                
                if(use_cache) frame_cache->put_frame(frame,
-                                                    current_frame,
-                                                    asset->frame_rate,
-                                                    1);
-               
+                       current_frame,
+                       asset->frame_rate,
+                       1);
+// printf("File::read_frame\n");
+// frame->dump_params();
+
                if(advance_position) current_frame++;
                return 0;
        }
index 225c737..c13864d 100644 (file)
@@ -35,9 +35,9 @@ public:
 // Get attributes for various file formats.
 // The dither parameter is carried over from recording, where dither is done at the device.
        int get_options(FormatTools *format, 
-                       int audio_options,
-                       int video_options,
-                       int lock_compressor);
+               int audio_options,
+               int video_options,
+               int lock_compressor);
 
        int raise_window();
 // Close parameter window
@@ -118,6 +118,8 @@ public:
 // Only called by filethread
        int write_frames(VFrame ***frames, int len);
 
+
+
 // For writing buffers in a background thread use these functions to get the buffer.
 // Get a pointer to a buffer to write to.
        double** get_audio_buffer();
index eac5478..f002899 100644 (file)
@@ -23,7 +23,8 @@
 #define FILE_JPEG                      5
 #define FILE_JPEG_LIST                 8
 #define FILE_MOV                       3
-#define FILE_MPEG                      15    // Libmpeg3 decoding only
+// Libmpeg3 decoding and transport stream capture only
+#define FILE_MPEG                      15    
 #define FILE_PCM                       1
 #define FILE_PLUGIN                    0x8000
 #define FILE_PNG                       4
index 1b7a727..495c98d 100644 (file)
@@ -132,6 +132,21 @@ int FileAC3::close_file()
        FileBase::close_file();
 }
 
+// Channel conversion matrices because ffmpeg encodes a
+// different channel order than liba52 decodes.
+// Each row is an output channel.
+// Each column is an input channel.
+// static int channels5[] = 
+// {
+//     { }
+// };
+// 
+// static int channels6[] = 
+// {
+//     { }
+// };
+
+
 int FileAC3::write_samples(double **buffer, int64_t len)
 {
 // Convert buffer to encoder format
index 24cbff1..a6089f2 100644 (file)
@@ -83,13 +83,16 @@ void FileCR2::format_to_asset()
 
 int FileCR2::read_frame(VFrame *frame)
 {
-       cr2_mutex.lock("FileCR2::check_sig");
+       cr2_mutex.lock("FileCR2::read_frame");
        if(frame->get_color_model() == BC_RGBA_FLOAT)
                dcraw_alpha = 1;
        else
                dcraw_alpha = 0;
 
 
+
+// printf("FileCR2::read_frame %d\n", interpolate);
+// frame->dump_stacks();
 // output to stdout
        int argc = 3;
        char *argv[3] = 
@@ -102,6 +105,9 @@ int FileCR2::read_frame(VFrame *frame)
 
        int result = dcraw_main(argc, argv);
 
+// printf("FileCR2::read_frame\n");
+// frame->dump_params();
+
        cr2_mutex.unlock();
        return 0;
 }
index 31752d6..35c9036 100644 (file)
@@ -435,7 +435,6 @@ int FileEXR::read_frame(VFrame *frame, VFrame *data)
 
 int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
 {
-//printf("FileEXR::write_frame 1\n");
        EXRUnit *exr_unit = (EXRUnit*)unit;
        int result = 0;
 
@@ -513,7 +512,6 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
                                sizeof(float) * components * output_frame->get_w()));
        file.setFrameBuffer(framebuffer);
        file.writePixels(asset->height);
-//printf("FileEXR::write_frame 10\n");
 }
 
 FrameWriterUnit* FileEXR::new_writer_unit(FrameWriter *writer)
index 92a4d04..5281b0c 100644 (file)
@@ -209,11 +209,9 @@ int FileJPEG::read_frame_header(char *path)
 
 int FileJPEG::read_frame(VFrame *output, VFrame *input)
 {
-SET_TRACE
        if(!decompressor) decompressor = mjpeg_new(asset->width, 
                asset->height, 
                1);
-SET_TRACE
        mjpeg_decompress((mjpeg_t*)decompressor, 
                input->get_data(), 
                input->get_compressed_size(),
@@ -224,7 +222,6 @@ SET_TRACE
                output->get_v(),
                output->get_color_model(),
                1);
-SET_TRACE
 
 
        return 0;
index 6fff989..9ff1a34 100644 (file)
@@ -294,8 +294,8 @@ int FileList::read_frame(VFrame *frame)
        }
        else
        {
-
 // Allocate and decompress once into temporary
+//printf("FileList::read_frame %d\n", frame->get_color_model());
                if(!temp || temp->get_color_model() != frame->get_color_model())
                {
                        if(temp) delete temp;
@@ -337,6 +337,9 @@ int FileList::read_frame(VFrame *frame)
 
                if(!temp) return result;
 
+// printf("FileList::read_frame frame=%d temp=%d\n", 
+// frame->get_color_model(),
+// temp->get_color_model());
                if(frame->get_color_model() == temp->get_color_model())
                {
                        frame->copy_from(temp);
@@ -585,7 +588,7 @@ void FrameWriterUnit::process_package(LoadPackage *package)
 
        int result = server->file->write_frame(ptr->input, output, this);
        
-//printf("FrameWriterUnit::process_package 4");
+//printf("FrameWriterUnit::process_package 4 %s %d\n", ptr->path, output->get_compressed_size());
        if(!result) result = !fwrite(output->get_data(), output->get_compressed_size(), 1, file);
 //TRACE("FrameWriterUnit::process_package 4");
        fclose(file);
index 687af5a..9b61978 100644 (file)
@@ -95,8 +95,11 @@ FileMOV::FileMOV(Asset *asset, File *file)
 
 FileMOV::~FileMOV()
 {
+SET_TRACE
        close_file();
+SET_TRACE
        delete threadframe_lock;
+SET_TRACE
 }
 
 void FileMOV::get_parameters(BC_WindowBase *parent_window, 
@@ -130,16 +133,16 @@ void FileMOV::get_parameters(BC_WindowBase *parent_window,
 void FileMOV::fix_codecs_for_writing(Asset *asset)
 {
        if(!strcasecmp(asset->vcodec, QUICKTIME_DV) ||
-          !strcasecmp(asset->vcodec, QUICKTIME_DVSD) || 
+          !strcasecmp(asset->vcodec, QUICKTIME_DVSD) ||
           !strcasecmp(asset->vcodec, QUICKTIME_DVCP))
        {
-               printf("AF: %i, AH: %i, VC: %s\n", asset->format, asset->height, asset->vcodec);
-               if (asset->format == FILE_AVI)
-                       strcpy (asset->vcodec, QUICKTIME_DVSD);
-               else if (asset->format == FILE_MOV && asset->height == 576) 
-                       strcpy (asset->vcodec, QUICKTIME_DVCP);
-               else if (asset->format == FILE_MOV && asset->height == 480)
-                       strcpy (asset->vcodec, QUICKTIME_DV);
+//        printf("AF: %i, AH: %i, VC: %s\n", asset->format, asset->height, asset->vcodec);
+        if (asset->format == FILE_AVI)
+                strcpy (asset->vcodec, QUICKTIME_DVSD);
+        else if (asset->format == FILE_MOV && asset->height == 576)
+                strcpy (asset->vcodec, QUICKTIME_DVCP);
+        else if (asset->format == FILE_MOV && asset->height == 480)
+                strcpy (asset->vcodec, QUICKTIME_DV);
        }
 }
 
@@ -182,11 +185,7 @@ int FileMOV::open_file(int rd, int wr)
 
        quicktime_set_cpus(fd, file->cpus);
 
-       if(rd)
-       {
-               format_to_asset();
-               
-       }
+       if(rd) format_to_asset();
 
        if(wr) asset_to_format();
 
@@ -295,6 +294,7 @@ void FileMOV::asset_to_format()
                        depth = 24;
                }
 
+
                quicktime_vtracks = quicktime_set_video(fd, 
                                        asset->layers, 
                                        asset->width, 
@@ -334,10 +334,6 @@ void FileMOV::asset_to_format()
 
 
        }
-//printf("FileMOV::asset_to_format 3.4\n");
-
-//printf("FileMOV::asset_to_format 4 %d %d\n", wr, 
-//                             asset->format);
 
        if(wr && asset->format == FILE_AVI)
        {
@@ -519,6 +515,7 @@ int FileMOV::can_copy_from(Edit *edit, int64_t position)
        if((edit->asset->format == FILE_MOV || 
                edit->asset->format == FILE_AVI))
        {
+//printf("FileMOV::can_copy_from %s %s\n", edit->asset->vcodec, this->asset->vcodec);
                if(match4(edit->asset->vcodec, this->asset->vcodec))
                        return 1;
 // there are combinations where the same codec has multiple fourcc codes
@@ -526,11 +523,11 @@ int FileMOV::can_copy_from(Edit *edit, int64_t position)
                int is_edit_dv = 0;
                int is_this_dv = 0;
                if (match4(edit->asset->vcodec, QUICKTIME_DV) || 
-                       match4(edit->asset->vcodec, QUICKTIME_DVSD) ||
+                       match4(edit->asset->vcodec, QUICKTIME_DVSD) || 
                        match4(edit->asset->vcodec, QUICKTIME_DVCP))
                        is_edit_dv = 1;
                if (match4(this->asset->vcodec, QUICKTIME_DV) || 
-                       match4(this->asset->vcodec, QUICKTIME_DVSD) ||
+                       match4(this->asset->vcodec, QUICKTIME_DVSD) || 
                        match4(this->asset->vcodec, QUICKTIME_DVCP))
                        is_this_dv = 1;
                if (is_this_dv && is_edit_dv)
@@ -916,7 +913,7 @@ int FileMOV::write_frames(VFrame ***frames, int len)
        }
 
 
-//printf("FileMOV::write_frames 100\n");
+//printf("FileMOV::write_frames 100 %d\n", result);
        return result;
 }
 
@@ -1603,6 +1600,7 @@ MOVConfigVideo::MOVConfigVideo(BC_WindowBase *parent_window,
        this->asset = asset;
        this->lock_compressor = lock_compressor;
        compression_popup = 0;
+
        reset();
 }
 
index 7c00189..7a8fb38 100644 (file)
@@ -144,6 +144,7 @@ int FileMPEG::reset_parameters_derived()
 // for reopening.
 int FileMPEG::open_file(int rd, int wr)
 {
+SET_TRACE
        int result = 0;
        this->rd = rd;
        this->wr = wr;
@@ -330,7 +331,8 @@ int FileMPEG::open_file(int rd, int wr)
 
 
 
-                       strcat(mjpeg_command, asset->vmpeg_progressive ? " -I 0" : " -I 1");
+                       strcat(mjpeg_command, 
+                               asset->vmpeg_progressive ? " -I 0" : " -I 1");
                        
 
 
@@ -431,7 +433,7 @@ int FileMPEG::open_file(int rd, int wr)
        }
 
 //asset->dump();
-//printf("FileMPEG::open_file 100\n");
+SET_TRACE
        return result;
 }
 
@@ -523,15 +525,21 @@ int FileMPEG::create_index()
 
                progress->stop_progress();
                delete progress;
+
+// Remove if error
                if(result)
                {
                        remove(index_filename);
                        return 1;
                }
+               else
+// Fix date to date of source if success
+               {
+               }
+
        }
 
 
-// Failed
 
 // Reopen file from index path instead of asset path.
        if(fd) mpeg3_close(fd);
@@ -749,6 +757,7 @@ int FileMPEG::set_video_position(int64_t x)
        if(!fd) return 1;
        if(x >= 0 && x < asset->video_length)
        {
+//printf("FileMPEG::set_video_position 1 %lld\n", x);
                mpeg3_set_frame(fd, x, file->current_layer);
        }
        else
@@ -1020,14 +1029,16 @@ int FileMPEG::read_frame(VFrame *frame)
        int result = 0;
        int src_cmodel;
 
-SET_TRACE
+// printf("FileMPEG::read_frame\n");
+// frame->dump_stacks();
+// frame->dump_params();
+
        if(mpeg3_colormodel(fd, 0) == MPEG3_YUV420P)
                src_cmodel = BC_YUV420P;
        else
        if(mpeg3_colormodel(fd, 0) == MPEG3_YUV422P)
                src_cmodel = BC_YUV422P;
 
-SET_TRACE
        switch(frame->get_color_model())
        {
                case MPEG3_RGB565:
@@ -1036,6 +1047,7 @@ SET_TRACE
                case MPEG3_RGB888:
                case MPEG3_RGBA8888:
                case MPEG3_RGBA16161616:
+SET_TRACE
                        mpeg3_read_frame(fd, 
                                        frame->get_rows(), /* Array of pointers to the start of each output row */
                                        0,                    /* Location in input frame to take picture */
@@ -1046,6 +1058,7 @@ SET_TRACE
                                        asset->height, 
                                        frame->get_color_model(),             /* One of the color model #defines */
                                        file->current_layer);
+SET_TRACE
                        break;
 
 // Use Temp
@@ -1053,6 +1066,7 @@ SET_TRACE
 // Read these directly
                        if(frame->get_color_model() == src_cmodel)
                        {
+SET_TRACE
                                mpeg3_read_yuvframe(fd,
                                        (char*)frame->get_y(),
                                        (char*)frame->get_u(),
@@ -1062,17 +1076,19 @@ SET_TRACE
                                        asset->width,
                                        asset->height,
                                        file->current_layer);
-
+SET_TRACE
                        }
                        else
 // Process through temp frame
                        {
                                char *y, *u, *v;
+SET_TRACE
                                mpeg3_read_yuvframe_ptr(fd,
                                        &y,
                                        &u,
                                        &v,
                                        file->current_layer);
+SET_TRACE
                                if(y && u && v)
                                {
                                        cmodel_transfer(frame->get_rows(), 
@@ -1098,13 +1114,14 @@ SET_TRACE
                                                frame->get_w());
                                }
                        }
-SET_TRACE
                        break;
        }
 
+SET_TRACE
        return result;
 }
 
+
 void FileMPEG::to_streamchannel(int channel, int &stream_out, int &channel_out)
 {
        for(stream_out = 0, channel_out = file->current_channel; 
index d77bc33..020292a 100644 (file)
@@ -201,10 +201,10 @@ int FileOGG::open_file(int rd, int wr)
                tf->videosync = 0;
        }
 
-TRACE("FileOGG::open_file 10")
+
        if(wr)
        {
-TRACE("FileOGG::open_file 20")
+
 
                if((stream = fopen(asset->path, "w+b")) == 0)
                {
@@ -424,16 +424,18 @@ TRACE("FileOGG::open_file 20")
        } else
        if (rd)
        {
-               TRACE("FileOGG::open_file 30")
+
                if((stream = fopen(asset->path, "rb")) == 0)
                {
                        perror(_("FileOGG::open_file rdwr"));
                        return 1;
                }
+
                /* get file length */
                struct stat file_stat;
                stat(asset->path, &file_stat);
                file_length = file_stat.st_size;
+
                /* start up Ogg stream synchronization layer */
                /* oy is used just here to parse header, we use separate syncs for video and audio*/
                sync_window_t oy;
@@ -441,15 +443,17 @@ TRACE("FileOGG::open_file 20")
                // make sure we init the position structures to zero
                read_buffer_at(stream, &oy, READ_SIZE, 0);
 
+
                /* init supporting Vorbis structures needed in header parsing */
                vorbis_info_init(&tf->vi);
                vorbis_comment_init(&tf->vc);
 
+
                /* init supporting Theora structures needed in header parsing */
                theora_comment_init(&tf->tc);
                theora_info_init(&tf->ti);
 
-               TRACE("FileOGG::open_file 40")
+
 
                /* Ogg file open; parse the headers */
                /* Only interested in Vorbis/Theora streams */
@@ -458,7 +462,7 @@ TRACE("FileOGG::open_file 20")
                int vorbis_p = 0;
                while(!stateflag)
                {
-//                     TRACE("FileOGG::open_file 50")
+
 
 //                     int ret = read_buffer(stream, &oy, 4096);
                        TRACE("FileOGG::open_file 60")
@@ -510,6 +514,7 @@ TRACE("FileOGG::open_file 20")
                /* fall through to non-bos page parsing */
                }
 
+
                /* we're expecting more header packets. */
                while((theora_p && theora_p < 3) || (vorbis_p && vorbis_p < 3))
                {
@@ -571,7 +576,7 @@ TRACE("FileOGG::open_file 20")
                // Remember where the real data begins for later seeking purposes
                filedata_begin = oy.file_pagepos; 
 
-//printf("FileOGG::Data pages begin at %lli\n", filedata_begin);
+
 
                /* and now we have it all.  initialize decoders */
                if(theora_p)
@@ -693,6 +698,8 @@ Not yet available in alpha4, we assume 420 for now
                        theora_info_clear(&tf->ti);
                        theora_comment_clear(&tf->tc);
                }
+
+
                if(vorbis_p)
                {
                        vorbis_synthesis_init(&tf->vd, &tf->vi);
@@ -793,7 +800,9 @@ Not yet available in alpha4, we assume 420 for now
                        vorbis_info_clear(&tf->vi);
                        vorbis_comment_clear(&tf->vc);
                }
+
                ogg_sync_clear(&oy.sync);
+
        }
        return 0;
 }
@@ -1273,21 +1282,29 @@ int FileOGG::ogg_seek_to_keyframe(sync_window_t *sw, long serialno, int64_t fram
 
 int FileOGG::check_sig(Asset *asset)
 {
+
        FILE *fd = fopen(asset->path, "rb");
+
 // Test for "OggS"
        fseek(fd, 0, SEEK_SET);
        char data[4];
+
        fread(data, 4, 1, fd);
+
        if(data[0] == 'O' &&
                data[1] == 'g' &&
                data[2] == 'g' &&
                data[3] == 'S')
        {
+
                fclose(fd);
 //             printf("Yay, we have an ogg file\n");
+
                return 1;
        }
+
        fclose(fd);
+
        return 0;
        
 }
index 7cd104c..a2d0ef3 100644 (file)
@@ -213,8 +213,11 @@ SET_TRACE
        else
        if(wr)
        {
+printf("FileSNDFile::open 1\n");
                asset_to_format();
+printf("FileSNDFile::open 1\n");
                fd = sf_open(asset->path, SFM_WRITE, &fd_config);
+printf("FileSNDFile::open 10 %p\n", fd);
        }
 
        if(!fd) 
index 74f0897..c722201 100644 (file)
@@ -33,19 +33,19 @@ FileTGA::~FileTGA()
 int FileTGA::check_sig(Asset *asset)
 {
 
-SET_TRACE
+
 // Test file extension
        int result = 0;
        char *ext = strrchr(asset->path, '.');
-SET_TRACE
+
        if(ext)
        {
-SET_TRACE
+
                if(!strncasecmp(ext, ".tga", 4)) result = 1;
-SET_TRACE
+
        }
 
-SET_TRACE
+
 
 // Test for list
        if(!result)
@@ -70,7 +70,7 @@ SET_TRACE
                        
                }
        }
-SET_TRACE
+
 
        return result;
 }
index f924380..308aa7c 100644 (file)
@@ -8,6 +8,10 @@
 
 #include <unistd.h>
 
+
+
+
+
 FileThread::FileThread(File *file, int do_audio, int do_video)
  : Thread(1, 0, 0)
 {
@@ -22,7 +26,6 @@ FileThread::~FileThread()
        delete_objects();
 
 
-
        delete file_lock;
 }
 
@@ -98,10 +101,8 @@ void FileThread::run()
                                file_lock->lock("FileThread::run 2");
                                if(do_audio)
                                {
-TRACE("FileThread::run 4");
                                        result = file->write_samples(audio_buffer[local_buffer], 
                                                output_size[local_buffer]);
-TRACE("FileThread::run 5");
                                }
                                else
                                if(do_video)
@@ -335,3 +336,5 @@ int FileThread::swap_buffer()
        current_buffer++;
        if(current_buffer >= ring_buffers) current_buffer = 0;
 }
+
+
index 7600029..3501ee4 100644 (file)
@@ -19,8 +19,11 @@ public:
                int do_video);
        void delete_objects();
        void reset();
+
+
+// ============================== writing section ==============================
        int start_writing();
-// Allocate the buffers and start loop.
+// Allocate the buffers and start loop for writing.
 // compressed - if 1 write_compressed_frames is called in the file
 //            - if 0 write_frames is called
        int start_writing(long buffer_size, 
@@ -28,6 +31,11 @@ public:
                        int ring_buffers, 
                        int compressed);
        int stop_writing();
+
+
+
+
+
 // write data into next available buffer
        int write_buffer(long size);
 // get pointer to next buffer to be written and lock it
index d55941e..cbdc1ed 100644 (file)
@@ -101,7 +101,7 @@ int FileXML::encode_text(char *text)
        char *replacement;
        int len = strlen(text);
        int lastpos = 0;
-       for (int i = 0; i < len; i++) 
+       for (int i = 0; i < len; i++)
        {
                switch (text[i]) {
                        case '<': replacement = leftb; break;
@@ -440,7 +440,7 @@ int XMLTag::read_tag(char *input, long &position, long length)
        while(input[position] != left_delimiter && position < length) position++;
        
        if(position >= length) return 1;
-       
+
 // find the start
        while(position < length &&
                (input[position] == ' ' ||         // skip spaces
@@ -521,7 +521,8 @@ int XMLTag::read_tag(char *input, long &position, long length)
                        terminating_char = '\"';     // use quotes to terminate
                        if(position < length) position++;   // don't store the quote itself
                }
-               else terminating_char = ' ';         // use space to terminate
+               else 
+                       terminating_char = ' ';         // use space to terminate
 
 // read until the terminating char
                for(j = 0;
@@ -549,7 +550,10 @@ int XMLTag::read_tag(char *input, long &position, long length)
 // skip the >
        if(position < length && input[position] == right_delimiter) position++;
 
-       if(total_properties || tag_title[0]) return 0; else return 1;
+       if(total_properties || tag_title[0]) 
+               return 0; 
+       else 
+               return 1;
        return 0;
 }
 
@@ -590,6 +594,7 @@ char* XMLTag::get_property(char *property, char *value)
        {
                if(!strcasecmp(tag_properties[i], property))
                {
+//printf("XMLTag::get_property %s %s\n", tag_properties[i], tag_property_values[i]);
                        int j = 0, k = 0;
                        char *tv = tag_property_values[i];
                        while (j < strlen(tag_property_values[i])) {
@@ -717,13 +722,6 @@ int XMLTag::set_property(char *text, int64_t value)
        return 0;
 }
 
-// int XMLTag::set_property(char *text, int value)
-// {
-//     sprintf(temp_string, "%d", value);
-//     set_property(text, temp_string);
-//     return 0;
-// }
-
 int XMLTag::set_property(char *text, float value)
 {
        if (value - (float)((int64_t)value) == 0)
index 2b57a9b..0739fc5 100644 (file)
@@ -456,10 +456,12 @@ void FloatAutos::dump()
                ((FloatAuto*)default_auto)->value);
        for(Auto* current = first; current; current = NEXT)
        {
-               printf("        position %lld value=%f invalue=%f outvalue=%f\n", 
+               printf("        position %lld value=%f invalue=%f outvalue=%f inposition=%lld outposition=%lld\n", 
                        current->position, 
                        ((FloatAuto*)current)->value,
                        ((FloatAuto*)current)->control_in_value,
-                       ((FloatAuto*)current)->control_out_value);
+                       ((FloatAuto*)current)->control_out_value,
+                       ((FloatAuto*)current)->control_in_position,
+                       ((FloatAuto*)current)->control_out_position);
        }
 }
index 524e08d..229fbbc 100644 (file)
@@ -76,13 +76,6 @@ int FormatPopup::create_objects()
        }
 
        format_items.append(new BC_ListBoxItem(_(TIFF_LIST_NAME)));
-//     for(i = 0; i < plugindb->total; i++)
-//     {
-//             if(plugindb->values[i]->fileio)
-//             {
-//                     add_item(format_items[total_items++] = new FormatPopupItem(this, plugindb->values[i]->title));
-//             }
-//     }
        update(&format_items,
                0,
                0,
index 848f34f..27371c7 100644 (file)
@@ -76,8 +76,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 1;
        item->edl->session->frame_rate = (double)60000.0 / 1001;
-//     item->edl->session->track_w = 1280;
-//     item->edl->session->track_h = 720;
        item->edl->session->output_w = 1280;
        item->edl->session->output_h = 720;
        item->edl->session->aspect_w = 16;
@@ -91,8 +89,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 1;
        item->edl->session->frame_rate = (double)60000.0 / 1001;
-//     item->edl->session->track_w = 720;
-//     item->edl->session->track_h = 480;
        item->edl->session->output_w = 720;
        item->edl->session->output_h = 480;
        item->edl->session->aspect_w = 4;
@@ -106,8 +102,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 1;
        item->edl->session->frame_rate = (double)30000.0 / 1001;
-//     item->edl->session->track_w = 720;
-//     item->edl->session->track_h = 480;
        item->edl->session->output_w = 720;
        item->edl->session->output_h = 480;
        item->edl->session->aspect_w = 4;
@@ -121,8 +115,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 1;
        item->edl->session->frame_rate = (double)30000.0 / 1001;
-//     item->edl->session->track_w = 360;
-//     item->edl->session->track_h = 240;
        item->edl->session->output_w = 360;
        item->edl->session->output_h = 240;
        item->edl->session->aspect_w = 4;
@@ -136,8 +128,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 1;
        item->edl->session->frame_rate = 15;
-//     item->edl->session->track_w = 320;
-//     item->edl->session->track_h = 240;
        item->edl->session->output_w = 320;
        item->edl->session->output_h = 240;
        item->edl->session->aspect_w = 4;
@@ -151,8 +141,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 0;
        item->edl->session->frame_rate = (double)30000.0 / 1001;
-//     item->edl->session->track_w = 720;
-//     item->edl->session->track_h = 480;
        item->edl->session->output_w = 720;
        item->edl->session->output_h = 480;
        item->edl->session->aspect_w = 4;
@@ -166,8 +154,6 @@ void FormatPresets::create_objects()
        item->edl->session->video_channels = 1;
        item->edl->session->video_tracks = 0;
        item->edl->session->frame_rate = (double)30000.0 / 1001;
-//     item->edl->session->track_w = 720;
-//     item->edl->session->track_h = 480;
        item->edl->session->output_w = 720;
        item->edl->session->output_h = 480;
        item->edl->session->aspect_w = 4;
index 6f83d53..8d7d498 100644 (file)
@@ -116,7 +116,6 @@ int FormatTools::create_objects(int &init_x,
                
        y += 25;
 
-//printf("FormatTools::create_objects 3\n");
        window->add_subwindow(format_title = new BC_Title(x, y, _("File Format:")));
        x += 90;
        window->add_subwindow(format_text = new BC_TextBox(x, 
@@ -130,7 +129,6 @@ int FormatTools::create_objects(int &init_x,
                this));
        format_button->create_objects();
 
-//printf("FormatTools::create_objects 4\n");
        x = init_x;
        y += format_button->get_h() + 10;
        if(do_audio)
@@ -146,7 +144,6 @@ int FormatTools::create_objects(int &init_x,
                x = init_x;
                y += aparams_button->get_h() + 20;
 
-//printf("FormatTools::create_objects 5\n");
 // Audio channels only used for recording.
                if(prompt_audio_channels)
                {
@@ -252,7 +249,6 @@ void FormatTools::reposition_window(int &init_x, int &init_y)
        path_textbox->reposition_window(x, y);
        x += 305;
        path_button->reposition_window(x, y);
-
        x -= 305;
        y += 35;
        format_title->reposition_window(x, y);
@@ -331,7 +327,6 @@ int FormatTools::set_audio_options()
        {
                aparams_thread->file->raise_window();
        }
-
        return 0;
 }
 
@@ -345,6 +340,7 @@ int FormatTools::set_video_options()
        {
                vparams_thread->file->raise_window();
        }
+
        return 0;
 }
 
index 7361dfb..f35da5a 100644 (file)
@@ -341,8 +341,8 @@ printf("IndexFile::create_index 1\n");
                index_thread->input_lock[current_buffer]->lock("IndexFile::create_index 2");
                index_thread->last_buffer[current_buffer] = 1;
                index_thread->output_lock[current_buffer]->unlock();
-
                index_thread->stop_build();
+
                delete index_thread;
        }
 
@@ -350,10 +350,12 @@ printf("IndexFile::create_index 1\n");
        source.close_file();
 
 
+
        open_index(asset);
+
        close_index();
+
        mwindow->edl->set_index_file(asset);
-//printf("IndexFile::create_index 11\n");
        return 0;
 }
 
@@ -567,7 +569,9 @@ int IndexFile::close_index()
 {
        if(file)
        {
+
                fclose(file);
+
                file = 0;
        }
 }
index 04629c4..2aff9c2 100644 (file)
@@ -143,7 +143,7 @@ void LoadFileThread::run()
        reel_name = "none";
        reel_number = 0;
        overwrite_reel = 0;
-       
+
        mwindow->interrupt_indexes();
        mwindow->gui->lock_window("LoadFileThread::run");
        result = mwindow->load_filenames(&path_list, load_mode, 0, reel_name, reel_number, overwrite_reel);
@@ -153,6 +153,7 @@ void LoadFileThread::run()
 
 
        mwindow->save_backup();
+
        mwindow->restart_brender();
 //     mwindow->undo->update_undo(_("load"), LOAD_ALL);
 
index d43927f..32b17be 100644 (file)
@@ -177,7 +177,7 @@ int main(int argc, char *argv[])
                PROGRAM_NAME " " 
                CINELERRA_VERSION " " 
                BUILDDATE 
-               " (C)2005 Heroine Virtual Ltd.\n\n"
+               " (C)2006 Heroine Virtual Ltd.\n\n"
 
 PROGRAM_NAME " is free software, covered by the GNU General Public License,\n"
 "and you are welcome to change it and/or distribute copies of it under\n"
@@ -256,7 +256,7 @@ PROGRAM_NAME " is free software, covered by the GNU General Public License,\n"
 // load the initial files on seperate tracks
                        if(filenames.total)
                        {
-                               mwindow.gui->lock_window();
+                               mwindow.gui->lock_window("main");
                                mwindow.load_filenames(&filenames, LOAD_REPLACE);
                                if(filenames.total == 1)
                                        mwindow.gui->mainmenu->add_load(filenames.values[0]);
index 316c783..f1e1cef 100644 (file)
@@ -82,6 +82,7 @@ void MainCursor::draw()
                selectionend = mwindow->edl->local_session->get_selectionend(1);
                view_start = mwindow->edl->local_session->view_start;
                zoom_sample = mwindow->edl->local_session->zoom_sample;
+//printf("MainCursor::draw %f %f\n", selectionstart, selectionend);
 
                pixel1 = Units::to_int64((selectionstart * 
                        mwindow->edl->session->sample_rate / 
index 431bc39..5e1c1e8 100644 (file)
@@ -94,14 +94,21 @@ public:
        int batchrender_x, batchrender_y, batchrender_w, batchrender_h;
 
 // Window positions
+// level window
        int lwindow_x, lwindow_y, lwindow_w, lwindow_h;
+// main window
        int mwindow_x, mwindow_y, mwindow_w, mwindow_h;
+// viewer
        int vwindow_x, vwindow_y, vwindow_w, vwindow_h;
+// compositor
        int cwindow_x, cwindow_y, cwindow_w, cwindow_h;
        int ctool_x, ctool_y;
+// asset window
        int awindow_x, awindow_y, awindow_w, awindow_h;
        int gwindow_x, gwindow_y;
+// record monitor
        int rmonitor_x, rmonitor_y, rmonitor_w, rmonitor_h;
+// record status
        int rwindow_x, rwindow_y, rwindow_w, rwindow_h;
        int afolders_w;
        int show_vwindow, show_awindow, show_cwindow, show_gwindow, show_lwindow;
index dad6ebf..2c1d158 100644 (file)
@@ -1,3 +1,4 @@
+#include "bcsignals.h"
 #include "clip.h"
 #include "condition.h"
 #include "maskauto.h"
@@ -676,6 +677,7 @@ void MaskUnit::process_package(LoadPackage *package)
 //             printf("diff: %lli\n", dif);
        }       /* END OF RECALCULATION! */
 
+SET_TRACE
 
        /* possible optimization: this could be useful for do_feather also */
 
@@ -1015,6 +1017,7 @@ void MaskEngine::do_mask(VFrame *output,
 
        int new_color_model = 0;
        recalculate = 0;
+
        switch(output->get_color_model())
        {
                case BC_RGB888:
@@ -1038,6 +1041,7 @@ void MaskEngine::do_mask(VFrame *output,
        }
 
 // Determine if recalculation is needed
+SET_TRACE
 
        if(mask && 
                (mask->get_w() != output->get_w() ||
@@ -1119,7 +1123,9 @@ void MaskEngine::do_mask(VFrame *output,
 
 
 // Run units
+SET_TRACE
        process_packages();
+SET_TRACE
 
 
 //printf("MaskEngine::do_mask 6\n");
@@ -1127,6 +1133,7 @@ void MaskEngine::do_mask(VFrame *output,
 
 void MaskEngine::init_packages()
 {
+SET_TRACE
 //printf("MaskEngine::init_packages 1\n");
        int division = (int)((float)output->get_h() / (get_total_packages()) + 0.5);
        if(division < 1) division = 1;
@@ -1149,6 +1156,7 @@ void MaskEngine::init_packages()
                }
 
        }
+SET_TRACE
 //printf("MaskEngine::init_packages 2\n");
 }
 
index 708838b..692634d 100644 (file)
@@ -74,6 +74,7 @@ public:
        MaskEngine(int cpus);
        ~MaskEngine();
 
+
        void do_mask(VFrame *output, 
                int64_t start_position,
                double frame_rate,
index 61db20f..3a8bda9 100644 (file)
@@ -92,6 +92,7 @@ void MeterPanel::update(double *levels)
 {
        if(subwindow->get_hidden()) return;
 
+
        for(int i = 0; 
                i < meter_count; 
                i++)
index e44feee..57d818c 100644 (file)
@@ -215,13 +215,11 @@ int Module::test_plugins()
 void Module::update_transition(int64_t current_position, 
        int direction)
 {
-SET_TRACE
        transition = track->get_current_transition(current_position, 
                direction,
                0,
                0); // position is already nudged in amodule.C and vmodule.C before calling update_transition!
 
-SET_TRACE
 // for situations where we had transition and have no more, we keep the server open:
 // maybe the same transition will follow and we won't need to reinit... (happens a lot while scrubbing over transitions left and right)
 //     if((prev_transition && !transition) ||
@@ -231,12 +229,9 @@ SET_TRACE
                delete transition_server;
                transition_server = 0;
        }
-SET_TRACE
 
        if(transition && !transition_server)
        {
-SET_TRACE
-
                if(renderengine)
                {
                        PluginServer *plugin_server = renderengine->scan_plugindb(transition->title,
@@ -256,22 +251,17 @@ SET_TRACE
                else
                if(plugin_array)
                {
-SET_TRACE
                        PluginServer *plugin_server = plugin_array->scan_plugindb(transition->title);
-SET_TRACE
                        transition_server = new PluginServer(*plugin_server);
-SET_TRACE
                        transition_server->open_plugin(0, 
                                plugin_array->mwindow->preferences,
                                get_edl(), 
                                transition,
                                -1);
-SET_TRACE
                        transition_server->init_realtime(
                                0,
                                1,
                                get_buffer_size());
-SET_TRACE
                }
        }
 }
index 4fa66b7..8537ae8 100644 (file)
@@ -133,7 +133,9 @@ void MTimeBar::draw_range()
                x2 > 0)
        {
                draw_top_background(get_parent(), 0, 0, x1, get_h());
+
                draw_3segmenth(x1, 0, x2 - x1, mwindow->theme->get_image("timebar_brender"));
+
                draw_top_background(get_parent(), x2, 0, get_w() - x2, get_h());
        }
        else
index 045c7c5..c576b51 100644 (file)
@@ -119,8 +119,6 @@ int atexit(void (*function)(void))
 
 
 
-
-
 MWindow::MWindow()
 {
        plugin_gui_lock = new Mutex("MWindow::plugin_gui_lock");
@@ -141,16 +139,16 @@ MWindow::~MWindow()
 
        delete mainindexes;
 
-TRACE("MWindow::~MWindow 1\n");
+SET_TRACE
        clean_indexes();
-TRACE("MWindow::~MWindow 2\n");
+SET_TRACE
 
        save_defaults();
-TRACE("MWindow::~MWindow 3\n");
+SET_TRACE
 // Give up and go to a movie
        exit(0);
 
-TRACE("MWindow::~MWindow 4\n");
+SET_TRACE
        delete mainprogress;
        delete audio_cache;             // delete the cache after the assets
        delete video_cache;             // delete the cache after the assets
@@ -169,6 +167,22 @@ TRACE("MWindow::~MWindow 4\n");
        delete plugin_gui_lock;
 }
 
+void MWindow::create_defaults_path(char *string)
+{
+// set the .bcast path
+               FileSystem fs;
+
+       sprintf(string, "%s", BCASTDIR);
+       fs.complete_path(string);
+       if(!fs.is_dir(string)) 
+       {
+               fs.create_dir(string); 
+       }
+
+// load the defaults
+       strcat(string, "Cinelerra_rc");
+}
+
 void MWindow::init_defaults(Defaults* &defaults, char *config_path)
 {
        char path[BCTEXTLEN];
@@ -179,18 +193,7 @@ void MWindow::init_defaults(Defaults* &defaults, char *config_path)
        }
        else
        {
-// set the .bcast path
-               FileSystem fs;
-
-               sprintf(path, "%s", BCASTDIR);
-               fs.complete_path(path);
-               if(fs.is_dir(path)) 
-               {
-                       fs.create_dir(path); 
-               }
-
-// load the defaults
-               strcat(path, "Cinelerra_rc");
+               create_defaults_path(path);
        }
 
        defaults = new Defaults(path);
@@ -254,6 +257,9 @@ void MWindow::init_plugin_path(Preferences *preferences,
                                                        new_plugin->close_plugin();
                                                        if(splash_window)
                                                                splash_window->operation->update(_(new_plugin->title));
+                                                       else
+                                                       {
+                                                       }
                                                }
                                        }while(!result);
                                }
@@ -263,6 +269,7 @@ void MWindow::init_plugin_path(Preferences *preferences,
                                        delete new_plugin;
                                }
                        }
+
                        if(splash_window) splash_window->progress->update((*counter)++);
                }
        }
@@ -343,6 +350,7 @@ void MWindow::init_plugins(Preferences *preferences,
                total += lad_fs.values[i]->total_files();
        if(splash_window) splash_window->progress->update_length(total);
 
+
 // Cinelerra
 #ifndef DO_STATIC
        init_plugin_path(preferences,
@@ -773,7 +781,7 @@ int MWindow::load_filenames(ArrayList<char*> *filenames,
        int reel_number,
        int overwrite_reel)
 {
-TRACE("MWindow::load_filenames 1");
+SET_TRACE
        ArrayList<EDL*> new_edls;
        ArrayList<Asset*> new_assets;
        ArrayList<File*> new_files;
@@ -795,7 +803,6 @@ TRACE("MWindow::load_filenames 1");
        vwindow->playback_engine->interrupt_playback(0);
 
 
-TRACE("MWindow::load_filenames 80");
 
 // Define new_edls and new_assets to load
        int result = 0;
@@ -832,9 +839,9 @@ TRACE("MWindow::load_filenames 80");
 
                sprintf(string, "Loading %s", new_asset->path);
                gui->show_message(string);
-TRACE("MWindow::load_filenames 81");
+SET_TRACE
                result = new_file->open_file(preferences, new_asset, 1, 0, 0, 0);
-TRACE("MWindow::load_filenames 82");
+SET_TRACE
 
                switch(result)
                {
@@ -842,14 +849,14 @@ TRACE("MWindow::load_filenames 82");
                        case FILE_OK:
                                if(load_mode != LOAD_RESOURCESONLY)
                                {
-TRACE("MWindow::load_filenames 83");
+SET_TRACE
                                        asset_to_edl(new_edl, new_asset);
-TRACE("MWindow::load_filenames 84");
+SET_TRACE
                                        new_edls.append(new_edl);
-TRACE("MWindow::load_filenames 85");
+SET_TRACE
                                        delete new_asset;
                                        new_asset = 0;
-TRACE("MWindow::load_filenames 86");
+SET_TRACE
                                }
                                else
                                {
@@ -996,7 +1003,7 @@ TRACE("MWindow::load_filenames 86");
                        }
                }
 
-TRACE("MWindow::load_filenames 87");
+SET_TRACE
                if(result)
                {
                        delete new_edl;
@@ -1004,11 +1011,11 @@ TRACE("MWindow::load_filenames 87");
                        new_edl = 0;
                        new_asset = 0;
                }
-TRACE("MWindow::load_filenames 88");
+SET_TRACE
 
 // Store for testing index
                new_files.append(new_file);
-TRACE("MWindow::load_filenames 89");
+SET_TRACE
        }
 
 
@@ -1017,7 +1024,6 @@ TRACE("MWindow::load_filenames 89");
 
 
 
-TRACE("MWindow::load_filenames 90");
 
 
 
@@ -1027,31 +1033,24 @@ TRACE("MWindow::load_filenames 90");
 // Don't back up here.
        if(new_edls.total)
        {
-SET_TRACE
 // For pasting, clear the active region
                if(load_mode == LOAD_PASTE)
                {
-SET_TRACE
                        double start = edl->local_session->get_selectionstart();
-SET_TRACE
                        double end = edl->local_session->get_selectionend();
-SET_TRACE
                        if(!EQUIV(start, end))
                                edl->clear(start, 
                                        end,
                                        edl->session->labels_follow_edits,
                                        edl->session->plugins_follow_edits);
-SET_TRACE
                }
 
-SET_TRACE
                paste_edls(&new_edls, 
                        load_mode,
                        0,
                        -1,
                        edl->session->labels_follow_edits, 
                        edl->session->plugins_follow_edits);
-SET_TRACE
        }
 
 
@@ -1059,8 +1058,8 @@ SET_TRACE
 
 
 
-TRACE("MWindow::load_filenames 91");
-
+// Add new assets to EDL and schedule assets for index building.
+// Used for loading resources only.
        if(new_assets.total)
        {
                for(int i = 0; i < new_assets.total; i++)
@@ -1090,25 +1089,25 @@ TRACE("MWindow::load_filenames 91");
                mainindexes->start_build();
        }
 
-TRACE("MWindow::load_filenames 100");
+
        update_project(load_mode);
-TRACE("MWindow::load_filenames 110");
+SET_TRACE
+
 
-//printf("MWindow::load_filenames 9\n");
-//sleep(10);
 
        new_edls.remove_all_objects();
-TRACE("MWindow::load_filenames 120\n");
+SET_TRACE
        new_assets.remove_all_objects();
-TRACE("MWindow::load_filenames 130\n");
+SET_TRACE
        new_files.remove_all_objects();
-TRACE("MWindow::load_filenames 140\n");
 
+SET_TRACE
        undo->update_undo(_("load"), LOAD_ALL, 0);
 
 
+SET_TRACE
        gui->stop_hourglass();
-UNTRACE
+SET_TRACE
 
        return 0;
 }
@@ -1178,7 +1177,6 @@ void MWindow::test_plugins(EDL *new_edl, char *path)
 
 
 
-
 void MWindow::create_objects(int want_gui, 
        int want_new,
        char *config_path)
@@ -1195,38 +1193,39 @@ void MWindow::create_objects(int want_gui,
        init_signals();
 
 
-TRACE("MWindow::create_objects 1");
+SET_TRACE
+
        init_defaults(defaults, config_path);
-TRACE("MWindow::create_objects 2");
+SET_TRACE
        init_preferences();
-TRACE("MWindow::create_objects 3");
+SET_TRACE
        init_plugins(preferences, plugindb, splash_window);
        if(splash_window) splash_window->operation->update(_("Initializing GUI"));
-TRACE("MWindow::create_objects 4");
+SET_TRACE
        init_theme();
 // Default project created here
-TRACE("MWindow::create_objects 5");
+SET_TRACE
        init_edl();
 
-TRACE("MWindow::create_objects 6");
+SET_TRACE
        init_awindow();
-TRACE("MWindow::create_objects 7");
+SET_TRACE
        init_compositor();
-TRACE("MWindow::create_objects 8");
+SET_TRACE
        init_levelwindow();
-TRACE("MWindow::create_objects 9");
+SET_TRACE
        init_viewer();
-TRACE("MWindow::create_objects 10");
+SET_TRACE
        init_cache();
-TRACE("MWindow::create_objects 11");
+SET_TRACE
        init_indexes();
-TRACE("MWindow::create_objects 12");
+SET_TRACE
        init_channeldb();
-TRACE("MWindow::create_objects 13");
+SET_TRACE
 
        init_gui();
        init_gwindow();
-TRACE("MWindow::create_objects 14");
+SET_TRACE
        init_render();
        init_brender();
        init_exportedl();
@@ -1235,36 +1234,35 @@ TRACE("MWindow::create_objects 14");
 
        plugin_guis = new ArrayList<PluginServer*>;
 
-TRACE("MWindow::create_objects 15");
+SET_TRACE
        if(session->show_vwindow) vwindow->gui->show_window();
        if(session->show_cwindow) cwindow->gui->show_window();
        if(session->show_awindow) awindow->gui->show_window();
        if(session->show_lwindow) lwindow->gui->show_window();
        if(session->show_gwindow) gwindow->gui->show_window();
-TRACE("MWindow::create_objects 16");
+SET_TRACE
 
 
        gui->mainmenu->load_defaults(defaults);
-TRACE("MWindow::create_objects 17");
+SET_TRACE
        gui->mainmenu->update_toggles(0);
-TRACE("MWindow::create_objects 18");
+SET_TRACE
        gui->patchbay->update();
-TRACE("MWindow::create_objects 19");
+SET_TRACE
        gui->canvas->draw();
-TRACE("MWindow::create_objects 20");
+SET_TRACE
        gui->cursor->draw();
-TRACE("MWindow::create_objects 21");
+SET_TRACE
        gui->show_window();
        gui->raise_window();
 
        if(preferences->use_tipwindow)
                init_tipwindow();
                
-TRACE("MWindow::create_objects 22");
-TRACE("MWindow::create_objects 23");
+SET_TRACE
 
        hide_splash();
-UNTRACE
+SET_TRACE
 }
 
 
@@ -1330,20 +1328,13 @@ void MWindow::show_gwindow()
 {
        session->show_gwindow = 1;
 
-SET_TRACE
        gwindow->gui->lock_window("MWindow::show_gwindow");
-SET_TRACE
        gwindow->gui->show_window();
-SET_TRACE
        gwindow->gui->raise_window();
-SET_TRACE
        gwindow->gui->flush();
-SET_TRACE
        gwindow->gui->unlock_window();
-SET_TRACE
 
        gui->mainmenu->show_gwindow->set_checked(1);
-SET_TRACE
 }
 
 void MWindow::show_lwindow()
@@ -1513,6 +1504,7 @@ void MWindow::hide_plugin(Plugin *plugin, int lock)
                }
        }
        if(lock) plugin_gui_lock->unlock();
+
 }
 
 void MWindow::hide_plugins()
@@ -1687,20 +1679,15 @@ int MWindow::asset_to_edl(EDL *new_edl,
 void MWindow::update_project(int load_mode)
 {
        restart_brender();
-//TRACE("MWindow::update_project 1");
        edl->tracks->update_y_pixels(theme);
 
 // Draw timeline
-//TRACE("MWindow::update_project 2");
        update_caches();
 
-TRACE("MWindow::update_project 3");
        gui->update(1, 1, 1, 1, 1, 1, 1);
 
-TRACE("MWindow::update_project 4");
        cwindow->update(0, 0, 1, 1, 1);
 
-TRACE("MWindow::update_project 5");
 
        if(load_mode == LOAD_REPLACE ||
                load_mode == LOAD_REPLACE_CONCATENATE)
@@ -1712,24 +1699,18 @@ TRACE("MWindow::update_project 5");
                vwindow->update(1);
        }
 
-TRACE("MWindow::update_project 6");
-
        cwindow->gui->slider->set_position();
-TRACE("MWindow::update_project 6.1");
        cwindow->gui->timebar->update(1, 1);
-TRACE("MWindow::update_project 6.2");
        cwindow->playback_engine->que->send_command(CURRENT_FRAME, 
                CHANGE_ALL,
                edl,
                1);
 
-TRACE("MWindow::update_project 7");
        awindow->gui->lock_window("MWindow::update_project");
        awindow->gui->update_assets();
        awindow->gui->flush();
        awindow->gui->unlock_window();
        gui->flush();
-TRACE("MWindow::update_project 100");
 }
 
 
@@ -1806,10 +1787,8 @@ void MWindow::remove_assets_from_project(int push_undo)
                video_cache->delete_entry(session->drag_assets->values[i]);
        }
 
-printf("MWindow::remove_assets_from_project 1\n");
 video_cache->dump();
 audio_cache->dump();
-printf("MWindow::remove_assets_from_project 100\n");
 
 // Remove from VWindow.
        for(int i = 0; i < session->drag_clips->total; i++)
index 80fbbfd..4fc22ec 100644 (file)
@@ -233,6 +233,9 @@ public:
        static int create_aspect_ratio(float &w, float &h, int width, int height);\r
        void cut();\r
 \r
+// Calculate defaults path\r
+       static void create_defaults_path(char *string);\r
+\r
        void delete_folder(char *folder);\r
        void delete_inpoint();\r
        void delete_outpoint();    \r
@@ -332,6 +335,7 @@ public:
        void undo_entry(BC_WindowBase *calling_window_gui);\r
        void redo_entry(BC_WindowBase *calling_window_gui);\r
 \r
+\r
        int cut_automation();\r
        int copy_automation();\r
        int paste_automation();\r
@@ -358,13 +362,10 @@ public:
        void update_caches();\r
        int optimize_assets();            // delete unused assets from the cache and assets\r
 \r
-// ================================= cursor selection ======================\r
 \r
        void select_point(double position);\r
        int set_loop_boundaries();         // toggle loop playback and set boundaries for loop playback\r
 \r
-// ================================ handle selection =======================\r
-\r
 \r
 \r
        SplashGUI *splash_window;\r
@@ -435,6 +436,7 @@ public:
 // Lock during creation and destruction of brender so playback doesn't use it.\r
        Mutex *brender_lock;\r
 \r
+\r
 // Initialize channel DB's for playback\r
        void init_channeldb();\r
        void init_render();\r
index f510825..df99f0f 100644 (file)
@@ -510,21 +510,21 @@ void MWindow::insert(double position,
        EDL edl(parent_edl);
        ArrayList<EDL*> new_edls;
        uint32_t load_flags = LOAD_ALL;
-SET_TRACE
+
 
        new_edls.append(&edl);
        edl.create_objects();
-SET_TRACE
+
 
 
 
        if(parent_edl) load_flags &= ~LOAD_SESSION;
        if(!edl.session->autos_follow_edits) load_flags &= ~LOAD_AUTOMATION;
        if(!edl.session->labels_follow_edits) load_flags &= ~LOAD_TIMEBAR;
-SET_TRACE
+
        edl.load_xml(plugindb, file, load_flags);
 
-SET_TRACE
+
 
 
 
@@ -666,10 +666,6 @@ void MWindow::insert_effect(char *title,
 int MWindow::modify_edithandles()
 {
 
-
-
-
-
        edl->modify_edithandles(session->drag_start, 
                session->drag_position, 
                session->drag_handle, 
@@ -993,7 +989,7 @@ int MWindow::paste(double start,
 // For editing use insertion point position
 void MWindow::paste()
 {
-SET_TRACE
+
        double start = edl->local_session->get_selectionstart();
        double end = edl->local_session->get_selectionend();
        int64_t len = gui->get_clipboard()->clipboard_len(SECONDARY_SELECTION);
@@ -1002,7 +998,7 @@ SET_TRACE
        {
                char *string = new char[len + 1];
 
-SET_TRACE
+
 
                gui->get_clipboard()->from_clipboard(string, 
                        len, 
@@ -1010,22 +1006,22 @@ SET_TRACE
                FileXML file;
                file.read_from_string(string);
 
-SET_TRACE
+
 
 
                clear(0);
-SET_TRACE
+
                insert(start, 
                        &file, 
                        edl->session->labels_follow_edits, 
                        edl->session->plugins_follow_edits);
-SET_TRACE
+
                edl->optimize();
-SET_TRACE
+
 
                delete [] string;
 
-SET_TRACE
+
 
                save_backup();
 
@@ -1037,7 +1033,7 @@ SET_TRACE
                awindow->gui->update_assets();
                sync_parameters(CHANGE_EDL);
        }
-SET_TRACE
+
 }
 
 int MWindow::paste_assets(double position, Track *dest_track)
@@ -1207,54 +1203,56 @@ int MWindow::paste_edls(ArrayList<EDL*> *new_edls,
        int edit_labels,
        int edit_plugins)
 {
-SET_TRACE
+
        ArrayList<Track*> destination_tracks;
        int need_new_tracks = 0;
 
        if(!new_edls->total) return 0;
+
+
 SET_TRACE
-//printf("MWindow::paste_edls 1\n");
 
 // Delete current project
        if(load_mode == LOAD_REPLACE ||
                load_mode == LOAD_REPLACE_CONCATENATE)
        {
-SET_TRACE
                edl->save_defaults(defaults);
-SET_TRACE
+
                hide_plugins();
-SET_TRACE
+
                delete edl;
-SET_TRACE
+
                edl = new EDL;
-SET_TRACE
+
                edl->create_objects();
-SET_TRACE
+
                edl->copy_session(new_edls->values[0]);
-SET_TRACE
+
                gui->mainmenu->update_toggles(0);
-SET_TRACE
+
 
                gui->unlock_window();
-SET_TRACE
+
                gwindow->gui->update_toggles(1);
-SET_TRACE
+
                gui->lock_window("MWindow::paste_edls");
-SET_TRACE
+
 
 // Insert labels for certain modes constitutively
                edit_labels = 1;
                edit_plugins = 1;
        }
+
 SET_TRACE
 
 
+SET_TRACE
 // Create new tracks in master EDL
        if(load_mode == LOAD_REPLACE || 
                load_mode == LOAD_REPLACE_CONCATENATE ||
                load_mode == LOAD_NEW_TRACKS)
        {
-SET_TRACE
+
                need_new_tracks = 1;
                for(int i = 0; i < new_edls->total; i++)
                {
@@ -1281,13 +1279,13 @@ SET_TRACE
 // Base track count on first EDL only for concatenation
                        if(load_mode == LOAD_REPLACE_CONCATENATE) break;
                }
-SET_TRACE
+
        }
        else
 // Recycle existing tracks of master EDL
        if(load_mode == LOAD_CONCATENATE || load_mode == LOAD_PASTE)
        {
-SET_TRACE
+
 // The point of this is to shift forward labels after the selection so they can
 // then be shifted back to their original locations without recursively
 // shifting back every paste.
@@ -1313,33 +1311,36 @@ SET_TRACE
 //                                             1);
                        }
                }
-SET_TRACE
+
        }
 
 
-SET_TRACE
+
 
        int destination_track = 0;
        double *paste_position = new double[destination_tracks.total];
 
-SET_TRACE
 
 
+SET_TRACE
+
 
 // Iterate through the edls
        for(int i = 0; i < new_edls->total; i++)
        {
-SET_TRACE
+
                EDL *new_edl = new_edls->values[i];
+SET_TRACE
                double edl_length = new_edl->local_session->clipboard_length ?
                        new_edl->local_session->clipboard_length :
                        new_edl->tracks->total_length();
 // printf("MWindow::paste_edls 2\n");
 // new_edl->dump();
 
-
 SET_TRACE
 
+
+
 // Resample EDL to master rates
                new_edl->resample(new_edl->session->sample_rate, 
                        edl->session->sample_rate, 
@@ -1351,6 +1352,7 @@ SET_TRACE
 SET_TRACE
 
 
+
 // Add assets and prepare index files
                for(Asset *new_asset = new_edl->assets->first;
                        new_asset;
@@ -1358,11 +1360,13 @@ SET_TRACE
                {
                        mainindexes->add_next_asset(0, new_asset);
                }
+SET_TRACE
 // Capture index file status from mainindex test
                edl->update_assets(new_edl);
 
 SET_TRACE
 
+
 // Get starting point of insertion.  Need this to paste labels.
                switch(load_mode)
                {
@@ -1399,9 +1403,10 @@ SET_TRACE
                }
 
 
-SET_TRACE
 
 
+SET_TRACE
+
 // Insert edl
                if(load_mode != LOAD_RESOURCESONLY)
                {
@@ -1473,11 +1478,14 @@ SET_TRACE
                        }
                }
 
+SET_TRACE
                if(load_mode == LOAD_PASTE)
                        current_position += edl_length;
        }
 
-// Move loading of clips and vwindow to the end - this fixes some strange issue, for index not being shown
+
+// Move loading of clips and vwindow to the end - this fixes some
+// strange issue, for index not being shown
 // Assume any paste operation from the same EDL won't contain any clips.
 // If it did it would duplicate every clip here.
        for(int i = 0; i < new_edls->total; i++)
@@ -1497,25 +1505,25 @@ SET_TRACE
                        edl->vwindow_edl->copy_all(new_edl->vwindow_edl);
                }
        }
-SET_TRACE
 
 
 SET_TRACE
        if(paste_position) delete [] paste_position;
 
+
 SET_TRACE
 // This is already done in load_filenames and everything else that uses paste_edls
 //     update_project(load_mode);
 
 SET_TRACE
-
 // Start examining next batch of index files
        mainindexes->start_build();
 SET_TRACE
 
+
 // Don't save a backup after loading since the loaded file is on disk already.
 
-SET_TRACE
+
        return 0;
 }
 
index 8527251..2141f29 100644 (file)
@@ -178,7 +178,9 @@ SET_TRACE
 SET_TRACE
 
        mwindow->theme->get_mwindow_sizes(this, get_w(), get_h());
+SET_TRACE
        mwindow->theme->draw_mwindow_bg(this);
+SET_TRACE
        mainmenu->create_objects();
 SET_TRACE
 
@@ -307,20 +309,13 @@ void MWindowGUI::update(int scrollbars,
        int clock,
        int buttonbar)
 {
-//TRACE("MWindowGUI::update 1");
        mwindow->edl->tracks->update_y_pixels(mwindow->theme);
-//TRACE("MWindowGUI::update 1");
        if(scrollbars) this->get_scrollbars();
-//TRACE("MWindowGUI::update 1");
        if(timebar) this->timebar->update();
-//TRACE("MWindowGUI::update 1");
        if(zoombar) this->zoombar->update();
-//TRACE("MWindowGUI::update 1");
        if(patchbay) this->patchbay->update();
-//TRACE("MWindowGUI::update 1");
        if(clock) this->mainclock->update(
                mwindow->edl->local_session->get_selectionstart(1));
-//TRACE("MWindowGUI::update 1");
        if(canvas)
        {
                this->canvas->draw(canvas == 2);
@@ -328,9 +323,7 @@ void MWindowGUI::update(int scrollbars,
                this->canvas->flash();
                this->canvas->activate();
        }
-//TRACE("MWindowGUI::update 1");
        if(buttonbar) mbuttons->update();
-//TRACE("MWindowGUI::update 100");
 }
 
 int MWindowGUI::visible(int64_t x1, int64_t x2, int64_t view_x1, int64_t view_x2)
@@ -474,7 +467,7 @@ int MWindowGUI::keypress_event()
                {
                        case LEFT:
                                if(!ctrl_down()) 
-                               {
+                               { 
                                        if (alt_down())
                                                mwindow->prev_edit_handle();
                                        else
@@ -646,7 +639,7 @@ int MWindowGUI::keypress_event()
                                                1);
                                unlock_window();
                                mwindow->cwindow->update(0, 1, 1);
-                               lock_window("TrackCanvas::keypress_event");
+                               lock_window("TrackCanvas::keypress_event 3");
 
                                result = 1;
                                break;
index 6a80df6..a2ef5dd 100644 (file)
@@ -37,8 +37,10 @@ public:
        int focus_in_event();
        int focus_out_event();
 
+// canvas - 1 for incremental drawing of resources
+//          2 for delete and redraw of resources
        void update(int scrollbars,
-               int canvas,      // 1 for incremental drawing.  2 for full refresh
+               int canvas, 
                int timebar,
                int zoombar,
                int patchbay, 
index afcc861..2290e8d 100644 (file)
@@ -2,6 +2,7 @@
 #include "cplayback.h"
 #include "cwindow.h"
 #include "cwindowgui.h"
+#include "edits.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "labels.h"
@@ -19,7 +20,7 @@
 #include "tracks.h"
 #include "transportque.h"
 #include "zoombar.h"
-#include "edits.h"
+
 
 void MWindow::update_plugins()
 {
@@ -491,6 +492,11 @@ int MWindow::prev_label()
        return 0;
 }
 
+
+
+
+
+
 int MWindow::next_edit_handle()
 {
        double position = edl->local_session->get_selectionend(1);
@@ -618,6 +624,11 @@ int MWindow::prev_edit_handle()
 
 
 
+
+
+
+
+
 int MWindow::expand_y()
 {
        int result = edl->local_session->zoom_y * 2;
index 6712815..3a2065a 100644 (file)
@@ -22,6 +22,7 @@
 #include "vplayback.h"
 #include "vwindow.h"
 
+
 #include <string.h>
 
 
@@ -148,9 +149,7 @@ void NewThread::run()
        }
        else
        {
-//printf("NewThread::run 4\n");
                new_project->create_new_project();
-//printf("NewThread::run 5\n");
        }
 }
 
@@ -874,30 +873,9 @@ int NewAspectAuto::handle_event()
 }
 
 
-#if 0
 
-NewCloneToggle::NewCloneToggle(MWindow *mwindow, NewWindow *nwindow, int x, int y)
- : BC_Toggle(x, 
-       y, 
-       mwindow->theme->chain_data, 
-       nwindow->new_thread->auto_sizes,
-       "",
-       0, 
-       0, 
-       0)
-{
-       this->mwindow = mwindow;
-       this->nwindow = nwindow;
-}
 
-int NewCloneToggle::handle_event()
-{
-       nwindow->canvas_w_text->update((int64_t)nwindow->new_edl->session->track_w);
-       nwindow->canvas_h_text->update((int64_t)nwindow->new_edl->session->track_h);
-       nwindow->new_edl->session->output_w = nwindow->new_edl->session->track_w;
-       nwindow->new_edl->session->output_h = nwindow->new_edl->session->track_h;
-       nwindow->new_thread->update_aspect();
-       return 1;
-}
 
-#endif
+
+
+
index 84a40d3..44cf551 100644 (file)
@@ -2581,7 +2581,7 @@ void BlendUnit::process_package(LoadPackage *package)
                                BLEND_ONLY_TRANSFER_REPLACE(uint16_t, 4);
                                break;
                }
-       } 
+       }
        else
        if (mode == TRANSFER_NORMAL) 
        {
index bd07c60..f0f17c9 100644 (file)
@@ -404,15 +404,10 @@ void PackageRenderer::do_video()
                                else
                                if(!result)
                                {
-//printf("PackageRenderer::do_video 7\n");
 // Set background rendering parameters
-//                                     if(package->use_brender)
-//                                     {
 // Allow us to skip sections of the output file by setting the frame number.
 // Used by background render and render farm.
-                                               video_output_ptr[0]->set_number(video_position);
-//printf("PackageRenderer::do_video 8 %p %lld\n", video_output_ptr[0], video_position);
-//                                     }
+                                       video_output_ptr[0]->set_number(video_position);
                                        video_write_position++;
 
                                        if(video_write_position >= video_write_length)
index 05d068a..8521905 100644 (file)
@@ -152,7 +152,7 @@ int PatchBay::create_objects()
        mode_icons[TRANSFER_REPLACE] = new BC_Pixmap(this, 
                mwindow->theme->get_image("mode_replace"),
                PIXMAP_ALPHA);
-       
+
        add_subwindow(nudge_popup = new NudgePopup(mwindow, this));
        nudge_popup->create_objects();
 
index ce4d703..2b368ef 100644 (file)
@@ -1,3 +1,4 @@
+#include "bcsignals.h"
 #include "clip.h"
 #include "edl.h"
 #include "edlsession.h"
@@ -105,15 +106,15 @@ int PerformancePrefs::create_objects()
                        pwindow->thread->preferences->brender_asset);
        brender_tools->create_objects(x, 
                y, 
-               0,    // Include tools for audio
-               1,   // Include tools for video
+               0,  // Include tools for audio
+               1,  // Include tools for video
                0,  // Include checkbox for audio
                0,  // Include checkbox for video
                0,
                1,
                0,  // Select compressors to be offered
                0, // Change captions for recording
-               0, // If nonzero, prompt for insertion strategy
+               0,  // If nonzero, prompt for insertion strategy
                1); // Supply file formats for background rendering
        x = xmargin1;
 
@@ -522,6 +523,7 @@ int PrefsRenderFarmNodes::column_resize_event()
 
 int PrefsRenderFarmNodes::handle_event()
 {
+SET_TRACE
        if(get_selection_number(0, 0) >= 0)
        {
                subwindow->hot_node = get_selection_number(1, 0);
@@ -540,6 +542,7 @@ int PrefsRenderFarmNodes::handle_event()
                subwindow->hot_node = -1;
                subwindow->edit_node->update("");
        }
+SET_TRACE
        return 1;
 }      
 int PrefsRenderFarmNodes::selection_changed()
index 221706f..08d228e 100644 (file)
@@ -2,7 +2,7 @@
 #define PICTURE_H
 
 
-// Container for picture controls
+// Container for picture controls like brightness.
 
 #include "arraylist.h"
 #include "bcwindowbase.inc"
@@ -57,7 +57,7 @@ public:
        PictureItem* new_item(const char *name);
        PictureItem* get_item(const char *name, int id);
        ArrayList<PictureItem*> controls;
-// To get defaults
+// Pointer to MWindow::defaults get defaults
        MWindow *mwindow;
 };
 
index 91749e6..2eb571f 100644 (file)
@@ -359,9 +359,7 @@ void PlaybackEngine::run()
 // Wait for current command to finish
                que->output_lock->lock("PlaybackEngine::run");
 
-//printf("PlaybackEngine::run 1\n");
                wait_render_engine();
-//printf("PlaybackEngine::run 2\n");
 
 
 // Read the new command
@@ -372,6 +370,7 @@ void PlaybackEngine::run()
                que->command.reset();
                que->input_lock->unlock();
 
+//printf("PlaybackEngine::run 1 %d\n", command->command);
 
 
                switch(command->command)
index ce626d5..5f28122 100644 (file)
@@ -1,6 +1,7 @@
 #include "adeviceprefs.h"
 #include "audioconfig.h"
 #include "audiodevice.inc"
+#include "bcsignals.h"
 #include "clip.h"
 #include "defaults.h"
 #include "edl.h"
@@ -52,6 +53,7 @@ int PlaybackPrefs::create_objects()
        add_subwindow(title2 = new BC_Title(x, y, _("Samples to send to console at a time:"), MEDIUMFONT, resources->text_default));
        x2 = MAX(title2->get_w(), title2->get_w()) + 10;
 
+SET_TRACE
        sprintf(string, "%d", playback_config->aconfig->fragment_size);
        PlaybackModuleFragment *menu;
        add_subwindow(menu = new PlaybackModuleFragment(x2, 
@@ -68,6 +70,7 @@ int PlaybackPrefs::create_objects()
        menu->add_item(new BC_MenuItem("131072"));
        menu->add_item(new BC_MenuItem("262144"));
 
+SET_TRACE
        y += menu->get_h() + 5;
        x2 = x;
        add_subwindow(title1 = new BC_Title(x2, y, _("Audio offset (sec):")));
@@ -79,6 +82,7 @@ int PlaybackPrefs::create_objects()
        audio_offset->create_objects();
        y += audio_offset->get_h() + 5;
 
+SET_TRACE
        add_subwindow(new PlaybackViewFollows(pwindow, pwindow->thread->edl->session->view_follows_playback, y));
        y += 30;
        add_subwindow(new PlaybackSoftwareTimer(pwindow, pwindow->thread->edl->session->playback_software_position, y));
@@ -95,18 +99,22 @@ int PlaybackPrefs::create_objects()
                MODEPLAY);
        audio_device->initialize();
 
+SET_TRACE
 
 
 
 // Video
        y += audio_device->get_h();
 
+SET_TRACE
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
        y += 5;
 
+SET_TRACE
        add_subwindow(new BC_Title(x, y, _("Video Out"), LARGEFONT, resources->text_default));
        y += 30;
 
+SET_TRACE
        add_subwindow(new VideoEveryFrame(pwindow, x, y));
 
        add_subwindow(new BC_Title(x + 200, y + 10, _("Framerate achieved:")));
@@ -114,6 +122,8 @@ int PlaybackPrefs::create_objects()
        draw_framerate();
 
        y += 35;
+
+SET_TRACE
        add_subwindow(new BC_Title(x, y, _("Scaling equation:")));
        y += 20;
        add_subwindow(nearest_neighbor = new PlaybackNearest(pwindow, 
@@ -134,11 +144,13 @@ int PlaybackPrefs::create_objects()
                10, 
                y));
 
+SET_TRACE
        y += 35;
        add_subwindow(new BC_Title(x, y, _("Preload buffer for Quicktime:"), MEDIUMFONT, resources->text_default));
        sprintf(string, "%d", pwindow->thread->edl->session->playback_preload);
        add_subwindow(new PlaybackPreload(x + 210, y, pwindow, this, string));
 
+SET_TRACE
 //     y += 30;
 //     add_subwindow(new PlaybackDeblock(pwindow, 10, y));
 
@@ -167,9 +179,7 @@ int PlaybackPrefs::create_objects()
                MODEPLAY);
        video_device->initialize();
 
-// Strategic playback options created here
-//     set_strategy(pwindow->thread->edl->session->playback_strategy, y);
-       
+SET_TRACE      
 
        return 0;
 }
@@ -396,21 +406,12 @@ int VideoEveryFrame::handle_event()
 
 
 
-// PlaybackDeblock::PlaybackDeblock(PreferencesWindow *pwindow, int x, int y)
-//  : BC_CheckBox(x, 
-//     y, 
-//     pwindow->thread->edl->session->mpeg4_deblock, 
-//     _("MPEG-4 Deblocking"))
-// {
-//     this->pwindow = pwindow;
-// }
-// 
-// int PlaybackDeblock::handle_event()
-// {
-//     pwindow->thread->edl->session->mpeg4_deblock = get_value();
-//     return 1;
-// }
-// 
+
+
+
+
+
+
 
 
 
index 9ec8532..f3e455e 100644 (file)
@@ -43,10 +43,6 @@ public:
        static char* strategy_to_string(int strategy);
        void delete_strategy();
 
-/*
- *     ArrayList<PlaybackConfig*>* current_config_list();
- *     PlaybackConfig* current_config();
- */
        void update(int interpolation);
        int draw_framerate();
 
@@ -62,14 +58,7 @@ public:
        PlaybackBilinearBilinear *linear_linear;
        PlaybackDeblock *mpeg4_deblock;
 
-//     int64_t current_head;
-//     BC_Title *head_title;
-//     BC_Title *host_title;
-//     BC_Title *head_count_title;
        BC_Title *vdevice_title;
-//     PlaybackHead *head_text;
-//     PlaybackHeadCount *head_count_text;
-//     PlaybackHost *host_text;
 };
 
 class PlaybackModuleFragment : public BC_PopupMenu
@@ -125,7 +114,9 @@ public:
 class VideoEveryFrame : public BC_CheckBox
 {
 public:
-       VideoEveryFrame(PreferencesWindow *pwindow, int x, int y);
+       VideoEveryFrame(PreferencesWindow *pwindow, 
+               int x, 
+               int y);
        int handle_event();
        PreferencesWindow *pwindow;
 };
index 6b278b2..25d5a8a 100644 (file)
@@ -245,6 +245,10 @@ void PlayTransport::handle_transport(int command,
        if(!get_edl()) return;
 
 
+//printf("PlayTransport::handle_transport 1 %d\n", command);
+       int prev_command = engine->command->command;
+       int prev_direction = engine->command->get_direction();
+       int prev_single_frame = engine->command->single_frame();
 
 // Dispatch command
        switch(command)
index 3a5e94d..c99d33e 100644 (file)
@@ -29,7 +29,9 @@ public:
        static int get_transport_width(MWindow *mwindow);
        int flip_vertical(int vertical, int &x, int &y);
        int keypress_event();
-       void handle_transport(int command, int wait_tracking = 0, int use_inout = 0);
+       void handle_transport(int command, 
+               int wait_tracking = 0, 
+               int use_inout = 0);
 
        int pause_transport();
        int reset_transport();
index d947742..1da73ad 100644 (file)
@@ -46,23 +46,23 @@ int PluginClient::plugin_init_realtime(int realtime_priority,
        int total_in_buffers,
        int buffer_size)
 {
-SET_TRACE
+
 // Get parameters for all
        master_gui_on = get_gui_status();
 
-SET_TRACE
+
 
 // get parameters depending on video or audio
        init_realtime_parameters();
-SET_TRACE
+
        smp = server->preferences->processors - 1;
-SET_TRACE
+
        this->realtime_priority = realtime_priority;
-SET_TRACE
+
        this->total_in_buffers = this->total_out_buffers = total_in_buffers;
-SET_TRACE
+
        this->out_buffer_size = this->in_buffer_size = buffer_size;
-SET_TRACE
+
        return 0;
 }
 
index 40932fa..a63c9bf 100644 (file)
@@ -271,24 +271,13 @@ public:
 
        int get_configure_change();                             // get propogated configuration change from a send_configure_change
 
-// Replaced by pull method
-/*
- *     virtual void plugin_process_realtime(double **input, 
- *             double **output, 
- *             int64_t current_position, 
- *             int64_t fragment_size,
- *             int64_t total_len) {};
- *     virtual void plugin_process_realtime(VFrame **input, 
- *             VFrame **output, 
- *             int64_t current_position,
- *             int64_t total_len) {};
- */
 // Called by plugin server to update GUI with rendered data.
        virtual void plugin_render_gui(void *data) {};
        virtual void plugin_render_gui(void *data, int size) {};
        virtual int plugin_process_loop(VFrame **buffers, int64_t &write_length) { return 1; };
        virtual int plugin_process_loop(double **buffers, int64_t &write_length) { return 1; };
-       virtual int init_realtime_parameters();     // get parameters depending on video or audio
+// get parameters depending on video or audio
+       virtual int init_realtime_parameters();     
        int get_gui_status();
        char* get_gui_string();
 
index 82dba0d..8dea0a3 100644 (file)
@@ -113,6 +113,8 @@ void PluginDialogThread::run()
 // Done at closing
        if(!result)
        {
+
+
                if(plugin_type)
                {
                        mwindow->gui->lock_window("PluginDialogThread::run 3");
index 0ce0f91..ae9fc1a 100644 (file)
@@ -328,16 +328,16 @@ int PluginServer::init_realtime(int realtime_sched,
                int total_in_buffers, 
                int buffer_size)
 {
-SET_TRACE
+
        if(!plugin_open) return 0;
-SET_TRACE
+
 // set for realtime priority
 // initialize plugin
 // Call start_realtime
        client->plugin_init_realtime(realtime_sched, 
                total_in_buffers, 
                buffer_size);
-SET_TRACE
+
 }
 
 
@@ -394,6 +394,7 @@ void PluginServer::process_buffer(VFrame **frame,
                0);
        vclient->direction = direction;
 
+
        if(multichannel)
        {
                vclient->process_buffer(frame, current_position, frame_rate);
index 40062c5..1df3c26 100644 (file)
@@ -200,8 +200,8 @@ public:
                int64_t total_samples);
 
 
-// Called by client to read data in realtime effect.  Returns -1 if error or 0 
-// if success.
+// Called by client to read data in realtime effect.  
+// Returns -1 if error or 0 if success.
        int read_frame(VFrame *buffer, 
                int channel, 
                int64_t start_position, 
@@ -286,7 +286,8 @@ public:
        int uses_gui;
 // Plugin is a transition
        int transition;
-// name of plugin in english.  Compared against the title value in the plugin.
+// name of plugin in english.
+// Compared against the title value in the plugin for resolving symbols.
        char *title;
        int64_t written_samples, written_frames;
        char *path;           // location of plugin on disk
index 775e20b..2b75b60 100644 (file)
@@ -6,7 +6,6 @@
 #include "pluginclient.h"
 #include "vframe.inc"
 
-
 // Maximum dimensions for a temporary frame a plugin should retain between 
 // process_buffer calls.  This allows memory conservation.
 #define PLUGIN_MAX_W 2000
@@ -51,6 +50,7 @@ public:
                int64_t start_position,
                double frame_rate);
 
+
 // Called by plugin server to render the GUI with rendered data.
        void plugin_render_gui(void *data);
        virtual void render_gui(void *data) { };
@@ -104,7 +104,7 @@ public:
        int64_t local_to_edl(int64_t position);
        int64_t edl_to_local(int64_t position);
 
-// Non realtime buffer pointers
+// ======================== Non realtime buffer pointers =======================
 // Channels of arrays of frames that the client uses.
        VFrame ***video_in, ***video_out;
 
@@ -116,6 +116,8 @@ public:
        VFrame ***input_ptr_render;
        VFrame ***output_ptr_render;
 
+
+
 // Frame rate of EDL
        double project_frame_rate;
 // Local parameters set by non realtime plugin about the file to be generated.
@@ -124,10 +126,15 @@ public:
 // requested rates.
        double frame_rate;
        int project_color_model;
-       int use_float;   // Whether user wants floating point calculations.
-       int use_alpha;   // Whether user wants alpha calculations.
-       int use_interpolation;   // Whether user wants pixel interpolation.
-       float aspect_w, aspect_h;  // Aspect ratio
+// Whether user wants floating point calculations.
+       int use_float;   
+// Whether user wants alpha calculations.
+       int use_alpha;   
+// Whether user wants pixel interpolation.
+       int use_interpolation;   
+// Aspect ratio
+       float aspect_w;
+       float aspect_h;  
 
 // Tempo
        VFrame *temp;
index 176a302..807b75c 100644 (file)
@@ -42,7 +42,8 @@ public:
 // Set frame rate for a node.  Node -1 is the master node.
 // The node number is relative to the enabled nodes.
        void set_rate(float rate, int node);
-// Calculate the number of cpus to use.  Determined by /proc/cpuinfo and force_uniprocessor
+// Calculate the number of cpus to use.  
+// Determined by /proc/cpuinfo and force_uniprocessor.
        int calculate_processors();
 
 // ================================= Performance ================================
@@ -58,7 +59,8 @@ public:
        double render_preroll;
        int brender_preroll;
        int force_uniprocessor;
-// The number of cpus to use.  Determined by /proc/cpuinfo and force_uniprocessor
+// The number of cpus to use when rendering.
+// Determined by /proc/cpuinfo and force_uniprocessor
        int processors;
 
 
index f1f5f7a..035d948 100644 (file)
@@ -1,6 +1,7 @@
 #include "aboutprefs.h"
 #include "asset.h"
 #include "audiodevice.inc"
+#include "bcsignals.h"
 #include "cache.h"
 #include "cplayback.h"
 #include "cwindow.h"
@@ -159,7 +160,7 @@ int PreferencesThread::apply_settings()
        AudioOutConfig *aconfig = mwindow->edl->session->playback_config->aconfig;
        VideoOutConfig *vconfig = mwindow->edl->session->playback_config->vconfig;
 
-
+       
        rerender = 
                (edl->session->playback_preload != mwindow->edl->session->playback_preload) ||
                (edl->session->interpolation_type != mwindow->edl->session->interpolation_type) ||
@@ -232,10 +233,14 @@ int PreferencesThread::apply_settings()
 
        if(rerender)
        {
+//printf("PreferencesThread::apply_settings 1\n");
+// This doesn't stop and restart, only reloads the assets before
+// the next play command.
                mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
                        CHANGE_ALL,
                        mwindow->edl,
                        1);
+//printf("PreferencesThread::apply_settings 10\n");
        }
 
        if(redraw_times || redraw_overlays)
@@ -263,9 +268,6 @@ char* PreferencesThread::category_to_text(int category)
                case 3:
                        return _("Interface");
                        break;
-//             case 4:
-//                     return _("Plugin Set");
-//                     break;
                case 4:
                        return _("About");
                        break;
@@ -275,6 +277,7 @@ char* PreferencesThread::category_to_text(int category)
 
 int PreferencesThread::text_to_category(char *category)
 {
+SET_TRACE
        int min_result = -1, result, result_num = 0;
        for(int i = 0; i < CATEGORIES; i++)
        {
@@ -285,6 +288,7 @@ int PreferencesThread::text_to_category(char *category)
                        result_num = i;
                }
        }
+SET_TRACE
        return result_num;
 }
 
@@ -397,6 +401,7 @@ int PreferencesWindow::set_current_dialog(int number)
                        add_subwindow(dialog = new AboutPrefs(mwindow, this));
                        break;
        }
+
        if(dialog)
        {
                dialog->draw_top_background(this, 0, 0, dialog->get_w(), dialog->get_h());
@@ -526,6 +531,8 @@ PreferencesCategory::~PreferencesCategory()
 
 int PreferencesCategory::handle_event()
 {
+SET_TRACE
        thread->window->set_current_dialog(thread->text_to_category(get_text()));
+SET_TRACE
        return 1;
 }
index ebb4dd5..33523f2 100644 (file)
@@ -117,7 +117,9 @@ Record::Record(MWindow *mwindow, RecordMenuItem *menu_item)
        file = 0;
        editing_batch = 0;
        current_batch = 0;
+SET_TRACE
        picture = new PictureConfig(mwindow);
+SET_TRACE
        channeldb = new ChannelDB;
        master_channel = new Channel;
        window_lock = new Mutex("Record::window_lock");
@@ -159,6 +161,8 @@ int Record::load_defaults()
        default_asset->layers = 1;
 
 
+
+// Fix encoding parameters depending on driver.
 // These are locked by a specific driver.
        if(mwindow->edl->session->vconfig_in->driver == CAPTURE_LML ||
                mwindow->edl->session->vconfig_in->driver == CAPTURE_BUZ ||
@@ -210,7 +214,9 @@ int Record::load_defaults()
        video_y = defaults->get("RECORD_VIDEO_Y", 0);
        video_zoom = defaults->get("RECORD_VIDEO_Z", (float)1);
 
+SET_TRACE
        picture->load_defaults();
+SET_TRACE
 
        reverse_interlace = defaults->get("REVERSE_INTERLACE", 0);
        for(int i = 0; i < MAXCHANNELS; i++) 
@@ -277,7 +283,9 @@ int Record::save_defaults()
        defaults->update("RECORD_VIDEO_Y", video_y);
        defaults->update("RECORD_VIDEO_Z", video_zoom);
        
+SET_TRACE
        picture->save_defaults();
+SET_TRACE
        defaults->update("REVERSE_INTERLACE", reverse_interlace);
        for(int i = 0; i < MAXCHANNELS; i++)
        {
@@ -417,49 +425,42 @@ void Record::run()
                edl->session->aspect_w = mwindow->edl->session->aspect_w;
                edl->session->aspect_h = mwindow->edl->session->aspect_h;
 
+SET_TRACE
                window_lock->lock("Record::run 3");
 SET_TRACE
                record_gui = new RecordGUI(mwindow, this);
-SET_TRACE
                record_gui->load_defaults();
-SET_TRACE
                record_gui->create_objects();
-SET_TRACE
 
+SET_TRACE
                record_monitor = new RecordMonitor(mwindow, this);
 SET_TRACE
                record_monitor->create_objects();
 SET_TRACE
                record_gui->update_batch_sources();
-SET_TRACE
 
-               menu_item->current_state = RECORD_CAPTURING;
 SET_TRACE
+               menu_item->current_state = RECORD_CAPTURING;
                record_engine = new RecordThread(mwindow, this);
-SET_TRACE
                record_engine->create_objects();
-SET_TRACE
                monitor_engine = new RecordThread(mwindow, this);
-SET_TRACE
                monitor_engine->create_objects();
-SET_TRACE
 
+SET_TRACE
 
                record_gui->show_window();
-SET_TRACE
                record_gui->flush();
-SET_TRACE
                if(video_window_open)
                {
                        record_monitor->window->show_window();
                        record_monitor->window->raise_window();
                        record_monitor->window->flush();
                }
-SET_TRACE
 
-               start_monitor();
 SET_TRACE
+               start_monitor();
 
+SET_TRACE
                window_lock->unlock();
 
                result = record_gui->run_window();
@@ -470,25 +471,33 @@ SET_TRACE
                else
                        monitor_engine->record_audio->batch_done = 1;
 
-               stop_operation(0);;
+SET_TRACE
+               stop_operation(0);
 
                close_output_file();
+SET_TRACE
 
                window_lock->lock("Record::run 4");
+
+SET_TRACE
                delete record_monitor;
                record_monitor = 0;
+SET_TRACE
+
+
 
+SET_TRACE
                record_gui->save_defaults();
 
-TRACE("Record::run 1");
+SET_TRACE
                delete record_gui;
                record_gui = 0;
                window_lock->unlock();
 
-TRACE("Record::run 2");
+SET_TRACE
                delete edl;
 
-TRACE("Record::run 3");
+SET_TRACE
        }
 
        menu_item->current_state = RECORD_NOTHING;
@@ -689,7 +698,6 @@ int Record::open_output_file()
                        1, 
                        default_asset->sample_rate, 
                        default_asset->frame_rate);
-//printf("Record::open_output_file 1\n");
 
                if(result)
                {
@@ -707,9 +715,7 @@ int Record::open_output_file()
                        record_gui->update_batches();
                        record_gui->unlock_window();
                }
-//printf("Record::open_output_file 1\n");
        }
-//printf("Record::open_output_file 2\n");
        return result;
 }
 
@@ -982,6 +988,7 @@ int Record::open_input_devices(int duplex, int context)
        int video_opened = 0;
        AudioInConfig *aconfig_in = mwindow->edl->session->aconfig_in;
 
+
 // Create devices
        if(default_asset->audio_data && context != CONTEXT_SINGLEFRAME)
                adevice = new AudioDevice;
@@ -1187,10 +1194,12 @@ int Record::stop_operation(int resume_monitor)
 
 // Remember to change meters if you change this.
 // Return the size of the fragments to read from the audio device.
-int Record::get_in_length() 
+int Record::get_in_length()
 {
        int64_t fragment_size = 1;
-       while(fragment_size < default_asset->sample_rate / mwindow->edl->session->record_speed) fragment_size *= 2;
+       while(fragment_size < default_asset->sample_rate / 
+               mwindow->edl->session->record_speed)
+               fragment_size *= 2;
        fragment_size /= 2;
        return fragment_size;
 }
index 00f4221..980e436 100644 (file)
@@ -182,7 +182,8 @@ public:
        int video_x;
        int video_y;
        float video_zoom;
-       int reverse_interlace;     // Reverse the interlace in the video window display only
+// Reverse the interlace in the video window display only
+       int reverse_interlace;
 // Color model for uncompressed device interface
        int color_model;
 // Picture quality and parameters the device supports
index 1703381..08b48f3 100644 (file)
@@ -77,6 +77,7 @@ int RecordAudio::stop_recording()
        if(record->adevice)
        {
                record->adevice->interrupt_crash();
+// Joined in RecordThread
                //Thread::join();
        }
        return 0;
@@ -249,7 +250,7 @@ TRACE("RecordAudio::run 4");
                error_box.run_window();
                batch_done = 1;
        }
-TRACE("RecordAudio::run 10\n");
+TRACE("RecordAudio::run 10");
 
        if(!record_thread->monitor)
        {
@@ -267,7 +268,7 @@ TRACE("RecordAudio::run 10\n");
                delete [] input;
                input = 0;
        }
-TRACE("RecordAudio::run 11\n");
+TRACE("RecordAudio::run 11");
 
 // reset meter
        gui->lock_window("RecordAudio::run 2");
@@ -275,12 +276,12 @@ TRACE("RecordAudio::run 11\n");
        {
                record->record_monitor->window->meters->meters.values[channel]->reset();
        }
-TRACE("RecordAudio::run 12\n");
+TRACE("RecordAudio::run 12");
 
        gui->unlock_window();
        delete [] max;
        delete [] over;
-TRACE("RecordAudio::run 100\n");
+TRACE("RecordAudio::run 100");
 }
 
 void RecordAudio::write_buffer(int skip_new)
index 4afb781..f21133c 100644 (file)
@@ -541,16 +541,18 @@ int RecordGUI::resize_event(int w, int h)
 
        int new_h = mwindow->session->rwindow_h - bottom_margin - batch_list->get_y();
        if(new_h < 10) new_h = 10;
+printf("RecordGUI::resize_event 1 %d\n", mwindow->session->rwindow_h - bottom_margin - batch_list->get_y());
        batch_list->reposition_window(batch_list->get_x(), 
                batch_list->get_y(),
                mwindow->session->rwindow_w - 20,
                mwindow->session->rwindow_h - bottom_margin - batch_list->get_y());
 
-
        load_mode->reposition_window(mwindow->session->rwindow_w / 2 - 
                        mwindow->theme->loadmode_w / 2,
                mwindow->session->rwindow_h - mode_margin);
 
+       
+
        flash();
        return 1;
 }
@@ -743,6 +745,18 @@ int RecordGUICancel::keypress_event()
        return 0;
 }
 
+
+
+
+
+
+
+
+
+
+
+
+
 RecordGUIStartOver::RecordGUIStartOver(Record *record, RecordGUI *record_gui, int x, int y)
  : BC_GenericButton(x, y, _("Start Over"))
 {
index df70b6c..b965580 100644 (file)
@@ -54,20 +54,26 @@ RecordMonitor::~RecordMonitor()
 int RecordMonitor::create_objects()
 {
        int min_w = 150;
+
        if(!record->default_asset->video_data)
                min_w = MeterPanel::get_meters_width(
                        record->default_asset->channels, 1);
+SET_TRACE
        window = new RecordMonitorGUI(mwindow,
                record, 
                this,
                min_w);
+SET_TRACE
        window->create_objects();
+SET_TRACE
 
        if(record->default_asset->video_data)
        {
 // Configure the output for record monitoring
                VideoOutConfig config;
+SET_TRACE
                device = new VideoDevice;
+SET_TRACE
 
 
 
@@ -76,6 +82,7 @@ int RecordMonitor::create_objects()
                        PLAYBACK_X11_XV) config.driver = PLAYBACK_X11_XV;
                config.x11_use_fields = 0;
 
+SET_TRACE
 
                device->open_output(&config, 
                                                record->default_asset->frame_rate, 
@@ -83,10 +90,14 @@ int RecordMonitor::create_objects()
                                                record->default_asset->height,
                                                window->canvas,
                                                0);
+SET_TRACE
 
                thread = new RecordMonitorThread(mwindow, record, this);
+SET_TRACE
                thread->start_playback();
+SET_TRACE
        }
+SET_TRACE
 
        Thread::start();
        return 0;
@@ -263,7 +274,6 @@ int RecordMonitorGUI::create_objects()
                                mwindow->theme->draw_rmonitor_bg(this);
                                background_done = 1;
 
-SET_TRACE
                                avc1394_transport = new AVC1394Transport(mwindow,
                                        avc,
                                        this,
@@ -271,7 +281,6 @@ SET_TRACE
                                        mwindow->theme->rmonitor_tx_y);
                                avc1394_transport->create_objects();
 
-SET_TRACE
                                add_subwindow(avc1394transport_timecode =
                                        new BC_Title(avc1394_transport->x_end,
                                                mwindow->theme->rmonitor_tx_y + 10,
@@ -284,21 +293,18 @@ SET_TRACE
                                                avc);
 
                                avc1394transport_thread->start();
-SET_TRACE
 
                        }
                }
 #endif
 
 
-SET_TRACE
                if(!background_done)
                {
                        mwindow->theme->draw_rmonitor_bg(this);
                        background_done = 1;
                }
 
-SET_TRACE
                canvas = new RecordMonitorCanvas(mwindow, 
                        this,
                        record, 
@@ -308,7 +314,6 @@ SET_TRACE
                        mwindow->theme->rmonitor_canvas_h);
                canvas->create_objects(0);
 
-SET_TRACE
                if(driver == VIDEO4LINUX ||
                        driver == CAPTURE_BUZ ||
                        driver == VIDEO4LINUX2 ||
@@ -323,7 +328,6 @@ SET_TRACE
                        channel_picker->create_objects();
                }
 
-SET_TRACE
                if(driver == CAPTURE_BUZ ||
                        driver == VIDEO4LINUX2JPEG)
                {
@@ -332,7 +336,6 @@ SET_TRACE
                                mwindow->theme->rmonitor_interlace_y));
                }
                
-SET_TRACE
                add_subwindow(monitor_menu = new BC_PopupMenu(0, 
                        0, 
                        0, 
@@ -340,7 +343,6 @@ SET_TRACE
                        0));
                monitor_menu->add_item(new RecordMonitorFullsize(mwindow, 
                        this));
-SET_TRACE
        }
 
 
@@ -350,7 +352,6 @@ SET_TRACE
                background_done = 1;
        }
 
-SET_TRACE
        if(record->default_asset->audio_data)
        {
                meters = new MeterPanel(mwindow, 
@@ -363,7 +364,6 @@ SET_TRACE
                        1);
                meters->create_objects();
        }
-SET_TRACE
        return 0;
 }
 
@@ -622,7 +622,8 @@ RecordMonitorCanvas::RecordMonitorCanvas(MWindow *mwindow,
        this->window = window;
        this->mwindow = mwindow;
        this->record = record;
-//printf("RecordMonitorCanvas::RecordMonitorCanvas 1 %d\n", mwindow->edl->session->vconfig_in->driver);
+printf("RecordMonitorCanvas::RecordMonitorCanvas 1 %d %d %d %d\n", 
+x, y, w, h);
 //printf("RecordMonitorCanvas::RecordMonitorCanvas 2\n");
 }
 
@@ -643,6 +644,7 @@ int RecordMonitorCanvas::get_output_h()
 
 int RecordMonitorCanvas::button_press_event()
 {
+
        if(Canvas::button_press_event()) return 1;
        
        if(mwindow->edl->session->vconfig_in->driver == SCREENCAPTURE)
@@ -681,11 +683,14 @@ int RecordMonitorCanvas::button_release_event()
 
 int RecordMonitorCanvas::cursor_motion_event()
 {
+SET_TRACE
        if(window->current_operation == MONITOR_TRANSLATE)
        {
+SET_TRACE
                record->set_translation(
                        get_cursor_x() - window->cursor_x_origin + window->translate_x_origin,
                        get_cursor_y() - window->cursor_y_origin + window->translate_y_origin);
+SET_TRACE
        }
 
        return 0;
@@ -902,18 +907,7 @@ int RecordMonitorThread::render_dv()
 
 void RecordMonitorThread::render_uncompressed()
 {
-// printf("RecordMonitorThread::render_uncompressed 1 %p %p %p %p %p %p %p\n", 
-//     output_frame[0],
-//     output_frame[0]->get_y(), 
-//     output_frame[0]->get_u(), 
-//     output_frame[0]->get_v(),
-//     input_frame->get_y(),
-//     input_frame->get_u(),
-//     input_frame->get_v());
-
        output_frame[0]->copy_from(input_frame);
-
-//printf("RecordMonitorThread::render_uncompressed 2\n");
 }
 
 void RecordMonitorThread::show_output_frame()
@@ -951,9 +945,7 @@ int RecordMonitorThread::render_frame()
 void RecordMonitorThread::new_output_frame()
 {
        long offset;
-//printf("RecordMonitorThread::new_output_frame %d %p %p\n", output_colormodel, record_monitor, record_monitor->device);
        record_monitor->device->new_output_buffers(output_frame, output_colormodel);
-//printf("RecordMonitorThread::new_output_frame 2\n");
 }
 
 void RecordMonitorThread::run()
@@ -962,19 +954,22 @@ void RecordMonitorThread::run()
        while(!done)
        {
 // Wait for next frame
+SET_TRACE
                output_lock->lock("RecordMonitorThread::run");
+
                if(done)
                {
                        unlock_input();
                        return;
                }
-//printf("RecordMonitorThread::run 1\n");
+
+SET_TRACE
                new_output_frame();
-//printf("RecordMonitorThread::run 2\n");
+SET_TRACE
                render_frame();
-//printf("RecordMonitorThread::run 3\n");
+SET_TRACE
                show_output_frame();
-//printf("RecordMonitorThread::run 4\n");
+SET_TRACE
                unlock_input();
 // Get next frame
                ready = 1;
index e54bb52..e47959e 100644 (file)
@@ -92,7 +92,11 @@ int RecordPrefs::create_objects()
        add_subwindow(new BC_Title(x, y, _("Video In"), LARGEFONT, resources->text_default));
        y += 25;
 
-       add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT, resources->text_default));
+       add_subwindow(new BC_Title(x, 
+               y, 
+               _("Record Driver:"), 
+               MEDIUMFONT, 
+               resources->text_default));
        video_in_device = new VDevicePrefs(x + 110, 
                y, 
                pwindow, 
@@ -182,8 +186,15 @@ int RecordWriteLength::handle_event()
 
 
 
-RecordRealTime::RecordRealTime(MWindow *mwindow, PreferencesWindow *pwindow, int x, int y, int value)
- : BC_CheckBox(x, y, value, _("Record in realtime priority (root only)"))
+RecordRealTime::RecordRealTime(MWindow *mwindow, 
+       PreferencesWindow *pwindow, 
+       int x, 
+       int y, 
+       int value)
+ : BC_CheckBox(x, 
+       y, 
+       value, 
+       _("Record in realtime priority (root only)"))
 { 
        this->pwindow = pwindow; 
 }
@@ -251,6 +262,11 @@ int RecordFrameRate::handle_event()
 }
 
 
+
+
+
+
+
 VideoWriteLength::VideoWriteLength(PreferencesWindow *pwindow, char *text, int y)
  : BC_TextBox(260, y, 100, 1, text)
 { 
@@ -356,3 +372,4 @@ int StillImageDuration::handle_event()
        return 1;
 }
 
+
index 91244c6..65ba220 100644 (file)
@@ -39,13 +39,17 @@ RecordThread::RecordThread(MWindow *mwindow, Record *record)
 
 RecordThread::~RecordThread()
 {
-TRACE("RecordThread::~RecordThread 1");
+SET_TRACE
        delete record_timer;
+SET_TRACE
        delete pause_lock;
+SET_TRACE
        delete startup_lock;
+SET_TRACE
        delete loop_lock;
+SET_TRACE
        delete state_lock;
-TRACE("RecordThread::~RecordThread 10");
+SET_TRACE
 }
 
 int RecordThread::create_objects()
@@ -82,15 +86,19 @@ int RecordThread::start_recording(int monitor, int context)
 
 int RecordThread::stop_recording(int resume_monitor)
 {
+SET_TRACE
 // Stop RecordThread while waiting for batch
        state_lock->lock("RecordThread::stop_recording");
+
        engine_done = 1;
 
+SET_TRACE
        this->resume_monitor = resume_monitor;
 // In the monitor engine, stops the engine.
 // In the recording engine, causes the monitor engine not to be restarted.
 // Video thread stops the audio thread itself
 // printf("RecordThread::stop_recording 1\n");
+SET_TRACE
        if(record_video)
        {
                record_video->batch_done = 1;
@@ -105,7 +113,9 @@ int RecordThread::stop_recording(int resume_monitor)
                record_audio->stop_recording();
        }
 
+SET_TRACE
        Thread::join();
+SET_TRACE
        return 0;
 }
 
@@ -372,12 +382,14 @@ TRACE("RecordThread::run 20");
 
                                if(drivesync) delete drivesync;
                        }
+SET_TRACE
                }
                else
                {
                        state_lock->unlock();
                }
 
+SET_TRACE
 // Wait for thread to stop before closing devices
                loop_lock->unlock();
                if(monitor)
@@ -386,9 +398,12 @@ TRACE("RecordThread::run 20");
                        pause_lock->lock("RecordThread::run");
                        pause_lock->unlock();
                }
+SET_TRACE
        }while(!engine_done);
 
+SET_TRACE
        record->close_input_devices();
+SET_TRACE
 
 // Resume monitoring only if not a monitor ourselves
        if(!monitor)
@@ -400,5 +415,6 @@ TRACE("RecordThread::run 20");
        {
                record->capture_state = IS_DONE;
        }
+SET_TRACE
 }
 
index 97d6308..8baf5da 100644 (file)
@@ -104,11 +104,9 @@ int RecordVideo::cleanup_recording()
 {
        if(!record_thread->monitor)
        {
-//printf("RecordVideo::cleanup_recording 1\n");
 // write last buffer
                write_buffer(1);
 // stop file I/O
-//printf("RecordVideo::cleanup_recording 2\n");
        }
        else
        {
@@ -185,7 +183,10 @@ void RecordVideo::run()
 // In 2.6.7 this doesn't work.  For some reason, probably buffer overflowing,
 // it causes the driver to hang up momentarily so we try to only delay
 // when really really far ahead.
-                       if(delay < 2000 && delay > 0) delayer.delay(delay);
+                       if(delay < 2000 && delay > 0) 
+                       {
+                               delayer.delay(delay);
+                       }
                        gui->update_dropped_frames(0);
                        last_dropped_frames = 0;
                }
@@ -336,7 +337,7 @@ void RecordVideo::run()
        }
 
        cleanup_recording();
-//TRACE("RecordVideo::run 100");
+SET_TRACE
 }
 
 void RecordVideo::read_buffer()
index 4c4221c..b8856c9 100644 (file)
@@ -316,45 +316,58 @@ void Render::run()
        if(mode == Render::INTERACTIVE)
        {
 // Fix the asset for rendering
+printf("Render::run 1\n");
                Asset *asset = new Asset;
                load_defaults(asset);
+printf("Render::run 2\n");
                check_asset(mwindow->edl, *asset);
+printf("Render::run 3\n");
 
 // Get format from user
                if(!result)
                {
+printf("Render::run 4\n");
                        do
                        {
                                format_error = 0;
                                result = 0;
 
                                {
-                                       render_window = new RenderWindow(mwindow, this, asset);
-                                       render_window->create_objects();
-                                       result = render_window->run_window();
+printf("Render::run 5\n");
+                                       RenderWindow window(mwindow, this, asset);
+printf("Render::run 6\n");
+                                       window.create_objects();
+printf("Render::run 7\n");
+                                       result = window.run_window();
+printf("Render::run 8\n");
                                        if (! result) {
                                                // add to recentlist only on OK
-                                               render_window->format_tools->path_recent->add_item(FILE_FORMAT_PREFIX(asset->format), asset->path);
+                                               window.format_tools->path_recent->add_item(FILE_FORMAT_PREFIX(asset->format), asset->path);
                                        }
-                                       delete render_window;
-                                       render_window = 0;
                                }
 
                                if(!result)
                                {
+printf("Render::run 8.1\n");
 // Check the asset format for errors.
                                        FormatCheck format_check(asset);
+printf("Render::run 8.2\n");
                                        format_error = format_check.check_format();
+printf("Render::run 8.3\n");
                                }
                        }while(format_error && !result);
                }
+printf("Render::run 9\n");
 
                save_defaults(asset);
                mwindow->save_defaults();
+printf("Render::run 10\n");
 
                if(!result) render(1, asset, mwindow->edl, strategy);
+printf("Render::run 11\n");
 
                delete asset;
+printf("Render::run 12\n");
        }
        else
        if(mode == Render::BATCH)
@@ -418,6 +431,7 @@ void Render::run()
                        mwindow->batch_render->update_done(-1, 0, 0);
                }
        }
+printf("Render::run 100\n");
 }
 
 
@@ -778,10 +792,9 @@ int Render::render(int test_overwrite,
 
 
 
-//printf("Render::run: Session finished.\n");
+printf("Render::run: Session finished.\n");
 
 
-//printf("Render::render 80\n");
 
 
 
@@ -791,7 +804,7 @@ int Render::render(int test_overwrite,
                        result |= packages->packages_are_done();
                }
 
-//printf("Render::render 90\n");
+printf("Render::render 90\n");
 
 // Notify of error
                if(result && 
index af4a564..cf8c57c 100644 (file)
@@ -76,8 +76,6 @@ int RenderFarmServer::start_clients()
 
                result = client->start_loop();
                client_lock->unlock();
-//usleep(100000);
-// Fails to connect all without a delay
        }
 
        return result;
@@ -134,7 +132,6 @@ int RenderFarmServerThread::start_loop()
 {
        int result = 0;
        char *hostname = server->preferences->get_node_hostname(number);
-//printf("RenderFarmServerThread::start_loop 1\n");
 
 // Open file for master node
        if(hostname[0] == '/')
@@ -157,29 +154,25 @@ int RenderFarmServerThread::start_loop()
 #define ATTEMPT_DELAY 100000
                        int done = 0;
                        int attempt = 0;
-//printf("RenderFarmServerThread::start_loop 2 %s\n", hostname);
+
                        do
                        {
-//printf("RenderFarmServerThread::start_loop 3\n");
                                if(connect(socket_fd, (struct sockaddr*)&addr, size) < 0)
                                {
                                        attempt++;
                                        if(attempt > 30000000 / ATTEMPT_DELAY)
                                        {
-//printf("RenderFarmServerThread::start_loop 4 %s\n", hostname);
-                                               fprintf(stderr, _("RenderFarmServerThread::start_loop: %s: %s\n"), 
+                                               fprintf(stderr, _("RenderFarmServerThread::open_client: %s: %s\n"), 
                                                        hostname, 
                                                        strerror(errno));
                                                result = 1;
                                        }
                                        else
                                                usleep(ATTEMPT_DELAY);
-//printf("RenderFarmServerThread::start_loop 5 %s\n", hostname);
                                }
                                else
                                        done = 1;
                        }while(!result && !done);
-//printf("RenderFarmServerThread::start_loop 6\n");
                }
        }
        else
@@ -200,7 +193,7 @@ int RenderFarmServerThread::start_loop()
                        hostinfo = gethostbyname(hostname);
                        if(hostinfo == NULL)
                {
-                       fprintf(stderr, _("RenderFarmServerThread::start_loop: unknown host %s.\n"), 
+                       fprintf(stderr, _("RenderFarmServerThread::open_client: unknown host %s.\n"), 
                                        server->preferences->get_node_hostname(number));
                        result = 1;
                }
@@ -210,7 +203,7 @@ int RenderFarmServerThread::start_loop()
 
                                if(connect(socket_fd, (struct sockaddr*)&addr, sizeof(addr)) < 0)
                                {
-                                       fprintf(stderr, _("RenderFarmServerThread::start_loop: %s: %s\n"), 
+                                       fprintf(stderr, _("RenderFarmServerThread::open_client: %s: %s\n"), 
                                                server->preferences->get_node_hostname(number), 
                                                strerror(errno));
                                        result = 1;
@@ -218,7 +211,7 @@ int RenderFarmServerThread::start_loop()
                        }
                }
        }
-//printf("RenderFarmServerThread::start_loop 7\n");
+
 
        if(!result) Thread::start();
 
@@ -226,13 +219,19 @@ int RenderFarmServerThread::start_loop()
 }
 
 
+
+
+
+
+
+
+
+
+
 int RenderFarmServerThread::read_socket(int socket_fd, char *data, int len, int timeout)
 {
        int bytes_read = 0;
        int offset = 0;
-//timeout = 0;
-
-//printf("RenderFarmServerThread::read_socket 1\n");
        while(len > 0 && bytes_read >= 0)
        {
                int result = 0;
@@ -252,7 +251,6 @@ int RenderFarmServerThread::read_socket(int socket_fd, char *data, int len, int
                                0, 
                                &tv);
                        FD_ZERO(&read_fds);
-//printf("RenderFarmServerThread::read_socket 1 %d\n", result);
                }
                else
                        result = 1;
@@ -267,17 +265,14 @@ int RenderFarmServerThread::read_socket(int socket_fd, char *data, int len, int
                        }
                        else
                        {
-//printf("RenderFarmServerThread::read_socket got 0 len=%d\n", len);
                                break;
                        }
                }
                else
                {
-printf("RenderFarmServerThread::read_socket timed out. len=%d\n", len);
                        break;
                }
        }
-//printf("RenderFarmServerThread::read_socket 2\n");
 
        return offset;
 }
@@ -350,7 +345,6 @@ void RenderFarmServerThread::run()
        while(!done)
        {
 
-//printf("RenderFarmServerThread::run 1\n");
 // Wait for requests.
 // Requests consist of request ID's and accompanying buffers.
 // Get request ID.
@@ -366,7 +360,6 @@ void RenderFarmServerThread::run()
                                                        (((u_int32_t)header[3]) << 8)  |
                                                        (u_int32_t)header[4];
 
-//printf("RenderFarmServerThread::run 2 %d %lld\n", request_id, request_size);
                reallocate_buffer(request_size);
 
 // Get accompanying buffer
@@ -375,6 +368,7 @@ void RenderFarmServerThread::run()
                        done = 1;
                        continue;
                }
+//printf("RenderFarmServerThread::run 3\n");
 
                switch(request_id)
                {
@@ -411,6 +405,7 @@ void RenderFarmServerThread::run()
                                break;
 
                        case RENDERFARM_DONE:
+//printf("RenderFarmServerThread::run 10\n");
                                done = 1;
                                break;
 
@@ -426,6 +421,7 @@ void RenderFarmServerThread::run()
        }
        
        if(buffer) delete [] buffer;
+//printf("RenderFarmServerThread::run 20\n");
 //     delete fs_server;
 }
 
@@ -518,7 +514,6 @@ void RenderFarmServerThread::send_package(unsigned char *buffer)
                        server->use_local_rate);
 
 //printf("RenderFarmServerThread::send_package 2\n");
-
        char datagram[BCTEXTLEN];
 
 // No more packages
index 9bc17d1..756c02d 100644 (file)
@@ -78,19 +78,19 @@ enum
        RENDERFARM_SET_VMAP,     // 8 Update video map in background rendering
 
 // VFS commands
-       RENDERFARM_FOPEN,      // 9
+       RENDERFARM_FOPEN,  
        RENDERFARM_FCLOSE,
        RENDERFARM_REMOVE,
        RENDERFARM_RENAME,
        RENDERFARM_FGETC,
        RENDERFARM_FPUTC,
-       RENDERFARM_FREAD,      // 15
+       RENDERFARM_FREAD,  
        RENDERFARM_FWRITE,
        RENDERFARM_FSEEK,
        RENDERFARM_FTELL,
        RENDERFARM_STAT,
-       RENDERFARM_STAT64,     // 20
-       RENDERFARM_FGETS,      // 21
+       RENDERFARM_STAT64, 
+       RENDERFARM_FGETS,  
        RENDERFARM_FILENO
 };
 
@@ -138,8 +138,6 @@ public:
 };
 
 
-// Waits for requests from every client.
-// Joins when the client is finished.
 class RenderFarmServerThread : public Thread
 {
 public:
@@ -147,7 +145,7 @@ public:
                RenderFarmServer *server, 
                int number);
        ~RenderFarmServerThread();
-       
+
        static int read_socket(int socket_fd, char *data, int len, int timeout);
        static int write_socket(int socket_fd, char *data, int len, int timeout);
 // Inserts header and writes string to socket
@@ -155,7 +153,6 @@ public:
 
 
 
-
        int read_socket(char *data, int len, int timeout);
        int write_socket(char *data, int len, int timeout);
        int start_loop();
index 05a5575..b69114d 100644 (file)
@@ -360,7 +360,6 @@ void RenderFarmClientThread::read_edl(int socket_fd,
        char *string;
        read_string(socket_fd, string);
 
-//printf("RenderFarmClientThread::read_edl 1\n");
 
        FileXML file;
        file.read_from_string((char*)string);
@@ -476,6 +475,7 @@ int RenderFarmClientThread::send_completion(int socket_fd)
 void RenderFarmClientThread::main_loop(int socket_fd)
 {
         this->socket_fd = socket_fd;
+
         Thread::start();
 }
 
@@ -496,14 +496,25 @@ void RenderFarmClientThread::run()
 
 
        int socket_fd = this->socket_fd;
-//printf("RenderFarmClientThread::run 1\n");
+
+
+//printf("RenderFarmClientThread::run command=%d\n", command);
+
+SET_TRACE
+
+
        EDL *edl;
        RenderPackage *package;
        Asset *default_asset;
        Preferences *preferences;
+
+
+
        FarmPackageRenderer package_renderer(this, socket_fd);
        int result = 0;
 
+
+
 //printf("RenderFarmClientThread::run 2\n");
 // Read settings
        preferences = new Preferences;
@@ -552,7 +563,7 @@ void RenderFarmClientThread::run()
 // Finished list
                if(result)
                {
-//printf("RenderFarmClientThread::run 7 %d\n", result);
+//printf("RenderFarmClientThread::run 7\n");
 
                        result = send_completion(socket_fd);
                        break;
@@ -585,15 +596,8 @@ void RenderFarmClientThread::run()
        delete edl;
 //printf("RenderFarmClientThread::run 11\n");
        delete preferences;
-//printf("RenderFarmClientThread::run 12\n");
 printf(_("RenderFarmClientThread::run: Session finished.\n"));
 
-// Socket error should be the only cause of this
-       if(result)
-       {
-               ;
-       }
-
        _exit(0);
 }
 
@@ -682,3 +686,12 @@ int FarmPackageRenderer::set_video_map(int64_t position, int value)
        return result;
 }
 
+
+
+
+
+
+
+
+
+
index 034644e..3a071fc 100644 (file)
@@ -12,8 +12,6 @@
 //#include "renderfarmfsclient.inc"
 #include "thread.h"
 
-// The render client waits for connections from the server.
-// Then it starts a thread for each connection.
 class RenderFarmClient
 {
 public:
@@ -24,7 +22,9 @@ public:
        ~RenderFarmClient();
        
        void main_loop();
-       
+
+
+
 
 // After a socket times out, kill the render node.
        void kill_client();
@@ -97,11 +97,6 @@ public:
 
 
 
-
-
-
-
-
 class FarmPackageRenderer : public PackageRenderer
 {
 public:
index 47a1fdf..d433a6a 100644 (file)
@@ -490,11 +490,11 @@ void ResourcePixmap::draw_audio_source(Edit *edit, int x, int w)
 
        w++;
        int source_start = (pixmap_x - edit_x + x) * mwindow->edl->local_session->zoom_sample + edit->startsource;
+       double asset_over_session = (double)edit->asset->sample_rate / 
+               mwindow->edl->session->sample_rate;
        int source_len = w * mwindow->edl->local_session->zoom_sample;
        int center_pixel = mwindow->edl->local_session->zoom_track / 2;
        if(mwindow->edl->session->show_titles) center_pixel += mwindow->theme->title_bg_data->get_h();
-       double asset_over_session = (double)edit->asset->sample_rate / 
-               mwindow->edl->session->sample_rate;
 
 // Single sample zoom
        if(mwindow->edl->local_session->zoom_sample == 1)
@@ -704,24 +704,20 @@ void ResourcePixmap::draw_video_resource(Edit *edit,
        int refresh_x, 
        int refresh_w)
 {
-//printf("ResourcePixmap::draw_video_resource 1\n");
 // pixels spanned by a picon
        int64_t picon_w = Units::round(edit->picon_w());
        int64_t picon_h = edit->picon_h();
 
-//printf("ResourcePixmap::draw_video_resource 1\n");
+
 // Don't draw video if picon is bigger than edit
        if(picon_w > edit_w) return;
 
-//printf("ResourcePixmap::draw_video_resource 1\n");
 // pixels spanned by a frame
        double frame_w = edit->frame_w();
 
-//printf("ResourcePixmap::draw_video_resource 1\n");
 // Frames spanned by a picon
        double frames_per_picon = edit->frames_per_picon();
 
-//printf("ResourcePixmap::draw_video_resource 1\n");
 // Current pixel relative to pixmap
        int x = 0;
        int y = 0;
@@ -733,7 +729,9 @@ void ResourcePixmap::draw_video_resource(Edit *edit,
 // Get first frame touched by x and fix x to start of frame
        if(frames_per_picon > 1)
        {
-               int picon = Units::to_int64((double)(refresh_x + pixmap_x - edit_x) / picon_w);
+               int picon = Units::to_int64(
+                       (double)(refresh_x + pixmap_x - edit_x) / 
+                       picon_w);
                x = picon_w * picon + edit_x - pixmap_x;
                project_frame = Units::to_int64((double)picon * frames_per_picon);
        }
@@ -742,15 +740,11 @@ void ResourcePixmap::draw_video_resource(Edit *edit,
                project_frame = Units::to_int64((double)(refresh_x + pixmap_x - edit_x) / 
                        frame_w);
                x = Units::round((double)project_frame * frame_w + edit_x - pixmap_x);
-       }
+       }
 
-//printf("ResourcePixmap::draw_video_resource 1 %s\n", edit->asset->path);
        File *source = mwindow->video_cache->check_out(edit->asset);
        if(!source) return;
 
-
-//printf("ResourcePixmap::draw_video_resource 2 project_frame=%d frame_w=%f refresh_x=%d refresh_w=%d x=%d\n",
-//project_frame, frame_w, refresh_x, refresh_w, x);
        while(x < refresh_x + refresh_w)
        {
                int64_t source_frame = project_frame + edit->startsource;
@@ -763,7 +757,6 @@ void ResourcePixmap::draw_video_resource(Edit *edit,
                VFrame *picon_frame = 0;
                int use_cache = 0;
 
-//frame_cache->dump();
                if((picon_frame = frame_cache->get_frame_ptr(source_frame,
                        mwindow->edl->session->frame_rate,
                        BC_RGB888,
@@ -828,6 +821,7 @@ void ResourcePixmap::draw_video_resource(Edit *edit,
                        0, 
                        0);
 
+
                if(use_cache)
                        frame_cache->unlock();
                
index 468f2d2..ca0bb5e 100644 (file)
@@ -850,6 +850,8 @@ int ScaleAspectText::handle_event()
 
 
 
+
+
 SetFormatApply::SetFormatApply(int x, int y, SetFormatThread *thread)
  : BC_GenericButton(x, y, _("Apply"))
 {
@@ -861,3 +863,21 @@ int SetFormatApply::handle_event()
        thread->apply_changes();
        return 1;
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index 87d67a9..1ab546c 100644 (file)
@@ -185,6 +185,7 @@ public:
        SetChannelsCanvas *canvas;
 // Screen size width, height
        ScaleSizeText* dimension[2];
+       SetFormatPresets *presets;
 // Size ratio width, height
        ScaleRatioText* ratio[2];
 // Aspect ratio
@@ -194,7 +195,6 @@ public:
        SetChannelsTextBox *channels;
        SetFrameRateTextBox *frame_rate;
        BC_TextBox *color_model;
-       SetFormatPresets *presets;
        ScaleAspectAuto *auto_aspect;
 };
 
index da0edd3..3bb5fd2 100644 (file)
@@ -398,18 +398,12 @@ void TimeBar::update_presentations()
 
 void TimeBar::update(int do_range, int do_others)
 {
-SET_TRACE
        draw_time();
-SET_TRACE
 // Need to redo these when range is drawn to get the background updated.
        update_labels();
-SET_TRACE
        update_points();
-SET_TRACE
        update_presentations();
-SET_TRACE
        flash();
-SET_TRACE
 }
 
 
index 50b229e..f581c15 100644 (file)
@@ -367,7 +367,7 @@ void Track::insert_track(Track *track,
        int replace_default,
        int edit_plugins)
 {
-SET_TRACE
+
 // Decide whether to copy settings based on load_mode
        if(replace_default) copy_settings(track);
 
@@ -382,7 +382,7 @@ SET_TRACE
                replace_default);
 
        optimize();
-SET_TRACE
+
 }
 
 // Called by insert_track
index 2460773..6eff00f 100644 (file)
@@ -759,7 +759,6 @@ int64_t TrackCanvas::get_drop_position (int *is_insertion, Edit *moved_edit, int
 void TrackCanvas::draw(int force, int hide_cursor)
 {
 // Swap pixmap layers
-TRACE("TrackCanvas::draw 1")
        if(get_w() != background_pixmap->get_w() ||
                get_h() != background_pixmap->get_h())
        {
@@ -767,17 +766,12 @@ TRACE("TrackCanvas::draw 1")
                background_pixmap = new BC_Pixmap(this, get_w(), get_h());
        }
 
-TRACE("TrackCanvas::draw 10")
 // Cursor disappears after resize when this is called.
 // Cursor doesn't redraw after editing when this isn't called.
        if(gui->cursor && hide_cursor) gui->cursor->hide();
-TRACE("TrackCanvas::draw 20")
        draw_top_background(get_parent(), 0, 0, get_w(), get_h(), background_pixmap);
-TRACE("TrackCanvas::draw 30")
        draw_resources(force);
-TRACE("TrackCanvas::draw 40")
        draw_overlays();
-UNTRACE
 }
 
 void TrackCanvas::update_cursor()
@@ -900,6 +894,7 @@ void TrackCanvas::draw_resources(int force,
                                        if(pixmap_w < pixmap->pixmap_w ||
                                                pixmap_h < pixmap->pixmap_h)
                                                pixmap->resize(pixmap_w, pixmap_h);
+
 // Copy pixmap to background canvas
                                        background_pixmap->draw_pixmap(pixmap, 
                                                pixmap->pixmap_x, 
@@ -3443,7 +3438,6 @@ int TrackCanvas::do_plugin_autos(Track *track,
 void TrackCanvas::draw_overlays()
 {
        int new_cursor, update_cursor, rerender;
-//TRACE("TrackCanvas::draw_overlays 1")
 
 // Move background pixmap to foreground pixmap
        draw_pixmap(background_pixmap, 
@@ -3453,29 +3447,23 @@ void TrackCanvas::draw_overlays()
                get_h(),
                0,
                0);
-//TRACE("TrackCanvas::draw_overlays 10")
 
 // In/Out points
        draw_inout_points();
 
-//TRACE("TrackCanvas::draw_overlays 11");
 // Transitions
        if(mwindow->edl->session->auto_conf->transitions) draw_transitions();
 
-//TRACE("TrackCanvas::draw_overlays 12");
 // Plugins
        draw_plugins();
 
-//TRACE("TrackCanvas::draw_overlays 13");
 // Loop points
        draw_loop_points();
        draw_brender_start();
 
-//TRACE("TrackCanvas::draw_overlays 14");
 // Highlighted areas
        draw_highlighting();
 
-//TRACE("TrackCanvas::draw_overlays 15");
 // Automation
        do_keyframes(0, 
                0, 
@@ -3485,15 +3473,12 @@ void TrackCanvas::draw_overlays()
                update_cursor,
                rerender);
 
-//TRACE("TrackCanvas::draw_overlays 16\n");
 // Selection cursor
        if(gui->cursor) gui->cursor->restore();
 
-//TRACE("TrackCanvas::draw_overlays 17\n");
 // Handle dragging
        draw_drag_handle();
 
-//TRACE("TrackCanvas::draw_overlays 20");
 // Playback cursor
        draw_playback_cursor();
 
@@ -5069,7 +5054,9 @@ int TrackCanvas::button_press_event()
 // Highlight selection
                                else
                                {
+SET_TRACE
                                        rerender = start_selection(position);
+SET_TRACE
                                        mwindow->session->current_operation = SELECT_REGION;
                                        update_cursor = 1;
                                }
@@ -5079,22 +5066,26 @@ int TrackCanvas::button_press_event()
                }
 
 
+SET_TRACE
                if(rerender)
                {
                        gui->unlock_window();
                        mwindow->cwindow->update(1, 0, 0, 0, 1);
+
                        gui->lock_window("TrackCanvas::button_press_event 2");
 // Update faders
                        mwindow->update_plugin_guis();
                        gui->patchbay->update();
                }
 
+SET_TRACE
                if(update_overlay)
                {
                        draw_overlays();
                        flash();
                }
 
+SET_TRACE
                if(update_cursor)
                {
                        gui->timebar->update_highlights();
@@ -5105,6 +5096,7 @@ int TrackCanvas::button_press_event()
                        result = 1;
                }
 
+SET_TRACE
 
 
        }
@@ -5116,6 +5108,7 @@ int TrackCanvas::start_selection(double position)
        int rerender = 0;
        position = mwindow->edl->align_to_frame(position, 0);
 
+
 // Extend a border
        if(shift_down())
        {
index e2f717b..38a2ae9 100644 (file)
@@ -311,6 +311,7 @@ public:
        BC_Pixmap *pankeyframe_pixmap;
        BC_Pixmap *projectorkeyframe_pixmap;
        BC_Pixmap *maskkeyframe_pixmap;
+
        int active;
 // Currently in a drag scroll operation
        int drag_scroll;
@@ -335,8 +336,6 @@ public:
 
 
 
-
-
 // event handlers
        int button_release();
        int draw_playback_cursor(int pixel, int flash = 1);
index 78c8edb..c4cb792 100644 (file)
@@ -1,3 +1,4 @@
+#include "bcsignals.h"
 #include "channelpicker.h"
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -46,11 +47,14 @@ VDevicePrefs::~VDevicePrefs()
 
 void VDevicePrefs::reset_objects()
 {
+       device_title = 0;
        device_text = 0;
 
        port_title = 0;
+
+       
+
        channel_title = 0;
-       device_title = 0;
        syt_title = 0;
 
        firewire_port = 0;
@@ -58,6 +62,7 @@ void VDevicePrefs::reset_objects()
        firewire_channels = 0;
        firewire_syt = 0;
        firewire_path = 0;
+
 }
 
 int VDevicePrefs::initialize()
@@ -123,8 +128,12 @@ int VDevicePrefs::initialize()
        return 0;
 }
 
+
+
+
 int VDevicePrefs::delete_objects()
 {
+SET_TRACE
        switch(driver)
        {
                case PLAYBACK_LML:
@@ -140,14 +149,23 @@ int VDevicePrefs::delete_objects()
        if(device_text) delete device_text;
 
        if(port_title) delete port_title;
+SET_TRACE
        if(firewire_port) delete firewire_port;
+SET_TRACE
        if(channel_title) delete channel_title;
+SET_TRACE
        if(firewire_channel) delete firewire_channel;
+SET_TRACE
+SET_TRACE
        if(device_title) delete device_title;
+SET_TRACE
        if(firewire_path) delete firewire_path;
+SET_TRACE
        if(syt_title) delete syt_title;
+SET_TRACE
        if(firewire_syt) delete firewire_syt;
 
+SET_TRACE
        reset_objects();
        driver = -1;
        return 0;
@@ -325,6 +343,7 @@ int VDevicePrefs::create_v4l2_objs()
        output_char = pwindow->thread->edl->session->vconfig_in->v4l2_in_device;
        dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device path:"), MEDIUMFONT, resources->text_default));
        dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + 20, output_char));
+
        return 0;
 }
 
@@ -336,6 +355,7 @@ int VDevicePrefs::create_v4l2jpeg_objs()
        output_char = pwindow->thread->edl->session->vconfig_in->v4l2jpeg_in_device;
        dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device path:"), MEDIUMFONT, resources->text_default));
        dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + 20, output_char));
+
        return 0;
 }
 
@@ -519,6 +539,8 @@ int VDeviceIntBox::handle_event()
 
 
 
+
+
 VDeviceCheckBox::VDeviceCheckBox(int x, int y, int *output, char *text)
  : BC_CheckBox(x, y, *output, text)
 {
index 112df34..bfb0bb7 100644 (file)
@@ -6,6 +6,7 @@
 
 
 #include "assets.h"
+#include "bcsignals.h"
 #include "channel.h"
 #include "chantables.h"
 #include "clip.h"
@@ -103,7 +104,7 @@ int VDeviceV4L::v4l_init()
        input_fd = open(device->in_config->v4l_in_device, O_RDWR);
 
        if(input_fd < 0)
-               perror("VDeviceV4L::init_video4linux");
+               perror("VDeviceV4L::v4l_init");
        else
        {
                set_cloexec_flag(input_fd, 1);
@@ -517,6 +518,7 @@ int VDeviceV4L::read_buffer(VFrame *frame)
 {
        int result = 0;
 
+SET_TRACE
        if(shared_memory)
        {
 // Read the current frame
@@ -533,6 +535,7 @@ int VDeviceV4L::read_buffer(VFrame *frame)
                read(input_fd, capture_buffer, capture_params.size);
        }
        got_first_frame = 1;
+SET_TRACE
 
        return 0;
 }
index 1c32a30..9b16e4f 100644 (file)
@@ -18,6 +18,7 @@
 
 #ifdef HAVE_VIDEO4LINUX2
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
@@ -479,6 +480,7 @@ printf("VDeviceV4L2Thread::run requested %d buffers\n", total_buffers);
                {
 // The requestbuffers.count changes in the 2.6.5 version of the API
                        allocate_buffers(requestbuffers.count);
+
 printf("VDeviceV4L2Thread::run got %d buffers\n", total_buffers);
                        for(int i = 0; i < total_buffers; i++)
                        {
@@ -532,6 +534,7 @@ printf("VDeviceV4L2Thread::run got %d buffers\n", total_buffers);
                                                        break;
                                        }
 
+//printf("VDeviceV4L2Thread::run color_model=%d\n", color_model);
                                        frame->reallocate(data,
                                                y_offset,
                                                u_offset,
@@ -744,7 +747,7 @@ int VDeviceV4L2::get_sources(VideoDevice *device,
 
        if((input_fd = open(path, O_RDWR)) < 0)
        {
-               perror("VDeviceV4L::open_input");
+               printf("VDeviceV4L2::open_input %s: %s\n", path, strerror(errno));
                return 1;
        }
        else
index d2a7d33..6b79335 100644 (file)
@@ -136,6 +136,10 @@ int VDeviceX11::close_all()
                if(bitmap)
                        delete output_frame;
        }
+
+
+
+
        if(bitmap)
        {
                delete bitmap;
@@ -146,6 +150,7 @@ int VDeviceX11::close_all()
 
        if(output)
        {
+       
                output->canvas->unlock_window();
        }
 
@@ -203,15 +208,13 @@ int VDeviceX11::get_best_colormodel(int colormodel)
                }
        }
 
-//printf("VDeviceX11::get_best_colormodel %d %d %d\n", device->single_frame, colormodel, result);
        return result;
 }
 
 
 void VDeviceX11::new_output_buffer(VFrame **output_channels, int colormodel)
 {
-//TRACE("VDeviceX11::new_output_buffer 1");
-       
+//printf("VDeviceX11::new_output_buffer 1\n");
        output->canvas->lock_window("VDeviceX11::new_output_buffer");
 
        for(int i = 0; i < MAX_CHANNELS; i++)
@@ -250,14 +253,12 @@ void VDeviceX11::new_output_buffer(VFrame **output_channels, int colormodel)
                if(bitmap_type == BITMAP_PRIMARY)
                {
 
-//printf("VDeviceX11::new_output_buffer\n");
                        output_frame->set_memory((unsigned char*)bitmap->get_data() /* + bitmap->get_shm_offset() */,
                                                bitmap->get_y_offset(),
                                                bitmap->get_u_offset(),
                                                bitmap->get_v_offset());
                }
        }
-//TRACE("VDeviceX11::new_output_buffer 10");
 
 // Create new bitmap
        if(!bitmap)
@@ -266,17 +267,14 @@ void VDeviceX11::new_output_buffer(VFrame **output_channels, int colormodel)
                switch(best_colormodel)
                {
                        case BC_YUV420P:
-//TRACE("VDeviceX11::new_output_buffer 10");
                                if(device->out_config->driver == PLAYBACK_X11_XV &&
                                        output->canvas->accel_available(best_colormodel, 0))
                                {
-//TRACE("VDeviceX11::new_output_buffer 20");
                                        bitmap = new BC_Bitmap(output->canvas, 
                                                device->out_w,
                                                device->out_h,
                                                best_colormodel,
                                                1);
-//TRACE("VDeviceX11::new_output_buffer 30");
                                        output_frame = new VFrame((unsigned char*)bitmap->get_data() + bitmap->get_shm_offset(), 
                                                bitmap->get_y_offset(),
                                                bitmap->get_u_offset(),