From: Good Guy Date: Fri, 6 Nov 2015 00:57:16 +0000 (-0700) Subject: add LastFrame plugin, add bld_scripts X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=0c9155dd01b6745f908e12c6a202c671a8f09514;p=goodguy%2Fhistory.git add LastFrame plugin, add bld_scripts --- diff --git a/cinelerra-5.0/bld_scripts/bld_dynamic.sh b/cinelerra-5.0/bld_scripts/bld_dynamic.sh new file mode 100755 index 00000000..864e6ca0 --- /dev/null +++ b/cinelerra-5.0/bld_scripts/bld_dynamic.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +dir="$1" +shift +path="/home" +bld="git-repo" +proj="cinelerra" +base="cinelerra-5.0" + +if [ ! -d "$path/$dir/$bld" ]; then + echo "$bld missing in /$path/$dir" + exit 1 +fi + +cd "$path/$dir/$bld" +rm -rf "$proj" +git clone "http://cinelerra.org/git-repo/$proj" +if [ $? -ne 0 ]; then + echo "git clone $bld/$proj/ failed" + exit 1 +fi + +cd "$proj/$base" +if [ "$dir" = "ubuntu" ]; then + echo "CFLAGS += -DPNG_SKIP_SETJMP_CHECK=1" >> global_config +fi +if [ "$dir" = "centos" ]; then + echo "EXTRA_LIBS += -lnuma" >> global_config + echo "CFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" >> global_config +fi +if [ "$dir" = "suse" ]; then + echo "EXTRA_LIBS += -lnuma" >> global_config +fi + +STATIC_LIBRARIES=0 ./configure >& log +make >> log 2>&1 $@ +make install >> log 2>&1 + +echo "finished: scanning log for ***" +grep -a "\*\*\*" log + diff --git a/cinelerra-5.0/bld_scripts/bld_incremental.sh b/cinelerra-5.0/bld_scripts/bld_incremental.sh new file mode 100755 index 00000000..ad62cd84 --- /dev/null +++ b/cinelerra-5.0/bld_scripts/bld_incremental.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +dir="$1" +path="/home" +bld="git-repo" +proj="cinelerra" +base="cinelerra-5.0" + +if [ ! -d "$path/$dir/$bld/$proj" ]; then + echo "$bld/$proj missing in $path/$dir" + exit 1 +fi + +cd "$path/$dir/$bld/$proj" +git pull +if [ $? -ne 0 ]; then + echo "git pull $bld/$proj failed" + exit 1 +fi + +cd "$base" +make rebuild_all >& log1 + +echo "finished: scanning log for ***" +grep -a "\*\*\*" log1 + diff --git a/cinelerra-5.0/bld_scripts/bld_package.sh b/cinelerra-5.0/bld_scripts/bld_package.sh new file mode 100755 index 00000000..81f027bd --- /dev/null +++ b/cinelerra-5.0/bld_scripts/bld_package.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +if [ $# -ne 2 ]; then + echo "usage: $0 " + echo " os = centos | ubuntu | suse" + echo " typ = static | dynamic" + exit 1 +fi + +dir="$1" +path="/home" +bld="git-repo" +proj="cinelerra" +base="cinelerra-5.0" + +centos="centos-7.0-1406" +suse="opensuse-13.2" +ubuntu="ubuntu-14.04.1" + +eval os="\${$dir}" +if [ -z "$os" ]; then + echo "unknown os: $dir" +fi + +if [ ! -d "$path/$dir/$bld/$proj/$base" ]; then + echo "missing $bld/$proj/$base in $path/$dir" + exit 1 +fi + +typ=$2 +sfx=`uname -m`-`date +"%Y%m%d"` +if [ "$typ" = "static" ]; then + sfx="$sfx-static" +elif [ "$typ" != "dynamic" ]; then + echo "err: suffix must be [static | dynamic]" + exit 1 +fi + +cd "$path/$dir/$bld/$proj/$base" +tar -C bin -cJf "../$base-$os-$sfx.txz" . +rm -f "$path/$dir/$base-$os-$sfx.txz" +mv "../$base-$os-$sfx.txz" "$path/$dir/." + diff --git a/cinelerra-5.0/bld_scripts/bld_prepare.sh b/cinelerra-5.0/bld_scripts/bld_prepare.sh new file mode 100755 index 00000000..9eb54334 --- /dev/null +++ b/cinelerra-5.0/bld_scripts/bld_prepare.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +if [ `id -u` -ne 0 ]; then + echo "you must be root" +fi + +if [ $# -ne 1 ]; then + echo "usage: $0 " + echo " = [centos | suse | ubuntu]" +fi + +dir="$1" + +case "$dir" in +"centos") + yum -y install nasm libavc1394-devel libusb-devel flac-devel \ + libjpeg-devel libdv-devel libdvdnav-devel libdvdread-devel \ + libtheora-devel libiec61883-devel uuid-devel giflib-devel \ + ncurses-devel ilmbase-devel fftw-devel OpenEXR-devel \ + libsndfile-devel libXft-devel libXinerama-devel libXv-devel \ + xorg-x11-fonts-misc xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 \ + xorg-x11-fonts-ISO8859-1-100dpi xorg-x11-fonts-ISO8859-1-75dpi \ + libpng-devel bzip2-devel zlib-devel kernel-headers \ + libavc1394 festival-devel libiec61883-devel flac-devel \ + libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \ + libvorbis-devel texinfo xz-devel lzma-devel cmake udftools + yasm=yasm-1.2.0-7.fc21.x86_64.rpm + release=http://archives.fedoraproject.org/pub/fedora/linux/releases/21 + url=$release/Everything/x86_64/os/Packages/y/$yasm + wget -P /tmp $url + yum -y install /tmp/$yasm + rm -f /tmp/$yasm + ;; +"suse") + zypper -n install nasm gcc gcc-c++ zlib-devel texinfo libpng16-devel \ + freeglut-devel libXv-devel alsa-devel libbz2-devel ncurses-devel \ + libXinerama-devel freetype-devel libXft-devel giblib-devel ctags \ + bitstream-vera-fonts xorg-x11-fonts-core xorg-x11-fonts dejavu-fonts \ + openexr-devel libavc1394-devel festival-devel libjpeg8-devel libdv-devel \ + libdvdnav-devel libdvdread-devel libiec61883-devel libuuid-devel \ + ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \ + cmake patch libnuma-devel lzma-devel udftools + if [ ! -f /usr/lib64/libtermcap.so ]; then + ln -s libtermcap.so.2 /usr/lib64/libtermcap.so + fi + ;; +"ubuntu") + apt-get -y install apt-file sox nasm yasm g++ build-essential libz-dev texinfo \ + libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ + libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev giblib-dev \ + exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \ + fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev \ + libdc1394-22-dev libiec61883-dev libesd0-dev libflac-dev \ + libsndfile1-dev libtheora-dev git cmake udftools libxml2-utils + ;; + *) + echo "unknown os: $dir" + exit 1; + ;; +esac + +rm -rf "/home/$dir" +mkdir -p "/home/$dir" +chmod a+rwx -R "/home/$dir" + diff --git a/cinelerra-5.0/bld_scripts/bld_static.sh b/cinelerra-5.0/bld_scripts/bld_static.sh new file mode 100755 index 00000000..a7ed47dd --- /dev/null +++ b/cinelerra-5.0/bld_scripts/bld_static.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +dir="$1" +shift +path="/home" +bld="git-repo" +proj="cinelerra" +base="cinelerra-5.0" + +if [ ! -d "$path/$dir/$bld" ]; then + echo "$bld missing in $path/$dir" + exit 1 +fi + +cd "$path/$dir/$bld" +rm -rf "$proj" +git clone "http://cinelerra.org/git-repo/$proj" +if [ $? -ne 0 ]; then + echo "git clone $bld/$proj/ failed" + exit 1 +fi + +cd "$proj/$base" +if [ "$dir" = "ubuntu" ]; then + echo "CFLAGS += -DPNG_SKIP_SETJMP_CHECK=1" >> global_config +fi +if [ "$dir" = "centos" ]; then + echo "EXTRA_LIBS += -lnuma" >> global_config + echo "CFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" >> global_config +fi +if [ "$dir" = "suse" ]; then + echo "EXTRA_LIBS += -lnuma" >> global_config +fi + +STATIC_LIBRARIES=1 ./configure >& log +make >> log 2>&1 $@ +make install >> log 2>&1 + +echo "finished: scanning log for ***" +grep -a "\*\*\*" log + diff --git a/cinelerra-5.0/cinelerra/dcraw.c b/cinelerra-5.0/cinelerra/dcraw.c index 300849b3..9543ae84 100644 --- a/cinelerra-5.0/cinelerra/dcraw.c +++ b/cinelerra-5.0/cinelerra/dcraw.c @@ -2376,7 +2376,7 @@ void CLASS kodak_thumb_load_raw() void CLASS sony_decrypt (unsigned *data, int len, int start, int key) { - static unsigned pad[128], p; + static unsigned pad[128], p = 0; if (start) { for (p=0; p < 4; p++) @@ -2387,8 +2387,10 @@ void CLASS sony_decrypt (unsigned *data, int len, int start, int key) for (p=0; p < 127; p++) pad[p] = htonl(pad[p]); } - while (len--) - *data++ ^= pad[p++ & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127]; + while (len--) { + *data++ ^= pad[p & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127]; + p++; + } } void CLASS sony_load_raw() diff --git a/cinelerra-5.0/cinelerra/devicev4l2base.C b/cinelerra-5.0/cinelerra/devicev4l2base.C index acbac871..baa52f45 100644 --- a/cinelerra-5.0/cinelerra/devicev4l2base.C +++ b/cinelerra-5.0/cinelerra/devicev4l2base.C @@ -550,7 +550,7 @@ int DeviceV4L2Base::v4l2_open(int color_model) struct v4l2_tuner tuner; memset(&tuner, 0, sizeof(tuner)); tuner.index = dev_tuner; - if(!vioctl(VIDIOC_G_TUNER, &tuner) < 0) + if(!vioctl(VIDIOC_G_TUNER, &tuner)) { // printf("DeviceV4L2Base::v4l2_open audmode=%d rxsubchans=%d\n", // tuner.audmode, tuner.rxsubchans); diff --git a/cinelerra-5.0/cinelerra/file.C b/cinelerra-5.0/cinelerra/file.C index b96f332f..c3d02443 100644 --- a/cinelerra-5.0/cinelerra/file.C +++ b/cinelerra-5.0/cinelerra/file.C @@ -1986,7 +1986,9 @@ int File::read_frame(VFrame *frame, int is_thread) // printf("File::read_frame %d\n", __LINE__); temp_frame->copy_stacks(frame); - file->read_frame(temp_frame); + int result = file->read_frame(temp_frame); + if( result && frame->get_status() > 0 ) + frame->set_status(-1); //for(int i = 0; i < 1000 * 1000; i++) ((float*)temp_frame->get_rows()[0])[i] = 1.0; // printf("File::read_frame %d %d %d %d %d %d\n", // temp_frame->get_color_model(), @@ -2022,7 +2024,9 @@ int File::read_frame(VFrame *frame, int is_thread) { // Can't advance position here because it needs to be added to cache //printf("File::read_frame %d\n", __LINE__); - file->read_frame(frame); + int result = file->read_frame(frame); + if( result && frame->get_status() > 0 ) + frame->set_status(-1); //for(int i = 0; i < 100 * 1000; i++) ((float*)frame->get_rows()[0])[i] = 1.0; } diff --git a/cinelerra-5.0/cinelerra/fileffmpeg.C b/cinelerra-5.0/cinelerra/fileffmpeg.C index b195623e..66fda8c1 100644 --- a/cinelerra-5.0/cinelerra/fileffmpeg.C +++ b/cinelerra-5.0/cinelerra/fileffmpeg.C @@ -290,8 +290,10 @@ int FileFFMPEG::read_samples(double *buffer, int64_t len) if( !ff || len < 0 ) return -1; int ch = file->current_channel; int64_t pos = file->current_sample; - ff->decode(ch, pos, buffer, len); - return 0; + int ret = ff->decode(ch, pos, buffer, len); + if( ret > 0 ) return 0; + memset(buffer,0,len*sizeof(*buffer)); + return -1; } int FileFFMPEG::read_frame(VFrame *frame) @@ -299,8 +301,11 @@ int FileFFMPEG::read_frame(VFrame *frame) if( !ff ) return -1; int layer = file->current_layer; int64_t pos = file->current_frame; - ff->decode(layer, pos, frame); - return 0; + int ret = ff->decode(layer, pos, frame); + frame->set_status(ret); + if( ret > 0 ) return 0; + frame->clear_frame(); + return -1; } diff --git a/cinelerra-5.0/cinelerra/framecache.C b/cinelerra-5.0/cinelerra/framecache.C index 78875578..9209be2b 100644 --- a/cinelerra-5.0/cinelerra/framecache.C +++ b/cinelerra-5.0/cinelerra/framecache.C @@ -130,6 +130,7 @@ int FrameCache::get_frame(VFrame *frame, // This would have copied the color matrix for interpolate, but // required the same plugin stack as the reader. // frame->copy_stacks(result->data); + frame->copy_params(result->data); } result->age = get_age(); } diff --git a/cinelerra-5.0/global_config b/cinelerra-5.0/global_config index afd54605..623a0e33 100644 --- a/cinelerra-5.0/global_config +++ b/cinelerra-5.0/global_config @@ -5,7 +5,7 @@ HAVE_XFT := y HAVE_ESOUND := y HAVE_FIREWIRE := y HAVE_OSS := y -STATIC_LIBRARIES := n +STATIC_LIBRARIES := y OBJDIR := $(shell uname --machine) diff --git a/cinelerra-5.0/guicast/vframe.C b/cinelerra-5.0/guicast/vframe.C index 99746eb8..de53a068 100644 --- a/cinelerra-5.0/guicast/vframe.C +++ b/cinelerra-5.0/guicast/vframe.C @@ -220,6 +220,7 @@ int VFrame::params_match(int w, int h, int color_model) int VFrame::reset_parameters(int do_opengl) { + status = 1; scene = 0; field2_offset = -1; memory_type = VFrame::PRIVATE; @@ -1216,10 +1217,12 @@ void VFrame::clear_stacks() next_effects.remove_all_objects(); prev_effects.remove_all_objects(); params->clear(); + status = 1; } void VFrame::copy_params(VFrame *src) { + status = src->status; params->copy_from(src->params); } @@ -1284,7 +1287,7 @@ void VFrame::dump() int VFrame::filefork_size() { - return sizeof(int) * 12 + sizeof(long); + return sizeof(int) * 13 + sizeof(long); } @@ -1301,7 +1304,8 @@ void VFrame::to_filefork(unsigned char *buffer) *(int*)(buffer + 32) = compressed_allocated; *(int*)(buffer + 36) = compressed_size; *(int*)(buffer + 40) = is_keyframe; - *(long*)(buffer + 44) = sequence_number; + *(int*)(buffer + 44) = status; + *(long*)(buffer + 48) = sequence_number; //printf("VFrame::to_filefork %d %lld\n", __LINE__, sequence_number); @@ -1350,7 +1354,8 @@ void VFrame::from_filefork(unsigned char *buffer) } is_keyframe = *(int*)(buffer + 40); - sequence_number = *(long*)(buffer + 44); + status = *(int*)(buffer + 44); + sequence_number = *(long*)(buffer + 48); //printf("VFrame::from_filefork %d %lld\n", __LINE__, sequence_number); } diff --git a/cinelerra-5.0/guicast/vframe.h b/cinelerra-5.0/guicast/vframe.h index b0a221c7..3cf9645b 100644 --- a/cinelerra-5.0/guicast/vframe.h +++ b/cinelerra-5.0/guicast/vframe.h @@ -335,6 +335,10 @@ public: // Relevant configuration parameters must be passed on. BC_Hash* get_params(); +// get/set read status -1/err, 0/noxfer, 1/ok + int get_status() { return status; } + void set_status(int v) { status = v; } + // Compare stacks and params from 2 images and return 1 if equal. int equal_stacks(VFrame *src); @@ -438,7 +442,8 @@ private: // For writing discontinuous frames in background rendering long sequence_number; double timestamp; - +// read status of input frame -1/err, 0/noxfr, 1/ok + int status; // OpenGL support int is_keyframe; // State of the current texture diff --git a/cinelerra-5.0/plugin_defs b/cinelerra-5.0/plugin_defs index c6d66234..cc14f5d3 100644 --- a/cinelerra-5.0/plugin_defs +++ b/cinelerra-5.0/plugin_defs @@ -103,6 +103,7 @@ interpolatevideo := video_tools invertvideo := video_tools linearblur := video_tools loopvideo := video_tools +lof := video_tools motion2 := video_tools motionblur := video_tools motion := video_tools diff --git a/cinelerra-5.0/plugins/Makefile b/cinelerra-5.0/plugins/Makefile index da618f42..de78961b 100644 --- a/cinelerra-5.0/plugins/Makefile +++ b/cinelerra-5.0/plugins/Makefile @@ -73,6 +73,7 @@ DIRS = \ linearblur \ liveaudio \ livevideo \ + lof \ loopaudio \ loopvideo \ motion \ diff --git a/cinelerra-5.0/plugins/lof/Makefile b/cinelerra-5.0/plugins/lof/Makefile new file mode 100644 index 00000000..88b492ed --- /dev/null +++ b/cinelerra-5.0/plugins/lof/Makefile @@ -0,0 +1,11 @@ +include ../../global_config + +OBJS = $(OBJDIR)/lof.o $(OBJDIR)/lofwindow.o + +PLUGIN = lof + +include ../../plugin_config + + +$(OBJDIR)/lof.o: lof.C +$(OBJDIR)/lofwindow.o: lofwindow.C diff --git a/cinelerra-5.0/plugins/lof/lof.C b/cinelerra-5.0/plugins/lof/lof.C new file mode 100644 index 00000000..3cac11f4 --- /dev/null +++ b/cinelerra-5.0/plugins/lof/lof.C @@ -0,0 +1,128 @@ + +#include "lofwindow.h" + +// repeat last output frame on read_frame error +// uses vframe.status as read status + +REGISTER_PLUGIN(LofEffect) + +LofConfig::LofConfig() +{ + errs = 0; + miss = 1; + mark = 1; +} + +void LofConfig::copy_from(LofConfig &src) +{ + errs = src.errs; + miss = src.miss; + mark = src.mark; +} + +int LofConfig::equivalent(LofConfig &src) +{ + if( errs != src.errs ) return 0; + if( miss != src.miss ) return 0; + if( mark != src.mark ) return 0; + return 1; +} + +void LofConfig::interpolate(LofConfig &prev, LofConfig &next, + long prev_frame, long next_frame, long current_frame) +{ + copy_from(prev); +} + +LofEffect::LofEffect(PluginServer *server) + : PluginVClient(server) +{ + frm = 0; +} +LofEffect::~LofEffect() +{ + delete frm; +} + +const char* LofEffect::plugin_title() { return _("Last Frame"); } +int LofEffect::is_realtime() { return 1; } + +NEW_WINDOW_MACRO(LofEffect, LofWindow) +LOAD_CONFIGURATION_MACRO(LofEffect, LofConfig) + +void LofEffect::update_gui() +{ + if(thread) { + thread->window->lock_window(); + load_configuration(); + ((LofWindow*)thread->window)->update(); + thread->window->unlock_window(); + } +} + + +void LofEffect::save_data(KeyFrame *keyframe) +{ + FileXML output; + output.set_shared_output(keyframe->get_data(), MESSAGESIZE); + output.tag.set_title("LOF"); + output.tag.set_property("ERRS", config.errs); + output.tag.set_property("MISS", config.miss); + output.tag.set_property("MARK", config.mark); + output.append_tag(); + output.terminate_string(); +} + +void LofEffect::read_data(KeyFrame *keyframe) +{ + FileXML input; + input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data())); + while(!input.read_tag()) { + if(input.tag.title_is("LOF")) { + config.errs = input.tag.get_property("ERRS", config.errs); + config.miss = input.tag.get_property("MISS", config.miss); + config.mark = input.tag.get_property("MARK", config.mark); + } + } +} + + +int LofEffect::process_buffer(VFrame *frame, int64_t start_position, double frame_rate) +{ + load_configuration(); + int w = frame->get_w(), h = frame->get_h(); + int colormodel = frame->get_color_model(); + if( frm && (frm->get_w() != w || frm->get_h() != h || + frm->get_color_model() != colormodel ) ) { + delete frm; frm = 0; + } + int ret = read_frame(frame, 0, start_position, frame_rate, get_use_opengl()); + if( ret >= 0 ) ret = frame->get_status(); + if( ret > 0 ) { + if( !frm ) + frm = new VFrame(w, h, colormodel, -1); + frm->copy_from(frame); + } + else if( !frm ) + frame->clear_frame(); + else if( (ret < 0 && config.errs) || (!ret && config.miss) ) { + frame->copy_from(frm); + if( config.mark ) { + VFrame dot(1, 1, BC_RGBA8888, -1); + *(uint32_t*)dot.get_rows()[0] = 0xff0000ff; + int scl = 48, sz = 3, ww = w/scl, hh = h/scl; + if( ww < sz ) ww = w > sz ? sz : w; + if( hh < sz ) hh = h > sz ? sz : h; + BC_CModels::transfer( + frame->get_rows(), dot.get_rows(), + frame->get_y(), frame->get_u(), frame->get_v(), + dot.get_y(), dot.get_u(), dot.get_v(), + 0, 0, 1, 1, 0, 0, ww, hh, + dot.get_color_model(), frame->get_color_model(), + 0, dot.get_w(), frame->get_w()); + } + } + return 0; +} + + diff --git a/cinelerra-5.0/plugins/lof/lof.h b/cinelerra-5.0/plugins/lof/lof.h new file mode 100644 index 00000000..9bdefc8c --- /dev/null +++ b/cinelerra-5.0/plugins/lof/lof.h @@ -0,0 +1,44 @@ +#ifndef LOF_H +#define LOF_H + +#include "filexml.h" +#include "bchash.h" +#include "language.h" +#include "pluginvclient.h" +#include "vframe.h" + +class LofConfig; +class LofEffect; +class LofWindow; + +class LofConfig { +public: + int errs; + int miss; + int mark; + + LofConfig(); + + void copy_from(LofConfig &src); + int equivalent(LofConfig &src); + void interpolate(LofConfig &prev, LofConfig &next, + long prev_frame, long next_frame, long current_frame); +}; + +class LofEffect : public PluginVClient { +public: + LofEffect(PluginServer *server); + ~LofEffect(); + + PLUGIN_CLASS_MEMBERS(LofConfig) + int process_buffer(VFrame *frame, int64_t start_position, double frame_rate); + int is_realtime(); + void save_data(KeyFrame *keyframe); + void read_data(KeyFrame *keyframe); + void update_gui(); + + VFrame *frm; +}; + + +#endif diff --git a/cinelerra-5.0/plugins/lof/lofwindow.C b/cinelerra-5.0/plugins/lof/lofwindow.C new file mode 100644 index 00000000..a2cfa12d --- /dev/null +++ b/cinelerra-5.0/plugins/lof/lofwindow.C @@ -0,0 +1,50 @@ +#include "lofwindow.h" +#include "language.h" + +LofWindow::LofWindow(LofEffect *plugin) + : PluginClientWindow(plugin, 260, 160, 260, 160, 0) +{ + this->plugin = plugin; +} + +void LofWindow::create_objects() +{ + int x = 10, y = 10; + BC_Title *title = new BC_Title(x, y, _("Show last good output frame")); + add_subwindow(title); y += title->get_h() + 5; + title = new BC_Title(x+20, y, _("(you should fix the input)")); + add_subwindow(title); y += title->get_h() + 20; + add_tool(errfrms = new LofToggle(this, &plugin->config.errs, x, y, _("errant frames"))); + y += errfrms->get_h() + 5; + add_tool(misfrms = new LofToggle(this, &plugin->config.miss, x, y, _("missed frames"))); + y += misfrms->get_h() + 5; + add_tool(mrkfrms = new LofToggle(this, &plugin->config.mark, x, y, _("mark fixed frames"))); + show_window(); + flush(); +} + +void LofWindow::update() +{ + errfrms->update(plugin->config.errs); + misfrms->update(plugin->config.miss); + mrkfrms->update(plugin->config.mark); +} + +LofToggle::LofToggle(LofWindow *lofwin, int *output, int x, int y, const char *lbl) + : BC_CheckBox(x, y, *output, lbl) +{ + this->lofwin = lofwin; + this->output = output; +} + +LofToggle::~LofToggle() +{ +} + +int LofToggle::handle_event() +{ + *output = get_value(); + lofwin->plugin->send_configure_change(); + return 1; +} + diff --git a/cinelerra-5.0/plugins/lof/lofwindow.h b/cinelerra-5.0/plugins/lof/lofwindow.h new file mode 100644 index 00000000..9336465a --- /dev/null +++ b/cinelerra-5.0/plugins/lof/lofwindow.h @@ -0,0 +1,34 @@ +#ifndef __LOFWINDOW_H__ +#define __LOFWINDOW_H__ + +#include "lof.h" +#include "pluginvclient.h" + +class LofToggle; +class LofWindow; + +class LofToggle : public BC_CheckBox +{ +public: + LofToggle(LofWindow *lofwin, int *output, int x, int y, const char *lbl); + ~LofToggle(); + int handle_event(); + + LofWindow *lofwin; + int *output; +}; + +class LofWindow : public PluginClientWindow { +public: + LofWindow(LofEffect *plugin); + void create_objects(); + void update(); + LofEffect *plugin; + + LofToggle *errfrms; + LofToggle *misfrms; + LofToggle *mrkfrms; +}; + + +#endif diff --git a/cinelerra-5.0/plugins/lof/picon.png b/cinelerra-5.0/plugins/lof/picon.png new file mode 100644 index 00000000..41514cad Binary files /dev/null and b/cinelerra-5.0/plugins/lof/picon.png differ diff --git a/cinelerra-5.0/thirdparty/src/ladspa.patch2 b/cinelerra-5.0/thirdparty/src/ladspa.patch2 new file mode 100644 index 00000000..134c2ee8 --- /dev/null +++ b/cinelerra-5.0/thirdparty/src/ladspa.patch2 @@ -0,0 +1,27 @@ +diff -urN a/sifter_1210.xml b/sifter_1210.xml +--- a/sifter_1210.xml 2015-11-04 15:13:54.195120748 -0500 ++++ b/sifter_1210.xml 2015-11-04 15:14:11.319176863 -0500 +@@ -11,12 +11,12 @@ + + #define MAX_BSIZE 1000 + +-inline int partition(LADSPA_Data array[], int left, int right); ++int partition(LADSPA_Data array[], int left, int right); + + #ifdef __clang__ + void q_sort(LADSPA_Data array[], int left, int right) { + #else +-inline void q_sort(LADSPA_Data array[], int left, int right) { ++void q_sort(LADSPA_Data array[], int left, int right) { + #endif + float pivot = partition(array, left, right); + +@@ -28,7 +28,7 @@ + } + } + +-inline int partition(LADSPA_Data array[], int left, int right) { ++int partition(LADSPA_Data array[], int left, int right) { + float pivot = array[left]; + + while (left < right) {