merged hv7 mod
authorGood Guy <good1.2guy@gmail.com>
Wed, 18 Oct 2017 23:04:27 +0000 (17:04 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 18 Oct 2017 23:04:27 +0000 (17:04 -0600)
223 files changed:
cinelerra-5.1/Cinelerra_factory [new file with mode: 0644]
cinelerra-5.1/Makefile.am
cinelerra-5.1/Makefile.devel
cinelerra-5.1/cinelerra/Makefile
cinelerra-5.1/cinelerra/aautomation.C
cinelerra-5.1/cinelerra/adeviceprefs.C
cinelerra-5.1/cinelerra/adeviceprefs.h
cinelerra-5.1/cinelerra/asset.C
cinelerra-5.1/cinelerra/asset.h
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/atrack.C
cinelerra-5.1/cinelerra/atrack.h
cinelerra-5.1/cinelerra/audioconfig.C
cinelerra-5.1/cinelerra/automation.C
cinelerra-5.1/cinelerra/awindow.C
cinelerra-5.1/cinelerra/awindow.h
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/cachebase.C
cinelerra-5.1/cinelerra/cachebase.h
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/channelinfo.C
cinelerra-5.1/cinelerra/clippopup.C
cinelerra-5.1/cinelerra/colorpicker.C
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/cwindowtool.C
cinelerra-5.1/cinelerra/cwindowtool.h
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/edits.C
cinelerra-5.1/cinelerra/edits.h
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/edl.inc
cinelerra-5.1/cinelerra/edlsession.C
cinelerra-5.1/cinelerra/edlsession.h
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/file.C
cinelerra-5.1/cinelerra/file.h
cinelerra-5.1/cinelerra/filebase.h
cinelerra-5.1/cinelerra/fileffmpeg.C
cinelerra-5.1/cinelerra/fileffmpeg.h
cinelerra-5.1/cinelerra/filejpeg.C
cinelerra-5.1/cinelerra/filelist.C
cinelerra-5.1/cinelerra/filempeg.C
cinelerra-5.1/cinelerra/filempeg.h
cinelerra-5.1/cinelerra/formattools.C
cinelerra-5.1/cinelerra/keyframe.C
cinelerra-5.1/cinelerra/keyframe.h
cinelerra-5.1/cinelerra/keyframegui.C
cinelerra-5.1/cinelerra/keyframegui.h
cinelerra-5.1/cinelerra/localsession.C
cinelerra-5.1/cinelerra/localsession.h
cinelerra-5.1/cinelerra/mainclock.C
cinelerra-5.1/cinelerra/menueffects.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindow.inc
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/packagerenderer.C
cinelerra-5.1/cinelerra/playbackconfig.C
cinelerra-5.1/cinelerra/playbackconfig.h
cinelerra-5.1/cinelerra/playbackprefs.C
cinelerra-5.1/cinelerra/playbackprefs.h
cinelerra-5.1/cinelerra/pluginclient.C
cinelerra-5.1/cinelerra/presets.C [new file with mode: 0644]
cinelerra-5.1/cinelerra/presets.h [new file with mode: 0644]
cinelerra-5.1/cinelerra/presets.inc [new file with mode: 0644]
cinelerra-5.1/cinelerra/presetsgui.C [new file with mode: 0644]
cinelerra-5.1/cinelerra/presetsgui.h [new file with mode: 0644]
cinelerra-5.1/cinelerra/presetsgui.inc [new file with mode: 0644]
cinelerra-5.1/cinelerra/record.C
cinelerra-5.1/cinelerra/record.h
cinelerra-5.1/cinelerra/recordgui.C
cinelerra-5.1/cinelerra/recordgui.h
cinelerra-5.1/cinelerra/recordmonitor.C
cinelerra-5.1/cinelerra/recordmonitor.h
cinelerra-5.1/cinelerra/recordprefs.C
cinelerra-5.1/cinelerra/recordprefs.h
cinelerra-5.1/cinelerra/recordscopes.C
cinelerra-5.1/cinelerra/recordvideo.C
cinelerra-5.1/cinelerra/recordwindow.h
cinelerra-5.1/cinelerra/remotecontrol.C
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/cinelerra/savefile.C
cinelerra-5.1/cinelerra/scopewindow.C
cinelerra-5.1/cinelerra/signalstatus.C
cinelerra-5.1/cinelerra/testwindow.h
cinelerra-5.1/cinelerra/theme.C
cinelerra-5.1/cinelerra/theme.h
cinelerra-5.1/cinelerra/track.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/tracksedit.C
cinelerra-5.1/cinelerra/vautomation.C
cinelerra-5.1/cinelerra/vdevice1394.C
cinelerra-5.1/cinelerra/vdevice1394.h
cinelerra-5.1/cinelerra/vdevicebase.h
cinelerra-5.1/cinelerra/vdeviceprefs.C
cinelerra-5.1/cinelerra/vdeviceprefs.h
cinelerra-5.1/cinelerra/vdevicex11.C
cinelerra-5.1/cinelerra/vdevicex11.h
cinelerra-5.1/cinelerra/videodevice.C
cinelerra-5.1/cinelerra/videodevice.h
cinelerra-5.1/cinelerra/vmodule.C
cinelerra-5.1/cinelerra/vrender.C
cinelerra-5.1/configure.ac
cinelerra-5.1/ffmpeg/decode.opts
cinelerra-5.1/guicast/Makefile
cinelerra-5.1/guicast/bcbitmap.h
cinelerra-5.1/guicast/bcbutton.C
cinelerra-5.1/guicast/bccapture.C
cinelerra-5.1/guicast/bccapture.h
cinelerra-5.1/guicast/bccmodels.h
cinelerra-5.1/guicast/bccolors.C [moved from cinelerra-5.1/cinelerra/cicolors.C with 99% similarity]
cinelerra-5.1/guicast/bccolors.h [moved from cinelerra-5.1/cinelerra/cicolors.h with 81% similarity]
cinelerra-5.1/guicast/bccolors.inc [moved from cinelerra-5.1/cinelerra/cicolors.inc with 100% similarity]
cinelerra-5.1/guicast/bcfilebox.C
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/guicast/bclistbox.h
cinelerra-5.1/guicast/bclistboxitem.h
cinelerra-5.1/guicast/bcmenubar.C
cinelerra-5.1/guicast/bcmenuitem.C
cinelerra-5.1/guicast/bcmenuitem.h
cinelerra-5.1/guicast/bcmeter.C
cinelerra-5.1/guicast/bcpan.C
cinelerra-5.1/guicast/bcpopupmenu.C
cinelerra-5.1/guicast/bcpot.C
cinelerra-5.1/guicast/bcprogress.C
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/guicast/bcresources.h
cinelerra-5.1/guicast/bcscrollbar.C
cinelerra-5.1/guicast/bcslider.C
cinelerra-5.1/guicast/bctextbox.C
cinelerra-5.1/guicast/bctextbox.h
cinelerra-5.1/guicast/bctitle.h
cinelerra-5.1/guicast/bctoggle.C
cinelerra-5.1/guicast/bctoggle.h
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/guicast/bcwindowbase.h
cinelerra-5.1/guicast/bcwindowdraw.C
cinelerra-5.1/guicast/fonts.h
cinelerra-5.1/guicast/guicast.h
cinelerra-5.1/guicast/test4.C
cinelerra-5.1/guicast/vframe.C
cinelerra-5.1/guicast/vframe.h
cinelerra-5.1/guicast/vicon.C
cinelerra-5.1/plugin_defs
cinelerra-5.1/plugins/C41/c41.C
cinelerra-5.1/plugins/Makefile
cinelerra-5.1/plugins/audioscope/audioscope.C
cinelerra-5.1/plugins/audioscope/audioscope.h
cinelerra-5.1/plugins/bluebanana/bluebanana.C
cinelerra-5.1/plugins/bluebanana/bluebanana.h
cinelerra-5.1/plugins/bluebanana/bluebananaslider.h
cinelerra-5.1/plugins/bluebanana/bluebananawindow.h
cinelerra-5.1/plugins/brightness/brightness.h
cinelerra-5.1/plugins/burn/burn.C
cinelerra-5.1/plugins/burn/burn.h
cinelerra-5.1/plugins/chromakey/chromakey.C
cinelerra-5.1/plugins/chromakeyhsv/chromakey.C
cinelerra-5.1/plugins/color3way/color3way.h
cinelerra-5.1/plugins/colorbalance/colorbalance.h
cinelerra-5.1/plugins/crikey/crikey.C
cinelerra-5.1/plugins/diffkey/diffkey.C
cinelerra-5.1/plugins/echo/echo.C
cinelerra-5.1/plugins/echocancel/echocancel.C
cinelerra-5.1/plugins/findobj/findobj.C
cinelerra-5.1/plugins/gamma/gamma.C
cinelerra-5.1/plugins/gamma/gamma.h
cinelerra-5.1/plugins/gradient/gradient.h
cinelerra-5.1/plugins/histogram/histogram.C
cinelerra-5.1/plugins/histogram/histogram.h
cinelerra-5.1/plugins/histogram_bezier/bistogram.C
cinelerra-5.1/plugins/histogram_bezier/bistogram.h
cinelerra-5.1/plugins/holo/holo.C
cinelerra-5.1/plugins/holo/holo.h
cinelerra-5.1/plugins/huesaturation/huesaturation.C
cinelerra-5.1/plugins/interpolate/interpolate.C
cinelerra-5.1/plugins/interpolatevideo/Makefile
cinelerra-5.1/plugins/interpolatevideo/interpolatevideo.C
cinelerra-5.1/plugins/interpolatevideo/motioncache-hv.C [new symlink]
cinelerra-5.1/plugins/interpolatevideo/motioncache-hv.h [new symlink]
cinelerra-5.1/plugins/interpolatevideo/motioncache-hv.inc [new symlink]
cinelerra-5.1/plugins/interpolatevideo/opticflow.C
cinelerra-5.1/plugins/interpolatevideo/opticflow.h
cinelerra-5.1/plugins/invertvideo/invert.C
cinelerra-5.1/plugins/libeffecttv/effecttv.C
cinelerra-5.1/plugins/libeffecttv/effecttv.h
cinelerra-5.1/plugins/motion-hv/Makefile
cinelerra-5.1/plugins/motion-hv/motion-hv.C
cinelerra-5.1/plugins/motion-hv/motioncache-hv.C [new file with mode: 0644]
cinelerra-5.1/plugins/motion-hv/motioncache-hv.h [new file with mode: 0644]
cinelerra-5.1/plugins/motion-hv/motioncache-hv.inc [new file with mode: 0644]
cinelerra-5.1/plugins/motion-hv/motionscan-hv.C
cinelerra-5.1/plugins/motion-hv/motionscan-hv.h
cinelerra-5.1/plugins/motion2point/Makefile
cinelerra-5.1/plugins/motion2point/motioncache-hv.C [new symlink]
cinelerra-5.1/plugins/motion2point/motioncache-hv.h [new symlink]
cinelerra-5.1/plugins/motion2point/motioncache-hv.inc [new symlink]
cinelerra-5.1/plugins/reverb/reverb.C
cinelerra-5.1/plugins/reverb/reverb.h
cinelerra-5.1/plugins/reverb/reverbwindow.C
cinelerra-5.1/plugins/rgbshift/rgbshift.C
cinelerra-5.1/plugins/spectrogram/spectrogram.C
cinelerra-5.1/plugins/spherecam/Makefile [new file with mode: 0644]
cinelerra-5.1/plugins/spherecam/picon_cinfinity.png [new file with mode: 0644]
cinelerra-5.1/plugins/spherecam/spherecam.C [new file with mode: 0644]
cinelerra-5.1/plugins/spherecam/spherecam.C.bak [new file with mode: 0644]
cinelerra-5.1/plugins/spherecam/spherecam.h [new file with mode: 0644]
cinelerra-5.1/plugins/spherecam/spherecam.h.bak [new file with mode: 0644]
cinelerra-5.1/plugins/swapframes/swapframes.C
cinelerra-5.1/plugins/threshold/histogramengine.C
cinelerra-5.1/plugins/threshold/histogramengine.h
cinelerra-5.1/plugins/threshold/threshold.C
cinelerra-5.1/plugins/threshold/threshold.h
cinelerra-5.1/plugins/timeavg/timeavg.C
cinelerra-5.1/plugins/timefront/timefront.h
cinelerra-5.1/plugins/timestretchrt/timestretchrt.C
cinelerra-5.1/plugins/timestretchrt/timestretchrt.h
cinelerra-5.1/plugins/videoscope/videoscope.C
cinelerra-5.1/plugins/yuv/yuv.C
cinelerra-5.1/plugins/yuv/yuv.h
cinelerra-5.1/plugins/yuv411/yuv411win.h
cinelerra-5.1/plugins/yuvshift/yuvshift.C
cinelerra-5.1/thirdparty/src/libXft-2.3.2.patch1 [new file with mode: 0644]

diff --git a/cinelerra-5.1/Cinelerra_factory b/cinelerra-5.1/Cinelerra_factory
new file mode 100644 (file)
index 0000000..97c2aa4
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<PLUGIN TITLE=Compressor>
+<KEYFRAME TITLE=loud><COMPRESSOR TRIGGER=0 REACTION_LEN=-1.0000000000000014e-01 DECAY_LEN=9.9999999999999367e-02 SMOOTHING_ONLY=0 INPUT=2>
+<LEVEL X=-4.9852631578947367e+01 Y=0>
+</KEYFRAME>
+<KEYFRAME TITLE=soft><COMPRESSOR TRIGGER=0 REACTION_LEN=-1.0000000000000014e-01 DECAY_LEN=4.9999999999999982e+00 SMOOTHING_ONLY=0 INPUT=2>
+<LEVEL X=-4.9852631578947367e+01 Y=0>
+</KEYFRAME>
+<KEYFRAME TITLE=voice><COMPRESSOR TRIGGER=0 REACTION_LEN=-1.0000000000000001e-01 DECAY_LEN=1.0000000000000001e-01 SMOOTHING_ONLY=0 INPUT=2>
+<LEVEL X=-3.0484210526315792e+01 Y=-80>
+<LEVEL X=-1.9873684210526321e+01 Y=0>
+</KEYFRAME>
+<KEYFRAME TITLE="live audio"><COMPRESSOR TRIGGER=0 REACTION_LEN=1.0000000000000001e-01 DECAY_LEN=1.0000000000000001e-01 SMOOTHING_ONLY=0 INPUT=2>
+<LEVEL X=-4.9852631578947367e+01 Y=0>
+</KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Lens>
+<KEYFRAME TITLE="15mm full frame stretch"><LENS FOCAL_LENGTH0=5.999998e-01 FOCAL_LENGTH1=6.000000e-01 FOCAL_LENGTH2=6.000000e-01 FOCAL_LENGTH3=6.000000e-01 ASPECT=1 RADIUS=1.020000e+00 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="15mm 1.6x stretch"><LENS FOCAL_LENGTH0=3.699997e-01 FOCAL_LENGTH1=3.700000e-01 FOCAL_LENGTH2=3.700000e-01 FOCAL_LENGTH3=3.700000e-01 ASPECT=1 RADIUS=8.500000e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="15mm full frame hemi"><LENS FOCAL_LENGTH0=5.999998e-01 FOCAL_LENGTH1=6.000000e-01 FOCAL_LENGTH2=6.000000e-01 FOCAL_LENGTH3=6.000000e-01 ASPECT=1.200000e+00 RADIUS=1.020000e+00 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="15mm 1920x1080"><LENS FOCAL_LENGTH0=5.799997e-01 FOCAL_LENGTH1=5.800000e-01 FOCAL_LENGTH2=5.800000e-01 FOCAL_LENGTH3=5.800000e-01 ASPECT=1 RADIUS=9.400000e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="15mm 1.6x video"><LENS FOCAL_LENGTH0=3.699998e-01 FOCAL_LENGTH1=3.700001e-01 FOCAL_LENGTH2=3.700001e-01 FOCAL_LENGTH3=3.700001e-01 ASPECT=1 RADIUS=8.400001e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE=gopro><LENS FOCAL_LENGTH0=4.999998e-01 FOCAL_LENGTH1=5.000001e-01 FOCAL_LENGTH2=5.000001e-01 FOCAL_LENGTH3=5.000001e-01 ASPECT=1 RADIUS=1.200000e+00 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="gopro hemi"><LENS FOCAL_LENGTH0=4.999998e-01 FOCAL_LENGTH1=5.000001e-01 FOCAL_LENGTH2=5.000001e-01 FOCAL_LENGTH3=5.000001e-01 ASPECT=1.330000e+00 RADIUS=7.300000e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE=gopro2.7k><LENS FOCAL_LENGTH0=4.399988e-01 FOCAL_LENGTH1=4.400000e-01 FOCAL_LENGTH2=4.400000e-01 FOCAL_LENGTH3=4.400000e-01 ASPECT=1 RADIUS=8.500000e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+<KEYFRAME TITLE="gopro 4k"><LENS FOCAL_LENGTH0=4.999998e-01 FOCAL_LENGTH1=5.000001e-01 FOCAL_LENGTH2=5.000001e-01 FOCAL_LENGTH3=5.000001e-01 ASPECT=1 RADIUS=8.700000e-01 MODE=3 CENTER_X=50 CENTER_Y=50 DRAW_GUIDES=0></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Spectrogram>
+<KEYFRAME TITLE=sissel><SPECTROGRAM LEVEL=1.4901161193847656e-08 NORMALIZE=0 WINDOW_SIZE=4096 XZOOM=1 MODE=0 HISTORY_SIZE=4 W=750 H=656>
+</KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Downsample>
+<KEYFRAME TITLE="UV 2x2"><DOWNSAMPLE HORIZONTAL=2 VERTICAL=2 HORIZONTAL_X=0 VERTICAL_Y=0 R=0 G=1 B=1 A=0></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Scale>
+<KEYFRAME TITLE="d-1 to gootube"><SCALE WIDTH=4.400000e-01 HEIGHT=5.000000e-01></KEYFRAME>
+<KEYFRAME TITLE="640x480 to d-1"><SCALE WIDTH=1.100000e+00 HEIGHT=1></KEYFRAME>
+<KEYFRAME TITLE="fix D-1 on gootube"><SCALE WIDTH=1 HEIGHT=1.125100e+00></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Motion>
+<KEYFRAME TITLE=coptercam><MOTION BLOCK_COUNT=1 GLOBAL_POSITIONS=256 ROTATE_POSITIONS=4 GLOBAL_BLOCK_W=45 GLOBAL_BLOCK_H=52 ROTATION_BLOCK_W=33 ROTATION_BLOCK_H=32 BLOCK_X=50 BLOCK_Y=50 GLOBAL_RANGE_W=39 GLOBAL_RANGE_H=47 ROTATION_RANGE=10 ROTATION_CENTER=0 MAGNITUDE=50 RETURN_SPEED=3 MODE1=1 GLOBAL=1 ROTATE=1 MODE2=5 DRAW_VECTORS=0 MODE3=11 TRACK_FRAME=0 BOTTOM_IS_MASTER=1 HORIZONTAL_ONLY=0 VERTICAL_ONLY=0></KEYFRAME>
+<KEYFRAME TITLE=running><MOTION BLOCK_COUNT=1 GLOBAL_POSITIONS=1024 ROTATE_POSITIONS=4 GLOBAL_BLOCK_W=34 GLOBAL_BLOCK_H=46 BLOCK_X=50 BLOCK_Y=50 GLOBAL_RANGE_W=100 GLOBAL_RANGE_H=100 ROTATION_RANGE=5 ROTATION_CENTER=0 MAGNITUDE=50 RETURN_SPEED=10 ROTATE_MAGNITUDE=15 ROTATE_RETURN_SPEED=10 ACTION_TYPE=3 GLOBAL=1 ROTATE=1 TRACKING_TYPE=1 DRAW_VECTORS=1 TRACKING_OBJECT=2 TRACK_FRAME=0 BOTTOM_IS_MASTER=1 HORIZONTAL_ONLY=0 VERTICAL_ONLY=0></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Reverb>
+<KEYFRAME TITLE=loud><REVERB LEVELINIT=0 DELAY_INIT=20 REF_LEVEL1=-1.7999996185302734e+01 REF_LEVEL2=-3.8000030517578125e+01 REF_TOTAL=124 REF_LENGTH=1059 LOWPASS1=24539 LOWPASS2=24539>
+</KEYFRAME>
+<KEYFRAME TITLE=long><REVERB LEVELINIT=0 DELAY_INIT=20 REF_LEVEL1=-16 REF_LEVEL2=-3.8000030517578125e+01 REF_TOTAL=137 REF_LENGTH=3034 LOWPASS1=24539 LOWPASS2=24539>
+</KEYFRAME>
+<KEYFRAME TITLE=piano><REVERB LEVELINIT=0 DELAY_INIT=90 REF_LEVEL1=-28 REF_LEVEL2=-40 REF_TOTAL=163 REF_LENGTH=600 LOWPASS1=24539 LOWPASS2=4425>
+</KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE="Interpolate Video">
+<KEYFRAME TITLE="10fps analog"><INTERPOLATEVIDEO INPUT_RATE=10 USE_KEYFRAMES=0 OPTIC_FLOW=1 DRAW_VECTORS=0 SEARCH_RADIUS=16 MACROBLOCK_SIZE=32></KEYFRAME>
+<KEYFRAME TITLE=iss><INTERPOLATEVIDEO INPUT_RATE=1 USE_KEYFRAMES=0 OPTIC_FLOW=1 DRAW_VECTORS=1 SEARCH_RADIUS=111 MACROBLOCK_SIZE=101></KEYFRAME>
+<KEYFRAME TITLE=hd><INTERPOLATEVIDEO INPUT_RATE=2.3976023976023978e+01 USE_KEYFRAMES=0 OPTIC_FLOW=1 DRAW_VECTORS=0 SEARCH_RADIUS=40 MACROBLOCK_SIZE=50></KEYFRAME>
+<KEYFRAME TITLE=weather><INTERPOLATEVIDEO INPUT_RATE=5 USE_KEYFRAMES=0 OPTIC_FLOW=1 DRAW_VECTORS=0 SEARCH_RADIUS=32 MACROBLOCK_SIZE=60></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE="Chroma key (HSV)">
+<KEYFRAME TITLE=blue><CHROMAKEY_HSV RED=0 GREEN=1.137255e-01 BLUE=1 MIN_BRIGHTNESS=0 MAX_BRIGHTNESS=100 SATURATION=0 MIN_SATURATION=20 TOLERANCE=30 IN_SLOPE=0 OUT_SLOPE=0 ALPHA_OFFSET=0 SPILL_THRESHOLD=0 SPILL_AMOUNT=0 SHOW_MASK=0></KEYFRAME>
+<KEYFRAME TITLE=pink><CHROMAKEY_HSV RED=1 GREEN=0 BLUE=8.313726e-01 MIN_BRIGHTNESS=0 MAX_BRIGHTNESS=100 SATURATION=0 MIN_SATURATION=20 TOLERANCE=20 IN_SLOPE=0 OUT_SLOPE=0 ALPHA_OFFSET=0 SPILL_THRESHOLD=0 SPILL_AMOUNT=0 SHOW_MASK=0></KEYFRAME>
+<KEYFRAME TITLE=cyan><CHROMAKEY_HSV RED=0 GREEN=9.647059e-01 BLUE=1 MIN_BRIGHTNESS=0 MAX_BRIGHTNESS=100 SATURATION=0 MIN_SATURATION=1.850000e+01 TOLERANCE=30 IN_SLOPE=0 OUT_SLOPE=0 ALPHA_OFFSET=0 SPILL_THRESHOLD=0 SPILL_AMOUNT=0 SHOW_MASK=0></KEYFRAME>
+<KEYFRAME TITLE=red><CHROMAKEY_HSV RED=1 GREEN=0 BLUE=9.137255e-01 MIN_BRIGHTNESS=11 MAX_BRIGHTNESS=100 SATURATION=0 MIN_SATURATION=20 TOLERANCE=20 IN_SLOPE=0 OUT_SLOPE=0 ALPHA_OFFSET=0 SPILL_THRESHOLD=0 SPILL_AMOUNT=0 SHOW_MASK=0></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=Histogram>
+<KEYFRAME TITLE=cr2><HISTOGRAM AUTOMATIC=0 THRESHOLD=9.990000e-01 PLOT=1 SPLIT=0 W=440 H=579 PARADE=0 MODE=3 LOW_OUTPUT_0=0 HIGH_OUTPUT_0=1 LOW_INPUT_0=0 HIGH_INPUT_0=1 GAMMA_0=1 LOW_OUTPUT_1=0 HIGH_OUTPUT_1=1 LOW_INPUT_1=0 HIGH_INPUT_1=1 GAMMA_1=1 LOW_OUTPUT_2=0 HIGH_OUTPUT_2=1 LOW_INPUT_2=0 HIGH_INPUT_2=1 GAMMA_2=1 LOW_OUTPUT_3=0 HIGH_OUTPUT_3=1 LOW_INPUT_3=0 HIGH_INPUT_3=5.548077e-01 GAMMA_3=2>
+</KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE="EQ Parametric">
+<KEYFRAME TITLE=ultrarunner><PARAMETRICEQ WETNESS=0 WINDOW_SIZE=4096>
+<BAND NUMBER=0 FREQ=2095 QUALITY=7.700000e-01 MAGNITUDE=5.800000e+00 MODE=3>
+<BAND NUMBER=1 FREQ=440 QUALITY=1 MAGNITUDE=0 MODE=0>
+<BAND NUMBER=2 FREQ=440 QUALITY=1 MAGNITUDE=0 MODE=0>
+</KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE=ReframeRT>
+<KEYFRAME TITLE=dave><REFRAMERT SCALE=2 DENOM=1 STRETCH=1></KEYFRAME>
+</PLUGIN>
+<PLUGIN TITLE="Sphere Cam">
+<KEYFRAME TITLE="gear360 4k"><SPHERECAM ENABLED_0=1 FOV_0=192 CENTER_X_0=2.520000e+01 CENTER_Y_0=5.179997e+01 ROTATE_X_0=100 ROTATE_Y_0=50 ROTATE_Z_0=0 ENABLED_1=1 FOV_1=1.917000e+02 CENTER_X_1=7.499998e+01 CENTER_Y_1=5.079998e+01 ROTATE_X_1=5.019999e+01 ROTATE_Y_1=4.940001e+01 ROTATE_Z_1=8.000001e-01 FEATHER=1 DRAW_GUIDES=0 MODE=1></KEYFRAME>
+<KEYFRAME TITLE="gear360 7k"><SPHERECAM ENABLED_0=1 FOV_0=194 CENTER_X_0=2.520000e+01 CENTER_Y_0=5.149998e+01 ROTATE_X_0=50 ROTATE_Y_0=50 ROTATE_Z_0=0 ENABLED_1=1 FOV_1=1.946000e+02 CENTER_X_1=7.499999e+01 CENTER_Y_1=5.129996e+01 ROTATE_X_1=0 ROTATE_Y_1=4.980000e+01 ROTATE_Z_1=1 FEATHER=1 DRAW_GUIDES=0 MODE=1></KEYFRAME>
+<KEYFRAME TITLE="gear360 sideways 4k"><SPHERECAM ENABLED_0=1 FOV_0=192 CENTER_X_0=2.530000e+01 CENTER_Y_0=5.129998e+01 ROTATE_X_0=100 ROTATE_Y_0=50 ROTATE_Z_0=90 ENABLED_1=1 FOV_1=1.917000e+02 CENTER_X_1=7.499998e+01 CENTER_Y_1=5.109998e+01 ROTATE_X_1=5.019999e+01 ROTATE_Y_1=4.980000e+01 ROTATE_Z_1=-8.889997e+01 FEATHER=1 DRAW_GUIDES=0 MODE=1></KEYFRAME>
+<KEYFRAME TITLE="gear360 sideways, 7k"><SPHERECAM ENABLED_0=1 FOV_0=194 CENTER_X_0=2.520000e+01 CENTER_Y_0=5.139998e+01 ROTATE_X_0=50 ROTATE_Y_0=50 ROTATE_Z_0=90 ENABLED_1=1 FOV_1=1.946000e+02 CENTER_X_1=7.499999e+01 CENTER_Y_1=5.079997e+01 ROTATE_X_1=0 ROTATE_Y_1=4.990000e+01 ROTATE_Z_1=-8.900002e+01 FEATHER=1 DRAW_GUIDES=0 MODE=1></KEYFRAME>
+</PLUGIN>
index a6426923cb64cb5da95603f0ae5bb31815ded62c..70f4728f47fc548b5a37cd3faff2aea18baa6e77 100644 (file)
@@ -31,7 +31,7 @@ export mkinstalldirs install_sh inst_sh
 
 # install to bin
 binstall:      install-recursive
-       cp -a COPYING README models ffmpeg msg info tips bin/.
+       cp -a COPYING README models Cinelerra_factory ffmpeg msg info tips bin/.
        sed -e 's/\<cin\>/$(WANT_CIN)/g' < image/cin.desktop \
                > "bin/applications/$(WANT_CIN).desktop"
        cp -a image/cin.svg "bin/pixmaps/$(WANT_CIN)".svg
@@ -49,7 +49,7 @@ cinstall:
        cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" \
                bdwrite cutads hveg2enc mpeg2enc mplex mplexlo
        cd bin; $(inst_sh) "$(DESTDIR)$(datadir)/$(WANT_CIN)" \
-               COPYING README models ffmpeg msg info tips doc
+               COPYING README models Cinelerra_factory ffmpeg msg info tips doc
        cd bin/locale; $(inst_sh) "$(DESTDIR)$(localedir)" .
        cd bin/plugins; $(inst_sh) "$(DESTDIR)$(WANT_PLUGIN_DIR)" .
        cd bin/ladspa; $(inst_sh) "$(DESTDIR)$(WANT_LADSPA_DIR)" .
index ae6c41e00dae84a97b83973c2244d3dc8ede12c5..04a9fd7ccf11eadc39ba67e2d1f74bd06061a60e 100644 (file)
@@ -22,7 +22,7 @@ clean:
 
 install:
        for dir in $(SUBDIRS); do $(MAKE) -C $$dir install; done
-       cp -a COPYING README models ffmpeg msg info tips bin/.
+       cp -a COPYING README models Cinelerra_factory ffmpeg msg info tips bin/.
        for d in picon*; do cp -a $$d/. bin/plugins/$$d/.; done
 
 rebuild:
index 6fe883550bb4c6be5333ac7f1d1337499dbf7dc0..bd59f62ea7093578ac7e6194992a768125fa7646 100644 (file)
@@ -59,7 +59,6 @@ OBJS = \
        $(OBJDIR)/channel.o \
        $(OBJDIR)/channelpicker.o \
        $(OBJDIR)/chantables.o \
-       $(OBJDIR)/cicolors.o \
        $(OBJDIR)/clipedit.o \
        $(OBJDIR)/clippopup.o \
        $(OBJDIR)/colorpicker.o \
@@ -230,6 +229,7 @@ OBJS = \
        $(OBJDIR)/pluginvclient.o \
        $(OBJDIR)/preferences.o \
        $(OBJDIR)/preferencesthread.o \
+       $(OBJDIR)/presets.o \
        $(OBJDIR)/probeprefs.o \
        $(OBJDIR)/proxy.o \
        $(OBJDIR)/question.o \
index 0c167602ffa8f5c21bf1fa4df7011be96c5d6a23..3b58cad65914515034410c0b2a08ee86822dc5a1 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "aautomation.h"
 #include "atrack.inc"
-#include "colors.h"
+#include "bccolors.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "floatauto.h"
index cff01da035b300cd20338cb605cc06f1b22125d9..be7ba2c67b704e80841dfa860ff21247fd83e73a 100644 (file)
 #include "adeviceprefs.h"
 #include "audioalsa.h"
 #include "audiodevice.inc"
+#include "bcsignals.h"
 #include "bitspopup.h"
 #include "edl.h"
 #include "language.h"
+#include "mwindow.h"
 #include "playbackconfig.h"
 #include "preferences.h"
 #include "preferencesthread.h"
 #include "recordconfig.h"
+#include "theme.h"
 #include <string.h>
 
-#define DEVICE_H 50
+//#define DEVICE_H 50
 
 ADevicePrefs::ADevicePrefs(int x, int y, PreferencesWindow *pwindow, PreferencesDialog *dialog,
        AudioOutConfig *out_config, AudioInConfig *in_config, int mode)
@@ -141,7 +144,14 @@ int ADevicePrefs::initialize(int creation)
 
 int ADevicePrefs::get_h(int recording)
 {
-       return !recording ? DEVICE_H + 30 : DEVICE_H;
+       int margin = pwindow->mwindow->theme->widget_border;
+       int result = BC_Title::calculate_h(dialog, "X", MEDIUMFONT) + margin +
+               BC_TextBox::calculate_h(dialog, MEDIUMFONT, 1, 1);
+       if( !recording ) {
+               result += BC_CheckBox::calculate_h(dialog) + margin;
+       }
+
+       return result;
 }
 
 int ADevicePrefs::delete_objects()
@@ -261,6 +271,7 @@ int ADevicePrefs::create_oss_objs()
 {
        char *output_char = 0;
        int *output_int = 0;
+       int margin = pwindow->mwindow->theme->widget_border;
        int y1 = y;
        BC_Resources *resources = BC_WindowBase::get_resources();
 
@@ -279,7 +290,7 @@ int ADevicePrefs::create_oss_objs()
                        break;
                }
                dialog->add_subwindow(oss_enable[i] = new OSSEnable(x1, y1 + 20, output_int));
-               x1 += oss_enable[i]->get_w() + 5;
+               x1 += oss_enable[i]->get_w() + margin;
 #endif
                switch(mode) {
                case MODEPLAY:
@@ -299,10 +310,10 @@ int ADevicePrefs::create_oss_objs()
                        dialog->add_subwindow(path_title);
                }
 
-               oss_path[i] = new ADeviceTextBox(x1, y1 + 20, output_char);
+               oss_path[i] = new ADeviceTextBox(
+                       x1, y1 + path_title->get_h() + margin, output_char);
                dialog->add_subwindow(oss_path[i]);
-
-               x1 += oss_path[i]->get_w() + 5;
+               x1 += oss_path[i]->get_w() + margin;
                if(i == 0) {
                        switch(mode) {
                        case MODEPLAY:
@@ -318,14 +329,15 @@ int ADevicePrefs::create_oss_objs()
                        bits_title = new BC_Title(x1, y, _("Bits:"),
                                        MEDIUMFONT, resources->text_default);
                        dialog->add_subwindow(bits_title);
-                       oss_bits = new BitsPopup(dialog, x1, y1 + 20, output_int,
-                               0, 0, 0, 0, 1);
+                       oss_bits = new BitsPopup(dialog,
+                               x1, y1 + bits_title->get_h() + margin, 
+                               output_int, 0, 0, 0, 0, 1);
                        oss_bits->create_objects();
                }
 
-               x1 += oss_bits->get_w() + 5;
-               y1 += DEVICE_H;
-break;  // apparently, 'i' must be zero
+               x1 += oss_bits->get_w() + margin;
+//             y1 += DEVICE_H;
+               break;
        }
 
        return 0;
@@ -336,16 +348,16 @@ int ADevicePrefs::create_alsa_objs()
 #ifdef HAVE_ALSA
        char *output_char = 0;
        int *output_int = 0;
-       int y1 = y;
+       int margin = pwindow->mwindow->theme->widget_border;
        BC_Resources *resources = BC_WindowBase::get_resources();
 
-       int x1 = x + menu->get_w() + 5;
+       int x1 = x + menu->get_w() + margin;
+       int y1 = y;
 
        ArrayList<char*> *alsa_titles = new ArrayList<char*>;
        alsa_titles->set_array_delete();
        AudioALSA::list_devices(alsa_titles, 0, mode);
 
-
        alsa_drivers = new ArrayList<BC_ListBoxItem*>;
        for(int i = 0; i < alsa_titles->total; i++)
                alsa_drivers->append(new BC_ListBoxItem(alsa_titles->values[i]));
@@ -366,7 +378,9 @@ int ADevicePrefs::create_alsa_objs()
        path_title = new BC_Title(x1, y, _("Device:"),
                        MEDIUMFONT, resources->text_default);
        dialog->add_subwindow(path_title);
-       alsa_device = new ALSADevice(dialog, x1, y1 + 20, output_char, alsa_drivers);
+       y1 += path_title->get_h() + margin;
+       alsa_device = new ALSADevice(dialog,
+               x1, y1, output_char, alsa_drivers);
        alsa_device->create_objects();
        int x2 = x1;
 
@@ -385,10 +399,12 @@ int ADevicePrefs::create_alsa_objs()
        bits_title = new BC_Title(x1, y, _("Bits:"),
                        MEDIUMFONT, resources->text_default);
        dialog->add_subwindow(bits_title);
-       alsa_bits = new BitsPopup(dialog, x1, y1 + 20, output_int, 0, 0, 0, 0, 1);
+       y1 = y + bits_title->get_h() + margin;
+       alsa_bits = new BitsPopup(dialog,
+                       x1, y1, output_int, 0, 0, 0, 0, 1);
        alsa_bits->create_objects();
 
-       y1 += alsa_bits->get_h() + 20 + 5;
+       y1 += alsa_bits->get_h();
        x1 = x2;
 
        if(mode == MODEPLAY) {
@@ -615,15 +631,15 @@ ADriverMenu::~ADriverMenu()
 
 void ADriverMenu::create_objects()
 {
+#ifdef HAVE_ALSA
+       add_item(new ADriverItem(this, AUDIO_ALSA_TITLE, AUDIO_ALSA));
+#endif
+
 #ifdef HAVE_OSS
        add_item(new ADriverItem(this, AUDIO_OSS_TITLE, AUDIO_OSS));
        add_item(new ADriverItem(this, AUDIO_OSS_ENVY24_TITLE, AUDIO_OSS_ENVY24));
 #endif
 
-#ifdef HAVE_ALSA
-       add_item(new ADriverItem(this, AUDIO_ALSA_TITLE, AUDIO_ALSA));
-#endif
-
 #ifdef HAVE_ESOUND
        if(!do_input) add_item(new ADriverItem(this, AUDIO_ESOUND_TITLE, AUDIO_ESOUND));
 #endif
index 2712610760b4bede9c76bc79386623cff6631c27..ebe5051ff20a69aca3490918a01620093c429a36 100644 (file)
@@ -50,7 +50,8 @@ public:
        ~ADevicePrefs();
 
        void reset();
-       static int get_h(int recording = 0);
+//     static int get_h(int recording = 0);
+       int get_h(int recording = 0);
        int update(AudioOutConfig *out_config);
 // creation - set if this is the first initialize of the object
 //            to prevent file format from being overwritten
index af87bdbb91750ed1f2dd9cac55d714c3ca9a21b1..bb56d8bfc9ce38bcbb158112368ae0dcdf1efc7c 100644 (file)
@@ -134,6 +134,8 @@ int Asset::init_values()
 
        tiff_cmodel = 0;
        tiff_compression = 0;
+       mov_sphere = 0;
+       jpeg_sphere = 0;
 
        use_header = 1;
        id = EDL::next_id();
@@ -271,6 +273,10 @@ void Asset::copy_format(Asset *asset, int do_index)
 
        tiff_cmodel = asset->tiff_cmodel;
        tiff_compression = asset->tiff_compression;
+       
+       
+       mov_sphere = asset->mov_sphere;
+       jpeg_sphere = asset->jpeg_sphere;
 }
 
 int64_t Asset::get_index_offset(int channel)
@@ -360,7 +366,9 @@ int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
                        interlace_fixmethod     == asset.interlace_fixmethod &&
                        width == asset.width &&
                        height == asset.height &&
-                       !strcmp(vcodec, asset.vcodec));
+                       !strcmp(vcodec, asset.vcodec) &&
+                       mov_sphere == asset.mov_sphere &&
+                       jpeg_sphere == asset.jpeg_sphere);
                if(result && format == FILE_FFMPEG)
                        result = !strcmp(ff_video_options, asset.ff_video_options) &&
                                ff_video_bitrate == asset.ff_video_bitrate &&
@@ -506,6 +514,8 @@ int Asset::read_video(FileXML *file)
        file->tag.get_property("VCODEC", vcodec);
 
        video_length = file->tag.get_property("VIDEO_LENGTH", (int64_t)0);
+       mov_sphere = file->tag.get_property("MOV_SPHERE", 0);
+       jpeg_sphere = file->tag.get_property("JPEG_SPHERE", 0);
        single_frame = file->tag.get_property("SINGLE_FRAME", (int64_t)0);
 
        interlace_autofixoption = file->tag.get_property("INTERLACE_AUTOFIX",0);
@@ -661,6 +671,8 @@ int Asset::write_video(FileXML *file)
                file->tag.set_property("VCODEC", vcodec);
 
        file->tag.set_property("VIDEO_LENGTH", video_length);
+       file->tag.set_property("MOV_SPHERE", mov_sphere);
+       file->tag.set_property("JPEG_SPHERE", jpeg_sphere);
        file->tag.set_property("SINGLE_FRAME", single_frame);
 
        file->tag.set_property("INTERLACE_AUTOFIX", interlace_autofixoption);
@@ -825,6 +837,8 @@ void Asset::load_defaults(BC_Hash *defaults,
        tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
        tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression);
 
+       mov_sphere = GET_DEFAULT("MOV_SPHERE", mov_sphere);
+       jpeg_sphere = GET_DEFAULT("JPEG_SPHERE", jpeg_sphere);
        boundaries();
 }
 
@@ -912,8 +926,16 @@ void Asset::save_defaults(BC_Hash *defaults,
                UPDATE_DEFAULT("EXR_COMPRESSION", exr_compression);
                UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel);
                UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression);
+
+
+
+               UPDATE_DEFAULT("MOV_SPHERE", mov_sphere);
+               UPDATE_DEFAULT("JPEG_SPHERE", jpeg_sphere);
        }
 
+
+
+
        if(do_bits)
        {
                UPDATE_DEFAULT("BITS", bits);
@@ -978,6 +1000,7 @@ int Asset::dump(FILE *fp)
                video_data, layers, program, frame_rate, width, height,
                vcodec, aspect_ratio,string);
        fprintf(fp,"   video_length %jd repeat %d\n", video_length, single_frame);
+       printf("   mov_sphere=%d jpeg_sphere=%d\n", mov_sphere, jpeg_sphere);
        return 0;
 }
 
index 4fa58aa41a010adb314b5d264da07b98a3c203d8..871ab22515592993715fcc4417fd09545a8d84f4 100644 (file)
@@ -150,6 +150,7 @@ public:
        char vcodec[BCTEXTLEN];
 
 // Length in frames
+// -1 means a still photo
        int64_t video_length;
 
 
@@ -226,6 +227,9 @@ public:
 
        int ac3_bitrate;
 
+// Insert tag for spherical playback
+       int mov_sphere, jpeg_sphere;
+
 // Image file sequences.  Background rendering doesn't want to write a
 // sequence header but instead wants to start the sequence numbering at a certain
 // number.  This ensures deletion of all the frames which aren't being used.
index c153e3db8935ed9ef0e3cc59ed00f04c4ed5c0e5..75c1bfa2d1efeaf663ae9d355ad4830e978d52ec 100644 (file)
@@ -145,14 +145,13 @@ AssetPopupInfo::~AssetPopupInfo()
 int AssetPopupInfo::handle_event()
 {
        int cur_x, cur_y;
-       popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0);
-       
-       if( mwindow->session->drag_assets->total ) {
-               mwindow->awindow->asset_edit->edit_asset(
+       popup->gui->get_abs_cursor_xy(cur_x, cur_y);
+       if( mwindow->session->drag_assets->size() ) {
+               AssetEdit *asset_edit = mwindow->awindow->get_asset_editor();
+               asset_edit->edit_asset(
                        mwindow->session->drag_assets->values[0], cur_x, cur_y);
        }
-       else
-       if( mwindow->session->drag_clips->total ) {
+       else if( mwindow->session->drag_clips->size() ) {
                popup->gui->awindow->clip_edit->edit_clip(
                        mwindow->session->drag_clips->values[0], cur_x, cur_y);
        }
index 9387ed9d4120e2154015c9fed922f8300dc69ae8..ed9df7b90105614a2f726cea39bab7a66a8c61bb 100644 (file)
@@ -177,3 +177,15 @@ int ATrack::paste_derived(int64_t start, int64_t end, int64_t total_length, File
        return 0;
 }
 
+void ATrack::deglitch(double position, 
+       int edit_labels, int edit_plugins, int edit_autos)
+{
+       int64_t samples = to_units(position, 0);
+       edits->deglitch(samples);
+       if( edit_plugins ) {
+               for(int i = 0; i < plugin_set.size(); i++) {
+                       plugin_set.get(i)->deglitch(samples);
+               }
+       }
+}
+
index 010b3923d8c2edef263ff28b327b59e047891220..74a4d935fe9e7202086ad250585d4561586804ed 100644 (file)
@@ -76,6 +76,10 @@ public:
 
 
        int modify_handles(int64_t oldposition, int64_t newposition, int currentend);
+       void deglitch(double position, 
+               int edit_labels,
+               int edit_plugins,
+               int edit_autos);
 
        int64_t length();
 //     int get_dimensions(double &view_start,
index 727bdb2c6cfabb389be619d9be5df39ff29d300b..44c5eabe168bf0b1637f6a3760bbd75a49ad62b8 100644 (file)
 
 AudioConfig::AudioConfig()
 {
+       audio_in_driver =  AUDIO_ALSA;
+       afirewire_in_port = 0;
+       afirewire_in_channel = 63;
+       strcpy(oss_in_device, "/dev/dsp");
+       oss_in_channels = 2;
+       oss_in_bits = 16;
+       strcpy(esound_in_server, "");
+       esound_in_port = 0;
+
+       audio_out_driver = AUDIO_ALSA;
+       strpcy(oss_out_device, "/dev/dsp");
+       oss_out_channels = 2;
+       oss_out_bits = 16;
+       strpcy(esound_out_server, "");
+       esound_out_port = 0;
+
+       audio_duplex_driver = AUDIO_ALSA;
+       strcpy(oss_duplex_device, "/dev/dsp");
+       oss_duplex_channels = 2;
+       oss_duplex_bits = 16;
+       strcpy(esound_duplex_server, "");
+       esound_duplex_port = 0;
 }
 
 AudioConfig::~AudioConfig()
@@ -72,7 +94,7 @@ AudioConfig& AudioConfig::operator=(AudioConfig &that)
 
 int AudioConfig::load_defaults(BC_Hash *defaults)
 {
-       audio_in_driver =             defaults->get("AUDIOINDRIVER", AUDIO_OSS);
+       audio_in_driver =             defaults->get("AUDIOINDRIVER", AUDIO_ALSA);
        afirewire_in_port =           defaults->get("AFIREWIRE_IN_PORT", 0);
        afirewire_in_channel =        defaults->get("AFIREWIRE_IN_CHANNEL", 63);
        sprintf(oss_in_device, "/dev/dsp");
@@ -83,8 +105,8 @@ int AudioConfig::load_defaults(BC_Hash *defaults)
                                      defaults->get("ESOUND_IN_SERVER", esound_in_server);
        esound_in_port =              defaults->get("ESOUND_IN_PORT", 0);
 
-       audio_out_driver =                defaults->get("AUDIO_OUT_DRIVER", AUDIO_OSS);
-       audio_duplex_driver =             defaults->get("AUDIO_DUPLEX_DRIVER", AUDIO_OSS);
+       audio_out_driver =                defaults->get("AUDIO_OUT_DRIVER", AUDIO_ALSA);
+       audio_duplex_driver =             defaults->get("AUDIO_DUPLEX_DRIVER", AUDIO_ALSA);
        sprintf(oss_out_device, "/dev/dsp");
                                      defaults->get("OSS_OUT_DEVICE", oss_out_device);
        oss_out_channels =                defaults->get("OUT_CHANNELS", 2);
@@ -93,7 +115,7 @@ int AudioConfig::load_defaults(BC_Hash *defaults)
                                      defaults->get("ESOUND_OUT_SERVER", esound_out_server);
        esound_out_port =             defaults->get("ESOUND_OUT_PORT", 0);
 
-       audio_duplex_driver =         defaults->get("AUDIO_DUPLEX_DRIVER", AUDIO_OSS);
+       audio_duplex_driver =         defaults->get("AUDIO_DUPLEX_DRIVER", AUDIO_ALSA);
        sprintf(oss_duplex_device, "/dev/dsp");
                                      defaults->get("OSS_DUPLEX_DEVICE", oss_duplex_device);
        oss_duplex_channels =         defaults->get("DUPLEX_CHANNELS", 2);
index 1ce714fbbf715f38985c6ca58624b48df15464a7..2a21dd4d743c3e0e4a08d901f45bfcb705373b51 100644 (file)
@@ -24,7 +24,7 @@
 #include "autos.h"
 #include "atrack.inc"
 #include "bcsignals.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "filexml.h"
index 7e1f56f0d3d29f7f565cfecd7739662214e9e3ab..d5f3204cc93df3a146c31bff7c7a976c9c9e1f0a 100644 (file)
@@ -35,7 +35,6 @@ AWindow::AWindow(MWindow *mwindow)
        this->mwindow = mwindow;
        current_folder[0] = 0;
        asset_remove = 0;
-       asset_edit = 0;
        clip_edit = 0;
        label_edit = 0;
 }
@@ -49,8 +48,8 @@ AWindow::~AWindow()
                gui->unlock_window();
        }
        Thread::join();
+       asset_editors.remove_all_objects();
        delete asset_remove;
-       delete asset_edit;
        delete label_edit;
        delete clip_edit;
        delete effect_tip;
@@ -62,7 +61,6 @@ void AWindow::create_objects()
        gui->create_objects();
        gui->async_update_assets();
        asset_remove = new AssetRemoveThread(mwindow);
-       asset_edit = new AssetEdit(mwindow);
        clip_edit = new ClipEdit(mwindow, this, 0);
        label_edit = new LabelEdit(mwindow, this, 0);
        effect_tip = new EffectTipDialog(mwindow, this);
@@ -78,6 +76,21 @@ int AWindow::load_defaults(BC_Hash *defaults)
 }
 
 
+AssetEdit *AWindow::get_asset_editor()
+{
+       AssetEdit *asset_edit = 0;
+       for( int i=0; !asset_edit && i<asset_editors.size(); ++i ) {
+               AssetEdit *thread = asset_editors[i];
+               if( !thread->running() ) asset_edit = thread;
+       }
+       if( !asset_edit ) {
+               asset_edit = new AssetEdit(mwindow);
+               asset_editors.append(asset_edit);
+       }
+       return asset_edit;
+}
+
+
 void AWindow::run()
 {
        gui->run_window();
index e7003f9a56d7efee8f0e0cce7c0dbb9c780a6bbe..40410b537f9a428facaf5c507f608f15fa561a9f 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef AWINDOW_H
 #define AWINDOW_H
 
+#include "arraylist.h"
 #include "assetedit.inc"
 #include "assetremove.inc"
 #include "awindowgui.inc"
@@ -42,6 +43,7 @@ public:
 
        void run();
        void create_objects();
+       AssetEdit *get_asset_editor();
        int load_defaults(BC_Hash *defaults);
        int save_defaults(BC_Hash *defaults);
 
@@ -49,7 +51,7 @@ public:
 
        AWindowGUI *gui;
        MWindow *mwindow;
-       AssetEdit *asset_edit;
+       ArrayList<AssetEdit*> asset_editors;
        AssetRemoveThread *asset_remove;
        ClipEdit *clip_edit;
        LabelEdit *label_edit;
index 5bca38f3687eb34c281042fc881da2a708d65fce..1267c001cd289b43079c538f58a189be1be54259 100644 (file)
@@ -1806,21 +1806,21 @@ int AWindowDeleteProject::handle_event()
        return 1;
 }
 
-AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y)
- : BC_Button(x, y, mwindow->theme->infoasset_data)
-{
-       this->mwindow = mwindow;
-       this->gui = gui;
-       set_tooltip(_("Edit information on asset"));
-}
-
-int AWindowInfo::handle_event()
-{
-       int cur_x, cur_y;
-       gui->get_abs_cursor_xy(cur_x, cur_y, 0);
-       gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y);
-       return 1;
-}
+// AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y)
+//  : BC_Button(x, y, mwindow->theme->infoasset_data)
+// {
+//     this->mwindow = mwindow;
+//     this->gui = gui;
+//     set_tooltip(_("Edit information on asset"));
+// }
+// 
+// int AWindowInfo::handle_event()
+// {
+//     int cur_x, cur_y;
+//     gui->get_abs_cursor_xy(cur_x, cur_y, 0);
+//     gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y);
+//     return 1;
+// }
 
 AWindowRedrawIndex::AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y)
  : BC_Button(x, y, mwindow->theme->redrawindex_data)
@@ -2021,4 +2021,3 @@ int AWindowListSort::handle_event()
        return 1;
 }
 
-
index 8e02543aa5f855b5950201ded9ee8fcc0b74ff63..40b1e1bf8d08b22dadac577f04ba56b8203891dc 100644 (file)
@@ -121,8 +121,8 @@ int CacheBase::delete_oldest()
                        oldest = current;
        }
        if( oldest && oldest->position >= 0 ) {
+               result = oldest->get_size();
                del_item(oldest);
-               result = 1;
        }
        lock->unlock();
        return result;
index ae37fbb4d5f9a1910eeee93dd946c84b17b76718..a548891abede571876ac2e51efd0d36d474b2180 100644 (file)
@@ -78,7 +78,8 @@ public:
 // Called when done with the item returned by get_.
 // Ignore if item was 0.
        void unlock();
-// delete oldest member, returns 1 if item deleted or 0 if none found
+// Delete oldest item.  
+// Return number of bytes freed if successful.  Return 0 if nothing to delete.
        int delete_oldest();
 // Calculate current size of cache in bytes
        int64_t get_memory_usage();
index 72d8a906544c86c63ab63b2f1d94ea5c9e675b93..e07dd33923c9e4a04c1da01e982f955715cedce9 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -332,8 +332,8 @@ void Canvas::get_transfers(EDL *edl,
        float &canvas_x1, float &canvas_y1, float &canvas_x2, float &canvas_y2,
        int canvas_w, int canvas_h)
 {
-// printf("Canvas::get_transfers %d %d\n", canvas_w,
-//             canvas_h);
+//printf("Canvas::get_transfers %d canvas_w=%d canvas_h=%d\n", 
+// __LINE__,  canvas_w, canvas_h);
 // automatic canvas size detection
        if(canvas_w < 0) canvas_w = get_canvas()->get_w();
        if(canvas_h < 0) canvas_h = get_canvas()->get_h();
@@ -430,6 +430,11 @@ void Canvas::get_transfers(EDL *edl,
                        {
                                out_h = (int)(out_w / edl->get_aspect_ratio() + 0.5);
                                canvas_y1 = canvas_h / 2 - out_h / 2;
+// printf("Canvas::get_transfers %d canvas_h=%d out_h=%f canvas_y1=%f\n",
+// __LINE__,
+// canvas_h,
+// out_h,
+// canvas_y1);
                        }
                        canvas_x2 = canvas_x1 + out_w;
                        canvas_y2 = canvas_y1 + out_h;
@@ -459,7 +464,8 @@ void Canvas::get_transfers(EDL *edl,
        canvas_y1 = MAX(0, canvas_y1);
        canvas_x2 = MAX(canvas_x1, canvas_x2);
        canvas_y2 = MAX(canvas_y1, canvas_y2);
-// printf("Canvas::get_transfers 2 %f,%f %f,%f -> %f,%f %f,%f\n",
+// printf("Canvas::get_transfers %d %f,%f %f,%f -> %f,%f %f,%f\n",
+// __LINE__,
 // output_x1,
 // output_y1,
 // output_x2,
@@ -853,8 +859,8 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame)
 
        if( refresh_frame &&
           (refresh_frame->get_w() != device->out_w ||
-           refresh_frame->get_h() != device->out_h ||
-           refresh_frame->get_color_model() != best_color_model) ) {
+           refresh_frame->get_h() != device->out_h ) ) {
+// x11 direct render uses BC_BGR8888, use tranfer_from to remap
                delete refresh_frame;  refresh_frame = 0;
        }
 
@@ -872,7 +878,7 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame)
                get_canvas()->lock_window(" Canvas::output_refresh");
        }
        else
-               refresh_frame->copy_from(output_frame);
+               refresh_frame->transfer_from(output_frame);
 }
 
 
index b96be4f354bd539577d375e2044c1f715ded1863..a044338e459e357445256cbcbf339958d87da1b5 100644 (file)
@@ -1773,9 +1773,10 @@ void ChannelInfo::delete_batch()
 }
 
 ChannelScan::ChannelScan(MWindow *mwindow)
- : BC_MenuItem(_("Scan..."), _("Shift-S"), 'S')
+ : BC_MenuItem(_("Scan..."), _("Ctrl-Alt-s"), 's')
 {
-       set_shift();
+       set_ctrl();
+       set_alt();
        this->mwindow = mwindow;
 }
 
index 602fbbd03802354f344e7e57026ee571973eb82d..2f9df23c98be119a07287adaf934e185d89459aa 100644 (file)
@@ -141,7 +141,8 @@ int ClipPopupInfo::handle_event()
        popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0);
 
        if( mwindow->session->drag_assets->total ) {
-               mwindow->awindow->asset_edit->edit_asset(
+               AssetEdit *asset_edit = mwindow->awindow->get_asset_editor();
+               asset_edit->edit_asset(
                        mwindow->session->drag_assets->values[0], cur_x, cur_y);
        }
        else
index 5c43fb93da1c49afe173a8970e5e0710cd26925e..a95f6ef381089faefa14f756fad665c6f3e33be1 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "bcbutton.h"
 #include "bccapture.h"
+#include "bccolors.h"
 #include "bcdisplayinfo.h"
 #include "colorpicker.h"
 #include "condition.h"
@@ -28,7 +29,7 @@
 #include "language.h"
 #include "mutex.h"
 #include "mwindow.h"
-#include "cicolors.h"
+#include "bccolors.h"
 #include "vframe.h"
 
 #include <string.h>
index 24a515fa83a3f3ec6009ab7211651dab01990545..20eff1207d05532fca714077f2b5c8c4b049bf72 100644 (file)
@@ -604,7 +604,7 @@ int CWindowGUI::drag_stop()
                if(mwindow->session->drag_assets->total)
                {
                        mwindow->gui->lock_window("CWindowGUI::drag_stop 1");
-                       mwindow->clear(0);
+                       mwindow->clear(0, 1);
                        mwindow->load_assets(mwindow->session->drag_assets,
                                mwindow->edl->local_session->get_selectionstart(),
                                LOADMODE_PASTE,
@@ -619,7 +619,7 @@ int CWindowGUI::drag_stop()
                if(mwindow->session->drag_clips->total)
                {
                        mwindow->gui->lock_window("CWindowGUI::drag_stop 2");
-                       mwindow->clear(0);
+                       mwindow->clear(0, 1);
                        mwindow->paste_edls(mwindow->session->drag_clips,
                                LOADMODE_PASTE,
                                mwindow->session->track_highlighted,
@@ -2167,15 +2167,24 @@ int CWindowCanvas::do_eyedrop(int &rerender, int button_press, int draw)
        float blue = (float)*row++ / max; \
        if(do_yuv) \
        { \
-               mwindow->edl->local_session->red += red + V_TO_R * (blue - 0.5); \
-               mwindow->edl->local_session->green += red + U_TO_G * (green - 0.5) + V_TO_G * (blue - 0.5); \
-               mwindow->edl->local_session->blue += red + U_TO_B * (green - 0.5); \
+               float r = red + V_TO_R * (blue - 0.5); \
+               float g = red + U_TO_G * (green - 0.5) + V_TO_G * (blue - 0.5); \
+               float b = red + U_TO_B * (green - 0.5); \
+               mwindow->edl->local_session->red += r; \
+               mwindow->edl->local_session->green += g; \
+               mwindow->edl->local_session->blue += b; \
+               if(r > mwindow->edl->local_session->red_max) mwindow->edl->local_session->red_max = r; \
+               if(g > mwindow->edl->local_session->green_max) mwindow->edl->local_session->green_max = g; \
+               if(b > mwindow->edl->local_session->blue_max) mwindow->edl->local_session->blue_max = b; \
        } \
        else \
        { \
                mwindow->edl->local_session->red += red; \
                mwindow->edl->local_session->green += green; \
                mwindow->edl->local_session->blue += blue; \
+               if(red > mwindow->edl->local_session->red_max) mwindow->edl->local_session->red_max = red; \
+               if(green > mwindow->edl->local_session->green_max) mwindow->edl->local_session->green_max = green; \
+               if(blue > mwindow->edl->local_session->blue_max) mwindow->edl->local_session->blue_max = blue; \
        } \
 }
 
@@ -2184,6 +2193,9 @@ int CWindowCanvas::do_eyedrop(int &rerender, int button_press, int draw)
                        mwindow->edl->local_session->red = 0;
                        mwindow->edl->local_session->green = 0;
                        mwindow->edl->local_session->blue = 0;
+                       mwindow->edl->local_session->red_max = 0;
+                       mwindow->edl->local_session->green_max = 0;
+                       mwindow->edl->local_session->blue_max = 0;
                        for(int i = row1; i < row2; i++)
                        {
                                for(int j = column1; j < column2; j++)
index d73a265b5727d15d3e4391d479ea21845ddc57b4..73f1f23254a5925e7d1e4e28a8f647e4f25bd2fd 100644 (file)
@@ -1,7 +1,6 @@
-
 /*
  * CINELERRA
- * Copyright (C) 2008-2014 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +22,7 @@
 #include <stdint.h>
 
 #include "automation.h"
-#include "cicolors.h"
+#include "bccolors.h"
 #include "clip.h"
 #include "condition.h"
 #include "cpanel.h"
@@ -461,7 +460,7 @@ void CWindowCropGUI::update()
 
 
 CWindowEyedropGUI::CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread)
- : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Color"), 220, 250)
+ : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Color"), 220, 290)
 {
 }
 
@@ -514,6 +513,8 @@ void CWindowEyedropGUI::create_objects()
 
        y = title6->get_y() + this->v->get_h() + 2*margin;
        add_subwindow(sample = new BC_SubWindow(x, y, 50, 50));
+       y += sample->get_h() + margin;
+       add_subwindow(use_max = new CWindowEyedropCheckBox(mwindow, this, x, y));
        update();
        unlock_window();
 }
@@ -528,27 +529,28 @@ void CWindowEyedropGUI::update()
 
        radius->update((int64_t)mwindow->edl->session->eyedrop_radius);
 
-       float r = mwindow->edl->local_session->red;
-       float g = mwindow->edl->local_session->green;
-       float b = mwindow->edl->local_session->blue;
-       red->update(r);
-       green->update(g);
-       blue->update(b);
+       LocalSession *local_session = mwindow->edl->local_session;
+       int use_max = local_session->use_max;
+       float r = use_max ? local_session->red_max : local_session->red;
+       float g = use_max ? local_session->green_max : local_session->green;
+       float b = use_max ? local_session->blue_max : local_session->blue;
+       this->red->update(r);
+       this->green->update(g);
+       this->blue->update(b);
+
        int rx = 255*r + 0.5;  bclamp(rx,0,255);
        int gx = 255*g + 0.5;  bclamp(gx,0,255);
        int bx = 255*b + 0.5;  bclamp(bx,0,255);
        char rgb_text[BCSTRLEN];
        sprintf(rgb_text, "#%02x%02x%02x", rx, gx, bx);
        rgb_hex->update(rgb_text);
-
+       
        float y, u, v;
-       YUV::rgb_to_yuv_f(mwindow->edl->local_session->red,
-               mwindow->edl->local_session->green,
-               mwindow->edl->local_session->blue,
-               y, u, v);
+       YUV::rgb_to_yuv_f(r, g, b, y, u, v);
        this->y->update(y);
        this->u->update(u);  u += 0.5;
        this->v->update(v);  v += 0.5;
+
        int yx = 255*y + 0.5;  bclamp(yx,0,255);
        int ux = 255*u + 0.5;  bclamp(ux,0,255);
        int vx = 255*v + 0.5;  bclamp(vx,0,255);
@@ -690,6 +692,23 @@ int CWindowCurveToggle::handle_event()
 }
 
 
+CWindowEyedropCheckBox::CWindowEyedropCheckBox(MWindow *mwindow, 
+       CWindowEyedropGUI *gui, int x, int y)
+ : BC_CheckBox(x, y, mwindow->edl->local_session->use_max, _("Use maximum"))
+{
+       this->mwindow = mwindow;
+       this->gui = gui;
+}
+
+int CWindowEyedropCheckBox::handle_event()
+{
+       mwindow->edl->local_session->use_max = get_value();
+       
+       gui->update();
+       return 1;
+}
+
+
 CWindowCameraGUI::CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow,
        thread,
index 651627e0860f8206d12aac83fa23f4edbb3b274b..9361034200c5977c233984da6fe3d38c36049565 100644 (file)
@@ -253,7 +253,7 @@ public:
 };
 
 
-
+class CWindowEyedropCheckBox;
 class CWindowEyedropGUI : public CWindowToolGUI
 {
 public:
@@ -266,12 +266,27 @@ public:
 
        BC_Title *current;
        CWindowCoord *radius;
+       CWindowEyedropCheckBox *use_max;
        BC_Title *red, *green, *blue, *y, *u, *v;
        BC_Title *rgb_hex, *yuv_hex;
        BC_SubWindow *sample;
 };
 
 
+class CWindowEyedropCheckBox : public BC_CheckBox
+{
+public:
+       CWindowEyedropCheckBox(MWindow *mwindow, 
+               CWindowEyedropGUI *gui,
+               int x, 
+               int y);
+
+       int handle_event();
+       MWindow *mwindow;
+       CWindowEyedropGUI *gui;
+};
+
+
 
 class CWindowCameraGUI : public CWindowToolGUI
 {
index 3658922df6d816a62cc1486e396072d7900649fd..d9f55ba74d546a89eaf3f756e595d82224237a78 100644 (file)
@@ -713,13 +713,17 @@ int Edit::shift_end_out(int edit_mode,
                                next->startproject += cut_length;
                                next->startsource += cut_length;
                                next->length -= cut_length;
-//printf("Edit::shift_end_out 2 %d\n", cut_length);
+//printf("Edit::shift_end_out %d cut_length=%d\n", __LINE__, cut_length);
                        }
                        else
                        {
+//printf("Edit::shift_end_out %d cut_length=%d next->length=%d\n", __LINE__, cut_length, next->length);
                                cut_length = next->length;
+                               next->startproject += next->length;
+                               next->startsource += next->length;
                                next->length = 0;
                                length += cut_length;
+//track->dump();
                        }
                }
                else
index a8e668f844c3dedf15322cc0abc320e7600a2525..4f54457bdc6f464db93c2938b36bea968dc12b6c 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -768,7 +768,7 @@ int Edits::modify_handles(double oldposition, double newposition, int currentend
                                else
                                {
 // move end of edit out
-//printf("Edits::modify_handle 6\n");
+//printf("Edits::modify_handle %d edit_mode=%d\n", __LINE__, edit_mode);
                                        current_edit->shift_end_out(edit_mode,
                                                track->to_units(newposition, 0),
                                                track->to_units(oldposition, 0),
@@ -843,3 +843,124 @@ void Edits::shift_effects_recursive(int64_t position, int64_t length, int edit_a
        track->shift_effects(position, length, edit_autos);
 }
 
+// only used for audio but also used for plugins which inherit from Edits
+void Edits::deglitch(int64_t position)
+{
+// range from the splice junk appears
+       int64_t threshold = (int64_t)((double)edl->session->sample_rate / 
+               edl->session->frame_rate) / 2;
+       Edit *current = 0;
+
+// the last edit before the splice
+       Edit *edit1 = 0;
+       if(first)
+       {
+               for(current = first; current; current = NEXT)
+               {
+                       if(current->startproject + current->length >= position - threshold)
+                       {
+                               edit1 = current;
+                               break;
+                       }
+               }
+
+// ignore if it ends after the splice
+               if(current && current->startproject + current->length >= position)
+               {
+                       edit1 = 0;
+               }
+       }
+
+// the first edit after the splice
+       Edit *edit2 = 0;
+       if(last)
+       {
+               for(current = last; current; current = PREVIOUS)
+               {
+                       if(current->startproject < position + threshold)
+                       {
+                               edit2 = current;
+                               break;
+                       }
+               }
+
+       // ignore if it starts before the splice
+               if(current && current->startproject < position)
+               {
+                       edit2 = 0;
+               }
+       }
+
+
+
+
+// printf("Edits::deglitch %d position=%ld edit1=%p edit2=%p\n", __LINE__,
+// position, 
+// edit1, 
+// edit2);
+// delete junk between the edits
+       if(edit1 != edit2)
+       {
+               if(edit1 != 0)
+               {
+// end the starting edit later
+                       current = edit1->next;
+                       while(current != 0 &&
+                               current != edit2 &&
+                               current->startproject < position)
+                       {
+                               Edit* next = NEXT;
+
+                               edit1->length += current->length;
+                               remove(current);
+
+                               current = next;
+                       }
+               }
+               
+               if(edit2 != 0)
+               {
+// start the ending edit earlier
+                       current = edit2->previous;
+                       while(current != 0 && 
+                               current != edit1 &&
+                               current->startproject >= position)
+                       {
+                               Edit *previous = PREVIOUS;
+
+                               int64_t length = current->length;
+//printf("Edits::deglitch %d length=%ld\n", __LINE__, length);
+                               if(!edit2->silence() && 
+                                       length > edit2->startsource)
+                               {
+                                       length = edit2->startsource;
+                               }
+
+                               // shift edit2 by using material from its source
+                               edit2->startproject -= length;
+                               edit2->startsource -= length;
+                               // assume enough is at the end
+                               edit2->length += length;
+
+                               // shift edit2 & its source earlier by remainder
+                               if(length < current->length)
+                               {
+                                       int64_t remainder = current->length - length;
+                                       edit2->startproject -= remainder;
+                                       // assume enough is at the end
+                                       edit2->length += remainder;
+                               }
+
+                               remove(current);
+
+
+                               current = previous;
+                       }
+               }
+       }
+       
+}
+
+
+
+
index d35917c71127c831c268ff7bf0a85df70eeb21ff..040c6bfa4cba746101b9d4269e3f12edf41106c4 100644 (file)
@@ -123,6 +123,7 @@ public:
                int edit_plugins,
                int edit_autos,
                Edits *trim_edits);
+       void deglitch(int64_t position);
        virtual int optimize();
 
        virtual int clone_derived(Edit* new_edit, Edit* old_edit) { return 0; }
index d6810aa763b05bd779b34a4a3c441c648aa381bf..cd20a7b0d56e570d3a36de7b47bd6315fcff947e 100644 (file)
@@ -808,12 +808,23 @@ void EDL::set_outpoint(double position)
        }
 }
 
+void EDL::deglitch(double position)
+{
+       if( !session->cursor_on_frames ) return;
+       Track *current_track = tracks->first; 
+       for( ; current_track; current_track=current_track->next ) {
+               if( !current_track->record ) continue;
+               if( current_track->data_type != TRACK_AUDIO ) continue;
+               ATrack *atrack = (ATrack*)current_track;
+               atrack->deglitch(position, 
+                       session->labels_follow_edits, 
+                       session->plugins_follow_edits, 
+                       session->autos_follow_edits);
+       }
+}
 
-int EDL::clear(double start,
-       double end,
-       int clear_labels,
-       int clear_plugins,
-       int edit_autos)
+int EDL::clear(double start, double end,
+       int clear_labels, int clear_plugins, int edit_autos)
 {
        if(start == end)
        {
index 3b1d22538726dad9422534d3fcc430cd33b8f194..45740cdf05f2ec9a6f412a9a17d006d57d15d89e 100644 (file)
@@ -189,6 +189,7 @@ public:
                int clear_labels,
                int clear_plugins,
                int edit_autos);
+       void deglitch(double position);
 // Insert the asset at a point in the EDL
        void insert_asset(Asset *asset,
                EDL *nested_edl,
index 0b6f218a4961d3e0b15c2cbbebd2f0173847f358..337d4bd4c5a2c7cd95d9ce19192aca743da04f17 100644 (file)
@@ -48,9 +48,9 @@ class EDL;
 #define EDIT_HANDLE_MODES 3
 
 // Behavior for the edit handles based on mouse button
-#define MOVE_ALL_EDITS 0
-#define MOVE_ONE_EDIT 1
-#define MOVE_NO_EDITS 2
+#define MOVE_ALL_EDITS 0 // default for left button
+#define MOVE_ONE_EDIT 1 // default for middle button
+#define MOVE_NO_EDITS 2 // default for right button
 #define MOVE_EDITS_DISABLED 3
 
 // AWindow folders
index 5876b9198bc96b101da278af04e160d8c5b056f6..d4c6df80aa43a408b0cf09036321eed29be1044a 100644 (file)
@@ -116,15 +116,15 @@ EDLSession::EDLSession(EDL *edl)
        record_write_length = 131072;
        record_realtime_toc = 1;
 
-        safe_regions = 0;
+       safe_regions = 0;
        sample_rate = 48000;
-        scrub_speed = 2.;
-        show_assets = 1;
-        show_titles = 1;
+       scrub_speed = 2.;
+       show_assets = 1;
+       show_titles = 1;
        test_playback_edits = 1;
        time_format = TIME_HMSF;
-        nudge_format = 1;
-        tool_window = 0;
+       nudge_format = 1;
+       tool_window = 0;
        for(int i = 0; i < MAXCHANNELS; i++) {
                vchannel_x[i] = 64*i;
                vchannel_y[i] = 0;
@@ -133,13 +133,13 @@ EDLSession::EDLSession(EDL *edl)
        aconfig_in = new AudioInConfig;
        vconfig_in = new VideoInConfig;
        recording_format = new Asset;
-        video_every_frame = 0;
-        video_asynchronous = 0;
+       video_every_frame = 0;
+//     video_asynchronous = 0;
        video_tracks = 1;
        video_write_length = 30;
-        view_follows_playback = 1;
-        vwindow_meter = 0;
-        vwindow_zoom = 1.;
+       view_follows_playback = 1;
+       vwindow_meter = 0;
+       vwindow_zoom = 1.;
 
        playback_config = new PlaybackConfig;
 }
@@ -159,7 +159,7 @@ int EDLSession::need_rerender(EDLSession *ptr)
        return ((playback_preload != ptr->playback_preload) ||
                (interpolation_type != ptr->interpolation_type) ||
                (video_every_frame != ptr->video_every_frame) ||
-               (video_asynchronous != ptr->video_asynchronous) ||
+//             (video_asynchronous != ptr->video_asynchronous) ||
                (real_time_playback != ptr->real_time_playback) ||
                (playback_software_position != ptr->playback_software_position) ||
                (test_playback_edits != ptr->test_playback_edits) ||
@@ -167,7 +167,9 @@ int EDLSession::need_rerender(EDLSession *ptr)
                (decode_subtitles != ptr->decode_subtitles) ||
                (subtitle_number != ptr->subtitle_number) ||
                (interpolate_raw != ptr->interpolate_raw) ||
-               (white_balance_raw != ptr->white_balance_raw));
+               (white_balance_raw != ptr->white_balance_raw) ||
+               (proxy_scale != ptr->proxy_scale) ||
+               (proxy_use_scaler != ptr->proxy_use_scaler));
 }
 
 void EDLSession::equivalent_output(EDLSession *session, double *result)
@@ -328,7 +330,7 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        }
        video_channels = defaults->get("VCHANNELS", video_channels);
        video_every_frame = defaults->get("VIDEO_EVERY_FRAME", 0);
-       video_asynchronous = defaults->get("VIDEO_ASYNCHRONOUS", 0);
+//     video_asynchronous = defaults->get("VIDEO_ASYNCHRONOUS", 0);
        video_tracks = defaults->get("VTRACKS", video_tracks);
        video_write_length = defaults->get("VIDEO_WRITE_LENGTH", 30);
        view_follows_playback = defaults->get("VIEW_FOLLOWS_PLAYBACK", 1);
@@ -441,7 +443,7 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("SAFE_REGIONS", safe_regions);
        defaults->update("SAMPLERATE", sample_rate);
        defaults->update("SCRUB_SPEED", scrub_speed);
-       defaults->update("SI_USEDURATION",si_useduration);
+       defaults->update("SI_USEDURATION",si_useduration);
        defaults->update("SI_DURATION",si_duration);
        defaults->update("SHOW_ASSETS", show_assets);
        defaults->update("SHOW_TITLES", show_titles);
@@ -458,7 +460,7 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        }
        defaults->update("VCHANNELS", video_channels);
        defaults->update("VIDEO_EVERY_FRAME", video_every_frame);
-       defaults->update("VIDEO_ASYNCHRONOUS", video_asynchronous);
+//     defaults->update("VIDEO_ASYNCHRONOUS", video_asynchronous);
        defaults->update("VTRACKS", video_tracks);
        defaults->update("VIDEO_WRITE_LENGTH", video_write_length);
        defaults->update("VIEW_FOLLOWS_PLAYBACK", view_follows_playback);
@@ -723,7 +725,7 @@ int EDLSession::save_video_config(FileXML *file)
        file->tag.set_property("COLORMODEL", string);
        ilacemode_to_xmltext(string, interlace_mode);
        file->tag.set_property("INTERLACE_MODE",string);
-    file->tag.set_property("CHANNELS", video_channels);
+       file->tag.set_property("CHANNELS", video_channels);
        for(int i = 0; i < video_channels; i++)
        {
                sprintf(string, "VCHANNEL_X_%d", i);
@@ -872,7 +874,7 @@ int EDLSession::copy(EDLSession *session)
        video_channels = session->video_channels;
        *vconfig_in = *session->vconfig_in;
        video_every_frame = session->video_every_frame;
-       video_asynchronous = session->video_asynchronous;
+//     video_asynchronous = session->video_asynchronous;
        video_tracks = session->video_tracks;
        video_write_length = session->video_write_length;
        view_follows_playback = session->view_follows_playback;
index d5d610ee742dc6a68edd5d9a61b630ae5953f0b6..89748b6550fcfad693445a0326f1b4cf3ba0b120 100644 (file)
@@ -214,7 +214,7 @@ public:
 // play every frame
        int video_every_frame;
 // decode video asynchronously
-       int video_asynchronous;
+//     int video_asynchronous;
        int video_tracks;
 // number of frames to write to disk at a time during video recording.
        int video_write_length;
index e031dcdbac7f19e184954f828683cb3eaf386a2a..1b4e100dfec252dc7295cedafa093a690bba07c5 100644 (file)
@@ -328,6 +328,8 @@ int FFStream::decode_activate()
                                if( decoder->capabilities & AV_CODEC_CAP_DR1 )
                                        avctx->flags |= CODEC_FLAG_EMU_EDGE;
                                avcodec_parameters_to_context(avctx, st->codecpar);
+                               if( !av_dict_get(copts, "threads", NULL, 0) )
+                                       avctx->thread_count = ffmpeg->ff_cpus();
                                ret = avcodec_open2(avctx, decoder, &copts);
                        }
                        if( ret >= 0 ) {
@@ -2001,6 +2003,8 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                av_dict_set(&sopts, "cin_bitrate", 0, 0);
                av_dict_set(&sopts, "cin_quality", 0, 0);
 
+               if( !av_dict_get(sopts, "threads", NULL, 0) )
+                       ctx->thread_count = ff_cpus();
                ret = avcodec_open2(ctx, codec, &sopts);
                if( ret >= 0 ) {
                        ret = avcodec_parameters_from_context(st->codecpar, ctx);
@@ -2682,6 +2686,8 @@ int FFMPEG::scan(IndexState *index_state, int64_t *scan_position, int *canceled)
                }
                if( ret >= 0 ) {
                        avcodec_parameters_to_context(avctx, st->codecpar);
+                       if( !av_dict_get(copts, "threads", NULL, 0) )
+                               avctx->thread_count = ff_cpus();
                        ret = avcodec_open2(avctx, decoder, &copts);
                }
                av_dict_free(&copts);
index 0fb926b26d6601fd4e99018bf4f2f08bf1f19664..4b9c1be85a5ccc60c4544442de152593834e2b7b 100644 (file)
@@ -75,6 +75,7 @@
 #include "samples.h"
 #include "vframe.h"
 
+//static int temp_debug = 0;
 //suppress noref warning
 void *vorbis0_ov_callbacks[] = {
  &OV_CALLBACKS_DEFAULT, &OV_CALLBACKS_NOCLOSE,
@@ -99,8 +100,10 @@ File::~File()
                format_completion->unlock();
        }
 
-       if( temp_frame ) delete temp_frame;
-
+       if( temp_frame ) {
+//printf("File::~File %d temp_debug=%d\n", __LINE__, --temp_debug);
+               delete temp_frame;
+       }
 
        close_file(0);
 
@@ -298,7 +301,6 @@ void File::set_white_balance_raw(int value)
        this->white_balance_raw = value;
 }
 
-
 void File::set_cache_frames(int value)
 {
 // caching only done locally
@@ -319,7 +321,7 @@ int File::purge_cache()
 
 int File::delete_oldest()
 {
-// caching only done locally
+// return the number of bytes freed
        return frame_cache->delete_oldest();
 }
 
@@ -474,8 +476,6 @@ int File::open_file(Preferences *preferences,
        this->wr = wr;
        file = 0;
 
-       if( debug ) printf("File::open_file %d\n", __LINE__);
-
        if( debug ) printf("File::open_file %p %d\n", this, __LINE__);
 
        switch( this->asset->format ) {
@@ -1113,14 +1113,7 @@ int File::read_frame(VFrame *frame, int is_thread)
        const int debug = 0;
 //printf("File::read_frame pos=%jd cache=%d 1frame=%d\n",
 // current_frame, use_cache, asset->single_frame);
-       if( debug ) PRINT_TRACE
-
-//printf("File::read_frame %d\n", __LINE__);
-
        if( video_thread && !is_thread ) return video_thread->read_frame(frame);
-
-//printf("File::read_frame %d\n", __LINE__);
-       if( debug ) PRINT_TRACE
        if( !file ) return 1;
        if( debug ) PRINT_TRACE
        int result = 0;
@@ -1128,6 +1121,7 @@ int File::read_frame(VFrame *frame, int is_thread)
        int advance_position = 1;
        int cache_active = use_cache || asset->single_frame ? 1 : 0;
        int64_t cache_position = !asset->single_frame ? current_frame : -1;
+
 // Test cache
        if( cache_active && frame_cache->get_frame(frame, cache_position,
                        current_layer, asset->frame_rate) ) {
@@ -1138,8 +1132,9 @@ int File::read_frame(VFrame *frame, int is_thread)
 // Need temp
        else if( frame->get_color_model() != BC_COMPRESSED &&
                (supported_colormodel != frame->get_color_model() ||
-               frame->get_w() != asset->width ||
-               frame->get_h() != asset->height) ) {
+               (!file->can_scale_input() &&
+                       (frame->get_w() != asset->width ||
+                        frame->get_h() != asset->height))) ) {
 
 //                     printf("File::read_frame %d\n", __LINE__);
 // Can't advance position here because it needs to be added to cache
@@ -1150,14 +1145,8 @@ int File::read_frame(VFrame *frame, int is_thread)
                        }
                }
 
-//                     printf("File::read_frame %d\n", __LINE__);
                if( !temp_frame ) {
-                       temp_frame = new VFrame(0,
-                               -1,
-                               asset->width,
-                               asset->height,
-                               supported_colormodel,
-                               -1);
+                       temp_frame = new VFrame(asset->width, asset->height, supported_colormodel);
                }
 
 //                     printf("File::read_frame %d\n", __LINE__);
@@ -1191,10 +1180,7 @@ int File::read_frame(VFrame *frame, int is_thread)
        return 0;
 }
 
-int File::can_copy_from(Asset *asset,
-       int64_t position,
-       int output_w,
-       int output_h)
+int File::can_copy_from(Asset *asset, int64_t position, int output_w, int output_h)
 {
        if( asset && file ) {
                return asset->width == output_w &&
index 4d80870ac3db729d1f7f9f5e19d243e2f1e4a319..f62739e0990b23605f1ac0ff3d1c86867daacde9 100644 (file)
@@ -86,8 +86,9 @@ public:
 // to delete the file object.  Otherwise we'd delete just the cached frames
 // while the list of open files grew.
        void set_cache_frames(int value);
-// Delete frame cache.  Return 0 if successful.  Return 1 if
-// nothing to delete.
+// Delete oldest frame from cache.
+// Return number of bytes freed if successful.
+// Return 0 if nothing to delete.
        int purge_cache();
 // Delete oldest frame from cache.  Return 0 if successful.  Return 1 if
 // nothing to delete.
index 3555e1e267f9a2f0bf69c0c1d7ac73bf16cd99e0..1fc58c0b28b99260926f7a75ab2a7f6da444feff 100644 (file)
@@ -127,6 +127,7 @@ public:
        virtual int colormodel_supported(int colormodel) { return BC_RGB888; }
 // This file can copy compressed frames directly from the asset
        virtual int can_copy_from(Asset *asset, int64_t position) { return 0; }
+       virtual int can_scale_input() { return 0; }
        virtual int get_render_strategy(ArrayList<int>* render_strategies) { return VRENDER_VPIXEL; }
 
 // Manages an audio history buffer
index 99fa71193af683c2df5194f7f67911ccf2bfeea9..f3f535681234e3bbefe1a17d841eae4443458c55 100644 (file)
@@ -338,33 +338,13 @@ int FileFFMPEG::colormodel_supported(int colormodel)
 int FileFFMPEG::get_best_colormodel(Asset *asset, int driver)
 {
        switch(driver) {
-       case PLAYBACK_X11:
-               return BC_RGB888;
-       case PLAYBACK_X11_XV:
-       case PLAYBACK_ASYNCHRONOUS:
-               return BC_YUV888;
-       case PLAYBACK_X11_GL:
-               return BC_YUV888;
-       case PLAYBACK_DV1394:
-       case PLAYBACK_FIREWIRE:
-               return BC_YUV422P;
-       case VIDEO4LINUX2:
-               return BC_RGB888;
-       case VIDEO4LINUX2JPEG:
-               return BC_COMPRESSED;
-       case CAPTURE_DVB:
-       case VIDEO4LINUX2MPEG:
-               return BC_YUV422P;
-       case CAPTURE_JPEG_WEBCAM:
-               return BC_COMPRESSED;
-       case CAPTURE_YUYV_WEBCAM:
-               return BC_YUV422;
-       case CAPTURE_FIREWIRE:
-       case CAPTURE_IEC61883:
-               return BC_YUV422P;
+// the direct X11 color model requires scaling in the codec
+       case PLAYBACK_X11: return BC_BGR8888;
+//     case PLAYBACK_X11: return BC_RGB888;
+       case PLAYBACK_X11_GL: return BC_RGB888;
        }
 
-       return BC_RGB888;
+       return BC_YUV420P;
 }
 
 int FileFFMPEG::can_render(const char *fformat, const char *type)
index 51e191519918e39ec73ac3f343c526dff462da1a..973cde15c847ff8f42eb48b624732a94311f522e 100644 (file)
@@ -50,6 +50,7 @@ public:
        int write_frames(VFrame ***frames,int len);
        int read_samples(double *buffer,int64_t len);
        int read_frame(VFrame *frame);
+       int can_scale_input() { return 1; }
        int64_t get_memory_usage(void);
        int colormodel_supported(int colormodel);
        static int get_best_colormodel(Asset *asset, int driver);
index e3f57bb85c5dc500a929bbf4cc5aafacdd1c5a0d..3abfa99fad9515309f4a7a67990da2bd8ba12bd2 100644 (file)
@@ -163,6 +163,59 @@ int FileJPEG::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
                frame->get_color_model(),
                1);
 
+// insert spherical tag
+       if(asset->jpeg_sphere)
+       {
+               const char *sphere_tag = 
+                       "http://ns.adobe.com/xap/1.0/\x00<?xpacket begin='\xef\xbb\xbf' id='W5M0MpCehiHzreSzNTczkc9d'?>\n"
+                       "<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::Cinelerra'>\n"
+                       "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\n"
+                       "\n"
+                       " <rdf:Description rdf:about=''\n"
+                       "  xmlns:GPano='http://ns.google.com/photos/1.0/panorama/'>\n"
+                       "  <GPano:ProjectionType>equirectangular</GPano:ProjectionType>\n"
+                       " </rdf:Description>\n"
+                       "</rdf:RDF>\n"
+                       "</x:xmpmeta>\n"
+                       "<?xpacket end='w'?>";
+
+// calculate length by skipping the \x00 byte
+               int skip = 32;
+               int tag_len = strlen(sphere_tag + skip) + skip;
+               int tag_len2 = tag_len + 2;
+               int tag_len3 = tag_len + 4;
+               
+               data->allocate_compressed_data(
+                       mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor) + tag_len3);
+               data->set_compressed_size(
+                       mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor) + tag_len3);
+                       
+               int jfif_size = 0x14;
+               uint8_t *ptr = data->get_data();
+               memcpy(ptr, 
+                       mjpeg_output_buffer((mjpeg_t*)jpeg_unit->compressor), 
+                       jfif_size);
+               ptr += jfif_size;
+               *ptr++ = 0xff;
+               *ptr++ = 0xe1;
+               *ptr++ = (tag_len2 >> 8) & 0xff;
+               *ptr++ = tag_len2 & 0xff;
+               memcpy(ptr,
+                       sphere_tag,
+                       tag_len);
+               ptr += tag_len;
+               memcpy(ptr,
+                       mjpeg_output_buffer((mjpeg_t*)jpeg_unit->compressor) + jfif_size,
+                       mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor) - jfif_size);
+       }
+       else
+       {
+               data->allocate_compressed_data(mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor));
+               data->set_compressed_size(mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor));
+               memcpy(data->get_data(), 
+                       mjpeg_output_buffer((mjpeg_t*)jpeg_unit->compressor), 
+                       mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor));
+       }
        data->allocate_compressed_data(mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor));
        data->set_compressed_size(mjpeg_output_size((mjpeg_t*)jpeg_unit->compressor));
        memcpy(data->get_data(),
@@ -295,7 +348,7 @@ JPEGConfigVideo::JPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset)
        parent_window->get_abs_cursor_x(1),
        parent_window->get_abs_cursor_y(1),
        400,
-       100)
+       200)
 {
        this->parent_window = parent_window;
        this->asset = asset;
@@ -310,17 +363,13 @@ void JPEGConfigVideo::create_objects()
        int x = 10, y = 10;
        lock_window("JPEGConfigVideo::create_objects");
        add_subwindow(new BC_Title(x, y, _("Quality:")));
-       add_subwindow(new BC_ISlider(x + 80,
-               y,
-               0,
-               200,
-               200,
-               0,
-               100,
-               asset->jpeg_quality,
-               0,
-               0,
+       BC_ISlider *slider;
+       add_subwindow(slider = new BC_ISlider(x + 80, y,
+               0, 200, 200, 0, 100, asset->jpeg_quality, 0, 0,
                &asset->jpeg_quality));
+       y += slider->get_h() + 10;
+       add_subwindow(new BC_CheckBox(x, y, 
+               &asset->jpeg_sphere, _("Tag for spherical playback")));
 
        add_subwindow(new BC_OKButton(this));
        show_window(1);
index 8f79da07046bf2082b6d5112503c9bbb9b1966af..4614f3f831f40cf9e842f3be3dafd65b629448c5 100644 (file)
@@ -296,7 +296,7 @@ int FileList::read_frame(VFrame *frame)
 
                FILE *in;
 
-// Fix path for VFS
+// Fix path for VFS.  Not used anymore.
                if(!strncmp(asset->path, RENDERFARM_FS_PREFIX, strlen(RENDERFARM_FS_PREFIX)))
                        sprintf(string, "%s%s", RENDERFARM_FS_PREFIX, path);
                else
index 0526875ba4c73debd051670c56affaa60ec53fd9..8310942cb6ac158375c3a46d87193421277b343b 100644 (file)
@@ -998,7 +998,9 @@ int FileMPEG::get_best_colormodel(Asset *asset, int driver)
        switch(driver)
        {
                case PLAYBACK_X11:
-                       return BC_RGB888;
+//                     return BC_RGB888;
+// the direct X11 color model requires scaling in the codec
+                       return BC_BGR8888;
                case PLAYBACK_X11_XV:
                case PLAYBACK_ASYNCHRONOUS:
                        return zmpeg3_cmdl(asset->vmpeg_cmodel) > 0 ?
index 0c870bd10a664cef3d6bf7b2e90993d2df1abb39..9b8db9dd15ddad4f045a1a167f0926a649425d3a 100644 (file)
@@ -110,6 +110,7 @@ public:
         static const char *zmpeg3_cmdl_name(int cmdl);
 // This file can copy frames directly from the asset
        int can_copy_from(Asset *asset, int64_t position);
+       int can_scale_input() { return 1; }
 
 private:
        void to_streamchannel(int channel, int &stream_out, int &channel_out);
index 60d0b6c2905d5dce9d1295f7151dacdbcf18ebd8..7d94acdc8bda3dd592e139cc09d60efe116f94c9 100644 (file)
@@ -118,6 +118,7 @@ void FormatTools::create_objects(
        int x = init_x;
        int y = init_y;
        int ylev = init_y;
+       int margin = mwindow->theme->widget_border;
 
        this->locked_compressor = locked_compressor;
        this->recording = recording;
@@ -179,10 +180,10 @@ void FormatTools::create_objects(
 
        x = init_x;
        window->add_subwindow(format_title = new BC_Title(x, y, _("File Format:")));
-       x += 90;
+       x += format_title->get_w() + margin;
        window->add_subwindow(format_text = new BC_TextBox(x, y, 160, 1,
                File::formattostr(asset->format)));
-       x += format_text->get_w();
+       x += format_text->get_w() + margin;
 //printf("FormatTools::create_objects %d %p\n", __LINE__, window);
        window->add_subwindow(format_button = new FormatFormat(x, y, this));
        format_button->create_objects();
@@ -194,14 +195,13 @@ void FormatTools::create_objects(
        format_ffmpeg->create_objects();
        x = init_x;
        y += format_button->get_h() + 10;
-       if(do_audio)
-       {
-               window->add_subwindow(audio_title = new BC_Title(x, y, _("Audio:"), LARGEFONT,  BC_WindowBase::get_resources()->audiovideo_color));
-               x += 80;
+       if( do_audio ) {
+               window->add_subwindow(audio_title = new BC_Title(x, y, _("Audio:"), LARGEFONT,
+                       BC_WindowBase::get_resources()->audiovideo_color));
+               x += audio_title->get_w() + margin;
                window->add_subwindow(aparams_button = new FormatAParams(mwindow, this, x, y));
-               x += aparams_button->get_w() + 10;
-               if(prompt_audio)
-               {
+               x += aparams_button->get_w() + margin;
+               if(prompt_audio) {
                        window->add_subwindow(audio_switch = new FormatAudio(x, y, this, asset->audio_data));
                }
                x = init_x;
@@ -225,30 +225,27 @@ void FormatTools::create_objects(
        }
 
 //printf("FormatTools::create_objects 7\n");
-       if(do_video)
-       {
-               if(horizontal_layout && do_audio){
+       if( do_video ) {
+               if( horizontal_layout && do_audio ) {
                        x += 370;
                        y = ylev;
                }
 
 //printf("FormatTools::create_objects 8\n");
-               window->add_subwindow(video_title = new BC_Title(x, y, _("Video:"), LARGEFONT,  BC_WindowBase::get_resources()->audiovideo_color));
-               x += 80;
-               if(prompt_video_compression)
-               {
+               window->add_subwindow(video_title = new BC_Title(x, y, _("Video:"), LARGEFONT,
+                       BC_WindowBase::get_resources()->audiovideo_color));
+               x += video_title->get_w() + margin;
+               if(prompt_video_compression) {
                        window->add_subwindow(vparams_button = new FormatVParams(mwindow, this, x, y));
-                       x += vparams_button->get_w() + 10;
+                       x += vparams_button->get_w() + margin;
                }
 
 //printf("FormatTools::create_objects 9\n");
-               if(prompt_video)
-               {
+               if(prompt_video) {
                        window->add_subwindow(video_switch = new FormatVideo(x, y, this, asset->video_data));
                        y += video_switch->get_h();
                }
-               else
-               {
+               else {
                        y += vparams_button->get_h();
                }
 
index 54b1612f23fd368215e97cceacb0b388e7040620..28ff8c6f089e318ae5bb1010045105919fde02f2 100644 (file)
@@ -139,8 +139,7 @@ void KeyFrame::get_contents(BC_Hash *ptr, char **text, char **extra)
 }
 
 void KeyFrame::update_parameter(BC_Hash *params,
-       const char *text,
-       char *extra)
+       const char *text, const char *extra)
 {
        FileXML output;
        FileXML input;
index d21ae1253fe4fbae0eb84009b9624330f89d6277..29cdb3c5f8b30d7771c4e18969d3817f029a900f 100644 (file)
@@ -66,9 +66,7 @@ public:
 // extra text in a newly allocated string
        void get_contents(BC_Hash *ptr, char **text, char **extra);
 // Update a single parameter or the anonymous text depending on which argument is nonzero
-       void update_parameter(BC_Hash *params,
-               const char *text,
-               char *extra);
+       void update_parameter(BC_Hash *params, const char *text, const char *extra);
 
 private:
        char data[MESSAGESIZE];
index 197ceed992bfdf08d4c3b941084a92a8bbdf395a..8e6019f005b5924b9c0bd5b83acac55186b60124 100644 (file)
@@ -1,27 +1,29 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ * Copyright (C) 2017 Adam Williams <broadcast at earthling dot net>
+ * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *
+ * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
+ * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * 
  */
 
 #include "bchash.h"
 #include "bcsignals.h"
 #include "edl.h"
+#include "file.h"
+#include "filesystem.h"
 #include "keyframe.h"
 #include "keyframes.h"
 #include "keyframegui.h"
@@ -33,6 +35,8 @@
 #include "mwindow.h"
 #include "mwindowgui.h"
 #include "plugin.h"
+#include "preferences.h"
+#include "presets.h"
 #include "theme.h"
 #include "trackcanvas.h"
 #include "tracks.h"
@@ -46,50 +50,59 @@ KeyFrameThread::KeyFrameThread(MWindow *mwindow)
        keyframe = 0;
        keyframe_data = new ArrayList<BC_ListBoxItem*>[KEYFRAME_COLUMNS];
        plugin_title[0] = 0;
+       is_factory = 0;
+       preset_text[0] = 0;
        window_title[0] = 0;
-       column_titles[0] = (char*)_("Parameter");
-       column_titles[1] = (char*)_("Value");
+       column_titles[0] = (char*)"Parameter";
+       column_titles[1] = (char*)"Value";
        column_width[0] = 0;
        column_width[1] = 0;
+       presets_data = new ArrayList<BC_ListBoxItem*>;
+       presets_db = new PresetsDB;
 }
 
 KeyFrameThread::~KeyFrameThread()
 {
-       close_window();
-       for(int i = 0; i < KEYFRAME_COLUMNS; i++)
+       for( int i=0; i<KEYFRAME_COLUMNS; ++i )
                keyframe_data[i].remove_all_objects();
        delete [] keyframe_data;
+       presets_data->remove_all_objects();
+       delete presets_data;
+       is_factories.remove_all();
+       preset_titles.remove_all_objects();
 }
 
 
+#ifdef EDIT_KEYFRAME
 void KeyFrameThread::update_values()
 {
 // Get the current selection before deleting the tables
        int selection = -1;
-       for(int i = 0; i < keyframe_data[0].size(); i++) {
-               if(keyframe_data[0].get(i)->get_selected()) {
+       for( int i=0; i<keyframe_data[0].size(); ++i ) {
+               if( keyframe_data[0].get(i)->get_selected() ) {
                        selection = i;
                        break;
                }
        }
 
-       for(int i = 0; i < KEYFRAME_COLUMNS; i++)
+       for( int i=0; i<KEYFRAME_COLUMNS; ++i )
                keyframe_data[i].remove_all_objects();
 
 
 // Must lock main window to read keyframe
        mwindow->gui->lock_window("KeyFrameThread::update_values");
-       if(!plugin || !mwindow->edl->tracks->plugin_exists(plugin)) {
+       if( !plugin || !mwindow->edl->tracks->plugin_exists(plugin) ) {
                mwindow->gui->unlock_window();
                return;
        }
 
        KeyFrame *keyframe = 0;
-       if(this->keyframe && plugin->keyframe_exists(this->keyframe)) {
+       if( this->keyframe && plugin->keyframe_exists(this->keyframe) ) {
 // If user edited a specific keyframe, use it.
                keyframe = this->keyframe;
        }
-       else if(plugin->track) {
+       else
+       if( plugin->track ) {
 // Use currently highlighted keyframe
                keyframe = plugin->get_prev_keyframe(
                        plugin->track->to_units(
@@ -97,43 +110,62 @@ void KeyFrameThread::update_values()
                        PLAY_FORWARD);
        }
 
-       if(keyframe) {
+       if( keyframe ) {
                BC_Hash hash;
-               char *text = 0, *extra = 0;
-               keyframe->get_contents(&hash, &text, &extra);
-
-               for(int i = 0; i < hash.size(); i++)
-               {
+               char *text = 0, *data = 0;
+               keyframe->get_contents(&hash, &text, &data);
+               
+               for( int i=0; i<hash.size(); ++i ) {
                        keyframe_data[0].append(new BC_ListBoxItem(hash.get_key(i)));
                        keyframe_data[1].append(new BC_ListBoxItem(hash.get_value(i)));
                }
-               keyframe_data[0].append(new BC_ListBoxItem((char*)_("TEXT")));
-               keyframe_data[1].append(new BC_ListBoxItem(text ? text : ""));
-
+               keyframe_data[0].append(new BC_ListBoxItem((char*)"TEXT"));
+               keyframe_data[1].append(new BC_ListBoxItem(text));
+               keyframe_data[0].append(new BC_ListBoxItem((char*)"DATA"));
+               keyframe_data[1].append(new BC_ListBoxItem(data));
+               
                delete [] text;
-               delete [] extra;
+               delete [] data;
        }
 
        column_width[0] = mwindow->session->keyframedialog_column1;
        column_width[1] = mwindow->session->keyframedialog_column2;
-       if(selection >= 0 && selection < keyframe_data[0].size()) {
-               for(int i = 0; i < KEYFRAME_COLUMNS; i++)
+       if( selection >= 0 && selection < keyframe_data[0].size() ) {
+               for( int i=0; i<KEYFRAME_COLUMNS; ++i )
                        keyframe_data[i].get(selection)->set_selected(1);
        }
        mwindow->gui->unlock_window();
 }
+#endif
 
 
 void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe)
 {
 
-       if(!BC_DialogThread::is_running()) {
-               if(!mwindow->edl->tracks->plugin_exists(plugin)) return;
+       if( !BC_DialogThread::is_running() ) {
+               if( !mwindow->edl->tracks->plugin_exists(plugin) ) return;
                this->keyframe = keyframe;
                this->plugin = plugin;
                plugin->calculate_title(plugin_title, 0);
-               sprintf(window_title, _(PROGRAM_NAME ": %s Keyframe"), plugin_title);
+               sprintf(window_title, PROGRAM_NAME ": %s Keyframe", plugin_title);
+
+// Load all the presets from disk
+               char path[BCTEXTLEN];
+               FileSystem fs;
+// system wide presets
+               sprintf(path, "%s/%s", File::get_cindat_path(), FACTORY_FILE);
+               fs.complete_path(path);
+               presets_db->load_from_file(path, 1, 1);
+// user presets
+               sprintf(path, "%s/%s", File::get_config_path(), PRESETS_FILE);
+               fs.complete_path(path);
+               presets_db->load_from_file(path, 0, 0);
+
+               calculate_preset_list();
+
+#ifdef EDIT_KEYFRAME
                update_values();
+#endif
                mwindow->gui->unlock_window();
                BC_DialogThread::start();
                mwindow->gui->lock_window("KeyFrameThread::start_window");
@@ -146,24 +178,32 @@ void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe)
 BC_Window* KeyFrameThread::new_gui()
 {
        mwindow->gui->lock_window("KeyFrameThread::new_gui");
-
-       int x = mwindow->gui->get_abs_cursor_x(0) -
+       
+       int x = mwindow->gui->get_abs_cursor_x(0) - 
                mwindow->session->plugindialog_w / 2;
-       int y = mwindow->gui->get_abs_cursor_y(0) -
+       int y = mwindow->gui->get_abs_cursor_y(0) - 
                mwindow->session->plugindialog_h / 2;
 
-       KeyFrameWindow *window = new KeyFrameWindow(mwindow,
-               this, x, y, window_title);
-       window->create_objects();
+       KeyFrameWindow *window = new KeyFrameWindow(mwindow, 
+               this, 
+               x, 
+               y,
+               window_title);
 
+       window->create_objects();
+       
+       
        mwindow->gui->unlock_window();
+
        return window;
 }
 
 void KeyFrameThread::handle_done_event(int result)
 {
-       if( !result )
-               apply_value();
+// Apply the preset
+       if( !result ) {
+               apply_preset(preset_text, is_factory);
+       }
 }
 
 void KeyFrameThread::handle_close_event(int result)
@@ -172,85 +212,217 @@ void KeyFrameThread::handle_close_event(int result)
        keyframe = 0;
 }
 
+void KeyFrameThread::close_window()
+{
+       lock_window("KeyFrameThread::close_window");
+       if( get_gui() ) {
+               get_gui()->lock_window("KeyFrameThread::close_window");
+               get_gui()->set_done(1);
+               get_gui()->unlock_window();
+       }
+       unlock_window();
+}
+
+
+
+void KeyFrameThread::calculate_preset_list()
+{
+       presets_data->remove_all_objects();
+       is_factories.remove_all();
+       preset_titles.remove_all_objects();
+       int total_presets = presets_db->get_total_presets(plugin_title, 0);
+
+// sort the list
+       presets_db->sort(plugin_title);
+       
+       for( int i=0; i<total_presets; ++i ) {
+               char text[BCTEXTLEN];
+               char *orig_title = presets_db->get_preset_title( plugin_title, i);
+               if( !orig_title ) continue;
+               int is_factory = presets_db->get_is_factory(plugin_title, i);
+               sprintf(text, "%s%s", is_factory ? "*" : "", orig_title);
+               presets_data->append(new BC_ListBoxItem(text));
+
+               preset_titles.append(strdup(orig_title));
+               is_factories.append(is_factory);
+       }
+}
+
 
 void KeyFrameThread::update_gui(int update_value_text)
 {
-       if(BC_DialogThread::is_running()) {
+#ifdef EDIT_KEYFRAME
+       if( BC_DialogThread::is_running() ) {
                mwindow->gui->lock_window("KeyFrameThread::update_gui");
                update_values();
                mwindow->gui->unlock_window();
 
                lock_window("KeyFrameThread::update_gui");
                KeyFrameWindow *window = (KeyFrameWindow*)get_gui();
-               if(window) {
+               if( window ) {
                        window->lock_window("KeyFrameThread::update_gui");
                        window->keyframe_list->update(keyframe_data,
-                               (const char **)column_titles,
+                               column_titles,
                                column_width,
                                KEYFRAME_COLUMNS,
                                window->keyframe_list->get_xposition(),
                                window->keyframe_list->get_yposition(),
                                window->keyframe_list->get_highlighted_item());
-                       if( update_value_text ) {
-                               int selection_number = window->keyframe_list->get_selection_number(0, 0);
-                               if( selection_number >= 0 && selection_number < keyframe_data[1].size()) {
-                                       char *edit_value = keyframe_data[1].get(selection_number)->get_text();
-                                       window->value_text->update(edit_value);
-                               }
+                       if( update_value_text &&
+                               window->keyframe_list->get_selection_number(0, 0) >= 0 &&
+                               window->keyframe_list->get_selection_number(0, 0) < keyframe_data[1].size() ) {
+                               window->value_text->update(
+                                       keyframe_data[1].get(window->keyframe_list->get_selection_number(0, 0))->get_text());
                        }
                        window->unlock_window();
                }
                unlock_window();
        }
+#endif
+}
+
+void KeyFrameThread::save_preset(const char *title, int is_factory)
+{
+       get_gui()->unlock_window();
+       mwindow->gui->lock_window("KeyFrameThread::save_preset");
+       
+// Test EDL for plugin existence
+       if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("KeyFrameThread::save_preset 2");
+               return;
+       }
+
+// Get current plugin keyframe
+       EDL *edl = mwindow->edl;
+       Track *track = plugin->track;
+       KeyFrame *keyframe = plugin->get_prev_keyframe(
+                       track->to_units(edl->local_session->get_selectionstart(1), 0), 
+                       PLAY_FORWARD);
+
+// Send to database
+       presets_db->save_preset(plugin_title, title, keyframe->get_data());
+
+       mwindow->gui->unlock_window();
+       get_gui()->lock_window("KeyFrameThread::save_preset 2");
+
+// Update list
+       calculate_preset_list();
+       ((KeyFrameWindow*)get_gui())->preset_list->update(presets_data,
+               0, 0, 1);
+}
+
+void KeyFrameThread::delete_preset(const char *title, int is_factory)
+{
+       get_gui()->unlock_window();
+       mwindow->gui->lock_window("KeyFrameThread::save_preset");
+       
+// Test EDL for plugin existence
+       if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("KeyFrameThread::delete_preset 1");
+               return;
+       }
+
+       presets_db->delete_preset(plugin_title, title, is_factory);
+       
+       mwindow->gui->unlock_window();
+       get_gui()->lock_window("KeyFrameThread::delete_preset 2");
+
+// Update list
+       calculate_preset_list();
+       ((KeyFrameWindow*)get_gui())->preset_list->update(presets_data,
+               0, 0, 1);
 }
 
+
+void KeyFrameThread::apply_preset(const char *title, int is_factory)
+{
+       if( presets_db->preset_exists(plugin_title, title, is_factory) ) {
+               get_gui()->unlock_window();
+               mwindow->gui->lock_window("KeyFrameThread::apply_preset");
+
+// Test EDL for plugin existence
+               if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+                       mwindow->gui->unlock_window();
+                       get_gui()->lock_window("KeyFrameThread::apply_preset 1");
+                       return;
+               }
+
+               mwindow->undo->update_undo_before();
+
+#ifdef USE_KEYFRAME_SPANNING
+               KeyFrame keyframe;
+               presets_db->load_preset(plugin_title, title, &keyframe, is_factory);
+               plugin->keyframes->update_parameter(&keyframe);
+#else
+               KeyFrame *keyframe = plugin->get_keyframe();
+               presets_db->load_preset(plugin_title, title, keyframe, is_factory);
+#endif
+               mwindow->save_backup();
+               mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); 
+
+               mwindow->update_plugin_guis(0);
+               mwindow->gui->draw_overlays(1);
+               mwindow->sync_parameters(CHANGE_PARAMS);
+
+
+               update_gui(1);
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("KeyFrameThread::apply_preset");
+       }
+}
+
+#ifdef EDIT_KEYFRAME
 void KeyFrameThread::apply_value()
 {
-       const char *text = 0;
-       BC_Hash hash;
+       const char *text = 0, *data = 0;
+       BC_Hash *hash = 0;
        KeyFrameWindow *window = (KeyFrameWindow*)get_gui();
        int selection = window->keyframe_list->get_selection_number(0, 0);
 //printf("KeyFrameThread::apply_value %d %d\n", __LINE__, selection);
-       if(selection < 0) return;
-
-       if(selection == keyframe_data[0].size() - 1)
+       if( selection < 0 ) return;
+       
+       if( selection == keyframe_data[0].size() - 2 )
                text = window->value_text->get_text();
+       else if( selection == keyframe_data[0].size() - 1 )
+               data = window->value_text->get_text();
        else {
-               char *key = keyframe_data[0].get(selection)->get_text();
+               const char *key = keyframe_data[0].get(selection)->get_text();
                const char *value = window->value_text->get_text();
-               hash.update(key, value);
+               hash = new BC_Hash();
+               hash->update(key, value);
        }
 
        get_gui()->unlock_window();
        mwindow->gui->lock_window("KeyFrameThread::apply_value");
-       if(plugin && mwindow->edl->tracks->plugin_exists(plugin)) {
+       if( plugin && mwindow->edl->tracks->plugin_exists(plugin) ) {
                mwindow->undo->update_undo_before();
-               if(mwindow->session->keyframedialog_all) {
+               if( mwindow->session->keyframedialog_all ) {
 // Search for all keyframes in selection but don't create a new one.
                        Track *track = plugin->track;
                        int64_t start = track->to_units(mwindow->edl->local_session->get_selectionstart(0), 0);
                        int64_t end = track->to_units(mwindow->edl->local_session->get_selectionend(0), 0);
                        int got_it = 0;
-                       for(KeyFrame *current = (KeyFrame*)plugin->keyframes->last;
-                               current;
-                               current = (KeyFrame*)PREVIOUS) {
+                       KeyFrame *current = (KeyFrame*)plugin->keyframes->last;
+                       for( ; current; current=(KeyFrame*)PREVIOUS ) {
                                got_it = 1;
-                               if(current && current->position < end) {
-                                       current->update_parameter(&hash, text, 0);
+                               if( current && current->position < end ) {
+                                   current->update_parameter(hash, text, data);
 // Stop at beginning of range
-                                       if(current->position <= start) break;
+                                       if( current->position <= start ) break;
                                }
                        }
 
-                       if(!got_it) {
-                               KeyFrame* keyframe = (KeyFrame*)plugin->keyframes->default_auto;
-                               keyframe->update_parameter(&hash, text, 0);
+                       if( !got_it ) {
+                               current = (KeyFrame*)plugin->keyframes->default_auto;
+                               current->update_parameter(hash, text, data);
                        }
                }
                else {
 // Create new keyframe if enabled
                        KeyFrame *keyframe = plugin->get_keyframe();
-                       keyframe->update_parameter(&hash, text, 0);
+                       keyframe->update_parameter(hash, text, data);
                }
        }
        else {
@@ -258,28 +430,37 @@ printf("KeyFrameThread::apply_value %d: plugin doesn't exist\n", __LINE__);
        }
 
        mwindow->save_backup();
-       mwindow->undo->update_undo_after(_("edit keyframe"), LOAD_AUTOMATION);
+       mwindow->undo->update_undo_after(_("edit keyframe"), LOAD_AUTOMATION); 
 
        mwindow->update_plugin_guis(0);
        mwindow->gui->draw_overlays(1);
        mwindow->sync_parameters(CHANGE_PARAMS);
-
-
-
        mwindow->gui->unlock_window();
 
        update_gui(0);
 
        get_gui()->lock_window("KeyFrameThread::apply_value");
+       delete hash;
 }
+#endif
+
 
 
 KeyFrameWindow::KeyFrameWindow(MWindow *mwindow,
-       KeyFrameThread *thread, int x, int y, char *title_string)
- : BC_Window(title_string, x, y,
-       mwindow->session->keyframedialog_w,
-       mwindow->session->keyframedialog_h,
-       320, 240, 1, 0, 1)
+       KeyFrameThread *thread,
+       int x,
+       int y,
+       char *title_string)
+ : BC_Window(title_string, 
+       x,
+       y,
+       mwindow->session->keyframedialog_w, 
+       mwindow->session->keyframedialog_h, 
+       320, 
+       240,
+       1,
+       0,
+       1)
 {
        this->mwindow = mwindow;
        this->thread = thread;
@@ -294,29 +475,104 @@ void KeyFrameWindow::create_objects()
        thread->column_width[1] = mwindow->session->keyframedialog_column2;
        lock_window("KeyFrameWindow::create_objects");
 
+#ifdef EDIT_KEYFRAME
+
+
        add_subwindow(title1 = new BC_Title(theme->keyframe_list_x,
-               theme->keyframe_list_y -
-                       BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) -
+               theme->keyframe_list_y - 
+                       BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - 
                        theme->widget_border,
-               _("Keyframe parameters:"), LARGEFONT));
+               _("Keyframe parameters:"),
+               LARGEFONT));
        add_subwindow(keyframe_list = new KeyFrameList(thread,
-               this, theme->keyframe_list_x, theme->keyframe_list_y,
-               theme->keyframe_list_w, theme->keyframe_list_h));
+               this,
+               theme->keyframe_list_x,
+               theme->keyframe_list_y,
+               theme->keyframe_list_w, 
+               theme->keyframe_list_h));
+//     add_subwindow(title2 = new BC_Title(theme->keyframe_text_x,
+//             theme->keyframe_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border,
+//             _("Global Text:")));
+//     add_subwindow(keyframe_text = new KeyFrameText(thread,
+//             this,
+//             theme->keyframe_text_x,
+//             theme->keyframe_text_y,
+//             theme->keyframe_text_w));
        add_subwindow(title3 = new BC_Title(theme->keyframe_value_x,
                theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
                _("Edit value:")));
        add_subwindow(value_text = new KeyFrameValue(thread,
-               this, theme->keyframe_value_x, theme->keyframe_value_y, theme->keyframe_value_w));
+               this,
+               theme->keyframe_value_x,
+               theme->keyframe_value_y,
+               theme->keyframe_value_w));
        add_subwindow(all_toggle = new KeyFrameAll(thread,
-               this, theme->keyframe_all_x, theme->keyframe_all_y));
+               this, 
+               theme->keyframe_all_x,
+               theme->keyframe_all_y));
+
+#endif
+
 
-       add_subwindow(new KeyFrameParamsOK(thread, this));
+
+       add_subwindow(title4 = new BC_Title(theme->presets_list_x,
+               theme->presets_list_y - 
+                       BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - 
+                       theme->widget_border,
+               _("Presets:"),
+               LARGEFONT));
+       add_subwindow(preset_list = new KeyFramePresetsList(thread,
+               this,
+               theme->presets_list_x,
+               theme->presets_list_y,
+               theme->presets_list_w, 
+               theme->presets_list_h));
+       add_subwindow(title5 = new BC_Title(theme->presets_text_x,
+               theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
+               _("Preset title:")));
+       add_subwindow(preset_text = new KeyFramePresetsText(thread,
+               this,
+               theme->presets_text_x,
+               theme->presets_text_y,
+               theme->presets_text_w));
+       add_subwindow(delete_preset = new KeyFramePresetsDelete(thread,
+               this,
+               theme->presets_delete_x,
+               theme->presets_delete_y));
+       add_subwindow(save_preset = new KeyFramePresetsSave(thread,
+               this,
+               theme->presets_save_x,
+               theme->presets_save_y));
+       add_subwindow(apply_preset = new KeyFramePresetsApply(thread,
+               this,
+               theme->presets_apply_x,
+               theme->presets_apply_y));
+
+
+
+
+       add_subwindow(new KeyFramePresetsOK(thread, this));
        add_subwindow(new BC_CancelButton(this));
 
        show_window();
        unlock_window();
 }
 
+// called when going in & out of a factory preset
+void KeyFrameWindow::update_editing()
+{
+       if( thread->is_factory ) {
+               delete_preset->disable();
+               save_preset->disable();
+       }
+       else {
+               delete_preset->enable();
+               save_preset->enable();
+       }
+}
+
+
+
 int KeyFrameWindow::resize_event(int w, int h)
 {
        Theme *theme = mwindow->theme;
@@ -324,24 +580,74 @@ int KeyFrameWindow::resize_event(int w, int h)
        mwindow->session->keyframedialog_h = h;
        theme->get_keyframedialog_sizes(this);
 
+#ifdef EDIT_KEYFRAME
+
        title1->reposition_window(theme->keyframe_list_x,
                theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
+//     title2->reposition_window(theme->keyframe_text_x,
+//             theme->keyframe_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
        title3->reposition_window(theme->keyframe_value_x,
                theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
-       keyframe_list->reposition_window(theme->keyframe_list_x, theme->keyframe_list_y,
-               theme->keyframe_list_w, theme->keyframe_list_h);
-       value_text->reposition_window(theme->keyframe_value_x, theme->keyframe_value_y,
+       keyframe_list->reposition_window(theme->keyframe_list_x,
+               theme->keyframe_list_y,
+               theme->keyframe_list_w, 
+               theme->keyframe_list_h);
+//     text->reposition_window(theme->keyframe_text_x,
+//             theme->keyframe_text_y,
+//             theme->keyframe_text_w);
+       value_text->reposition_window(theme->keyframe_value_x,
+               theme->keyframe_value_y,
                theme->keyframe_value_w);
-       all_toggle->reposition_window(theme->keyframe_all_x, theme->keyframe_all_y);
+       all_toggle->reposition_window(theme->keyframe_all_x,
+               theme->keyframe_all_y);
+
+#endif // EDIT_KEYFRAME
+
+
+
+
+       title4->reposition_window(theme->presets_list_x,
+               theme->presets_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
+       title5->reposition_window(theme->presets_text_x,
+               theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
+       preset_list->reposition_window(theme->presets_list_x,
+               theme->presets_list_y,
+               theme->presets_list_w, 
+               theme->presets_list_h);
+       preset_text->reposition_window(theme->presets_text_x,
+               theme->presets_text_y,
+               theme->presets_text_w);
+       delete_preset->reposition_window(theme->presets_delete_x,
+               theme->presets_delete_y);
+       save_preset->reposition_window(theme->presets_save_x,
+               theme->presets_save_y);
+       apply_preset->reposition_window(theme->presets_apply_x,
+               theme->presets_apply_y);
 
        return 0;
 }
 
+
+
+
+#ifdef EDIT_KEYFRAME
+
+
 KeyFrameList::KeyFrameList(KeyFrameThread *thread,
-       KeyFrameWindow *window, int x, int y, int w, int h)
- : BC_ListBox(x, y, w, h, LISTBOX_TEXT,
-       thread->keyframe_data, (const char **)thread->column_titles,
-       thread->column_width, KEYFRAME_COLUMNS)
+       KeyFrameWindow *window,
+       int x,
+       int y,
+       int w, 
+       int h)
+ : BC_ListBox(x, 
+               y, 
+               w, 
+               h,
+               LISTBOX_TEXT,
+               thread->keyframe_data,
+               thread->column_titles,
+               thread->column_width,
+               KEYFRAME_COLUMNS)
 {
        this->thread = thread;
        this->window = window;
@@ -368,9 +674,40 @@ int KeyFrameList::column_resize_event()
 }
 
 
+
+
+// KeyFrameText::KeyFrameText(KeyFrameThread *thread,
+//     KeyFrameWindow *window,
+//     int x,
+//     int y,
+//     int w)
+//  : BC_TextBox(x, 
+//     y, 
+//     w, 
+//     1, 
+//     "")
+// {
+//     this->thread = thread;
+//     this->window = window;
+// }
+// 
+// int KeyFrameText::handle_event()
+// {
+//     return 0;
+// }
+
+
+
 KeyFrameValue::KeyFrameValue(KeyFrameThread *thread,
-       KeyFrameWindow *window, int x, int y, int w)
- : BC_TextBox(x, y, w, 1, "")
+       KeyFrameWindow *window,
+       int x,
+       int y,
+       int w)
+ : BC_TextBox(x, 
+       y, 
+       w, 
+       1, 
+       (char*)"")
 {
        this->thread = thread;
        this->window = window;
@@ -378,14 +715,21 @@ KeyFrameValue::KeyFrameValue(KeyFrameThread *thread,
 
 int KeyFrameValue::handle_event()
 {
-       thread->update_values();
+       thread->apply_value();
        return 0;
 }
 
 
+
+
+
 KeyFrameAll::KeyFrameAll(KeyFrameThread *thread,
-       KeyFrameWindow *window, int x, int y)
- : BC_CheckBox(x, y, thread->mwindow->session->keyframedialog_all,
+       KeyFrameWindow *window,
+       int x,
+       int y)
+ : BC_CheckBox(x, 
+       y, 
+       thread->mwindow->session->keyframedialog_all, 
        _("Apply to all selected keyframes"))
 {
        this->thread = thread;
@@ -398,18 +742,160 @@ int KeyFrameAll::handle_event()
        return 1;
 }
 
-KeyFrameParamsOK::KeyFrameParamsOK(KeyFrameThread *thread, KeyFrameWindow *window)
+#endif // EDIT_KEYFRAME
+
+
+
+
+
+
+
+
+
+
+KeyFramePresetsList::KeyFramePresetsList(KeyFrameThread *thread,
+       KeyFrameWindow *window,
+       int x,
+       int y,
+       int w, 
+       int h)
+ : BC_ListBox(x, 
+               y, 
+               w, 
+               h,
+               LISTBOX_TEXT,
+               thread->presets_data)
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int KeyFramePresetsList::selection_changed()
+{
+       int number = get_selection_number(0, 0);
+       if( number >= 0 ) {
+               strcpy(thread->preset_text, thread->preset_titles.get(number));
+               thread->is_factory = thread->is_factories.get(number);
+// show title without factory symbol in the textbox
+               window->preset_text->update(
+                       thread->presets_data->get(number)->get_text());
+               window->update_editing();
+       }
+       
+       return 0;
+}
+
+int KeyFramePresetsList::handle_event()
+{
+       thread->apply_preset(thread->preset_text, thread->is_factory);
+       window->set_done(0);
+       return 0;
+}
+
+
+KeyFramePresetsText::KeyFramePresetsText(KeyFrameThread *thread,
+       KeyFrameWindow *window, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, thread->preset_text)
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+// user entered a title
+int KeyFramePresetsText::handle_event()
+{
+       strcpy(thread->preset_text, get_text());
+// once changed, it's now not a factory preset
+       thread->is_factory = 0;
+       window->update_editing();
+       return 0;
+}
+
+
+KeyFramePresetsDelete::KeyFramePresetsDelete(KeyFrameThread *thread,
+       KeyFrameWindow *window,
+       int x,
+       int y)
+ : BC_GenericButton(x, y, _("Delete"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int KeyFramePresetsDelete::handle_event()
+{
+       if( !thread->is_factory ) {
+               thread->delete_preset(thread->preset_text, thread->is_factory);
+       }
+       return 1;
+}
+
+
+KeyFramePresetsSave::KeyFramePresetsSave(KeyFrameThread *thread,
+       KeyFrameWindow *window,
+       int x,
+       int y)
+: BC_GenericButton(x, y, _("Save"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int KeyFramePresetsSave::handle_event()
+{
+       if( !thread->is_factory ) {
+               thread->save_preset(thread->preset_text, thread->is_factory);
+       }
+       return 1;
+}
+
+
+
+
+
+
+
+
+KeyFramePresetsApply::KeyFramePresetsApply(KeyFrameThread *thread,
+       KeyFrameWindow *window,
+       int x,
+       int y)
+ : BC_GenericButton(x, y, _("Apply"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int KeyFramePresetsApply::handle_event()
+{
+       thread->apply_preset(thread->preset_text, thread->is_factory);
+       return 1;
+}
+
+
+KeyFramePresetsOK::KeyFramePresetsOK(KeyFrameThread *thread,
+       KeyFrameWindow *window)
  : BC_OKButton(window)
 {
        this->thread = thread;
        this->window = window;
 }
 
-int KeyFrameParamsOK::keypress_event()
+int KeyFramePresetsOK::keypress_event()
 {
        if( get_keypress() == RETURN ) {
-               thread->apply_value();
-               return 1;
+// Apply the preset
+               if( thread->presets_db->preset_exists(thread->plugin_title, 
+                       thread->preset_text, thread->is_factory) ) {
+                       window->set_done(0);
+                       return 1;
+               }
+               else {
+                       if( !thread->is_factory ) {
+                               thread->save_preset(thread->preset_text, thread->is_factory);
+                               return 1;
+                       }
+               }
        }
        return 0;
 }
index 9f98c06838cdf04afda36df3adb74a6e54f83413..c6cdb85c0c4e4660cce7a8bc8c56335a17616119 100644 (file)
@@ -1,22 +1,22 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ * Copyright (C) 2017 Adam Williams <broadcast at earthling dot net>
+ * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *
+ * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
+ * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * 
  */
 
 #ifndef KEYFRAMEGUI_H
 
 #include "bcdialog.h"
 #include "guicast.h"
+#include "presets.inc"
 
 class KeyFrameWindow;
 
 
+
+
 #define KEYFRAME_COLUMNS 2
 // Enable editing of detailed keyframe parameters.
+#define EDIT_KEYFRAME
+
 class KeyFrameThread : public BC_DialogThread
 {
 public:
@@ -44,8 +49,13 @@ public:
        void handle_close_event(int result);
        void update_values();
        void save_value(char *value);
+       void save_preset(const char *title, int is_factory);
+       void delete_preset(const char *title, int is_factory);
+       void apply_preset(const char *title, int is_factory);
        void apply_value();
+       void calculate_preset_list();
        void update_gui(int update_value_text = 1);
+       void close_window();
 
        ArrayList<BC_ListBoxItem*> *keyframe_data;
        Plugin *plugin;
@@ -53,38 +63,134 @@ public:
        MWindow *mwindow;
        char window_title[BCTEXTLEN];
        char plugin_title[BCTEXTLEN];
-       char *column_titles[KEYFRAME_COLUMNS];
+
+// the currently selected preset is a factory preset
+       int is_factory;
+// title of the currently selected preset from the DB
+       char preset_text[BCTEXTLEN];
+       
+       const char *column_titles[KEYFRAME_COLUMNS];
        int column_width[KEYFRAME_COLUMNS];
+// list of preset text to display
+       ArrayList<BC_ListBoxItem*> *presets_data;
+// flag for each preset shown
+       ArrayList<int> is_factories;
+// title of each preset shown
+       ArrayList<char*> preset_titles;
+       PresetsDB *presets_db;
 };
 
+#ifdef EDIT_KEYFRAME
+
+
 class KeyFrameList : public BC_ListBox
 {
 public:
        KeyFrameList(KeyFrameThread *thread,
-               KeyFrameWindow *window, int x, int y, int w, int h);
+               KeyFrameWindow *window,
+               int x,
+               int y,
+               int w, 
+               int h);
        int selection_changed();
        int handle_event();
        int column_resize_event();
        KeyFrameThread *thread;
        KeyFrameWindow *window;
 };
+#endif
 
-class KeyFrameParamList : public BC_ListBox
+class KeyFramePresetsList : public BC_ListBox
 {
 public:
-       KeyFrameParamList(KeyFrameThread *thread,
-               KeyFrameWindow *window, int x, int y, int w, int h);
+       KeyFramePresetsList(KeyFrameThread *thread,
+               KeyFrameWindow *window,
+               int x,
+               int y,
+               int w, 
+               int h);
        int selection_changed();
        int handle_event();
        KeyFrameThread *thread;
        KeyFrameWindow *window;
 };
 
+class KeyFramePresetsText : public BC_TextBox
+{
+public:
+       KeyFramePresetsText(KeyFrameThread *thread,
+               KeyFrameWindow *window,
+               int x,
+               int y,
+               int w);
+       int handle_event();
+       KeyFrameThread *thread;
+       KeyFrameWindow *window;
+};
+
+
+class KeyFramePresetsDelete : public BC_GenericButton
+{
+public:
+       KeyFramePresetsDelete(KeyFrameThread *thread,
+               KeyFrameWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       KeyFrameThread *thread;
+       KeyFrameWindow *window;
+};
+
+class KeyFramePresetsSave : public BC_GenericButton
+{
+public:
+       KeyFramePresetsSave(KeyFrameThread *thread,
+               KeyFrameWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       KeyFrameThread *thread;
+       KeyFrameWindow *window;
+};
+
+class KeyFramePresetsApply : public BC_GenericButton
+{
+public:
+       KeyFramePresetsApply(KeyFrameThread *thread,
+               KeyFrameWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       KeyFrameThread *thread;
+       KeyFrameWindow *window;
+};
+
+/*
+ * class KeyFrameText : public BC_TextBox
+ * {
+ * public:
+ *     KeyFrameText(KeyFrameThread *thread,
+ *             KeyFrameWindow *window,
+ *             int x,
+ *             int y,
+ *             int w);
+ *     int handle_event();
+ *     KeyFrameThread *thread;
+ *     KeyFrameWindow *window;
+ * };
+ */
+
+#ifdef EDIT_KEYFRAME
+
+
 class KeyFrameValue : public BC_TextBox
 {
 public:
        KeyFrameValue(KeyFrameThread *thread,
-               KeyFrameWindow *window, int x, int y, int w);
+               KeyFrameWindow *window,
+               int x,
+               int y,
+               int w);
        int handle_event();
        KeyFrameThread *thread;
        KeyFrameWindow *window;
@@ -94,29 +200,42 @@ class KeyFrameAll : public BC_CheckBox
 {
 public:
        KeyFrameAll(KeyFrameThread *thread,
-               KeyFrameWindow *window, int x, int y);
+               KeyFrameWindow *window,
+               int x,
+               int y);
        int handle_event();
        KeyFrameThread *thread;
        KeyFrameWindow *window;
 };
 
-class KeyFrameParamsOK : public BC_OKButton
+#endif
+
+
+class KeyFramePresetsOK : public BC_OKButton
 {
 public:
-       KeyFrameParamsOK(KeyFrameThread *thread,
+       KeyFramePresetsOK(KeyFrameThread *thread,
                KeyFrameWindow *window);
        int keypress_event();
        KeyFrameThread *thread;
        KeyFrameWindow *window;
 };
 
+
+
 class KeyFrameWindow : public BC_Window
 {
 public:
        KeyFrameWindow(MWindow *mwindow,
-               KeyFrameThread *thread, int x, int y, char *title);
+               KeyFrameThread *thread,
+               int x,
+               int y,
+               char *title);
        void create_objects();
        int resize_event(int w, int h);
+       void update_editing();
+
+#ifdef EDIT_KEYFRAME
 
 // List of parameters, values, & whether the parameter is defined by the current keyframe.
        KeyFrameList *keyframe_list;
@@ -125,10 +244,34 @@ public:
 // Value text of the current parameter
        KeyFrameValue *value_text;
        KeyFrameAll *all_toggle;
-       BC_Title *title1, *title3;
+#endif
+       
+       KeyFramePresetsList *preset_list;
+       KeyFramePresetsText *preset_text;
+       KeyFramePresetsDelete *delete_preset;
+       KeyFramePresetsSave *save_preset;
+       KeyFramePresetsApply *apply_preset;
+
+#ifdef EDIT_KEYFRAME
+
+       BC_Title *title1;
+//     BC_Title *title2;
+       BC_Title *title3;
+#endif
+
+       BC_Title *title4;
+       BC_Title *title5;
 
        MWindow *mwindow;
        KeyFrameThread *thread;
 };
 
+
+
+
 #endif
+
+
+
+
+
index 5d8249fe780d97e5eec9075b384265391f3f3561..0008bcd30a1d7051253903cdc2e9de84692e3132 100644 (file)
@@ -104,6 +104,8 @@ LocalSession::LocalSession(EDL *edl)
        floatauto_type = FloatAuto::SMOOTH;
 
        red = green = blue = 0;
+       red_max = green_max = blue_max = 0;
+       use_max = 0;
 }
 
 LocalSession::~LocalSession()
@@ -138,14 +140,17 @@ void LocalSession::copy_from(LocalSession *that)
        preview_end = that->preview_end;
        red = that->red;
        green = that->green;
+       blue = that->blue;
+       red_max = that->red_max;
+       green_max = that->green_max;
+       blue_max = that->blue_max;
+       use_max = that->use_max;
 
        for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                automation_mins[i] = that->automation_mins[i];
                automation_maxs[i] = that->automation_maxs[i];
        }
        floatauto_type = that->floatauto_type;
-
-       blue = that->blue;
 }
 
 void LocalSession::save_xml(FileXML *file, double start)
@@ -192,6 +197,10 @@ void LocalSession::save_xml(FileXML *file, double start)
        file->tag.set_property("RED", red);
        file->tag.set_property("GREEN", green);
        file->tag.set_property("BLUE", blue);
+       file->tag.set_property("RED_MAX", red_max);
+       file->tag.set_property("GREEN_MAX", green_max);
+       file->tag.set_property("BLUE_MAX", blue_max);
+       file->tag.set_property("USE_MAX", use_max);
 
        for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                if (!Automation::autogrouptypes_fixedrange[i]) {
@@ -217,6 +226,9 @@ void LocalSession::synchronize_params(LocalSession *that)
        red = that->red;
        green = that->green;
        blue = that->blue;
+       red_max = that->red_max;
+       green_max = that->green_max;
+       blue_max = that->blue_max;
 }
 
 
@@ -261,7 +273,10 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags)
                red = file->tag.get_property("RED", red);
                green = file->tag.get_property("GREEN", green);
                blue = file->tag.get_property("BLUE", blue);
-
+               red_max = file->tag.get_property("RED_MAX", red_max);
+               green_max = file->tag.get_property("GREEN_MAX", green_max);
+               blue_max = file->tag.get_property("BLUE_MAX", blue_max);
+               use_max = file->tag.get_property("USE_MAX", use_max);
 
                for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                        if (!Automation::autogrouptypes_fixedrange[i]) {
@@ -310,6 +325,10 @@ int LocalSession::load_defaults(BC_Hash *defaults)
        red = defaults->get("RED", 0.0);
        green = defaults->get("GREEN", 0.0);
        blue = defaults->get("BLUE", 0.0);
+       red_max = defaults->get("RED_MAX", 0.0);
+       green_max = defaults->get("GREEN_MAX", 0.0);
+       blue_max = defaults->get("BLUE_MAX", 0.0);
+       use_max = defaults->get("USE_MAX", 0);
 
        for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                if (!Automation::autogrouptypes_fixedrange[i]) {
@@ -340,6 +359,10 @@ int LocalSession::save_defaults(BC_Hash *defaults)
        defaults->update("RED", red);
        defaults->update("GREEN", green);
        defaults->update("BLUE", blue);
+       defaults->update("RED_MAX", red_max);
+       defaults->update("GREEN_MAX", green_max);
+       defaults->update("BLUE_MAX", blue_max);
+       defaults->update("USE_MAX", use_max);
 
        for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                if (!Automation::autogrouptypes_fixedrange[i]) {
index 547fcb8afa27be359d01c91086cc7fb2874f45d2..e2ee664e2ec40beb4a0935f18f6cc739ce21faa3 100644 (file)
@@ -109,6 +109,8 @@ public:
 
 // Eye dropper
        float red, green, blue;
+       float red_max, green_max, blue_max;
+       int use_max;
 private:
 // The reason why selection ranges and inpoints have to be separate:
 // The selection position has to change to set new in points.
index f03ac9d0aa7a87f1b78c25c1be297f91d51f120d..3fbbc5761ba228c3662b29025d4d0747f9c459dd 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 1997-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,8 @@
 #include "theme.h"
 
 MainClock::MainClock(MWindow *mwindow, int x, int y, int w)
- : BC_Title(x, y, "", MEDIUM_7SEGMENT, BLACK, 0, w)
+ : BC_Title(x, y, "", CLOCKFONT, //MEDIUM_7SEGMENT,
+       mwindow->theme->clock_fg_color, 0, w)
 {
        this->mwindow = mwindow;
        position_offset = 0;
index bc089e7f5848f5155449856233d13d722f942e69..a0a661fdb930e9aed9692bf4a9875d624409cb6a 100644 (file)
@@ -516,7 +516,7 @@ void MenuEffectThread::run()
 
                mwindow->undo->update_undo_before("", 0);
                if(load_mode == LOADMODE_PASTE)
-                       mwindow->clear(0);
+                       mwindow->clear(0, 1);
 
                mwindow->load_assets(&assets, -1, load_mode, 0, 0,
                        mwindow->edl->session->labels_follow_edits,
index e700e71f675f718987e635051a5de43599091225..a7bd7e3d507f38f2df50479d3045ebee65fa6a71 100644 (file)
@@ -316,7 +316,7 @@ public:
 // Clears active region in EDL.
 // If clear_handle, edit boundaries are cleared if the range is 0.
 // Called by paste, record, menueffects, render, and CWindow drop.
-       void clear(int clear_handle);
+       void clear(int clear_handle, int deglitch);
        void clear_labels();
        int clear_labels(double start, double end);
        void concatenate_tracks();
index 48d2648479ae85f6e3e0146f9ba0086009adc337..366236ffc28936958dd75402faa5d2eb52e35b66 100644 (file)
 #define DEFAULT_THEME "UnFlat"
 #define DEFAULT_PICON "cinfinity"
 #define CONFIG_FILE "Cinelerra_rc"
+// user presets
 #define PRESETS_FILE "Cinelerra_presets"
+// factory presets
+#define FACTORY_FILE "Cinelerra_factory"
 #define PICTURE_FILE "Cinelerra_picture"
 #define PLUGIN_FILE "Cinelerra_plugins"
 #define LADSPA_FILE "ladspa_plugins."
index 0e4121b121ae18e17b414cedc264912507ac5cc0..4e1c5c7415d76314da93fb85d398683a9327046f 100644 (file)
@@ -301,7 +301,7 @@ void MWindow::asset_to_rate()
 void MWindow::clear_entry()
 {
        undo->update_undo_before();
-       clear(1);
+       clear(1, 1);
 
        edl->optimize();
        save_backup();
@@ -315,7 +315,7 @@ void MWindow::clear_entry()
                send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
 }
 
-void MWindow::clear(int clear_handle)
+void MWindow::clear(int clear_handle, int deglitch)
 {
        double start = edl->local_session->get_selectionstart();
        double end = edl->local_session->get_selectionend();
@@ -326,6 +326,12 @@ void MWindow::clear(int clear_handle)
                        edl->session->plugins_follow_edits,
                        edl->session->autos_follow_edits);
        }
+       
+// always needed by paste operations
+       if(deglitch)
+       {
+               edl->deglitch(start);
+       }
 }
 
 void MWindow::set_automation_mode(int mode)
@@ -525,6 +531,7 @@ void MWindow::cut(double start, double end, double new_position)
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
+       edl->deglitch(start);
 
 
        edl->optimize();
@@ -862,15 +869,20 @@ void MWindow::finish_modify_handles()
 
        if( (session->drag_handle == 1 && edit_mode != MOVE_NO_EDITS) ||
                (session->drag_handle == 0 && edit_mode == MOVE_ONE_EDIT) ) {
+//printf("MWindow::finish_modify_handles %d\n", __LINE__);
                edl->local_session->set_selectionstart(session->drag_position);
                edl->local_session->set_selectionend(session->drag_position);
+               edl->deglitch(session->drag_position);
        }
        else
        if( edit_mode != MOVE_NO_EDITS ) {
+//printf("MWindow::finish_modify_handles %d\n", __LINE__);
                edl->local_session->set_selectionstart(session->drag_start);
                edl->local_session->set_selectionend(session->drag_start);
+               edl->deglitch(session->drag_start);
        }
 
+// clamp the selection to 0
        if( edl->local_session->get_selectionstart(1) < 0 ) {
                edl->local_session->set_selectionstart(0);
                edl->local_session->set_selectionend(0);
@@ -1047,6 +1059,10 @@ void MWindow::mute_selection()
                edl->paste_silence(start, end, 0,
                        edl->session->plugins_follow_edits,
                        edl->session->autos_follow_edits);
+               edl->deglitch(start);
+               edl->deglitch(end);
+
+               
                save_backup();
                undo->update_undo_after(_("mute"), LOAD_EDITS);
 
@@ -1108,7 +1124,7 @@ int MWindow::paste(double start,
        int edit_plugins,
        int edit_autos)
 {
-       clear(0);
+       clear(0, 1);
 
 // Want to insert with assets shared with the master EDL.
        insert(start, file,
@@ -1131,7 +1147,7 @@ void MWindow::paste()
                gui->from_clipboard(string, len, BC_PRIMARY_SELECTION);
                FileXML file;
                file.read_from_string(string);
-               clear(0);
+               clear(0, 1);
 
                insert(start, &file,
                        edl->session->labels_follow_edits,
@@ -1609,6 +1625,8 @@ void MWindow::paste_silence()
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
+       edl->deglitch(start);
+       edl->deglitch(end);
        edl->optimize();
        save_backup();
        undo->update_undo_after(_("silence"), LOAD_EDITS | LOAD_TIMEBAR);
@@ -2145,6 +2163,10 @@ void MWindow::trim_selection()
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
+       edl->deglitch(0);
+       edl->deglitch(edl->local_session->get_selectionend() -
+               edl->local_session->get_selectionstart());
+       
 
        save_backup();
        undo->update_undo_after(_("trim selection"), LOAD_EDITS | LOAD_TIMEBAR);
index 9f0c70d507c1545b48bb58f943ea386922c5c78c..14df0a12900a26add674d579d44724b05a327268 100644 (file)
@@ -84,8 +84,7 @@ int New::handle_event()
 
 void New::create_new_edl()
 {
-       if(!new_edl)
-       {
+       if( !new_edl ) {
                new_edl = new EDL;
                new_edl->create_objects();
                new_edl->load_defaults(mwindow->defaults);
@@ -96,12 +95,9 @@ void New::create_new_edl()
 int New::create_new_project()
 {
        mwindow->cwindow->playback_engine->que->send_command(STOP,
-               CHANGE_NONE,
-               0,
-               0);
+               CHANGE_NONE, 0, 0);
 
-       for(int i = 0; i < mwindow->vwindows.size(); i++)
-       {
+       for( int i=0; i<mwindow->vwindows.size(); ++i ) {
                VWindow *vwindow = mwindow->vwindows.get(i);
                if( !vwindow->is_running() ) continue;
                vwindow->playback_engine->que->send_command(STOP, CHANGE_NONE, 0, 0);
@@ -113,8 +109,6 @@ int New::create_new_project()
        mwindow->gui->lock_window();
        mwindow->reset_caches();
 
-
-
        memcpy(new_edl->session->achannel_positions,
                &mwindow->preferences->channel_positions[
                        MAXCHANNELS * (new_edl->session->audio_channels - 1)],
@@ -152,8 +146,6 @@ NewThread::~NewThread()
        close_window();
 }
 
-
-
 BC_Window* NewThread::new_gui()
 {
        mwindow->edl->save_defaults(mwindow->defaults);
@@ -170,29 +162,22 @@ BC_Window* NewThread::new_gui()
        return nwindow;
 }
 
-
-
 void NewThread::handle_close_event(int result)
 {
-
        if( !new_project->new_edl ) return;
        new_project->new_edl->save_defaults(mwindow->defaults);
        mwindow->defaults->save();
 
-       if(result)
-       {
+       if( result ) {
 // Aborted
                if( !new_project->new_edl->Garbage::remove_user() )
                        new_project->new_edl = 0;
        }
-       else
-       {
+       else {
                new_project->create_new_project();
        }
 }
 
-
-
 int NewThread::load_defaults()
 {
        auto_aspect = mwindow->defaults->get("AUTOASPECT", 0);
@@ -207,8 +192,7 @@ int NewThread::save_defaults()
 
 int NewThread::update_aspect()
 {
-       if(auto_aspect)
-       {
+       if( auto_aspect ) {
                char string[BCTEXTLEN];
                mwindow->create_aspect_ratio(new_project->new_edl->session->aspect_w,
                        new_project->new_edl->session->aspect_h,
@@ -223,8 +207,6 @@ int NewThread::update_aspect()
 }
 
 
-
-
 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
  : BC_Window(_(PROGRAM_NAME ": New Project"), x, y, WIDTH, HEIGHT,
                -1, -1, 0, 0, 1)
@@ -238,7 +220,7 @@ NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
 NewWindow::~NewWindow()
 {
        lock_window("NewWindow::~NewWindow");
-       if(format_presets) delete format_presets;
+       if( format_presets ) delete format_presets;
        unlock_window();
 }
 
@@ -261,8 +243,6 @@ void NewWindow::create_objects()
        x = format_presets->x;
        y = format_presets->y;
 
-
-
        y += 40;
        y1 = y;
        add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT));
@@ -365,10 +345,7 @@ void NewWindow::create_objects()
        add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
        x1 += aspect_h_text->get_w();
        add_subwindow(new AspectPulldown(mwindow,
-               aspect_w_text,
-               aspect_h_text,
-               x1,
-               y));
+               aspect_w_text, aspect_h_text, x1, y));
 
        x1 = aspect_w_text->get_x();
        y += aspect_w_text->get_h() + 5;
@@ -419,11 +396,6 @@ int NewWindow::update()
 }
 
 
-
-
-
-
-
 NewPresets::NewPresets(MWindow *mwindow, NewWindow *gui, int x, int y)
  : FormatPresets(mwindow, gui, 0, x, y)
 {
@@ -445,7 +417,6 @@ EDL* NewPresets::get_edl()
 }
 
 
-
 NewATracks::NewATracks(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -478,6 +449,7 @@ int NewATracksTumbler::handle_down_event()
        return 1;
 }
 
+
 NewAChannels::NewAChannels(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -490,6 +462,7 @@ int NewAChannels::handle_event()
        return 1;
 }
 
+
 NewAChannelsTumbler::NewAChannelsTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -523,18 +496,10 @@ int NewSampleRate::handle_event()
        return 1;
 }
 
+
 SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->sample_rates,
-       0,
-       0,
-       1,
-       0,
-       1)
+ : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT,
+       &mwindow->theme->sample_rates, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output = output;
@@ -548,19 +513,6 @@ int SampleRatePulldown::handle_event()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 NewVTracks::NewVTracks(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -573,6 +525,7 @@ int NewVTracks::handle_event()
        return 1;
 }
 
+
 NewVTracksTumbler::NewVTracksTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -593,6 +546,7 @@ int NewVTracksTumbler::handle_down_event()
        return 1;
 }
 
+
 NewVChannels::NewVChannels(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -605,6 +559,7 @@ int NewVChannels::handle_event()
        return 1;
 }
 
+
 NewVChannelsTumbler::NewVChannelsTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -625,6 +580,7 @@ int NewVChannelsTumbler::handle_down_event()
        return 1;
 }
 
+
 NewFrameRate::NewFrameRate(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -637,21 +593,11 @@ int NewFrameRate::handle_event()
        return 1;
 }
 
+
 FrameRatePulldown::FrameRatePulldown(MWindow *mwindow,
-       BC_TextBox *output,
-       int x,
-       int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->frame_rates,
-       0,
-       0,
-       1,
-       0,
-       1)
+       BC_TextBox *output, int x, int y)
+ : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT,
+       &mwindow->theme->frame_rates, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output = output;
@@ -665,26 +611,15 @@ int FrameRatePulldown::handle_event()
 }
 
 FrameSizePulldown::FrameSizePulldown(Theme *theme,
-               BC_TextBox *output_w,
-               BC_TextBox *output_h,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       100,
-       250,
-       LISTBOX_TEXT,
-       &theme->frame_sizes,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
+ : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT,
+       &theme->frame_sizes, 0, 0, 1, 0, 1)
 {
        this->theme = theme;
        this->output_w = output_w;
        this->output_h = output_h;
 }
+
 int FrameSizePulldown::handle_event()
 {
        char *text = get_selection(0, 0)->get_text();
@@ -694,8 +629,7 @@ int FrameSizePulldown::handle_event()
 
        strcpy(string, text);
        ptr = strrchr(string, 'x');
-       if(ptr)
-       {
+       if( ptr ) {
                ptr++;
                h = atol(ptr);
 
@@ -709,6 +643,7 @@ int FrameSizePulldown::handle_event()
        return 1;
 }
 
+
 NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y)
  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w)
 {
@@ -721,6 +656,7 @@ int NewOutputW::handle_event()
        return 1;
 }
 
+
 NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y)
  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h)
 {
@@ -733,6 +669,7 @@ int NewOutputH::handle_event()
        return 1;
 }
 
+
 NewAspectW::NewAspectW(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 70, 1, text)
 {
@@ -745,6 +682,7 @@ int NewAspectW::handle_event()
        return 1;
 }
 
+
 NewAspectH::NewAspectH(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 70, 1, text)
 {
@@ -757,27 +695,17 @@ int NewAspectH::handle_event()
        return 1;
 }
 
+
 AspectPulldown::AspectPulldown(MWindow *mwindow,
-               BC_TextBox *output_w,
-               BC_TextBox *output_h,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->aspect_ratios,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
+ : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT,
+       &mwindow->theme->aspect_ratios, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output_w = output_w;
        this->output_h = output_h;
 }
+
 int AspectPulldown::handle_event()
 {
        char *text = get_selection(0, 0)->get_text();
@@ -787,8 +715,7 @@ int AspectPulldown::handle_event()
 
        strcpy(string, text);
        ptr = strrchr(string, ':');
-       if(ptr)
-       {
+       if( ptr ) {
                ptr++;
                h = atof(ptr);
 
@@ -802,6 +729,7 @@ int AspectPulldown::handle_event()
        return 1;
 }
 
+
 ColormodelItem::ColormodelItem(const char *text, int value)
  : BC_ListBoxItem(text)
 {
@@ -809,21 +737,9 @@ ColormodelItem::ColormodelItem(const char *text, int value)
 }
 
 ColormodelPulldown::ColormodelPulldown(MWindow *mwindow,
-               BC_TextBox *output_text,
-               int *output_value,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       200,
-       150,
-       LISTBOX_TEXT,
-       (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_text, int *output_value, int x, int y)
+ : BC_ListBox(x, y, 200, 150, LISTBOX_TEXT,
+       (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output_text = output_text;
@@ -840,8 +756,8 @@ int ColormodelPulldown::handle_event()
 
 const char* ColormodelPulldown::colormodel_to_text()
 {
-       for(int i = 0; i < mwindow->colormodels.total; i++)
-               if(mwindow->colormodels.values[i]->value == *output_value)
+       for( int i=0; i<mwindow->colormodels.total; ++i )
+               if( mwindow->colormodels.values[i]->value == *output_value )
                        return mwindow->colormodels.values[i]->get_text();
        return _("Unknown");
 }
@@ -910,12 +826,6 @@ int NewAspectAuto::handle_event()
 }
 
 
-
-
-
-
-
-
 NewSwapExtents::NewSwapExtents(MWindow *mwindow, NewWindow *gui, int x, int y)
  : BC_Button(x, y, mwindow->theme->get_image_set("swap_extents"))
 {
@@ -936,6 +846,3 @@ int NewSwapExtents::handle_event()
        return 1;
 }
 
-
-
-
index 178082a42449eff849b864df011e7de647f5ee6c..e05080999f3f218c0b05a4cb3cccd4a39f8d92ba 100644 (file)
@@ -158,15 +158,8 @@ void PackageRenderer::create_output()
                strncpy(asset->path, package->path, sizeof(asset->path));
 
        file = new File;
-
        file->set_processors(preferences->processors);
-
-//printf("PackageRenderer::create_output %d\n", __LINE__);
-       result = file->open_file(preferences,
-                                       asset,
-                                       0,
-                                       1);
-//printf("PackageRenderer::create_output %d %d\n", __LINE__, result);
+       result = file->open_file(preferences, asset, 0, 1);
 
        if(result && mwindow)
        {
@@ -251,7 +244,12 @@ void PackageRenderer::create_engine()
                direct_frame_copying = 0;
 
 
-//printf("PackageRenderer::create_engine %d\n", __LINE__);
+//printf("PackageRenderer::create_engine %d video_write_length=%d\n", __LINE__, video_write_length);
+// starting frames are corrupted if video_write_length > 2.  Work around it, for now.
+               if(video_write_length > 2)
+               {
+                       video_write_length = 2;
+               }
                file->start_video_thread(video_write_length,
                        command->get_edl()->session->color_model,
                        preferences->processors > 1 ? 2 : 1,
@@ -416,7 +414,8 @@ void PackageRenderer::do_video()
                                        VFrame *preview_output;
 
                                        video_device->new_output_buffer(&preview_output,
-                                               command->get_edl()->session->color_model);
+                                               command->get_edl()->session->color_model,
+                                               command->get_edl());
 
                                        preview_output->copy_from(video_output_ptr);
                                        video_device->write_buffer(preview_output,
@@ -742,6 +741,7 @@ int PackageRenderer::direct_frame_copy(EDL *edl,
 //printf("Render::direct_frame_copy 2\n");
 
                if(!package->use_brender)
+               {
                        error |= ((VEdit*)playable_edit)->read_frame(compressed_output,
                                video_position,
                                PLAY_FORWARD,
@@ -749,7 +749,9 @@ int PackageRenderer::direct_frame_copy(EDL *edl,
                                1,
                                0,
                                0);
-
+//printf("Render::direct_frame_copy %d %d\n", __LINE__, compressed_output->get_compressed_size());
+               }
+               
 
                if(!error && video_preroll > 0)
                {
index 1c329474636f994f1c536979c728c55f5c7d3830..22fee714ef0675a3c74cba4585ecd1195cca4b24 100644 (file)
@@ -239,7 +239,7 @@ const char *VideoOutConfig::default_video_device = "/dev/video0";
 
 VideoOutConfig::VideoOutConfig()
 {
-       driver = PLAYBACK_X11_XV;
+       driver = PLAYBACK_X11;
        x11_host[0] = 0;
        x11_use_fields = USE_NO_FIELDS;
 
@@ -259,6 +259,7 @@ VideoOutConfig::VideoOutConfig()
        contrast = 32768;
        whiteness = 32768;
        out_channel = -1;
+       use_direct_x11 = 1;
 }
 
 VideoOutConfig::~VideoOutConfig()
@@ -276,6 +277,7 @@ int VideoOutConfig::operator==(VideoOutConfig &that)
        return (driver == that.driver) &&
                !strcmp(x11_host, that.x11_host) &&
                (x11_use_fields == that.x11_use_fields) &&
+               (use_direct_x11 == that.use_direct_x11) &&
                (brightness == that.brightness) &&
                (hue == that.hue) &&
                (color == that.color) &&
@@ -309,6 +311,7 @@ void VideoOutConfig::copy_from(VideoOutConfig *src)
        this->driver = src->driver;
        strcpy(this->x11_host, src->x11_host);
        this->x11_use_fields = src->x11_use_fields;
+       this->use_direct_x11 = src->use_direct_x11;
 
        firewire_channel = src->firewire_channel;
        firewire_port = src->firewire_port;
index 99323f640ea226f9c413dbeaad13b68a7c9838c6..1896a5da8c9f839aadf248dc741070a6b1f45632 100644 (file)
@@ -99,6 +99,7 @@ public:
 
        int driver;
        int out_channel;
+       int use_direct_x11;
 
 // X11 options
        char x11_host[BCTEXTLEN];
index cadec09d5fcd8f0c583922451c4056f27fee26de..91adc592dca8dcd3e8381626b25661c3aafb7c9d 100644 (file)
@@ -68,30 +68,19 @@ void PlaybackPrefs::create_objects()
 
        x = mwindow->theme->preferencesoptions_x;
        y = mwindow->theme->preferencesoptions_y;
-       //int margin = mwindow->theme->widget_border;
+       int margin = mwindow->theme->widget_border;
 
 // Audio
-       add_subwindow(new BC_Title(x,
-               y,
-               _("Audio Out"),
-               LARGEFONT));
-
-
-       y += get_text_height(LARGEFONT) + 5;
-
-
        BC_Title *title1, *title2;
+       add_subwindow(title1 = new BC_Title(x, y, _("Audio Out"), LARGEFONT));
+       y += title1->get_h() + margin;
        add_subwindow(title2 = new BC_Title(x, y, _("Playback buffer samples:"), MEDIUMFONT));
-       x2 = MAX(title2->get_w(), title2->get_w()) + 10;
+       x2 = title2->get_x() + title2->get_w() + margin;
 
 SET_TRACE
        sprintf(string, "%d", playback_config->aconfig->fragment_size);
        PlaybackModuleFragment *menu;
-       add_subwindow(menu = new PlaybackModuleFragment(x2,
-               y,
-               pwindow,
-               this,
-               string));
+       add_subwindow(menu = new PlaybackModuleFragment(x2, y, pwindow, this, string));
        menu->add_item(new BC_MenuItem("1024"));
        menu->add_item(new BC_MenuItem("2048"));
        menu->add_item(new BC_MenuItem("4096"));
@@ -141,26 +130,29 @@ SET_TRACE
 
 
 // Video
-       y += audio_device->get_h();
+       y += audio_device->get_h(0) + margin;
 
 SET_TRACE
-       add_subwindow(new BC_Bar(5, y,  get_w() - 10));
+       add_subwindow(new BC_Bar(x, y,  get_w() - x * 2));
        y += 5;
 
 SET_TRACE
-       add_subwindow(new BC_Title(x, y, _("Video Out"), LARGEFONT));
-       y += 30;
+       add_subwindow(title1 = new BC_Title(x, y, _("Video Out"), LARGEFONT));
+       y += title1->get_h() + margin;
 
 SET_TRACE
        add_subwindow(window = new VideoEveryFrame(pwindow, this, x, y));
-
-       add_subwindow(new BC_Title(x + 200, y + 5, _("Framerate achieved:")));
-       add_subwindow(framerate_title = new BC_Title(x + 350, y + 5, "--", MEDIUMFONT, RED));
+       int x1 = x + window->get_w() + 30;
+       const char *txt = _("Framerate achieved:");
+       int y1 = y + (window->get_h() - BC_Title::calculate_h(this, txt)) / 2;
+       add_subwindow(title1 = new BC_Title(x1, y1, txt));
+       x1 += title1->get_w() + margin;
+       add_subwindow(framerate_title = new BC_Title(x1, y1, _("--"), MEDIUMFONT, RED));
        draw_framerate(0);
-       y += window->get_h() + 5;
+       y += window->get_h() + 2*margin;
 
-       add_subwindow(asynchronous = new VideoAsynchronous(pwindow, x, y));
-       y += asynchronous->get_h() + 10;
+//     add_subwindow(asynchronous = new VideoAsynchronous(pwindow, x, y));
+//     y += asynchronous->get_h() + 10;
 
 SET_TRACE
        add_subwindow(title1 = new BC_Title(x, y, _("Scaling equation: Enlarge / Reduce ")));
@@ -174,14 +166,13 @@ SET_TRACE
 
        add_subwindow(title1 = new BC_Title(x, y, _("DVD Subtitle to display:")));
        PlaybackSubtitleNumber *subtitle_number;
-       subtitle_number = new PlaybackSubtitleNumber(x + title1->get_w() + 10,
-               y,
-               pwindow,
-               this);
+       x1 = x + title1->get_w() + margin;
+       subtitle_number = new PlaybackSubtitleNumber(x1, y, pwindow, this);
        subtitle_number->create_objects();
 
        x2 = x + title1->get_w() + 10 + subtitle_number->get_w() + 30;
        PlaybackSubtitle *subtitle_toggle;
+       x1 += subtitle_number->get_w() + margin;
        add_subwindow(subtitle_toggle = new PlaybackSubtitle(x2, y, pwindow, this));
        y += subtitle_toggle->get_h();
 
@@ -197,18 +188,18 @@ SET_TRACE
 
        add_subwindow(interpolate_raw = new PlaybackInterpolateRaw( x, y,
                pwindow, this));
-       y += interpolate_raw->get_h();
+       y += interpolate_raw->get_h() + margin;
 
-       add_subwindow(white_balance_raw = new PlaybackWhiteBalanceRaw( x, y,
+       add_subwindow(white_balance_raw = new PlaybackWhiteBalanceRaw(x, y,
                pwindow, this));
-       y += white_balance_raw->get_h() + 10;
-       if(!pwindow->thread->edl->session->interpolate_raw)
-               white_balance_raw->disable();
+       if(!pwindow->thread->edl->session->interpolate_raw) 
+               white_balance_raw->disable();
+       y += white_balance_raw->get_h() + margin;
 
-       y += white_balance_raw->get_h() + 5;
        add_subwindow(vdevice_title = new BC_Title(x, y, _("Video Driver:")));
-       video_device = new VDevicePrefs(x + vdevice_title->get_w() + 10, y,
-               pwindow, this, playback_config->vconfig, 0, MODEPLAY);
+       y += vdevice_title->get_h() + margin;
+       video_device = new VDevicePrefs(x, y, pwindow, this,
+               playback_config->vconfig, 0, MODEPLAY);
        video_device->initialize(0);
 }
 
@@ -327,7 +318,7 @@ PlaybackInterpolateRaw::PlaybackInterpolateRaw( int x, int y,
 int PlaybackInterpolateRaw::handle_event()
 {
        pwindow->thread->edl->session->interpolate_raw = get_value();
-       if(!pwindow->thread->edl->session->interpolate_raw) {
+       if( !pwindow->thread->edl->session->interpolate_raw ) {
                playback->white_balance_raw->update(0, 0);
                playback->white_balance_raw->disable();
        }
@@ -338,7 +329,6 @@ int PlaybackInterpolateRaw::handle_event()
        return 1;
 }
 
-
 PlaybackWhiteBalanceRaw::PlaybackWhiteBalanceRaw( int x, int y,
                PreferencesWindow *pwindow, PlaybackPrefs *playback)
  : BC_CheckBox(x,
@@ -358,23 +348,22 @@ int PlaybackWhiteBalanceRaw::handle_event()
        return 1;
 }
 
-
-VideoAsynchronous::VideoAsynchronous(PreferencesWindow *pwindow, int x, int y)
- : BC_CheckBox(x, y,
-       pwindow->thread->edl->session->video_every_frame &&
-               pwindow->thread->edl->session->video_asynchronous,
-       _("Decode frames asynchronously"))
-{
-       this->pwindow = pwindow;
-       if(!pwindow->thread->edl->session->video_every_frame)
-               disable();
-}
-
-int VideoAsynchronous::handle_event()
-{
-       pwindow->thread->edl->session->video_asynchronous = get_value();
-       return 1;
-}
+// VideoAsynchronous::VideoAsynchronous(PreferencesWindow *pwindow, int x, int y)
+//  : BC_CheckBox(x, y,
+//     pwindow->thread->edl->session->video_every_frame &&
+//             pwindow->thread->edl->session->video_asynchronous,
+//     _("Decode frames asynchronously"))
+// {
+//     this->pwindow = pwindow;
+//     if(!pwindow->thread->edl->session->video_every_frame)
+//             disable();
+// }
+// 
+// int VideoAsynchronous::handle_event()
+// {
+//     pwindow->thread->edl->session->video_asynchronous = get_value();
+//     return 1;
+// }
 
 
 VideoEveryFrame::VideoEveryFrame(PreferencesWindow *pwindow,
@@ -388,14 +377,14 @@ VideoEveryFrame::VideoEveryFrame(PreferencesWindow *pwindow,
 int VideoEveryFrame::handle_event()
 {
        pwindow->thread->edl->session->video_every_frame = get_value();
-       if(!pwindow->thread->edl->session->video_every_frame) {
-               playback_prefs->asynchronous->update(0, 0);
-               playback_prefs->asynchronous->disable();
-       }
-       else {
-               playback_prefs->asynchronous->update(pwindow->thread->edl->session->video_asynchronous, 0);
-               playback_prefs->asynchronous->enable();
-       }
+//     if(!pwindow->thread->edl->session->video_every_frame) {
+//             playback_prefs->asynchronous->update(0, 0);
+//             playback_prefs->asynchronous->disable();
+//     }
+//     else {
+//             playback_prefs->asynchronous->update(pwindow->thread->edl->session->video_asynchronous, 0);
+//             playback_prefs->asynchronous->enable();
+//     }
        return 1;
 }
 
index 167d3bd62f5a91cfa961ca9b3508690a770ac87c..f2befa9f1108526cad39baea358805fe3f2d1909 100644 (file)
@@ -30,7 +30,7 @@ class PlaybackViewFollows;
 class PlaybackSoftwareTimer;
 class PlaybackRealTime;
 class PlaybackMap51_2;
-class VideoAsynchronous;
+//class VideoAsynchronous;
 class VideoEveryFrame;
 class PlaybackPreload;
 class PlaybackInterpolateRaw;
@@ -70,7 +70,7 @@ public:
        BC_Title *framerate_title;
        PlaybackInterpolateRaw *interpolate_raw;
        PlaybackWhiteBalanceRaw *white_balance_raw;
-       VideoAsynchronous *asynchronous;
+//     VideoAsynchronous *asynchronous;
 
        BC_Title *vdevice_title;
        PlaybackAudioOffset *audio_offset;
@@ -127,6 +127,14 @@ public:
        PreferencesWindow *pwindow;
 };
 
+// class VideoAsynchronous : public BC_CheckBox
+// {
+// public:
+//     VideoAsynchronous(PreferencesWindow *pwindow, int x, int y);
+//     int handle_event();
+//     PreferencesWindow *pwindow;
+// };
+
 class PlaybackMap51_2 : public BC_CheckBox
 {
 public:
@@ -137,14 +145,6 @@ public:
        PlaybackPrefs *playback_prefs;
 };
 
-class VideoAsynchronous : public BC_CheckBox
-{
-public:
-       VideoAsynchronous(PreferencesWindow *pwindow, int x, int y);
-       int handle_event();
-       PreferencesWindow *pwindow;
-};
-
 class VideoEveryFrame : public BC_CheckBox
 {
 public:
index 03e8c3f1e642f43487950ef60b1f213e29a95262..aaec69d86e107e92da749a70a46a63b3a7b6d26e 100644 (file)
@@ -730,39 +730,29 @@ int PluginClient::get_interpolation_type()
 
 float PluginClient::get_red()
 {
-       if(server->mwindow)
-               return server->mwindow->edl->local_session->red;
-       else
-       if(server->edl)
-               return server->edl->local_session->red;
-       else
-               return 0;
+       EDL *edl = server->mwindow ? server->mwindow->edl : server->edl;
+       return !edl ? 0 : edl->local_session->use_max ?
+               edl->local_session->red_max :
+               edl->local_session->red;
 }
 
 float PluginClient::get_green()
 {
-       if(server->mwindow)
-               return server->mwindow->edl->local_session->green;
-       else
-       if(server->edl)
-               return server->edl->local_session->green;
-       else
-               return 0;
+       EDL *edl = server->mwindow ? server->mwindow->edl : server->edl;
+       return !edl ? 0 : edl->local_session->use_max ?
+               edl->local_session->green_max :
+               edl->local_session->green;
 }
 
 float PluginClient::get_blue()
 {
-       if(server->mwindow)
-               return server->mwindow->edl->local_session->blue;
-       else
-       if(server->edl)
-               return server->edl->local_session->blue;
-       else
-               return 0;
+       EDL *edl = server->mwindow ? server->mwindow->edl : server->edl;
+       return !edl ? 0 : edl->local_session->use_max ?
+               edl->local_session->blue_max :
+               edl->local_session->blue;
 }
 
 
-
 int64_t PluginClient::get_source_position()
 {
        return source_position;
diff --git a/cinelerra-5.1/cinelerra/presets.C b/cinelerra-5.1/cinelerra/presets.C
new file mode 100644 (file)
index 0000000..8a28909
--- /dev/null
@@ -0,0 +1,438 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#include "bcsignals.h"
+#include "bcwindowbase.inc"
+#include "file.h"
+#include "filesystem.h"
+#include "filexml.h"
+#include "keyframe.h"
+#include "messages.inc"
+#include "mwindow.h"
+#include "pluginserver.h"
+#include "preferences.inc"
+#include "presets.h"
+
+#include <errno.h>
+#include <string.h>
+
+PresetsDB::PresetsDB()
+{
+}
+
+void PresetsDB::clear()
+{
+       plugins.remove_all_objects();
+}
+
+void PresetsDB::load_from_file(char *path, int is_factory, int clear_it)
+{
+       if( clear_it ) clear();
+       FileXML file;
+
+       file.read_from_file(path);
+       load_common(&file, is_factory);
+}
+
+void PresetsDB::load_from_string(char *string, int is_factory, int clear_it)
+{
+       if( clear_it ) clear();
+       
+       FileXML file;
+       file.read_from_string(string);
+       load_common(&file, is_factory);
+}
+
+
+
+void PresetsDB::load_common(FileXML *file, int is_factory)
+{
+       int result = 0;
+       char string[BCTEXTLEN];
+
+       do {
+               result = file->read_tag();
+               if( ! result  ) {
+                       if( file->tag.title_is("PLUGIN") ) {
+                               PresetsDBPlugin *plugin = 0;
+                               sprintf(string, "Unknown");
+                               const char *title = file->tag.get_property("TITLE", string);
+
+// Search for existing plugin
+                               for( int i=0; i<plugins.size(); ++i ) {
+                                       if( !strcasecmp(plugins[i]->title, title) ) {
+                                               plugin = plugins[i];
+                                               break;
+                                       }
+                               }
+
+// Create new plugin
+                               if( !plugin ) {
+                                       plugin = new PresetsDBPlugin(title);
+                                       plugins.append(plugin);
+                               }
+
+                               plugin->load(file, is_factory);
+                       }
+               }
+       } while(!result);
+}
+
+
+void PresetsDB::save()
+{
+       FileXML file;
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( plugin->get_total_presets(1) > 0 ) {
+                       plugin->save(&file);
+               }
+       }
+       file.terminate_string();
+
+       char path[BCTEXTLEN];
+       sprintf(path, "%s/%s", File::get_config_path(), PRESETS_FILE);
+       FileSystem fs;
+       fs.complete_path(path);
+       file.write_to_file(path);
+}
+
+
+int PresetsDB::get_total_presets(char *plugin_title, int user_only)
+{
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( !strcasecmp(plugin->title, plugin_title) ) {
+                       return plugin->get_total_presets(user_only);
+               }
+       }
+
+       return 0;
+}
+
+
+// move factory presets to the start, followed by sorted preset titles
+void PresetsDB::sort(char *plugin_title)
+{
+       PresetsDBPlugin *plugin = 0;
+       for( int i=0; !plugin && i<plugins.size(); ++i ) {
+               if( !strcasecmp(plugins[i]->title, plugin_title) )
+                       plugin = plugins[i];
+       }
+
+       if( plugin ) {
+               int done = 0;
+               int total_presets = plugin->get_total_presets(0);
+               while( !done ) {
+                       done = 1;
+                       for( int i=0; i<total_presets-1; ++i ) {
+                               PresetsDBKeyframe *keyframe1 = plugin->keyframes[i];
+                               PresetsDBKeyframe *keyframe2 = plugin->keyframes[i+1];
+
+                               if( (keyframe2->is_factory && !keyframe1->is_factory) ||
+                                   (keyframe2->is_factory == keyframe1->is_factory &&
+                                    strcmp(keyframe2->title, keyframe1->title) < 0) ) {
+                                       plugin->keyframes.set(i, keyframe2);
+                                       plugin->keyframes.set(i + 1, keyframe1);
+                                       done = 0;
+                               }
+                       }
+               }
+       }
+}
+
+
+char* PresetsDB::get_preset_title(char *plugin_title, int number)
+{
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( !strcasecmp(plugin->title, plugin_title) ) {
+                       if( number < plugin->keyframes.size() )
+                               return plugin->keyframes[number]->title;
+                       printf("PresetsDB::get_preset_title %d buffer overrun\n", __LINE__);
+                       break;
+               }
+       }
+       return 0;
+}
+
+
+int PresetsDB::get_is_factory(char *plugin_title, int number)
+{
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( !strcasecmp(plugin->title, plugin_title) ) {
+                       if( number < plugin->keyframes.size() )
+                               return plugin->keyframes[number]->is_factory;
+                       printf("PresetsDB::get_preset_title %d buffer overrun\n", __LINE__);
+                       break;
+               }
+       }
+       return 0;
+}
+
+
+char* PresetsDB::get_preset_data(char *plugin_title, int number)
+{
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( !strcasecmp(plugin->title, plugin_title) ) {
+                       if( number < plugin->keyframes.size() )
+                               return plugin->keyframes[number]->data;
+                       printf("PresetsDB::get_preset_data %d buffer overrun\n", __LINE__);
+                       break;
+               }
+       }
+       return 0;
+}
+
+PresetsDBPlugin* PresetsDB::get_plugin(const char *plugin_title)
+{
+       for( int i=0; i<plugins.size(); ++i ) {
+               PresetsDBPlugin *plugin = plugins[i];
+               if( !strcasecmp(plugin->title, plugin_title) )
+                       return plugin;
+       }
+       return 0;
+}
+
+PresetsDBPlugin* PresetsDB::new_plugin(const char *plugin_title)
+{
+       PresetsDBPlugin *result = new PresetsDBPlugin(plugin_title);
+       plugins.append(result);
+       return result;
+}
+
+
+void PresetsDB::save_preset(const char *plugin_title, 
+       const char *preset_title, 
+       char *data)
+{
+       PresetsDBPlugin *plugin = get_plugin(plugin_title);
+       if( !plugin ) plugin = new_plugin(plugin_title);
+       PresetsDBKeyframe *keyframe = plugin->get_keyframe(preset_title, 0);
+       if( !keyframe ) keyframe = plugin->new_keyframe(preset_title);
+       keyframe->set_data(data);
+       save();
+
+}
+
+
+void PresetsDB::delete_preset(const char *plugin_title, 
+       const char *preset_title,
+       int is_factory)
+{
+       PresetsDBPlugin *plugin = get_plugin(plugin_title);
+       if( plugin ) {
+               plugin->delete_keyframe(preset_title);
+       }
+       save();
+}
+
+void PresetsDB::load_preset(const char *plugin_title,
+       const char *preset_title, 
+       KeyFrame *keyframe,
+       int is_factory)
+{
+       PresetsDBPlugin *plugin = get_plugin(plugin_title);
+       if( plugin ) {
+               plugin->load_preset(preset_title, keyframe, is_factory);
+       }
+}
+
+int PresetsDB::preset_exists(const char *plugin_title, 
+       const char *preset_title,
+       int is_factory)
+{
+       PresetsDBPlugin *plugin = get_plugin(plugin_title);
+       if( plugin ) {
+               return plugin->preset_exists(preset_title, is_factory);
+       }
+       return 0;
+}
+
+
+
+
+PresetsDBKeyframe::PresetsDBKeyframe(const char *title, int is_factory)
+{
+       this->title = strdup(title);
+       data = 0;
+       this->is_factory = is_factory;
+}
+
+PresetsDBKeyframe::~PresetsDBKeyframe()
+{
+       delete [] title;
+       delete [] data;
+}
+
+void PresetsDBKeyframe::set_data(char *data)
+{
+       delete [] this->data;
+       this->data = new char[strlen(data) + 1];
+       strcpy(this->data, data);
+}
+
+
+PresetsDBPlugin::PresetsDBPlugin(const char *title)
+{
+       this->title = strdup(title);
+}
+
+PresetsDBPlugin::~PresetsDBPlugin()
+{
+       keyframes.remove_all_objects();
+       delete [] title;
+}
+
+int PresetsDBPlugin::get_total_presets(int user_only)
+{
+       if( !user_only )
+               return keyframes.size();
+       int result = 0;
+       for( int j=0; j<keyframes.size(); ++j )
+               if( !keyframes[j]->is_factory ) ++result;
+       return result;
+}
+
+void PresetsDBPlugin::load(FileXML *file, int is_factory)
+{
+       int result = 0;
+       char string[BCTEXTLEN];
+
+       do {
+               result = file->read_tag();
+               if( !result ) {
+                       if( file->tag.title_is("/PLUGIN") ) break;
+                       else
+                       if( file->tag.title_is("KEYFRAME") ) {
+                               sprintf(string, "Unknown");
+                               const char *keyframe_title = file->tag.get_property("TITLE", string);
+                               PresetsDBKeyframe *keyframe = new PresetsDBKeyframe(keyframe_title, is_factory);
+
+                               char data[MESSAGESIZE];
+                               file->read_text_until("/KEYFRAME", data, MESSAGESIZE);
+                               keyframe->set_data(data);
+                               keyframes.append(keyframe);
+               
+                       }
+               }
+       } while(!result);
+}
+
+void PresetsDBPlugin::save(FileXML *file)
+{
+       file->tag.set_title("PLUGIN");
+       file->tag.set_property("TITLE", title);
+       file->append_tag();
+       file->append_newline();
+
+       for( int j=0; j<keyframes.size(); ++j ) {
+               PresetsDBKeyframe *keyframe = keyframes[j];
+               
+               if( !keyframe->is_factory ) {
+                       file->tag.set_title("KEYFRAME");
+                       file->tag.set_property("TITLE", keyframe->title);
+                       file->append_tag();
+                       file->append_text(keyframe->data);
+                       file->tag.set_title("/KEYFRAME");
+                       file->append_tag();
+                       file->append_newline();
+               }
+       }
+
+       file->tag.set_title("/PLUGIN");
+       file->append_tag();
+       file->append_newline();
+}
+
+PresetsDBKeyframe* PresetsDBPlugin::get_keyframe(const char *title, 
+       int is_factory)
+{
+       for( int i=0; i<keyframes.size(); ++i ) {
+               PresetsDBKeyframe *keyframe = keyframes[i];
+               if( !strcasecmp(keyframe->title, title) && 
+                   keyframe->is_factory == is_factory )
+                       return keyframe;
+       }
+       return 0;
+}
+
+void PresetsDBPlugin::delete_keyframe(const char *title)
+{
+       for( int i=0; i<keyframes.size(); ++i ) {
+               PresetsDBKeyframe *keyframe = keyframes[i];
+               if( !strcasecmp(keyframe->title, title) && !keyframe->is_factory )
+                   keyframes.remove_object_number(i);
+                       return;
+       }
+}
+
+
+PresetsDBKeyframe* PresetsDBPlugin::new_keyframe(const char *title)
+{
+       PresetsDBKeyframe *keyframe = new PresetsDBKeyframe(title, 0);
+       keyframes.append(keyframe);
+       return keyframe;
+}
+
+void PresetsDBPlugin::load_preset(const char *preset_title, 
+       KeyFrame *keyframe,
+       int is_factory)
+{
+       PresetsDBKeyframe *src = get_keyframe(preset_title, is_factory);
+       if( src ) {
+               keyframe->set_data(src->data);
+// Save as the plugin's default, Need the path
+//printf("PresetsDBPlugin::load_preset %d %s\n", __LINE__, title);
+               PluginServer *server = MWindow::scan_plugindb(title, -1);
+               if( server ) {
+                       char path[BCTEXTLEN];
+                       server->get_defaults_path(path);
+                       FileSystem fs;
+                       fs.complete_path(path);
+
+                       FILE *fd = fopen(path, "w");
+                       if( fd ) {
+                               if( !fwrite(src->data, strlen(src->data), 1, fd) ) {
+                                       fprintf(stderr, "PresetsDBPlugin::load_preset %d \"%s\": %s\n",
+                                               __LINE__,
+                                               path,
+                                               strerror(errno));
+                               }
+
+                               fclose(fd);
+                       }
+                       else {
+                               fprintf(stderr, "PresetsDBPlugin::load_preset %d \"%s\": %s\n",
+                                       __LINE__, path, strerror(errno));
+                       }
+               }
+       }
+}
+
+int PresetsDBPlugin::preset_exists(const char *preset_title, int is_factory)
+{
+       PresetsDBKeyframe *src = get_keyframe(preset_title, is_factory);
+       return src ? 1 : 0;
+}
+
diff --git a/cinelerra-5.1/cinelerra/presets.h b/cinelerra-5.1/cinelerra/presets.h
new file mode 100644 (file)
index 0000000..1db071e
--- /dev/null
@@ -0,0 +1,128 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#ifndef PRESETS_H
+#define PRESETS_H
+
+
+#include "arraylist.h"
+#include "filexml.inc"
+#include "keyframe.inc"
+
+
+// Front end for a DB of presets for all plugins
+
+// A single preset
+class PresetsDBKeyframe
+{
+public:
+       PresetsDBKeyframe(const char *title, int is_factory);
+       ~PresetsDBKeyframe();
+
+       void set_data(char *data);
+
+       char *title;
+       char *data;
+// is a factory preset
+       int is_factory;
+};
+
+// Presets for a single plugin
+class PresetsDBPlugin
+{
+public:
+       PresetsDBPlugin(const char *title);
+       ~PresetsDBPlugin();
+       
+       
+       void load(FileXML *file, int is_factory);
+       void save(FileXML *file);
+
+// Get a preset by name
+       PresetsDBKeyframe* get_keyframe(const char *title, int is_factory);
+// Create a new keyframe
+       PresetsDBKeyframe* new_keyframe(const char *title);
+       void delete_keyframe(const char *title);
+// Load a preset into the keyframe
+       void load_preset(const char *preset_title, 
+               KeyFrame *keyframe,
+               int is_factory);
+       int preset_exists(const char *preset_title, int is_factory);
+       int get_total_presets(int user_only);
+
+       ArrayList<PresetsDBKeyframe*> keyframes;
+       char *title;
+};
+
+class PresetsDB
+{
+public:
+       PresetsDB();
+
+// Load the database from the file.
+       void load_from_file(char *path, int is_factory, int clear_it);
+// load the database from a string
+       void load_from_string(char *string, int is_factory, int clear_it);
+       void load_common(FileXML *file, int is_factory);
+       
+// Save the database to the file.
+       void save();
+       void sort(char *plugin_title);
+
+// Get the total number of presets for a plugin
+       int get_total_presets(char *plugin_title, int user_only);
+// Get the title of a preset
+       char* get_preset_title(char *plugin_title, int number);
+       int get_is_factory(char *plugin_title, int number);
+// Get the data for a preset
+       char* get_preset_data(char *plugin_title, int number);
+// Get a pluginDB by name
+       PresetsDBPlugin* get_plugin(const char *plugin_title);
+// Create a pluginDB
+       PresetsDBPlugin* new_plugin(const char *plugin_title);
+       void save_preset(const char *plugin_title, 
+               const char *preset_title, 
+               char *data);
+       void delete_preset(const char *plugin_title, 
+               const char *preset_title,
+               int is_factory);
+// Load a preset into the keyframe
+       void load_preset(const char *plugin_title, 
+               const char *preset_title, 
+               KeyFrame *keyframe,
+               int is_factory);
+       int preset_exists(const char *plugin_title, 
+               const char *preset_title,
+               int is_factory);
+
+private:
+// Remove all plugin data
+       void clear();
+
+       ArrayList<PresetsDBPlugin*> plugins;
+};
+
+
+
+#endif
+
+
+
diff --git a/cinelerra-5.1/cinelerra/presets.inc b/cinelerra-5.1/cinelerra/presets.inc
new file mode 100644 (file)
index 0000000..cae1427
--- /dev/null
@@ -0,0 +1,32 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#ifndef PRESETS_INC
+#define PRESETS_INC
+
+
+class PresetsDB;
+
+#endif
+
+
+
+
diff --git a/cinelerra-5.1/cinelerra/presetsgui.C b/cinelerra-5.1/cinelerra/presetsgui.C
new file mode 100644 (file)
index 0000000..c5dbe8e
--- /dev/null
@@ -0,0 +1,508 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#if 0
+
+
+
+
+#include "edl.h"
+#include "keyframe.h"
+#include "keys.h"
+#include "language.h"
+#include "localsession.h"
+#include "mainsession.h"
+#include "mainundo.h"
+#include "mwindow.h"
+#include "mwindowgui.h"
+#include "plugin.h"
+#include "presets.h"
+#include "presetsgui.h"
+#include "theme.h"
+#include "trackcanvas.h"
+#include "tracks.h"
+
+
+
+
+
+
+
+
+
+
+
+PresetsThread::PresetsThread(MWindow *mwindow)
+ : BC_DialogThread()
+{
+       this->mwindow = mwindow;
+       plugin = 0;
+       data = new ArrayList<BC_ListBoxItem*>;
+       presets_db = new PresetsDB;
+       plugin_title[0] = 0;
+       window_title[0] = 0;
+}
+
+PresetsThread::~PresetsThread()
+{
+       delete data;
+}
+
+void PresetsThread::calculate_list()
+{
+       data->remove_all_objects();
+       int total_presets = presets_db->get_total_presets(plugin_title);
+       for(int i = 0; i < total_presets; i++)
+       {
+               data->append(new BC_ListBoxItem(presets_db->get_preset_title(
+                       plugin_title,
+                       i)));
+       }
+}
+
+
+void PresetsThread::start_window(Plugin *plugin)
+{
+       if(!BC_DialogThread::is_running())
+       {
+               this->plugin = plugin;
+               plugin->calculate_title(plugin_title, 0);
+               sprintf(window_title, PROGRAM_NAME ": %s Presets", plugin_title);
+
+
+// Calculate database
+               presets_db->load();
+               calculate_list();
+
+
+               mwindow->gui->unlock_window();
+               BC_DialogThread::start();
+               mwindow->gui->lock_window("PresetsThread::start_window");
+       }
+}
+
+BC_Window* PresetsThread::new_gui()
+{
+       mwindow->gui->lock_window("PresetsThread::new_gui");
+       int x = mwindow->gui->get_abs_cursor_x(0) - 
+               mwindow->session->plugindialog_w / 2;
+       int y = mwindow->gui->get_abs_cursor_y(0) - 
+               mwindow->session->plugindialog_h / 2;
+
+       PresetsWindow *window = new PresetsWindow(mwindow, 
+               this, 
+               x, 
+               y,
+               window_title);
+
+       window->create_objects();
+       mwindow->gui->unlock_window();
+       return window;
+}
+
+void PresetsThread::handle_done_event(int result)
+{
+// Apply the preset
+       if(!result)
+       {
+               char *title = ((PresetsWindow*)get_gui())->title_text->get_text();
+               apply_preset(title);
+       }
+}
+
+void PresetsThread::handle_close_event(int result)
+{
+}
+
+void PresetsThread::save_preset(char *title)
+{
+       get_gui()->unlock_window();
+       mwindow->gui->lock_window("PresetsThread::save_preset");
+       
+// Test EDL for plugin existence
+       if(!mwindow->edl->tracks->plugin_exists(plugin))
+       {
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("PresetsThread::save_preset 2");
+               return;
+       }
+
+
+// Get current plugin keyframe
+       EDL *edl = mwindow->edl;
+       Track *track = plugin->track;
+       KeyFrame *keyframe = plugin->get_prev_keyframe(
+                       track->to_units(edl->local_session->get_selectionstart(1), 0), 
+                       PLAY_FORWARD);
+
+// Send to database
+       presets_db->save_preset(plugin_title, title, keyframe->get_data());
+
+       mwindow->gui->unlock_window();
+       get_gui()->lock_window("PresetsThread::save_preset 2");
+
+
+// Update list
+       calculate_list();
+       ((PresetsWindow*)get_gui())->list->update(data,
+               0,
+               0,
+               1);
+}
+
+void PresetsThread::delete_preset(char *title)
+{
+       get_gui()->unlock_window();
+       mwindow->gui->lock_window("PresetsThread::save_preset");
+       
+// Test EDL for plugin existence
+       if(!mwindow->edl->tracks->plugin_exists(plugin))
+       {
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("PresetsThread::delete_preset 1");
+               return;
+       }
+
+       presets_db->delete_preset(plugin_title, title);
+       
+       mwindow->gui->unlock_window();
+       get_gui()->lock_window("PresetsThread::delete_preset 2");
+
+
+// Update list
+       calculate_list();
+       ((PresetsWindow*)get_gui())->list->update(data,
+               0,
+               0,
+               1);
+}
+
+
+void PresetsThread::apply_preset(char *title)
+{
+       if(presets_db->preset_exists(plugin_title, title))
+       {
+               get_gui()->unlock_window();
+               mwindow->gui->lock_window("PresetsThread::apply_preset");
+
+// Test EDL for plugin existence
+               if(!mwindow->edl->tracks->plugin_exists(plugin))
+               {
+                       mwindow->gui->unlock_window();
+                       get_gui()->lock_window("PresetsThread::delete_preset 1");
+                       return;
+               }
+
+               mwindow->undo->update_undo_before();
+               KeyFrame *keyframe = plugin->get_keyframe();
+               presets_db->load_preset(plugin_title, title, keyframe);
+               mwindow->save_backup();
+               mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); 
+
+               mwindow->update_plugin_guis();
+               mwindow->gui->canvas->draw_overlays();
+               mwindow->gui->canvas->flash();
+               mwindow->sync_parameters(CHANGE_PARAMS);
+
+               mwindow->gui->unlock_window();
+               get_gui()->lock_window("PresetsThread::apply_preset");
+       }
+}
+
+
+
+
+
+PresetsList::PresetsList(PresetsThread *thread,
+       PresetsWindow *window,
+       int x,
+       int y,
+       int w, 
+       int h)
+ : BC_ListBox(x, 
+               y, 
+               w, 
+               h,
+               LISTBOX_TEXT,
+               thread->data)
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsList::selection_changed()
+{
+       window->title_text->update(
+               thread->data->get(get_selection_number(0, 0))->get_text());
+       return 0;
+}
+
+int PresetsList::handle_event()
+{
+       window->set_done(0);
+       return 0;
+}
+
+
+
+
+
+
+
+
+
+
+PresetsText::PresetsText(PresetsThread *thread,
+       PresetsWindow *window,
+       int x,
+       int y,
+       int w)
+ : BC_TextBox(x, 
+       y, 
+       w, 
+       1, 
+       "")
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsText::handle_event()
+{
+       return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+PresetsDelete::PresetsDelete(PresetsThread *thread,
+       PresetsWindow *window,
+       int x,
+       int y)
+ : BC_GenericButton(x, y, _("Delete"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsDelete::handle_event()
+{
+       thread->delete_preset(window->title_text->get_text());
+       return 1;
+}
+
+
+
+
+
+
+
+PresetsSave::PresetsSave(PresetsThread *thread,
+       PresetsWindow *window,
+       int x,
+       int y)
+: BC_GenericButton(x, y, _("Save"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsSave::handle_event()
+{
+       thread->save_preset(window->title_text->get_text());
+       return 1;
+}
+
+
+
+
+
+
+
+
+PresetsApply::PresetsApply(PresetsThread *thread,
+       PresetsWindow *window,
+       int x,
+       int y)
+ : BC_GenericButton(x, y, _("Apply"))
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsApply::handle_event()
+{
+       thread->apply_preset(window->title_text->get_text());
+       return 1;
+}
+
+
+
+PresetsOK::PresetsOK(PresetsThread *thread,
+       PresetsWindow *window)
+ : BC_OKButton(window)
+{
+       this->thread = thread;
+       this->window = window;
+}
+
+int PresetsOK::keypress_event()
+{
+       if(get_keypress() == RETURN)
+       {
+printf("PresetsOK::keypress_event %d\n", __LINE__);
+               if(thread->presets_db->preset_exists(thread->plugin_title, 
+                       window->title_text->get_text()))
+               {
+printf("PresetsOK::keypress_event %d\n", __LINE__);
+                       window->set_done(0);
+                       return 1;
+               }
+               else
+               {
+printf("PresetsOK::keypress_event %d\n", __LINE__);
+                       thread->save_preset(window->title_text->get_text());
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+
+
+
+
+
+
+
+
+
+PresetsWindow::PresetsWindow(MWindow *mwindow,
+       PresetsThread *thread,
+       int x,
+       int y,
+       char *title_string)
+ : BC_Window(title_string, 
+       x,
+       y,
+       mwindow->session->presetdialog_w, 
+       mwindow->session->presetdialog_h, 
+       320, 
+       240,
+       1,
+       0,
+       1)
+{
+       this->mwindow = mwindow;
+       this->thread = thread;
+}
+
+void PresetsWindow::create_objects()
+{
+       Theme *theme = mwindow->theme;
+
+       lock_window("PresetsWindow::create_objects");
+       theme->get_presetdialog_sizes(this);
+       
+       add_subwindow(title1 = new BC_Title(theme->presets_list_x,
+               theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border,
+               _("Saved presets:")));
+       add_subwindow(list = new PresetsList(thread,
+               this,
+               theme->presets_list_x,
+               theme->presets_list_y,
+               theme->presets_list_w, 
+               theme->presets_list_h));
+       add_subwindow(title2 = new BC_Title(theme->presets_text_x,
+               theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border,
+               _("Preset title:")));
+       add_subwindow(title_text = new PresetsText(thread,
+               this,
+               theme->presets_text_x,
+               theme->presets_text_y,
+               theme->presets_text_w));
+       add_subwindow(delete_button = new PresetsDelete(thread,
+               this,
+               theme->presets_delete_x,
+               theme->presets_delete_y));
+       add_subwindow(save_button = new PresetsSave(thread,
+               this,
+               theme->presets_save_x,
+               theme->presets_save_y));
+       add_subwindow(apply_button = new PresetsApply(thread,
+               this,
+               theme->presets_apply_x,
+               theme->presets_apply_y));
+
+       add_subwindow(new PresetsOK(thread, this));
+       add_subwindow(new BC_CancelButton(this));
+
+       show_window();
+       unlock_window();
+}
+
+int PresetsWindow::resize_event(int w, int h)
+{
+       Theme *theme = mwindow->theme;
+       mwindow->session->presetdialog_w = w;
+       mwindow->session->presetdialog_h = h;
+       theme->get_presetdialog_sizes(this);
+
+       title1->reposition_window(theme->presets_list_x,
+               theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border);
+       title2->reposition_window(theme->presets_text_x,
+               theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border);
+       list->reposition_window(theme->presets_list_x,
+               theme->presets_list_y,
+               theme->presets_list_w, 
+               theme->presets_list_h);
+       title_text->reposition_window(theme->presets_text_x,
+               theme->presets_text_y,
+               theme->presets_text_w);
+       delete_button->reposition_window(theme->presets_delete_x,
+               theme->presets_delete_y);
+       save_button->reposition_window(theme->presets_save_x,
+               theme->presets_save_y);
+       apply_button->reposition_window(theme->presets_apply_x,
+               theme->presets_apply_y);
+       return 0;
+}
+
+
+
+
+
+
+#endif
+
diff --git a/cinelerra-5.1/cinelerra/presetsgui.h b/cinelerra-5.1/cinelerra/presetsgui.h
new file mode 100644 (file)
index 0000000..abd63e8
--- /dev/null
@@ -0,0 +1,170 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#ifndef PRESETSGUI_H
+#define PRESETSGUI_H
+
+
+// Presets for effects & transitions
+#if 0
+
+#include "bcdialog.h"
+#include "guicast.h"
+#include "mwindow.inc"
+#include "plugin.inc"
+#include "presets.inc"
+
+class PresetsWindow;
+
+
+
+
+
+class PresetsThread : public BC_DialogThread
+{
+public:
+       PresetsThread(MWindow *mwindow);
+       ~PresetsThread();
+
+       void calculate_list();
+       void start_window(Plugin *plugin);
+       BC_Window* new_gui();
+       void handle_done_event(int result);
+       void handle_close_event(int result);
+       void save_preset(char *title);
+       void delete_preset(char *title);
+       void apply_preset(char *title);
+
+       char window_title[BCTEXTLEN];
+       char plugin_title[BCTEXTLEN];
+       MWindow *mwindow;
+       Plugin *plugin;
+       ArrayList<BC_ListBoxItem*> *data;
+       PresetsDB *presets_db;
+};
+
+class PresetsList : public BC_ListBox
+{
+public:
+       PresetsList(PresetsThread *thread,
+               PresetsWindow *window,
+               int x,
+               int y,
+               int w, 
+               int h);
+       int selection_changed();
+       int handle_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+class PresetsText : public BC_TextBox
+{
+public:
+       PresetsText(PresetsThread *thread,
+               PresetsWindow *window,
+               int x,
+               int y,
+               int w);
+       int handle_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+
+class PresetsDelete : public BC_GenericButton
+{
+public:
+       PresetsDelete(PresetsThread *thread,
+               PresetsWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+class PresetsSave : public BC_GenericButton
+{
+public:
+       PresetsSave(PresetsThread *thread,
+               PresetsWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+class PresetsApply : public BC_GenericButton
+{
+public:
+       PresetsApply(PresetsThread *thread,
+               PresetsWindow *window,
+               int x,
+               int y);
+       int handle_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+class PresetsOK : public BC_OKButton
+{
+public:
+       PresetsOK(PresetsThread *thread,
+               PresetsWindow *window);
+       int keypress_event();
+       PresetsThread *thread;
+       PresetsWindow *window;
+};
+
+
+class PresetsWindow : public BC_Window
+{
+public:
+       PresetsWindow(MWindow *mwindow,
+               PresetsThread *thread,
+               int x,
+               int y,
+               char *title_string);
+
+       void create_objects();
+       int resize_event(int w, int h);
+
+       PresetsList *list;
+       PresetsText *title_text;
+       PresetsDelete *delete_button;
+       PresetsSave *save_button;
+       PresetsApply *apply_button;
+       BC_Title *title1;
+       BC_Title *title2;
+       MWindow *mwindow;
+       PresetsThread *thread;
+};
+
+
+
+#endif
+
+#endif
+
+
+
diff --git a/cinelerra-5.1/cinelerra/presetsgui.inc b/cinelerra-5.1/cinelerra/presetsgui.inc
new file mode 100644 (file)
index 0000000..688ec11
--- /dev/null
@@ -0,0 +1,33 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ */
+
+#ifndef PRESETSGUI_INC
+#define PRESETSGUI_INC
+
+
+class PresetsThread;
+class PresetsWindow;
+
+#endif
+
+
+
+
index 4cd0ae447824cf5dbd83393cd31685e49ad2c14e..3ea53a42ffa4a82da550707c819d252afc8c1ce1 100644 (file)
@@ -230,6 +230,8 @@ int Record::load_defaults()
        video_zoom = defaults->get("RECORD_VIDEO_Z", (float)1);
        picture->load_defaults();
        reverse_interlace = defaults->get("REVERSE_INTERLACE", 0);
+       do_cursor = defaults->get("RECORD_CURSOR", 0);
+       do_big_cursor = defaults->get("RECORD_BIG_CURSOR", 0);
        for( int i=0; i<MAXCHANNELS; ++i ) {
                sprintf(string, "RECORD_DCOFFSET_%d", i);
                dc_offset[i] = defaults->get(string, 0);
@@ -266,6 +268,8 @@ int Record::save_defaults()
        defaults->update("RECORD_VIDEO_Z", video_zoom);
        picture->save_defaults();
        defaults->update("REVERSE_INTERLACE", reverse_interlace);
+       defaults->update("RECORD_CURSOR", do_cursor);
+       defaults->update("RECORD_BIG_CURSOR", do_big_cursor);
        for( int i=0; i<MAXCHANNELS; ++i ) {
                sprintf(string, "RECORD_DCOFFSET_%d", i);
                defaults->update(string, dc_offset[i]);
@@ -401,7 +405,7 @@ void Record::run()
                        mwindow->undo->update_undo_before();
 // For pasting, clear the active region
                        if(load_mode == LOADMODE_PASTE)
-                               mwindow->clear(0);
+                               mwindow->clear(0, 1);
                        int loadmode = load_mode == LOADMODE_RESOURCESONLY ?
                                LOADMODE_ASSETSONLY : load_mode;
                        mwindow->paste_edls(&new_edls, loadmode, 0, -1,
@@ -437,9 +441,10 @@ void Record::run()
 void Record::stop(int wait)
 {
        stop_operation();
-       if( wait && running() )
+       if( record_gui )
                record_gui->set_done(1);
-       join();
+       if( wait )
+               join();
        window_lock->lock("Record::stop");
        delete record_thread;   record_thread = 0;
        delete record_monitor;  record_monitor = 0;
@@ -995,6 +1000,7 @@ void Record::open_video_input()
                master_channel->copy_usage(vdevice->channel);
                picture->copy_usage(vdevice->picture);
                vdevice->set_field_order(reverse_interlace);
+               vdevice->set_do_cursor(do_cursor, do_big_cursor);
                vdevice->set_adevice(adevice);
                if( adevice ) adevice->set_vdevice(vdevice);
                set_dev_channel(get_current_channel());
@@ -1207,11 +1213,15 @@ void Record::set_power_off(int value)
        record_gui->power_off->update(value);
 }
 
-int Record::set_video_picture()
+void Record::set_video_picture()
 {
        if( default_asset->video_data && vdevice )
                vdevice->set_picture(picture);
-       return 0;
+}
+
+void Record::set_do_cursor()
+{
+       vdevice->set_do_cursor(do_cursor, do_big_cursor);
 }
 
 void Record::set_translation(int x, int y)
index 423b4b09de07831e65994325406fa0ccc91720b6..d8fb0102cb2d5e9384ed3b813028abdea278837b 100644 (file)
@@ -147,7 +147,8 @@ public:
        void set_play_gain(double gain);
        void set_video_monitoring(int mode);
        void stop_operation();
-       int set_video_picture();
+       void set_video_picture();
+       void set_do_cursor();
 // Set screencapture translation
        void set_translation(int x, int y);
 
@@ -283,6 +284,9 @@ public:
        float video_zoom;
 // Reverse the interlace in the video window display only
        int reverse_interlace;
+// record the cursor for screencapture
+       int do_cursor;
+       int do_big_cursor;
 // Color model for uncompressed device interface
        int color_model;
 // Picture quality and parameters the device supports
index 00b257e9b930cb2e242c02ef132c97dcc2356a22..0b3810d861adb483028ae103f2ec09b9e3a60d0e 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -116,7 +116,6 @@ RecordGUI::RecordGUI(MWindow *mwindow, Record *record)
 
 RecordGUI::~RecordGUI()
 {
-TRACE("RecordGUI::~RecordGUI 1");
        delete status_thread;
        delete batch_source;
        delete batch_mode;
@@ -126,7 +125,6 @@ TRACE("RecordGUI::~RecordGUI 1");
        delete batch_start;
        delete batch_duration;
        delete load_mode;
-TRACE("RecordGUI::~RecordGUI 2");
 }
 
 
@@ -1612,5 +1610,3 @@ int RecordGUIResetTranslation::handle_event()
        return 1;
 }
 
-
-
index 40c18df15cd85dda129b9e7398374c5430fbb71d..4b506bd4a204d928a935b35c512923958264fc29 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index c72317fb9be46168807e22250a8706c7d25260b6..b04587a7cb348a953a4f68879d9a09855a39b0ec 100644 (file)
@@ -79,55 +79,36 @@ void RecordMonitor::create_objects()
        mwindow->session->rwindow_fullscreen = 0;
 
        if( !record->default_asset->video_data )
-               min_w = MeterPanel::get_meters_width(
-                       mwindow->theme,
+               min_w = MeterPanel::get_meters_width(mwindow->theme,
                        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
-
-
 
 // Override default device for X11 drivers
                if(mwindow->edl->session->playback_config->vconfig->driver ==
                        PLAYBACK_X11_XV) config.driver = PLAYBACK_X11_XV;
                config.x11_use_fields = 0;
-
-//SET_TRACE
-
                device->open_output(&config,
                        record->default_asset->frame_rate,
                        record->default_asset->width,
                        record->default_asset->height,
                        window->canvas, 0);
-//SET_TRACE
 
                scope_thread = new RecordScopeThread(mwindow, this);
 
-               if(mwindow->session->record_scope)
-               {
+               if(mwindow->session->record_scope) {
                        scope_thread->start();
                }
 
-
                thread = new RecordMonitorThread(mwindow, record, this);
-//SET_TRACE
                thread->start_playback();
-//SET_TRACE
        }
-//SET_TRACE
 
        Thread::start();
 }
@@ -273,6 +254,8 @@ RecordMonitorGUI::RecordMonitorGUI(MWindow *mwindow,
        reverse_interlace = 0;
        meters = 0;
        canvas = 0;
+       cursor_toggle = 0;
+       big_cursor_toggle = 0;
        current_operation = MONITOR_NONE;
        signal_status = 0;
 }
@@ -284,19 +267,15 @@ RecordMonitorGUI::~RecordMonitorGUI()
        delete signal_status;
 #endif
        delete canvas;
-       if( bitmap ) delete bitmap;
+       delete cursor_toggle;
+       delete big_cursor_toggle;
+       delete bitmap;
        if( channel_picker ) delete channel_picker;
 #ifdef HAVE_FIREWIRE
-       if( avc1394transport_thread )
-               delete avc1394transport_thread;
-       if( avc ) {
-               delete avc;
-       }
-       if( avc1394_transport ) {
-               delete avc1394_transport;
-       }
-       if( avc1394transport_title )
-               delete avc1394transport_title;
+       delete avc1394transport_thread;
+       delete avc;
+       delete avc1394_transport;
+       delete avc1394transport_title;
 #endif
        unlock_window();
 }
@@ -312,8 +291,9 @@ void RecordMonitorGUI::create_objects()
                        driver == VIDEO4LINUX2MPEG ||
                        driver == CAPTURE_JPEG_WEBCAM ||
                        driver == CAPTURE_YUYV_WEBCAM);
+       int do_cursor = driver == SCREENCAPTURE;
        int do_scopes = do_channel || driver == SCREENCAPTURE;
-       int do_interlace = (driver == VIDEO4LINUX2JPEG);
+       int do_interlace = driver == VIDEO4LINUX2JPEG;
        int background_done = 0;
        int do_audio = record->default_asset->audio_data;
        int do_video = record->default_asset->video_data;
@@ -399,13 +379,23 @@ void RecordMonitorGUI::create_objects()
                        x += reverse_interlace->get_w() + mwindow->theme->widget_border;
                }
 
-               if(do_scopes)
-               {
+               if( do_scopes ) {
                        scope_toggle = new ScopeEnable(mwindow, thread, x, y);
                        add_subwindow(scope_toggle);
                        x += scope_toggle->get_w() + mwindow->theme->widget_border;
                }
 
+               if( do_cursor ) {
+                       add_subwindow(cursor_toggle = new DoCursor(record,
+                               x, 
+                               y));
+                       x += cursor_toggle->get_w() + mwindow->theme->widget_border;
+                       add_subwindow(big_cursor_toggle = new DoBigCursor(record,
+                               x, 
+                               y));
+                       x += big_cursor_toggle->get_w() + mwindow->theme->widget_border;
+               }
+
                add_subwindow(monitor_menu = new BC_PopupMenu(0, 0, 0, "", 0));
                monitor_menu->add_item(new RecordMonitorFullsize(mwindow, this));
        }
@@ -469,10 +459,8 @@ int RecordMonitorGUI::button_release_event()
 
 int RecordMonitorGUI::cursor_motion_event()
 {
-//SET_TRACE
        if( canvas && canvas->get_canvas() ) {
                canvas->get_canvas()->unhide_cursor();
-//SET_TRACE
                return canvas->cursor_motion_event();
        }
        return 0;
@@ -588,11 +576,25 @@ int RecordMonitorGUI::resize_event(int w, int h)
        }
 #endif
 
-       if(channel_picker) channel_picker->reposition();
-       if(reverse_interlace) reverse_interlace->reposition_window(reverse_interlace->get_x(),
-               reverse_interlace->get_y());
-       if(canvas && do_video)
-       {
+       
+       if( channel_picker ) {
+               channel_picker->reposition();
+       }
+       if( reverse_interlace ) {
+               reverse_interlace->reposition_window(
+                       reverse_interlace->get_x(),
+                       reverse_interlace->get_y());
+       }
+       if( cursor_toggle ) {
+               cursor_toggle->reposition_window(
+                       cursor_toggle->get_x(),
+                       cursor_toggle->get_y());
+               big_cursor_toggle->reposition_window(
+                       big_cursor_toggle->get_x(),
+                       big_cursor_toggle->get_y());
+       }
+
+       if( canvas && do_video ) {
                canvas->reposition_window(0,
                        mwindow->theme->rmonitor_canvas_x,
                        mwindow->theme->rmonitor_canvas_y,
@@ -600,14 +602,14 @@ int RecordMonitorGUI::resize_event(int w, int h)
                        mwindow->theme->rmonitor_canvas_h);
        }
 
-       if(do_meters) {
+       if( do_meters ) {
                meters->reposition_window(mwindow->theme->rmonitor_meter_x,
                        mwindow->theme->rmonitor_meter_y,
                        do_video ? -1 : mwindow->theme->rmonitor_meter_w,
                        mwindow->theme->rmonitor_meter_h);
                meters->set_meters(record->default_asset->channels,1);
        }
-       else if(meters) {
+       else if( meters ) {
                meters->set_meters(0,0);
        }
 
@@ -665,6 +667,41 @@ int RecordMonitorGUI::create_bitmap()
        return 0;
 }
 
+
+DoCursor::DoCursor(Record *record, int x, int y)
+ : BC_CheckBox(x, y, record->do_cursor, _("Record cursor"))
+{
+       this->record = record;
+}
+
+DoCursor::~DoCursor()
+{
+}
+
+int DoCursor::handle_event()
+{
+       record->do_cursor = get_value();
+       return 0;
+}
+
+
+DoBigCursor::DoBigCursor(Record *record, int x, int y)
+ : BC_CheckBox(x, y, record->do_big_cursor, _("Big cursor"))
+{
+       this->record = record;
+}
+
+DoBigCursor::~DoBigCursor()
+{
+}
+
+int DoBigCursor::handle_event()
+{
+       record->do_big_cursor = get_value();
+       return 0;
+}
+
+
 void RecordMonitorGUI::enable_signal_status(int enable)
 {
 #ifdef HAVE_DVB
@@ -1079,7 +1116,9 @@ int RecordMonitorThread::render_frame()
 
 void RecordMonitorThread::new_output_frame()
 {
-       record_monitor->device->new_output_buffer(&output_frame, output_colormodel);
+       record_monitor->device->new_output_buffer(&output_frame, 
+               output_colormodel,
+               record->edl);
 }
 
 void RecordMonitorThread::
index ac3bd1d6a212f3149afee2e978eb8e2c0cee78e1..65bf732d078bfaa2bbcb4e34c5e48fffd53d7ccf 100644 (file)
@@ -86,6 +86,8 @@ public:
 
 class ReverseInterlace;
 class RecordMonitorCanvas;
+class DoCursor;
+class DoBigCursor;
 
 class RecordMonitorGUI : public BC_Window
 {
@@ -113,6 +115,8 @@ public:
 #endif
        RecordChannelPicker *channel_picker;
        ScopeEnable *scope_toggle;
+       DoCursor *cursor_toggle;
+       DoBigCursor *big_cursor_toggle;
        ReverseInterlace *reverse_interlace;
        int cursor_x_origin, cursor_y_origin;
        int translate_x_origin, translate_y_origin;
@@ -235,6 +239,24 @@ public:
        Record *record;
 };
 
+class DoCursor : public BC_CheckBox
+{
+public:
+       DoCursor(Record *record, int x, int y);
+       ~DoCursor();
+       int handle_event();
+       Record *record;
+};
+
+class DoBigCursor : public BC_CheckBox
+{
+public:
+       DoBigCursor(Record *record, int x, int y);
+       ~DoBigCursor();
+       int handle_event();
+       Record *record;
+};
+
 class ReverseInterlace : public BC_CheckBox
 {
 public:
index 6ff6182525c84b720a773f3b8241ede06b21bbaf..5851eb90995d279081e2e37d850703ab9ad3d0ac 100644 (file)
@@ -54,18 +54,21 @@ RecordPrefs::~RecordPrefs()
 
 void RecordPrefs::create_objects()
 {
-       int x, y, x2;
+       int x, y, x1, x2;
        char string[BCTEXTLEN];
        BC_Resources *resources = BC_WindowBase::get_resources();
        BC_Title *title;
+       BC_Title *title0, *title1, *title2, *title3;
+       BC_TextBox *textbox;
 
        x = mwindow->theme->preferencesoptions_x;
        y = mwindow->theme->preferencesoptions_y;
+       int margin = mwindow->theme->widget_border;
        int x0 = x, y0 = y;
 
        add_subwindow(title = new BC_Title(x, y, _("File Format:"),
                LARGEFONT, resources->text_default));
-       y += title->get_h() + 5;
+       y += title->get_h() + margin;
 
        recording_format = new FormatTools(mwindow, this,
                        pwindow->thread->edl->session->recording_format);
@@ -87,26 +90,24 @@ void RecordPrefs::create_objects()
        add_subwindow(realtime_toc);
 
 // Audio hardware
-       add_subwindow(new BC_Bar(5, y,  get_w() - 10));
-       y += 5;
+       add_subwindow(new BC_Bar(x, y,  get_w() - x * 2));
+       y += margin;
 
 
        add_subwindow(title = new BC_Title(x, y,
                _("Audio In"), LARGEFONT,
                resources->text_default));
 
-       y += title->get_h() + 5;
+       y += title->get_h() + margin;
 
        add_subwindow(new BC_Title(x, y, _("Record Driver:"),
                MEDIUMFONT, resources->text_default));
        audio_in_device = new ADevicePrefs(x + 110, y, pwindow, this, 0,
                pwindow->thread->edl->session->aconfig_in, MODERECORD);
        audio_in_device->initialize(1);
-       y += audio_in_device->get_h(1);
+       y += audio_in_device->get_h(1) + margin;
 
 
-       BC_TextBox *textbox;
-       BC_Title *title0, *title1, *title2, *title3;
        int pad = RecordWriteLength::calculate_h(this,
                MEDIUMFONT,
                1,
@@ -116,9 +117,9 @@ void RecordPrefs::create_objects()
        add_subwindow(title1 = new BC_Title(x, y + pad, _("Samples to write to disk:")));
        add_subwindow(title2 = new BC_Title(x, y + pad * 2, _("Sample rate for recording:")));
        add_subwindow(title3 = new BC_Title(x, y + pad * 3, _("Channels to record:")));
-       x2 = MAX(title0->get_w(), title1->get_w()) + mwindow->theme->widget_border;
-       x2 = MAX(x2, title2->get_w() + mwindow->theme->widget_border);
-       x2 = MAX(x2, title3->get_w() + mwindow->theme->widget_border);
+       x2 = MAX(title0->get_w(), title1->get_w()) + margin;
+       x2 = MAX(x2, title2->get_w() + margin);
+       x2 = MAX(x2, title3->get_w() + margin);
 
 
        sprintf(string, "%ld", (long)pwindow->thread->edl->session->record_fragment_size);
@@ -173,31 +174,36 @@ void RecordPrefs::create_objects()
 
 // Video hardware
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
-       y += 5;
+       y += margin;
 
-       add_subwindow(new BC_Title(x, y, _("Video In"), LARGEFONT,
+       add_subwindow(title1 = new BC_Title(x, y, _("Video In"), LARGEFONT,
                resources->text_default));
-       y += 25;
+       y += title1->get_h() + margin;
 
-       add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT,
+       add_subwindow(title1 = new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT,
                resources->text_default));
-       video_in_device = new VDevicePrefs(x + 110, y, pwindow, this, 0,
-               pwindow->thread->edl->session->vconfig_in, MODERECORD);
+       video_in_device = new VDevicePrefs(x + title1->get_w() + margin, y,
+               pwindow, this, 0, pwindow->thread->edl->session->vconfig_in, MODERECORD);
        video_in_device->initialize(1);
+       y += video_in_device->get_h() + margin;
 
-       y += 55;
+       add_subwindow(title1 = new BC_Title(x, y, _("Frames to record to disk at a time:")));
+       x1 = x + title1->get_w() + margin;
        sprintf(string, "%d", pwindow->thread->edl->session->video_write_length);
-       add_subwindow(textbox = new VideoWriteLength(pwindow, string, y));
-       add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), y));
-       add_subwindow(new BC_Title(x, y, _("Frames to record to disk at a time:")));
+       add_subwindow(textbox = new VideoWriteLength(pwindow, string, x1, y));
+       x1 += textbox->get_w() + margin;
+       add_subwindow(new CaptureLengthTumbler(pwindow, textbox, x1, y));
        y += 27;
+
+       add_subwindow(title1 = new BC_Title(x, y, _("Frames to buffer in device:")));
+       x1 = x + title1->get_w() + margin;
        sprintf(string, "%d", pwindow->thread->edl->session->vconfig_in->capture_length);
-       add_subwindow(textbox = new VideoCaptureLength(pwindow, string, y));
-       add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), y));
-       add_subwindow(new BC_Title(x, y, _("Frames to buffer in device:")));
+       add_subwindow(textbox = new VideoCaptureLength(pwindow, string, x1, y));
+       x1 += textbox->get_w() + margin;
+       add_subwindow(new CaptureLengthTumbler(pwindow, textbox, x1, y));
        y += 27;
 
-       int x1 = x;
+       x1 = x;
        add_subwindow(new BC_Title(x1, y, _("Positioning:")));
        x1 += 100;
        add_subwindow(textbox = new BC_TextBox(x1, y, 200, 1, ""));
@@ -212,23 +218,24 @@ void RecordPrefs::create_objects()
        y += 35;
 
        BC_TextBox *w_text, *h_text;
-       add_subwindow(new BC_Title(x, y, _("Size of captured frame:")));
-       x += 170;
+       add_subwindow(title1 = new BC_Title(x, y, _("Size of captured frame:")));
+       x += title1->get_w() + margin;
        add_subwindow(w_text = new RecordW(pwindow, x, y));
-       x += w_text->get_w() + 2;
-       add_subwindow(new BC_Title(x, y, "x"));
-       x += 10;
+       x += w_text->get_w() + margin;
+       add_subwindow(title1 = new BC_Title(x, y, "x"));
+       x += title1->get_w() + margin;
        add_subwindow(h_text = new RecordH(pwindow, x, y));
-       x += h_text->get_w();
-       add_subwindow(new FrameSizePulldown(mwindow->theme,
+       x += h_text->get_w() + margin;
+       FrameSizePulldown *tumbler;
+       add_subwindow(tumbler = new FrameSizePulldown(mwindow->theme, 
                w_text, h_text, x, y));
+       y += tumbler->get_h() + margin;
 
-       y += 30;
-       x = 5;
-       add_subwindow(new BC_Title(x, y, _("Frame rate for recording:")));
-       x += 180;
+       x = mwindow->theme->preferencesoptions_x;
+       add_subwindow(title1 = new BC_Title(x, y, _("Frame rate for recording:")));
+       x += title1->get_w() + margin;
        add_subwindow(textbox = new RecordFrameRate(pwindow, x, y));
-       x += 75;
+       x += textbox->get_w() + margin;
        add_subwindow(new FrameRatePulldown(mwindow, textbox, x, y));
 
 }
@@ -377,7 +384,7 @@ int RecordH::handle_event()
 }
 
 RecordFrameRate::RecordFrameRate(PreferencesWindow *pwindow, int x, int y)
- : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->vconfig_in->in_framerate)
+ : BC_TextBox(x, y, 140, 1, pwindow->thread->edl->session->vconfig_in->in_framerate)
 {
        this->pwindow = pwindow;
 }
@@ -420,8 +427,8 @@ int RecordGain::handle_event()
 
 
 
-VideoWriteLength::VideoWriteLength(PreferencesWindow *pwindow, char *text, int y)
- : BC_TextBox(260, y, 100, 1, text)
+VideoWriteLength::VideoWriteLength(PreferencesWindow *pwindow, char *text, int x, int y)
+ : BC_TextBox(x, y, 100, 1, text)
 {
        this->pwindow = pwindow;
 }
@@ -433,8 +440,8 @@ int VideoWriteLength::handle_event()
 }
 
 
-VideoCaptureLength::VideoCaptureLength(PreferencesWindow *pwindow, char *text, int y)
- : BC_TextBox(260, y, 100, 1, text)
+VideoCaptureLength::VideoCaptureLength(PreferencesWindow *pwindow, char *text, int x, int y)
+ : BC_TextBox(x, y, 100, 1, text)
 {
        this->pwindow = pwindow;
 }
index e8dbd4378d4ae155b9435dd0f8da84658e5b6af7..81f6fe88ff5c4029e93fe2e5a7edf55010afaca0 100644 (file)
@@ -138,7 +138,7 @@ public:
 class VideoWriteLength : public BC_TextBox
 {
 public:
-       VideoWriteLength(PreferencesWindow *pwindow, char *text, int y);
+       VideoWriteLength(PreferencesWindow *pwindow, char *text, int x, int y);
        int handle_event();
        PreferencesWindow *pwindow;
 };
@@ -146,7 +146,7 @@ public:
 class VideoCaptureLength : public BC_TextBox
 {
 public:
-       VideoCaptureLength(PreferencesWindow *pwindow, char *text, int y);
+       VideoCaptureLength(PreferencesWindow *pwindow, char *text, int x, int y);
        int handle_event();
        PreferencesWindow *pwindow;
 };
index 7004d45447ce9a5805239389f59dc2b51164ef96..65f50b1e8ded9334e65e0d9872df8725e6c3c8cf 100644 (file)
@@ -21,7 +21,7 @@
 
 
 #include "bctheme.h"
-#include "cicolors.h"
+#include "bccolors.h"
 #include "language.h"
 #include "mainsession.h"
 #include "mutex.h"
index 2abd343a564fddb34cf6f68bf1b928b24a3f3884..91b5971b3e58e9e99f7fef6938a77d18f8d5f65c 100644 (file)
@@ -196,6 +196,7 @@ void RecordVideo::run()
                VideoDevice *vdevice = record->vdevice;
                VFrame *capture_frame = get_buffer();
                vdevice->set_field_order(record->reverse_interlace);
+               record->set_do_cursor();
 // Capture a frame
                grab_result = read_buffer(capture_frame);
                if( done ) break;
index 9f24048fab2b1275bf518edb14b48c2fab208727..1452c0e06dbf753b39a6abf00f81cc350db0ecf2 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index b668e9788830d49db74d963a34d9846e219e9d8d..1fa93d9c215b5658565ddc1401ad17729fd43d29 100644 (file)
@@ -1,5 +1,5 @@
 
-#include "colors.h"
+#include "bccolors.h"
 #include "mainsession.h"
 #include "mwindow.h"
 #include "mwindowgui.h"
index 085384ae9b8ad3f2b165062f349897ff53acb7b3..702ffbd4028074d56362efbc0b87f7334efe6128 100644 (file)
@@ -970,7 +970,7 @@ if(debug) printf("Render::render %d\n", __LINE__);
                ArrayList<Indexable*> *assets = render->packages->get_asset_list();
 if(debug) printf("Render::render %d\n", __LINE__);
                if(render->load_mode == LOADMODE_PASTE)
-                       mwindow->clear(0);
+                       mwindow->clear(0, 1);
 if(debug) printf("Render::render %d\n", __LINE__);
                mwindow->load_assets(assets, -1, render->load_mode, 0, 0,
                        mwindow->edl->session->labels_follow_edits,
index 936bd4d5ef5755b377a3e2c203e5beb4dd4a787c..8b3bc74a9a062552e05969ba48289ef4476752dd 100644 (file)
@@ -130,7 +130,7 @@ int Save::save_before_quit()
 }
 
 SaveAs::SaveAs(MWindow *mwindow)
- : BC_MenuItem(_("Save as..."), ""), Thread()
+ : BC_MenuItem(_("Save as..."), "Shift-S", 'S'), Thread()
 {
        this->mwindow = mwindow;
        quit_now = 0;
index fb3c01980491b9119197de8d4fb6488a7a3b2a9b..56dd5171319b96c809f6eacf76fcca9835b356a9 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #include "bcsignals.h"
-#include "cicolors.h"
+#include "bccolors.h"
 #include "clip.h"
 #include "cursors.h"
 #include "language.h"
index 7963fa34bb233b8ffbc261b0b9280748eff547a1..8e22161869f5a5b910519cb01459ae33da28325b 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef HAVE_DVB
 
 #include "bctitle.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "devicedvbinput.h"
 #include "fonts.h"
 #include "signalstatus.h"
index 8d06c956db11e744cca0d6c0643a470eb866ba27..929eb7eca96297682a603d683d6a48611cac22b5 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "bcwindow.h"
 #include "bcsignals.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "fonts.h"
 #include "thread.h"
 
index 20f8b36b886301020b19243196a03e73e2320308..bddba8783277c220524e45b5d42fdb5577a5ef93 100644 (file)
@@ -22,7 +22,7 @@
 #include "awindowgui.h"
 #include "bcsignals.h"
 #include "clip.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "cwindowgui.h"
 #include "edl.h"
 #include "edlsession.h"
@@ -85,6 +85,7 @@ Theme::Theme()
        play_h = 22;
        title_h = 23;
        clock_bg_color = BLACK;
+       clock_fg_color = GREEN;
        assetedit_color = YELLOW;
        const char *cp = getenv("BC_USE_COMMERCIALS");
        use_commercials = !cp ? 0 : atoi(cp);
@@ -264,43 +265,20 @@ void Theme::build_menus()
 
        frame_sizes.append(new BC_ListBoxItem("128x96"));
        frame_sizes.append(new BC_ListBoxItem("160x120"));
-       frame_sizes.append(new BC_ListBoxItem("176x144"));
-       frame_sizes.append(new BC_ListBoxItem("240x180"));
-       frame_sizes.append(new BC_ListBoxItem("320x200"));
        frame_sizes.append(new BC_ListBoxItem("320x240"));
-       frame_sizes.append(new BC_ListBoxItem("352x288"));
        frame_sizes.append(new BC_ListBoxItem("360x240"));
        frame_sizes.append(new BC_ListBoxItem("400x300"));
-       frame_sizes.append(new BC_ListBoxItem("424x318"));
-       frame_sizes.append(new BC_ListBoxItem("512x384"));
-       frame_sizes.append(new BC_ListBoxItem("640x350"));
+       frame_sizes.append(new BC_ListBoxItem("640x400"));
        frame_sizes.append(new BC_ListBoxItem("640x480"));
-       frame_sizes.append(new BC_ListBoxItem("704x576"));
        frame_sizes.append(new BC_ListBoxItem("720x480"));
-       frame_sizes.append(new BC_ListBoxItem("720x576"));
        frame_sizes.append(new BC_ListBoxItem("800x600"));
-       frame_sizes.append(new BC_ListBoxItem("852x480"));
-       frame_sizes.append(new BC_ListBoxItem("852x480"));
-       frame_sizes.append(new BC_ListBoxItem("960x540"));
-       frame_sizes.append(new BC_ListBoxItem("960x1080"));
        frame_sizes.append(new BC_ListBoxItem("1024x768"));
        frame_sizes.append(new BC_ListBoxItem("1280x720"));
        frame_sizes.append(new BC_ListBoxItem("1280x1024"));
-       frame_sizes.append(new BC_ListBoxItem("1368x768"));
-       frame_sizes.append(new BC_ListBoxItem("1408x1152"));
-       frame_sizes.append(new BC_ListBoxItem("1600x1024"));
        frame_sizes.append(new BC_ListBoxItem("1600x1200"));
        frame_sizes.append(new BC_ListBoxItem("1920x1080"));
-       frame_sizes.append(new BC_ListBoxItem("1920x1088"));
-       frame_sizes.append(new BC_ListBoxItem("1920x1200"));
-       frame_sizes.append(new BC_ListBoxItem("2048x1536"));
-       frame_sizes.append(new BC_ListBoxItem("2560x1600"));
-       frame_sizes.append(new BC_ListBoxItem("2560x2048"));
-       frame_sizes.append(new BC_ListBoxItem("3200x2048"));
-       frame_sizes.append(new BC_ListBoxItem("3840x2400"));
-       frame_sizes.append(new BC_ListBoxItem("5120x4096"));
-       frame_sizes.append(new BC_ListBoxItem("6400x4096"));
-       frame_sizes.append(new BC_ListBoxItem("7680x4800"));
+       frame_sizes.append(new BC_ListBoxItem("3840x2160"));
+       frame_sizes.append(new BC_ListBoxItem("4096x1720"));
 
        sample_rates.append(new BC_ListBoxItem("8000"));
        sample_rates.append(new BC_ListBoxItem("16000"));
@@ -311,6 +289,7 @@ void Theme::build_menus()
        sample_rates.append(new BC_ListBoxItem("96000"));
        sample_rates.append(new BC_ListBoxItem("192000"));
 
+       frame_rates.append(new BC_ListBoxItem("0.25"));
        frame_rates.append(new BC_ListBoxItem("1"));
        frame_rates.append(new BC_ListBoxItem("5"));
        frame_rates.append(new BC_ListBoxItem("10"));
@@ -324,6