lv2 fixes, dcraw upgrade, arch/libdv
authorGood Guy <good1.2guy@gmail.com>
Thu, 14 Jun 2018 01:02:36 +0000 (19:02 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 14 Jun 2018 01:02:36 +0000 (19:02 -0600)
27 files changed:
cinelerra-5.1/Makefile.am
cinelerra-5.1/Makefile.devel
cinelerra-5.1/PKGBUILD
cinelerra-5.1/cinelerra/Makefile
cinelerra-5.1/cinelerra/appearanceprefs.C
cinelerra-5.1/cinelerra/appearanceprefs.h
cinelerra-5.1/cinelerra/dcraw.C
cinelerra-5.1/cinelerra/dcraw.h
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/interfaceprefs.h
cinelerra-5.1/cinelerra/lv2ui.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/pluginlv2.C
cinelerra-5.1/cinelerra/pluginlv2.h
cinelerra-5.1/cinelerra/pluginlv2client.C
cinelerra-5.1/cinelerra/pluginlv2gui.C
cinelerra-5.1/cinelerra/pluginlv2gui.h
cinelerra-5.1/cinelerra/pluginlv2ui.C
cinelerra-5.1/cinelerra/pluginlv2ui.h
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/preferences.inc
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/guicast/filesystem.C
cinelerra-5.1/guicast/filesystem.h
cinelerra-5.1/lv2_blacklist.txt [new file with mode: 0644]

index 5200484f4fb1afb2f1be8c63740fbe6a3981fa40..9b9e7cbdaeac8390615fb8dd91d933e2e4855ba0 100644 (file)
@@ -15,7 +15,7 @@ SUBDIRS = thirdparty libzmpeg3 mpeg2enc mplexlo \
 
 BUILT_SOURCES := bin
 bin:
-       mkdir -p bin bin/applications bin/pixmaps
+       mkdir -p bin bin/applications bin/pixmaps bin/lv2
 
 clean-generic:
        rm -rf thirdparty/opencv*
@@ -43,6 +43,7 @@ binstall:     install-recursive
          cp -a $$d bin/plugins/picon/.; \
        done
        cp -a db/utils/new_db "bin/cin_db"
+       cp -av lv2_blacklist.txt bin/.
 
 buninstall:
        rm -rf bin
@@ -54,7 +55,8 @@ cinstall:
        cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" \
                bdwrite cutads lv2ui hveg2enc mpeg2enc mplex mplexlo
        cd bin; $(inst_sh) "$(DESTDIR)$(datadir)/$(WANT_CIN)" \
-               COPYING README models Cinelerra_factory ffmpeg msg info tips doc
+               COPYING README models Cinelerra_factory ffmpeg msg info tips doc \
+               lv2 lv2_blacklist.txt
        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 09f7da9b3a1c8039a4d5bf44379ed25d71ef1893..30d169f1c4bf684fcf693d58b2a8f332f95fd40c 100644 (file)
@@ -12,7 +12,7 @@ SUBDIRS := thirdparty libzmpeg3 mpeg2enc mplexlo\
  db guicast cinelerra plugins doc po
 
 all:
-       mkdir -p bin
+       mkdir -p bin bin/lv2
        +for dir in $(SUBDIRS); do $(MAKEJ) -C $$dir all; done
 
 clean:
@@ -24,6 +24,7 @@ clean:
 install:
        for dir in $(SUBDIRS); do $(MAKE) -C $$dir install; done
        cp -a COPYING README models Cinelerra_factory ffmpeg msg info tips bin/.
+       cp -a lv2_blacklist.txt bin/.
        mkdir -p bin/plugins/picon/cinfinity; for d in picon/*; do \
          if [ $$d = picon/cinfinity ]; then continue; fi; \
          cp -a $$d bin/plugins/picon/.; \
index 715ff8951239935e1a4408264a7f07ceb98520df..2d4b98d79b39fbbc893659b1bf80ca6957ec2ba6 100644 (file)
@@ -6,7 +6,7 @@ pkgdesc="Cinelerra git://git.cinelerra-cv.org/goodguy/cinelerra.git ($pkgrel)"
 arch=('x86_64')
 url="http://www.cinelerra-cv.org"
 license=('GPL')
-depends=('xorg-server' 'libpng' 'libxv' 'libva'
+depends=('xorg-server' 'libpng' 'libxv' 'libva' 'libdv'
          'libxft' 'freetype2' 'alsa-lib' 'inkscape' 'dvdauthor')
 makedepends=('yasm' 'nasm' 'cmake'
         'libxml2' 'perl-xml-libxml' 'perl-xml-parser')
index 6abdc06385fe67266d7cc58c2800785579376ec4..67e14e8a751f70e442de6959ba12b4dc1b9fac5b 100644 (file)
@@ -500,6 +500,7 @@ lv2ui:      $(LV2UI)
 
 install-lv2ui:
        cp -av $(LV2UI) $(BINDIR)/.
+
 install:       install-lv2ui
 endif
 
index 2f51f61fb359cdf4a71ff18a5e4b7f22b68ed524..766cf6ce2c9fd3f61e4ec48a1ee4cd6bc945b0a7 100644 (file)
@@ -191,9 +191,6 @@ void AppearancePrefs::create_objects()
        y1 += displacement->get_h() + 5;
        add_subwindow(thumbnails = new ViewThumbnails(x1, y1, pwindow));
        y1 += thumbnails->get_h() + 5;
-       PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x1, y1,pwindow);
-       add_subwindow(autostart_lv2ui);
-       y1 += autostart_lv2ui->get_h() + 5;
        PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow);
        add_subwindow(perpetual);
        y1 += perpetual->get_h() + 5;
@@ -635,19 +632,6 @@ int YuvColorRangeItem::handle_event()
        return popup->handle_event();
 }
 
-
-PrefsAutostartLV2UI::PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow)
- : BC_CheckBox(x, y,
-       pwindow->thread->preferences->autostart_lv2ui, _("Auto start lv2 gui"))
-{
-       this->pwindow = pwindow;
-}
-int PrefsAutostartLV2UI::handle_event()
-{
-       pwindow->thread->preferences->autostart_lv2ui = get_value();
-       return 1;
-}
-
 PerpetualSession::PerpetualSession(int x, int y, PreferencesWindow *pwindow)
  : BC_CheckBox(x, y,
        pwindow->thread->preferences->perpetual_session, _("Perpetual session"))
index 975842336fefbabb101f4f9010dda03ecb522503..b59a9ed995a1470fca1f982bc744eb4b0a88eec6 100644 (file)
@@ -297,14 +297,6 @@ public:
        int id;
 };
 
-class PrefsAutostartLV2UI : public BC_CheckBox
-{
-public:
-       PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow);
-       int handle_event();
-       PreferencesWindow *pwindow;
-};
-
 class PerpetualSession : public BC_CheckBox
 {
 public:
index 5a6f54210e5e67e99aeee454240a2fcb76223bc7..1913d982997569c181a857f109c9c5a055f56469 100644 (file)
@@ -1,6 +1,6 @@
 /*
    dcraw.c -- Dave Coffin's raw photo decoder
-   Copyright 1997-2016 by Dave Coffin, dcoffin a cybercom o net
+   Copyright 1997-2018 by Dave Coffin, dcoffin a cybercom o net
 
    This is a command-line ANSI C program to convert raw photos from
    any digital camera on any computer running any operating system.
    *If you have not modified dcraw.c in any way, a link to my
    homepage qualifies as "full source code".
 
-   $Revision: 1.477 $
-   $Date: 2016/05/10 21:30:43 $
+   $Revision: 1.478 $
+   $Date: 2018/06/01 20:36:25 $
  */
 
-#define DCRAW_VERSION "9.27"
+#define DCRAW_VERSION "9.28"
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
@@ -102,8 +102,9 @@ const float DCRaw_data::d65_white[3] = {
 
 /*
    All global variables are defined here, and all functions that
-   access them are prefixed with "CLASS".  Note that a thread-safe
-   C++ class cannot have non-const static local variables.
+   access them are prefixed with "CLASS".  For thread-safety, all
+   non-const static local variables except cbrt[] must be declared
+   "thread_local".
  */
 
 #define FORC(cnt) for (c=0; c < cnt; c++)
@@ -319,11 +320,22 @@ double CLASS getreal (int type)
   }
 }
 
+static void swabb(const void *bfrom, void *bto, ssize_t n)
+{
+  const char *from = (const char *) bfrom;
+  char *to = (char *) bto;
+  n &= ~((ssize_t) 1);
+  while (n > 1) {
+    const char b0 = from[--n], b1 = from[--n];
+    to[n] = b0;  to[n + 1] = b1;
+  }
+}
+
 void CLASS read_shorts (ushort *pixel, int count)
 {
   if (fread (pixel, 2, count, ifp) < count) derror();
   if ((order == 0x4949) == (ntohs(0x1234) == 0x1234))
-    swab (pixel, pixel, count*2);
+    swabb(pixel, pixel, count*2);
 }
 
 void CLASS cubic_spline (const int *x_, const int *y_, const int len)
@@ -1601,7 +1613,7 @@ void CLASS phase_one_correct()
            for (col = (qc ? ph1.split_col : 0);
                 col < (qc ? raw_width : ph1.split_col); col++)
              RAW(row,col) = curve[RAW(row,col)];
-        }
+       }
       }
       qmult_applied = 1;
       qlin_applied = 1;
@@ -1886,10 +1898,10 @@ void CLASS packed_load_raw()
   UINT64 bitbuf=0;
 
   bwide = raw_width * tiff_bps / 8;
-  bwide += bwide & load_flags >> 7;
+  bwide += bwide & load_flags >> 9;
   rbits = bwide * 8 - raw_width * tiff_bps;
   if (load_flags & 1) bwide = bwide * 16 / 15;
-  bite = 8 + (load_flags & 24);
+  bite = 8 + (load_flags & 56);
   half = (raw_height+1) >> 1;
   for (irow=0; irow < raw_height; irow++) {
     row = irow;
@@ -1907,10 +1919,10 @@ void CLASS packed_load_raw()
       for (vbits -= tiff_bps; vbits < 0; vbits += bite) {
        bitbuf <<= bite;
        for (i=0; i < bite; i+=8)
-         bitbuf |= (unsigned) (fgetc(ifp) << i);
+         bitbuf |= ((UINT64) fgetc(ifp) << i);
       }
       val = bitbuf << (64-tiff_bps-vbits) >> (64-tiff_bps);
-      RAW(row,col ^ (load_flags >> 6 & 1)) = val;
+      RAW(row,col ^ (load_flags >> 6 & 3)) = val;
       if (load_flags & 1 && (col % 10) == 9 && fgetc(ifp) &&
        row < height+top_margin && col < width+left_margin) derror();
     }
@@ -2048,6 +2060,14 @@ void CLASS olympus_load_raw()
   }
 }
 
+void CLASS canon_crx_load_raw()
+{
+}
+
+void CLASS fuji_xtrans_load_raw()
+{
+}
+
 void CLASS minolta_rd175_load_raw()
 {
   uchar pixel[768];
@@ -2262,7 +2282,7 @@ fill_input_buffer (j_decompress_ptr cinfo)
   size_t nbytes;
 
   nbytes = fread (jpeg_buffer, 1, 4096, ifp);
-  swab (jpeg_buffer, jpeg_buffer, nbytes);
+  swabb(jpeg_buffer, jpeg_buffer, nbytes);
   cinfo->src->next_input_byte = jpeg_buffer;
   cinfo->src->bytes_in_buffer = nbytes;
   return TRUE;
@@ -2727,7 +2747,7 @@ void CLASS samsung_load_raw()
       }
       for (c=0; c < 16; c+=2) {
        i = len[((c & 1) << 1) | (c >> 3)];
-        RAW(row,col+c) = ((signed) ph1_bits(i) << (32-i) >> (32-i)) +
+       RAW(row,col+c) = ((signed) ph1_bits(i) << (32-i) >> (32-i)) +
          (dir ? RAW(row+(~c | -2),col+c) : col ? RAW(row,col+(c | -2)) : 128);
        if (c == 14) c = -1;
       }
@@ -3755,7 +3775,7 @@ void CLASS crop_masked_pixels()
       load_raw == &CLASS sony_load_raw ||
      (load_raw == &CLASS eight_bit_load_raw && strncmp(model,"DC2",3)) ||
       load_raw == &CLASS kodak_262_load_raw ||
-     (load_raw == &CLASS packed_load_raw && (load_flags & 32))) {
+     (load_raw == &CLASS packed_load_raw && (load_flags & 256))) {
 sides:
     mask[0][0] = mask[1][0] = top_margin;
     mask[0][2] = mask[1][2] = top_margin+height;
@@ -5190,7 +5210,7 @@ void CLASS parse_makernote (int base, int uptag)
     offset = get4();
     fseek (ifp, offset-8, SEEK_CUR);
   } else if (!strcmp (buf,"OLYMPUS") ||
-             !strcmp (buf,"PENTAX ")) {
+            !strcmp (buf,"PENTAX ")) {
     base = ftell(ifp)-10;
     fseek (ifp, -2, SEEK_CUR);
     order = get2();
@@ -5712,14 +5732,13 @@ int CLASS parse_tiff_ifd (int base)
       case 258:                                /* BitsPerSample */
       case 61443:
        tiff_ifd[ifd].samples = len & 7;
-       tiff_ifd[ifd].bps = getint(type);
+       if ((tiff_ifd[ifd].bps = getint(type)) > 32)
+            tiff_ifd[ifd].bps = 8;
        if (tiff_bps < tiff_ifd[ifd].bps)
            tiff_bps = tiff_ifd[ifd].bps;
        break;
       case 61446:
        raw_height = 0;
-       if (tiff_ifd[ifd].bps > 12) break;
-       load_raw = &CLASS packed_load_raw;
        load_flags = get4() ? 24:80;
        break;
       case 259:                                /* Compression */
@@ -6007,7 +6026,7 @@ int CLASS parse_tiff_ifd (int base)
       case 50708:                      /* UniqueCameraModel */
        if (model[0]) break;
        fgets (make, 64, ifp);
-        if ((cp = strchr(make,' '))) {
+       if ((cp = strchr(make,' '))) {
          strcpy(model,cp+1);
          *cp = 0;
        }
@@ -6098,7 +6117,7 @@ guess_cfa_pc:
        width = getint(type) - left_margin;
        break;
       case 50830:                      /* MaskedAreas */
-        for (i=0; i < len && i < 32; i++)
+       for (i=0; i < len && i < 32; i++)
          ((int *)mask)[i] = getint(type);
        black = 0;
        break;
@@ -6220,6 +6239,7 @@ void CLASS apply_tiff()
       case 32767:
        if (tiff_ifd[raw].bytes == raw_width*raw_height) {
          tiff_bps = 12;
+         maximum = 4095;
          load_raw = &CLASS sony_arw2_load_raw;                 break;
        }
        if (tiff_ifd[raw].bytes*8 != raw_width*raw_height*tiff_bps) {
@@ -6235,6 +6255,9 @@ void CLASS apply_tiff()
        if (!strncmp(make,"OLYMPUS",7) &&
                tiff_ifd[raw].bytes*2 == raw_width*raw_height*3)
          load_flags = 24;
+       if (!strcmp(make,"SONY") && tiff_bps < 14 &&
+               tiff_ifd[raw].bytes == raw_width*raw_height*2)
+           tiff_bps = 14;
        if (tiff_ifd[raw].bytes*5 == raw_width*raw_height*8) {
          load_flags = 81;
          tiff_bps = 12;
@@ -6244,12 +6267,16 @@ void CLASS apply_tiff()
          case 12: if (tiff_ifd[raw].phint == 2)
                     load_flags = 6;
                   load_raw = &CLASS packed_load_raw;           break;
-         case 14: load_flags = 0;
+         case 14: load_raw = &CLASS packed_load_raw;
+                  if (tiff_ifd[raw].bytes*4 == raw_width*raw_height*7) break;
+                  load_flags = 0;
          case 16: load_raw = &CLASS unpacked_load_raw;
                   if (!strncmp(make,"OLYMPUS",7) &&
                        tiff_ifd[raw].bytes*7 > raw_width*raw_height)
                     load_raw = &CLASS olympus_load_raw;
        }
+       if (filters == 9 && tiff_ifd[raw].bytes*8 < raw_width*raw_height*tiff_bps)
+         load_raw = &CLASS fuji_xtrans_load_raw;
        break;
       case 6:  case 7:  case 99:
        load_raw = &CLASS lossless_jpeg_load_raw;               break;
@@ -6707,7 +6734,7 @@ void CLASS parse_fuji (int offset)
       FORC(36) xtrans_abs[0][35-c] = fgetc(ifp) & 3;
     } else if (tag == 0x2ff0) {
       FORC4 cam_mul[c ^ 1] = get2();
-    } else if (tag == 0xc000) {
+    } else if (tag == 0xc000 && len > 20000) {
       c = order;
       order = 0x4949;
       while ((tag = get4()) > raw_width);
@@ -6787,6 +6814,72 @@ void CLASS parse_riff()
     fseek (ifp, size, SEEK_CUR);
 }
 
+void CLASS parse_crx (int end)
+{
+  unsigned i, save, size, tag, base;
+  static int index=0, wide, high, off, len;
+
+  order = 0x4d4d;
+  while (ftell(ifp)+7 < end) {
+    save = ftell(ifp);
+    if ((size = get4()) < 8) break;
+    switch (tag = get4()) {
+      case 0x6d6f6f76:                         /* moov */
+      case 0x7472616b:                         /* trak */
+      case 0x6d646961:                         /* mdia */
+      case 0x6d696e66:                         /* minf */
+      case 0x7374626c:                         /* stbl */
+       parse_crx (save+size);
+       break;
+      case 0x75756964:                         /* uuid */
+       switch (i=get4()) {
+         case 0xeaf42b5e: fseek (ifp,  8, SEEK_CUR);
+         case 0x85c0b687: fseek (ifp, 12, SEEK_CUR);
+           parse_crx (save+size);
+       }
+       break;
+      case 0x434d5431:                         /* CMT1 */
+      case 0x434d5432:                         /* CMT2 */
+       base = ftell(ifp);
+       order = get2();
+       fseek (ifp, 6, SEEK_CUR);
+       tag & 1 ? (void)parse_tiff_ifd (base) : parse_exif (base);
+       order = 0x4d4d;
+       break;
+      case 0x746b6864:                         /* tkhd */
+       fseek (ifp, 12, SEEK_CUR);
+       index = get4();
+       fseek (ifp, 58, SEEK_CUR);
+       wide = get4();
+       high = get4();
+       break;
+      case 0x7374737a:                         /* stsz */
+       len = (get4(),get4());
+       break;
+      case 0x636f3634:                         /* co64 */
+       fseek (ifp, 12, SEEK_CUR);
+       off = get4();
+       switch (index) {
+         case 1:                       /* 1 = full size, 2 = 27% size */
+           thumb_width  = wide;
+           thumb_height = high;
+           thumb_length = len;
+           thumb_offset = off;
+           break;
+         case 3:
+           raw_width  = wide;
+           raw_height = high;
+           data_offset = off;
+           load_raw = &CLASS canon_crx_load_raw;
+       }
+       break;
+      case 0x50525657:                         /* PRVW */
+       fseek (ifp, 6, SEEK_CUR);
+    }
+    fseek (ifp, save+size, SEEK_SET);
+  }
+}
+
 void CLASS parse_qt (int end)
 {
   unsigned save, size;
@@ -7028,12 +7121,16 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6188,-1341,-890,-7168,14489,2937,-2640,3228,8483 } },
     { "Canon EOS 5DS", 0, 0x3c96,
        { 6250,-711,-808,-5153,12794,2636,-1249,2198,5610 } },
+    { "Canon EOS 5D Mark IV", 0, 0,
+       { 6446,-366,-864,-4436,12204,2513,-952,2496,6348 } },
     { "Canon EOS 5D Mark III", 0, 0x3c80,
        { 6722,-635,-963,-4287,12460,2028,-908,2162,5668 } },
     { "Canon EOS 5D Mark II", 0, 0x3cf0,
        { 4716,603,-830,-7798,15474,2480,-1496,1937,6651 } },
     { "Canon EOS 5D", 0, 0xe6c,
        { 6347,-479,-972,-8297,15954,2480,-1968,2131,7649 } },
+    { "Canon EOS 6D Mark II", 0, 0,
+       { 6875,-970,-932,-4691,12459,2501,-874,1953,5809 } },
     { "Canon EOS 6D", 0, 0x3c82,
        { 7034,-804,-1014,-4420,12564,2058,-851,1994,5758 } },
     { "Canon EOS 7D Mark II", 0, 0x3510,
@@ -7056,10 +7153,14 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6719,-994,-925,-4408,12426,2211,-887,2129,6051 } },
     { "Canon EOS 70D", 0, 0x3bc7,
        { 7034,-804,-1014,-4420,12564,2058,-851,1994,5758 } },
+    { "Canon EOS 77D", 0, 0,
+       { 7377,-742,-998,-4235,11981,2549,-673,1918,5538 } },
     { "Canon EOS 80D", 0, 0,
        { 7457,-671,-937,-4849,12495,2643,-1213,2354,5492 } },
     { "Canon EOS 100D", 0, 0x350f,
        { 6602,-841,-939,-4472,12458,2247,-975,2039,6148 } },
+    { "Canon EOS 200D", 0, 0,
+       { 7377,-742,-998,-4235,11981,2549,-673,1918,5538 } },
     { "Canon EOS 300D", 0, 0xfa0,
        { 8197,-2000,-1118,-6714,14335,2592,-2536,3178,8266 } },
     { "Canon EOS 350D", 0, 0xfff,
@@ -7082,6 +7183,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6362,-823,-847,-4426,12109,2616,-743,1857,5635 } },
     { "Canon EOS 760D", 0, 0x350f,
        { 6362,-823,-847,-4426,12109,2616,-743,1857,5635 } },
+    { "Canon EOS 800D", 0, 0,
+       { 6970,-512,-968,-4425,12161,2553,-739,1982,5601 } },
     { "Canon EOS 1000D", 0, 0xe43,
        { 6771,-1139,-977,-7818,15123,2928,-1244,1437,7533 } },
     { "Canon EOS 1100D", 0, 0x3510,
@@ -7090,8 +7193,18 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } },
     { "Canon EOS 1300D", 0, 0x3510,
        { 6939,-1016,-866,-4428,12473,2177,-1175,2178,6162 } },
+    { "Canon EOS 1500D", 0, 0,
+       { 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 } },
+    { "Canon EOS 3000D", 0, 0,
+       { 6939,-1016,-866,-4428,12473,2177,-1175,2178,6162 } },
+    { "Canon EOS M6", 0, 0,
+       { 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 } },
+    { "Canon EOS M5", 0, 0,    /* also M50 */
+       { 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 } },
     { "Canon EOS M3", 0, 0,
        { 6362,-823,-847,-4426,12109,2616,-743,1857,5635 } },
+    { "Canon EOS M100", 0, 0,
+       { 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 } },
     { "Canon EOS M10", 0, 0,
        { 6400,-480,-888,-5294,13416,2047,-1296,2203,6137 } },
     { "Canon EOS M", 0, 0,
@@ -7136,6 +7249,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 7474,-2301,-567,-4056,11456,2975,-222,716,4181 } },
     { "Canon PowerShot G16", 0, 0,
        { 8020,-2687,-682,-3704,11879,2052,-965,1921,5556 } },
+    { "Canon PowerShot G1 X Mark III", 0, 0,
+       { 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 } },
     { "Canon PowerShot G1 X", 0, 0,
        { 7378,-1255,-1043,-4088,12251,2048,-876,1946,5805 } },
     { "Canon PowerShot G1", 0, 0,
@@ -7154,6 +7269,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 9877,-3775,-871,-7613,14807,3072,-1448,1305,7485 } },
     { "Canon PowerShot G7 X", 0, 0,
        { 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 } },
+    { "Canon PowerShot G9 X Mark II", 0, 0,
+       { 10056,-4131,-944,-2576,11143,1625,-238,1294,5179 } },
     { "Canon PowerShot G9 X", 0, 0,
        { 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 } },
     { "Canon PowerShot G9", 0, 0,
@@ -7248,6 +7365,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 10004,-3219,-1201,-7036,15047,2107,-1863,2565,7736 } },
     { "Fujifilm F8", 0, 0,
        { 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
+    { "Fujifilm GFX 50S", 0, 0,
+       { 11756,-4754,-874,-3056,11045,2305,-381,1457,6006 } },
     { "Fujifilm S100FS", 514, 0,
        { 11521,-4355,-1065,-6524,13767,3058,-1466,1984,6045 } },
     { "Fujifilm S1", 0, 0,
@@ -7256,9 +7375,9 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 10004,-3219,-1201,-7036,15047,2107,-1863,2565,7736 } },
     { "Fujifilm S20", 512, 0x3fff,
        { 11401,-4498,-1312,-5088,12751,2613,-838,1568,5941 } },
-    { "Fujifilm S2Pro", 128, 0,
+    { "Fujifilm S2Pro", 128, 0xf15,
        { 12492,-4690,-1402,-7033,15423,1647,-1507,2111,7697 } },
-    { "Fujifilm S3Pro", 0, 0,
+    { "Fujifilm S3Pro", 0, 0x3dff,
        { 11807,-4612,-1294,-8927,16968,1988,-2120,2741,8006 } },
     { "Fujifilm S5Pro", 0, 0,
        { 12300,-5110,-1304,-9117,17143,1998,-1947,2448,8100 } },
@@ -7292,7 +7411,7 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 12300,-5110,-1304,-9117,17143,1998,-1947,2448,8100 } },
     { "Fujifilm HS10 HS11", 0, 0xf68,
        { 12440,-3954,-1183,-1123,9674,1708,-83,1614,4086 } },
-    { "Fujifilm HS2", 0, 0,
+    { "Fujifilm HS2", 0, 0xfef,
        { 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
     { "Fujifilm HS3", 0, 0,
        { 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
@@ -7300,6 +7419,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 12085,-4727,-953,-3257,11489,2002,-511,2046,4592 } },
     { "Fujifilm F900EXR", 0, 0,
        { 12085,-4727,-953,-3257,11489,2002,-511,2046,4592 } },
+    { "Fujifilm X100F", 0, 0,
+       { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
     { "Fujifilm X100S", 0, 0,
        { 10592,-4262,-1008,-3514,11355,2465,-870,2025,6386 } },
     { "Fujifilm X100T", 0, 0,
@@ -7318,26 +7439,42 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 } },
     { "Fujifilm X-Pro2", 0, 0,
        { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
+    { "Fujifilm X-A10", 0, 0,
+       { 11540,-4999,-991,-2949,10963,2278,-382,1049,5605 } },
+    { "Fujifilm X-A20", 0, 0,
+       { 11540,-4999,-991,-2949,10963,2278,-382,1049,5605 } },
     { "Fujifilm X-A1", 0, 0,
        { 11086,-4555,-839,-3512,11310,2517,-815,1341,5940 } },
     { "Fujifilm X-A2", 0, 0,
        { 10763,-4560,-917,-3346,11311,2322,-475,1135,5843 } },
+    { "Fujifilm X-A3", 0, 0,
+       { 12407,-5222,-1086,-2971,11116,2120,-294,1029,5284 } },
+    { "Fujifilm X-A5", 0, 0,
+       { 11673,-4760,-1041,-3988,12058,2166,-771,1417,5569 } },
     { "Fujifilm X-E1", 0, 0,
        { 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 } },
     { "Fujifilm X-E2S", 0, 0,
        { 11562,-5118,-961,-3022,11007,2311,-525,1569,6097 } },
     { "Fujifilm X-E2", 0, 0,
        { 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 } },
+    { "Fujifilm X-E3", 0, 0,
+       { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
+    { "Fujifilm X-H1", 0, 0,
+       { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
     { "Fujifilm X-M1", 0, 0,
        { 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 } },
     { "Fujifilm X-S1", 0, 0,
        { 13509,-6199,-1254,-4430,12733,1865,-331,1441,5022 } },
     { "Fujifilm X-T1", 0, 0,   /* also X-T10 */
        { 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 } },
+    { "Fujifilm X-T2", 0, 0,   /* also X-T20 */
+       { 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 } },
     { "Fujifilm XF1", 0, 0,
        { 13509,-6199,-1254,-4430,12733,1865,-331,1441,5022 } },
     { "Fujifilm XQ", 0, 0,     /* XQ1 and XQ2 */
        { 9252,-2704,-1064,-5893,14265,1717,-1101,2341,4349 } },
+    { "GoPro HERO5 Black", 0, 0,
+       { 10344,-4210,-620,-2315,10625,1948,93,1058,5541 } },
     { "Imacon Ixpress", 0, 0,          /* DJC */
        { 7025,-1415,-704,-5188,13765,1424,-1248,2742,6038 } },
     { "Kodak NC2000", 0, 0,
@@ -7450,6 +7587,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 7013,-1408,-635,-5268,12902,2640,-1470,2801,7379 } },
     { "Nikon D3300", 0, 0,
        { 6988,-1384,-714,-5631,13410,2447,-1485,2204,7318 } },
+    { "Nikon D3400", 0, 0,
+       { 6988,-1384,-714,-5631,13410,2447,-1485,2204,7318 } },
     { "Nikon D300", 0, 0,
        { 9030,-1992,-715,-8465,16302,2255,-2689,3217,8069 } },
     { "Nikon D3X", 0, 0,
@@ -7478,6 +7617,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6988,-1384,-714,-5631,13410,2447,-1485,2204,7318 } },
     { "Nikon D5500", 0, 0,
        { 8821,-2938,-785,-4178,12142,2287,-824,1651,6860 } },
+    { "Nikon D5600", 0, 0,
+       { 8821,-2938,-785,-4178,12142,2287,-824,1651,6860 } },
     { "Nikon D500", 0, 0,
        { 8813,-3210,-1036,-4703,12868,2021,-1054,1940,6129 } },
     { "Nikon D50", 0, 0,
@@ -7496,12 +7637,16 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8322,-3112,-1047,-6367,14342,2179,-988,1638,6394 } },
     { "Nikon D7200", 0, 0,
        { 8322,-3112,-1047,-6367,14342,2179,-988,1638,6394 } },
+    { "Nikon D7500", 0, 0,
+       { 8813,-3210,-1036,-4703,12868,2021,-1054,1940,6129 } },
     { "Nikon D750", 0, 0,
        { 9020,-2890,-715,-4535,12436,2348,-934,1919,7086 } },
     { "Nikon D700", 0, 0,
        { 8139,-2171,-663,-8747,16541,2295,-1925,2008,8093 } },
     { "Nikon D70", 0, 0,
        { 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } },
+    { "Nikon D850", 0, 0,
+       { 10405,-3755,-1270,-5461,13787,1793,-1040,2015,6785 } },
     { "Nikon D810", 0, 0,
        { 9369,-3195,-791,-4488,12430,2301,-893,1796,6872 } },
     { "Nikon D800", 0, 0,
@@ -7542,6 +7687,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 7971,-2314,-913,-8451,15762,2894,-1442,1520,7610 } },
     { "Nikon COOLPIX A", 0, 0,
        { 8198,-2239,-724,-4871,12389,2798,-1043,2050,7181 } },
+    { "Nikon COOLPIX B700", 200, 0,
+       { 14387,-6014,-1299,-1357,9975,1616,467,1047,4744 } },
     { "Nikon COOLPIX P330", 200, 0,
        { 10321,-3920,-931,-2750,11146,1824,-442,1545,5539 } },
     { "Nikon COOLPIX P340", 200, 0,
@@ -7640,12 +7787,18 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
     { "Olympus E-PL7", 0, 0,
        { 9197,-3190,-659,-2606,10830,2039,-458,1250,5458 } },
+    { "Olympus E-PL8", 0, 0,
+       { 9197,-3190,-659,-2606,10830,2039,-458,1250,5458 } },
+    { "Olympus E-PL9", 0, 0,
+       { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
     { "Olympus E-PM1", 0, 0,
        { 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
     { "Olympus E-PM2", 0, 0,
        { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
-    { "Olympus E-M10", 0, 0,   /* also E-M10 Mark II */
+    { "Olympus E-M10", 0, 0,   /* also E-M10 Mark II & III */
        { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
+    { "Olympus E-M1Mark II", 0, 0,
+       { 9383,-3170,-763,-2457,10702,2020,-384,1236,5552 } },
     { "Olympus E-M1", 0, 0,
        { 7687,-1984,-606,-4327,11928,2721,-1381,2339,6452 } },
     { "Olympus E-M5MarkII", 0, 0,
@@ -7674,6 +7827,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8360,-2420,-880,-3928,12353,1739,-1381,2416,5173 } },
     { "Olympus TG-4", 0, 0,
        { 11426,-4159,-1126,-2066,10678,1593,-120,1327,4998 } },
+    { "Olympus TG-5", 0, 0,
+       { 10899,-3833,-1082,-2112,10736,1575,-267,1452,5269 } },
     { "Olympus XZ-10", 0, 0,
        { 9777,-3483,-925,-2886,11297,1800,-602,1663,5134 } },
     { "Olympus XZ-1", 0, 0,
@@ -7709,7 +7864,7 @@ void CLASS adobe_coeff (const char *make, const char *model)
     { "Pentax K-r", 0, 0,
        { 9895,-3077,-850,-5304,13035,2521,-883,1768,6936 } },
     { "Pentax K-1", 0, 0,
-       { 8566,-2746,-1201,-3612,12204,1550,-893,1680,6264 } },
+       { 8596,-2981,-639,-4202,12046,2431,-685,1424,6122 } },
     { "Pentax K-30", 0, 0,
        { 8710,-2632,-1167,-3995,12301,1881,-981,1719,6535 } },
     { "Pentax K-3 II", 0, 0,
@@ -7720,37 +7875,45 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8170,-2725,-639,-4440,12017,2744,-771,1465,6599 } },
     { "Pentax K-5", 0, 0,
        { 8713,-2833,-743,-4342,11900,2772,-722,1543,6247 } },
+    { "Pentax K-70", 0, 0,
+       { 8270,-2117,-1299,-4359,12953,1515,-1078,1933,5975 } },
     { "Pentax K-7", 0, 0,
        { 9142,-2947,-678,-8648,16967,1663,-2224,2898,8615 } },
     { "Pentax K-S1", 0, 0,
        { 8512,-3211,-787,-4167,11966,2487,-638,1288,6054 } },
     { "Pentax K-S2", 0, 0,
        { 8662,-3280,-798,-3928,11771,2444,-586,1232,6054 } },
+    { "Pentax KP", 0, 0,
+       { 8617,-3228,-1034,-4674,12821,2044,-803,1577,5728 } },
     { "Pentax Q-S1", 0, 0,
        { 12995,-5593,-1107,-1879,10139,2027,-64,1233,4919 } },
     { "Pentax 645D", 0, 0x3e00,
        { 10646,-3593,-1158,-3329,11699,1831,-667,2874,6287 } },
     { "Panasonic DMC-CM1", 15, 0,
        { 8770,-3194,-820,-2871,11281,1803,-513,1552,4434 } },
+    { "Panasonic DC-FZ80", 0, 0,
+       { 8550,-2908,-842,-3195,11529,1881,-338,1603,4631 } },
     { "Panasonic DMC-FZ8", 0, 0xf7f,
        { 8986,-2755,-802,-6341,13575,3077,-1476,2144,6379 } },
     { "Panasonic DMC-FZ18", 0, 0,
        { 9932,-3060,-935,-5809,13331,2753,-1267,2155,5575 } },
     { "Panasonic DMC-FZ28", 15, 0xf96,
        { 10109,-3488,-993,-5412,12812,2916,-1305,2140,5543 } },
+    { "Panasonic DMC-FZ2500", 15, 0,
+       { 7386,-2443,-743,-3437,11864,1757,-608,1660,4766 } },
     { "Panasonic DMC-FZ330", 15, 0,
        { 8378,-2798,-769,-3068,11410,1877,-538,1792,4623 } },
     { "Panasonic DMC-FZ300", 15, 0,
        { 8378,-2798,-769,-3068,11410,1877,-538,1792,4623 } },
     { "Panasonic DMC-FZ30", 0, 0xf94,
        { 10976,-4029,-1141,-7918,15491,2600,-1670,2071,8246 } },
-    { "Panasonic DMC-FZ3", 15, 0,
+    { "Panasonic DMC-FZ3", 15, 0,      /* FZ35, FZ38 */
        { 9938,-2780,-890,-4604,12393,2480,-1117,2304,4620 } },
-    { "Panasonic DMC-FZ4", 15, 0,
+    { "Panasonic DMC-FZ4", 15, 0,      /* FZ40, FZ45 */
        { 13639,-5535,-1371,-1698,9633,2430,316,1152,4108 } },
     { "Panasonic DMC-FZ50", 0, 0,
        { 7906,-2709,-594,-6231,13351,3220,-1922,2631,6537 } },
-    { "Panasonic DMC-FZ7", 15, 0,
+    { "Panasonic DMC-FZ7", 15, 0,      /* FZ70, FZ72 */
        { 11532,-4324,-1066,-2375,10847,1749,-564,1699,4351 } },
     { "Leica V-LUX1", 0, 0,
        { 7906,-2709,-594,-6231,13351,3220,-1922,2631,6537 } },
@@ -7792,6 +7955,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 10148,-3743,-991,-2837,11366,1659,-701,1893,4899 } },
     { "Leica D-LUX 6", 15, 0,
        { 10148,-3743,-991,-2837,11366,1659,-701,1893,4899 } },
+    { "Panasonic DMC-LX9", 15, 0,
+       { 7790,-2736,-755,-3452,11870,1769,-628,1647,4898 } },
     { "Panasonic DMC-FZ1000", 15, 0,
        { 7830,-2696,-763,-3325,11667,1866,-641,1712,4824 } },
     { "Leica V-LUX (Typ 114)", 15, 0,
@@ -7824,6 +7989,10 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8294,-2891,-651,-3869,11590,2595,-1183,2267,5352 } },
     { "Panasonic DMC-G7", 15, 0xfff,
        { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
+    { "Panasonic DMC-G8", 15, 0xfff,   /* G8, G80, G81, G85 */
+       { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
+    { "Panasonic DC-G9", 15, 0xfff,
+       { 7685,-2375,-634,-3687,11700,2249,-748,1546,5111 } },
     { "Panasonic DMC-GF1", 15, 0xf92,
        { 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } },
     { "Panasonic DMC-GF2", 15, 0xfff,
@@ -7838,6 +8007,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
     { "Panasonic DMC-GF8", 15, 0,
        { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
+    { "Panasonic DC-GF9", 15, 0,
+       { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
     { "Panasonic DMC-GH1", 15, 0xf92,
        { 6299,-1466,-532,-6535,13852,2969,-2331,3112,5984 } },
     { "Panasonic DMC-GH2", 15, 0xf95,
@@ -7846,6 +8017,10 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6559,-1752,-491,-3672,11407,2586,-962,1875,5130 } },
     { "Panasonic DMC-GH4", 15, 0,
        { 7122,-2108,-512,-3155,11201,2231,-541,1423,5045 } },
+    { "Panasonic DC-GH5S", 15, 0,
+       { 6929,-2355,-708,-4192,12534,1828,-1097,1989,5195 } },
+    { "Panasonic DC-GH5", 15, 0,
+       { 7641,-2336,-605,-3218,11299,2187,-485,1338,5121 } },
     { "Panasonic DMC-GM1", 15, 0,
        { 6770,-1895,-744,-5232,13145,2303,-1664,2691,5703 } },
     { "Panasonic DMC-GM5", 15, 0,
@@ -7854,24 +8029,26 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6763,-1919,-863,-3868,11515,2684,-1216,2387,5879 } },
     { "Panasonic DMC-GX7", 15, 0,
        { 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 } },
+    { "Panasonic DMC-GX85", 15, 0,
+       { 7771,-3020,-629,-4029,11950,2345,-821,1977,6119 } },
     { "Panasonic DMC-GX8", 15, 0,
        { 7564,-2263,-606,-3148,11239,2177,-540,1435,4853 } },
-    { "Panasonic DMC-TZ1", 15, 0,
+    { "Panasonic DC-GX9", 15, 0,
+       { 7564,-2263,-606,-3148,11239,2177,-540,1435,4853 } },
+    { "Panasonic DMC-ZS100", 15, 0,
        { 7790,-2736,-755,-3452,11870,1769,-628,1647,4898 } },
-    { "Panasonic DMC-ZS1", 15, 0,
+    { "Panasonic DC-ZS200", 15, 0,
        { 7790,-2736,-755,-3452,11870,1769,-628,1647,4898 } },
-    { "Panasonic DMC-TZ6", 15, 0,
-       { 8607,-2822,-808,-3755,11930,2049,-820,2060,5224 } },
-    { "Panasonic DMC-ZS4", 15, 0,
+    { "Panasonic DMC-ZS40", 15, 0,
        { 8607,-2822,-808,-3755,11930,2049,-820,2060,5224 } },
-    { "Panasonic DMC-TZ7", 15, 0,
+    { "Panasonic DMC-ZS50", 15, 0,
        { 8802,-3135,-789,-3151,11468,1904,-550,1745,4810 } },
-    { "Panasonic DMC-ZS5", 15, 0,
-       { 8802,-3135,-789,-3151,11468,1904,-550,1745,4810 } },
-    { "Panasonic DMC-TZ8", 15, 0,
+    { "Panasonic DMC-TZ82", 15, 0,
        { 8550,-2908,-842,-3195,11529,1881,-338,1603,4631 } },
     { "Panasonic DMC-ZS6", 15, 0,
        { 8550,-2908,-842,-3195,11529,1881,-338,1603,4631 } },
+    { "Panasonic DMC-ZS70", 15, 0,
+       { 9052,-3117,-883,-3045,11346,1927,-205,1520,4730 } },
     { "Leica S (Typ 007)", 0, 0,
        { 6063,-2234,-231,-5210,13787,1500,-1043,2866,6997 } },
     { "Leica X", 0, 0,         /* X and X-U, both (Typ 113) */
@@ -7881,7 +8058,15 @@ void CLASS adobe_coeff (const char *make, const char *model)
     { "Leica M (Typ 262)", 0, 0,
        { 6653,-1486,-611,-4221,13303,929,-881,2416,7226 } },
     { "Leica SL (Typ 601)", 0, 0,
-       { 11865,-4523,-1441,-5423,14458,935,-1587,2687,4830} },
+       { 11865,-4523,-1441,-5423,14458,935,-1587,2687,4830 } },
+    { "Leica TL2", 0, 0,
+       { 5836,-1626,-647,-5384,13326,2261,-1207,2129,5861 } },
+    { "Leica TL", 0, 0,
+       { 5463,-988,-364,-4634,12036,2946,-766,1389,6522 } },
+    { "Leica CL", 0, 0,
+       { 7414,-2393,-840,-5127,13180,2138,-1585,2468,5064 } },
+    { "Leica M10", 0, 0,
+       { 8249,-2849,-620,-5415,14756,565,-957,3074,6517 } },
     { "Phase One H 20", 0, 0,          /* DJC */
        { 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
     { "Phase One H 25", 0, 0,
@@ -7952,16 +8137,20 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 8512,-2641,-694,-8042,15670,2526,-1821,2117,7414 } },
     { "Sony DSC-V3", 0, 0,
        { 7511,-2571,-692,-7894,15088,3060,-948,1111,8128 } },
-    { "Sony DSC-RX100M", 0, 0,         /* M2, M3, and M4 */
+    { "Sony DSC-RX100M", 0, 0,         /* M2, M3, M4, and M5 */
        { 6596,-2079,-562,-4782,13016,1933,-970,1581,5181 } },
     { "Sony DSC-RX100", 0, 0,
        { 8651,-2754,-1057,-3464,12207,1373,-568,1398,4434 } },
-    { "Sony DSC-RX10", 0, 0,           /* also RX10M2 */
+    { "Sony DSC-RX10M4", 0, 0,
+       { 7699,-2566,-629,-2967,11270,1928,-378,1286,4807 } },
+    { "Sony DSC-RX10", 0, 0,           /* also RX10M2, RX10M3 */
        { 6679,-1825,-745,-5047,13256,1953,-1580,2422,5183 } },
     { "Sony DSC-RX1RM2", 0, 0,
        { 6629,-1900,-483,-4618,12349,2550,-622,1381,6514 } },
     { "Sony DSC-RX1", 0, 0,
        { 6344,-1612,-462,-4863,12477,2681,-865,1786,6899 } },
+    { "Sony DSC-RX0", 200, 0,
+       { 9396,-3507,-843,-2497,11111,1572,-343,1355,5089 } },
     { "Sony DSLR-A100", 0, 0xfeb,
        { 9437,-2811,-774,-8405,16215,2290,-710,596,7181 } },
     { "Sony DSLR-A290", 0, 0,
@@ -7996,18 +8185,26 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 6435,-1903,-536,-4722,12449,2550,-663,1363,6517 } },
     { "Sony ILCA-77M2", 0, 0,
        { 5991,-1732,-443,-4100,11989,2381,-704,1467,5992 } },
-    { "Sony ILCE-6300", 0, 0,
+    { "Sony ILCA-99M2", 0, 0,
+       { 6660,-1918,-471,-4613,12398,2485,-649,1433,6447 } },
+    { "Sony ILCE-6", 0, 0,             /* 6300, 6500 */
        { 5973,-1695,-419,-3826,11797,2293,-639,1398,5789 } },
     { "Sony ILCE-7M2", 0, 0,
        { 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 } },
+    { "Sony ILCE-7M3", 0, 0,
+       { 7374,-2389,-551,-5435,13162,2519,-1006,1795,6552 } },
     { "Sony ILCE-7S", 0, 0,    /* also ILCE-7SM2 */
        { 5838,-1430,-246,-3497,11477,2297,-748,1885,5778 } },
+    { "Sony ILCE-7RM3", 0, 0,
+       { 6640,-1847,-503,-5238,13010,2474,-993,1673,6527 } },
     { "Sony ILCE-7RM2", 0, 0,
        { 6629,-1900,-483,-4618,12349,2550,-622,1381,6514 } },
     { "Sony ILCE-7R", 0, 0,
        { 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 } },
     { "Sony ILCE-7", 0, 0,
        { 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 } },
+    { "Sony ILCE-9", 0, 0,
+       { 6389,-1703,-378,-4562,12265,2587,-670,1489,6550 } },
     { "Sony ILCE", 0, 0,       /* 3000, 5000, 5100, 6000, and QX1 */
        { 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
     { "Sony NEX-5N", 0, 0,
@@ -8050,6 +8247,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
        { 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
     { "Sony SLT-A99", 0, 0,
        { 6344,-1612,-462,-4863,12477,2681,-865,1786,6899 } },
+    { "YI M1", 0, 0,
+       { 7712,-2059,-653,-3882,11494,2726,-710,1332,5958 } },
   };
   double cam_xyz[4][3];
   char name[130];
@@ -8205,8 +8404,11 @@ void CLASS identify()
     { 5712, 3774,  62, 20, 10,  2 },
     { 5792, 3804, 158, 51,  0,  0 },
     { 5920, 3950, 122, 80,  2,  0 },
+    { 6096, 4051,  76, 35,  0,  0 },
     { 6096, 4056,  72, 34,  0,  0 },
-    { 6288, 4056, 264, 34,  0,  0 },
+    { 6288, 4056, 264, 36,  0,  0 },
+    { 6384, 4224, 120, 44,  0,  0 },
+    { 6880, 4544, 136, 42,  0,  0 },
     { 8896, 5920, 160, 64,  0,  0 },
   };
   static const struct {
@@ -8220,7 +8422,10 @@ void CLASS identify()
     { 0x261, "EOS 50D" },    { 0x281, "EOS-1D Mark IV" },
     { 0x287, "EOS 60D" },    { 0x167, "EOS-1DS" },
     { 0x325, "EOS 70D" },
+    { 0x408, "EOS 77D" },    { 0x331, "EOS M" },
     { 0x350, "EOS 80D" },    { 0x328, "EOS-1D X Mark II" },
+    { 0x346, "EOS 100D" },
+    { 0x417, "EOS 200D" },
     { 0x170, "EOS 300D" },   { 0x188, "EOS-1Ds Mark II" },
     { 0x176, "EOS 450D" },   { 0x215, "EOS-1Ds Mark III" },
     { 0x189, "EOS 350D" },   { 0x324, "EOS-1D C" },
@@ -8231,12 +8436,14 @@ void CLASS identify()
     { 0x301, "EOS 650D" },   { 0x302, "EOS 6D" },
     { 0x326, "EOS 700D" },   { 0x250, "EOS 7D" },
     { 0x393, "EOS 750D" },   { 0x289, "EOS 7D Mark II" },
-    { 0x347, "EOS 760D" },
+    { 0x347, "EOS 760D" },   { 0x406, "EOS 6D Mark II" },
+    { 0x405, "EOS 800D" },   { 0x349, "EOS 5D Mark IV" },
     { 0x254, "EOS 1000D" },
     { 0x288, "EOS 1100D" },
-    { 0x327, "EOS 1200D" },  { 0x382, "Canon EOS 5DS" },
-    { 0x404, "EOS 1300D" },  { 0x401, "Canon EOS 5DS R" },
-    { 0x346, "EOS 100D" },
+    { 0x327, "EOS 1200D" },  { 0x382, "EOS 5DS" },
+    { 0x404, "EOS 1300D" },  { 0x401, "EOS 5DS R" },
+    { 0x422, "EOS 1500D" },
+    { 0x432, "EOS 3000D" },
   }, sonique[] = {
     { 0x002, "DSC-R1" },     { 0x100, "DSLR-A100" },
     { 0x101, "DSLR-A900" },  { 0x102, "DSLR-A700" },
@@ -8266,7 +8473,30 @@ void CLASS identify()
     { 0x155, "DSC-RX100M4" },{ 0x156, "DSC-RX10M2" },
     { 0x158, "DSC-RX1RM2" }, { 0x15a, "ILCE-QX1" },
     { 0x15b, "ILCE-7RM2" },  { 0x15e, "ILCE-7SM2" },
-    { 0x161, "ILCA-68" },    { 0x165, "ILCE-6300" },
+    { 0x161, "ILCA-68" },    { 0x162, "ILCA-99M2" },
+    { 0x163, "DSC-RX10M3" }, { 0x164, "DSC-RX100M5" },
+    { 0x165, "ILCE-6300" },  { 0x166, "ILCE-9" },
+    { 0x168, "ILCE-6500" },  { 0x16a, "ILCE-7RM3" },
+    { 0x16b, "ILCE-7M3" },   { 0x16c, "DSC-RX0" },
+    { 0x16d, "DSC-RX10M4" },
+  };
+  static const char *orig, panalias[][12] = {
+    "@DC-FZ80", "DC-FZ82", "DC-FZ85",
+    "@DC-FZ81", "DC-FZ83",
+    "@DC-GF9", "DC-GX800", "DC-GX850",
+    "@DC-GF10", "DC-GF90",
+    "@DC-GX9", "DC-GX7MK3",
+    "@DC-ZS70", "DC-TZ90", "DC-TZ91", "DC-TZ92", "DC-TZ93",
+    "@DMC-FZ40", "DMC-FZ45",
+    "@DMC-FZ2500", "DMC-FZ2000", "DMC-FZH1",
+    "@DMC-G8", "DMC-G80", "DMC-G81", "DMC-G85",
+    "@DMC-GX85", "DMC-GX80", "DMC-GX7MK2",
+    "@DMC-LX9", "DMC-LX10", "DMC-LX15",
+    "@DMC-ZS40", "DMC-TZ60", "DMC-TZ61",
+    "@DMC-ZS50", "DMC-TZ70", "DMC-TZ71",
+    "@DMC-ZS60", "DMC-TZ80", "DMC-TZ81", "DMC-TZ85",
+    "@DMC-ZS100", "DMC-ZS110", "DMC-TZ100", "DMC-TZ101", "DMC-TZ110", "DMC-TX1",
+    "@DC-ZS200", "DC-TX2", "DC-TZ200", "DC-TZ202", "DC-TZ220", "DC-ZS220",
   };
   static const struct {
     unsigned fsize;
@@ -8286,24 +8516,24 @@ void CLASS identify()
     { 15980544,3264,2448, 0, 0, 0, 0, 8,0x61,0,1,"AgfaPhoto","DC-833m" },
     {  9631728,2532,1902, 0, 0, 0, 0,96,0x61,0,0,"Alcatel","5035D" },
     {  2868726,1384,1036, 0, 0, 0, 0,64,0x49,0,8,"Baumer","TXG14",1078 },
-    {  5298000,2400,1766,12,12,44, 2,40,0x94,0,2,"Canon","PowerShot SD300" },
-    {  6553440,2664,1968, 4, 4,44, 4,40,0x94,0,2,"Canon","PowerShot A460" },
-    {  6573120,2672,1968,12, 8,44, 0,40,0x94,0,2,"Canon","PowerShot A610" },
-    {  6653280,2672,1992,10, 6,42, 2,40,0x94,0,2,"Canon","PowerShot A530" },
-    {  7710960,2888,2136,44, 8, 4, 0,40,0x94,0,2,"Canon","PowerShot S3 IS" },
-    {  9219600,3152,2340,36,12, 4, 0,40,0x94,0,2,"Canon","PowerShot A620" },
-    {  9243240,3152,2346,12, 7,44,13,40,0x49,0,2,"Canon","PowerShot A470" },
-    { 10341600,3336,2480, 6, 5,32, 3,40,0x94,0,2,"Canon","PowerShot A720 IS" },
-    { 10383120,3344,2484,12, 6,44, 6,40,0x94,0,2,"Canon","PowerShot A630" },
-    { 12945240,3736,2772,12, 6,52, 6,40,0x94,0,2,"Canon","PowerShot A640" },
-    { 15636240,4104,3048,48,12,24,12,40,0x94,0,2,"Canon","PowerShot A650" },
-    { 15467760,3720,2772, 6,12,30, 0,40,0x94,0,2,"Canon","PowerShot SX110 IS" },
-    { 15534576,3728,2778,12, 9,44, 9,40,0x94,0,2,"Canon","PowerShot SX120 IS" },
-    { 18653760,4080,3048,24,12,24,12,40,0x94,0,2,"Canon","PowerShot SX20 IS" },
-    { 19131120,4168,3060,92,16, 4, 1,40,0x94,0,2,"Canon","PowerShot SX220 HS" },
-    { 21936096,4464,3276,25,10,73,12,40,0x16,0,2,"Canon","PowerShot SX30 IS" },
-    { 24724224,4704,3504, 8,16,56, 8,40,0x94,0,2,"Canon","PowerShot A3300 IS" },
-    { 30858240,5248,3920, 8,16,56,16,40,0x94,0,2,"Canon","IXUS 160" },
+    {  5298000,2400,1766,12,12,44, 2, 8,0x94,0,2,"Canon","PowerShot SD300" },
+    {  6553440,2664,1968, 4, 4,44, 4, 8,0x94,0,2,"Canon","PowerShot A460" },
+    {  6573120,2672,1968,12, 8,44, 0, 8,0x94,0,2,"Canon","PowerShot A610" },
+    {  6653280,2672,1992,10, 6,42, 2, 8,0x94,0,2,"Canon","PowerShot A530" },
+    {  7710960,2888,2136,44, 8, 4, 0, 8,0x94,0,2,"Canon","PowerShot S3 IS" },
+    {  9219600,3152,2340,36,12, 4, 0, 8,0x94,0,2,"Canon","PowerShot A620" },
+    {  9243240,3152,2346,12, 7,44,13, 8,0x49,0,2,"Canon","PowerShot A470" },
+    { 10341600,3336,2480, 6, 5,32, 3, 8,0x94,0,2,"Canon","PowerShot A720 IS" },
+    { 10383120,3344,2484,12, 6,44, 6, 8,0x94,0,2,"Canon","PowerShot A630" },
+    { 12945240,3736,2772,12, 6,52, 6, 8,0x94,0,2,"Canon","PowerShot A640" },
+    { 15636240,4104,3048,48,12,24,12, 8,0x94,0,2,"Canon","PowerShot A650" },
+    { 15467760,3720,2772, 6,12,30, 0, 8,0x94,0,2,"Canon","PowerShot SX110 IS" },
+    { 15534576,3728,2778,12, 9,44, 9, 8,0x94,0,2,"Canon","PowerShot SX120 IS" },
+    { 18653760,4080,3048,24,12,24,12, 8,0x94,0,2,"Canon","PowerShot SX20 IS" },
+    { 19131120,4168,3060,92,16, 4, 1, 8,0x94,0,2,"Canon","PowerShot SX220 HS" },
+    { 21936096,4464,3276,25,10,73,12, 8,0x16,0,2,"Canon","PowerShot SX30 IS" },
+    { 24724224,4704,3504, 8,16,56, 8, 8,0x94,0,2,"Canon","PowerShot A3300 IS" },
+    { 30858240,5248,3920, 8,16,56,16, 8,0x94,0,2,"Canon","IXUS 160" },
     {  1976352,1632,1211, 0, 2, 0, 1, 0,0x94,0,1,"Casio","QV-2000UX" },
     {  3217760,2080,1547, 0, 0,10, 1, 0,0x94,0,1,"Casio","QV-3*00EX" },
     {  6218368,2585,1924, 0, 0, 9, 0, 0,0x94,0,1,"Casio","QV-5700" },
@@ -8376,12 +8606,13 @@ void CLASS identify()
     { 44390468,4080,5440, 0, 0, 0, 0,33,0x61,0,0,"Sinar","",68 },
     {  1409024,1376,1024, 0, 0, 1, 0, 0,0x49,0,0,"Sony","XCD-SX910CR" },
     {  2818048,1376,1024, 0, 0, 1, 0,97,0x49,0,0,"Sony","XCD-SX910CR" },
+    { 17496000,4320,3240, 0, 0, 0,0,224,0x94,0,0,"Xiro","Xplorer V" },
   };
   static const char *corp[] =
     { "AgfaPhoto", "Canon", "Casio", "Epson", "Fujifilm",
       "Mamiya", "Minolta", "Motorola", "Kodak", "Konica", "Leica",
       "Nikon", "Nokia", "Olympus", "Ricoh", "Pentax", "Phase One",
-      "Samsung", "Sigma", "Sinar", "Sony" };
+      "Samsung", "Sigma", "Sinar", "Sony", "YI" };
   char head[32], *cp;
   int hlen, flen, fsize, zero_fsize=1, i, c;
   struct jhead jh;
@@ -8469,14 +8700,20 @@ void CLASS identify()
       if (is_raw == 2 && shot_select)
        parse_fuji (i);
     }
-    load_raw = &CLASS unpacked_load_raw;
     fseek (ifp, 100+28*(shot_select > 0), SEEK_SET);
     parse_tiff (data_offset = get4());
     parse_tiff (thumb_offset+12);
     apply_tiff();
+    if (!load_raw) {
+      load_raw = &CLASS unpacked_load_raw;
+      tiff_bps = 14;
+    }
   } else if (!memcmp (head,"RIFF",4)) {
     fseek (ifp, 0, SEEK_SET);
     parse_riff();
+  } else if (!memcmp (head+4,"ftypcrx ",8)) {
+    fseek (ifp, 0, SEEK_SET);
+    parse_crx (fsize);
   } else if (!memcmp (head+4,"ftypqt   ",9)) {
     fseek (ifp, 0, SEEK_SET);
     parse_qt (fsize);
@@ -8572,7 +8809,8 @@ void CLASS identify()
          case 8:
            load_raw = &CLASS eight_bit_load_raw;  break;
          case 10: case 12:
-           load_flags |= 128;
+           load_flags |= 512;
+           if (!strcmp(make,"Canon")) load_flags |= 256;
            load_raw = &CLASS packed_load_raw;     break;
          case 16:
            order = 0x4949 | 0x404 * (load_flags & 1);
@@ -8627,17 +8865,25 @@ void CLASS identify()
     { height  = 2616;   width  = 3896; }
   if (height == 3136 && width == 4864)  /* Pentax K20D and Samsung GX20 */
     { height  = 3124;   width  = 4688; filters = 0x16161616; }
-  if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
+  if (raw_height == 2868 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
     {                  width  = 4309; filters = 0x16161616; }
-  if (width >= 4960 && !strncmp(model,"K-5",3))
-    { left_margin = 10; width  = 4950; filters = 0x16161616; }
-  if (width == 4736 && !strcmp(model,"K-7"))
+  if (raw_height == 3136 && !strcmp(model,"K-7"))
     { height  = 3122;   width  = 4684; filters = 0x16161616; top_margin = 2; }
-  if (width == 6080 && !strcmp(model,"K-3"))
-    { left_margin = 4;  width  = 6040; }
-  if (width == 7424 && !strcmp(model,"645D"))
-    { height  = 5502;   width  = 7328; filters = 0x61616161; top_margin = 29;
-      left_margin = 48; }
+  if (raw_height == 3284 && !strncmp(model,"K-5",3))
+    { left_margin = 10; width  = 4950; filters = 0x16161616; }
+  if (raw_height == 3300 && !strncmp(model,"K-50",4))
+    { height  = 3288,   width  = 4952;  left_margin = 0;  top_margin = 12; }
+  if (raw_height == 3664 && !strncmp(model,"K-S",3))
+    {                  width  = 5492;  left_margin = 0; }
+  if (raw_height == 4032 && !strcmp(model,"K-3"))
+    { height  = 4032;   width  = 6040;  left_margin = 4; }
+  if (raw_height == 4060 && !strcmp(model,"KP"))
+    { height  = 4032;   width  = 6032;  left_margin = 52; top_margin = 28; }
+  if (raw_height == 4950 && !strcmp(model,"K-1"))
+    { height  = 4932;   width  = 7380;  left_margin = 4;  top_margin = 18; }
+  if (raw_height == 5552 && !strcmp(model,"645D"))
+    { height  = 5502;   width  = 7328;  left_margin = 48; top_margin = 29;
+      filters = 0x61616161; }
   if (height == 3014 && width == 4096) /* Ricoh GX200 */
                        width  = 4014;
   if (dng_version) {
@@ -8682,6 +8928,10 @@ void CLASS identify()
   for (i=0; i < sizeof sonique / sizeof *sonique; i++)
     if (unique_id == sonique[i].id)
       strcpy (model, sonique[i].model);
+  for (i=0; i < sizeof panalias / sizeof *panalias; i++)
+    if (panalias[i][0] == '@') orig = panalias[i]+1;
+    else if (!strcmp(model,panalias[i]))
+      adobe_coeff ("Panasonic", orig);
   if (!strcmp(make,"Nikon")) {
     if (!load_raw)
       load_raw = &CLASS packed_load_raw;
@@ -8749,7 +8999,7 @@ canon_a5:
     colors = 4;
     tiff_bps = 10;
     load_raw = &CLASS packed_load_raw;
-    load_flags = 40;
+    load_flags = 264;
   } else if (!strcmp(model,"PowerShot Pro90 IS") ||
             !strcmp(model,"PowerShot G1")) {
     colors = 4;
@@ -8761,6 +9011,9 @@ canon_a5:
   } else if (!strcmp(model,"EOS D2000C")) {
     filters = 0x61616161;
     black = curve[200];
+  } else if (!strcmp(model,"EOS 80D")) {
+    top_margin -= 2;
+    height += 2;
   } else if (!strcmp(model,"D1")) {
     cam_mul[0] *= 256/527.0;
     cam_mul[2] *= 256/317.0;
@@ -8815,6 +9068,8 @@ canon_a5:
     else width -= 8;
   } else if (!strncmp(model,"D300",4)) {
     width -= 32;
+  } else if (!strncmp(model,"COOLPIX B",9)) {
+    load_flags = 24;
   } else if (!strncmp(model,"COOLPIX P",9) && raw_width != 4032) {
     load_flags = 24;
     filters = 0x94949494;
@@ -8887,12 +9142,11 @@ canon_a5:
       height = 2144;
       width  = 2880;
       flip = 6;
-    } else if (load_raw != &CLASS packed_load_raw)
-      maximum = (is_raw == 2 && shot_select) ? 0x2f00 : 0x3e00;
+    }
     top_margin = (raw_height - height) >> 2 << 1;
     left_margin = (raw_width - width ) >> 2 << 1;
     if (width == 2848 || width == 3664) filters = 0x16161616;
-    if (width == 4032 || width == 4952 || width == 6032) left_margin = 0;
+    if (width == 4032 || width == 4952 || width == 6032 || width == 8280) left_margin = 0;
     if (width == 3328 && (width -= 66)) left_margin = 34;
     if (width == 4936) left_margin = 4;
     if (!strcmp(model,"HS50EXR") ||
@@ -8954,7 +9208,7 @@ konica_400z:
   } else if (!strcmp(make,"Samsung") && raw_width == 4704) {
     height -= top_margin = 8;
     width -= 2 * (left_margin = 8);
-    load_flags = 32;
+    load_flags = 256;
   } else if (!strcmp(make,"Samsung") && raw_height == 3714) {
     height -= top_margin = 18;
     left_margin = raw_width - (width = 5536);
@@ -9024,6 +9278,11 @@ konica_400z:
       top_margin  = 4;
       left_margin = 41;
       filters = 0x61616161;
+    } else if (raw_width == 8384) {
+      height = 6208;
+      width  = 8280;
+      top_margin  = 96;
+      left_margin = 46;
     } else if (raw_width == 9044) {
       height = 6716;
       width  = 8964;
@@ -9137,6 +9396,8 @@ konica_400z:
       thumb_width  = 640;
     } else if (!strcmp(model,"TG-4")) {
       width -= 16;
+    } else if (!strcmp(model,"TG-5")) {
+      width -= 6;
     }
   } else if (!strcmp(model,"N Digital")) {
     height = 2047;
@@ -9182,11 +9443,6 @@ konica_400z:
     width -= 30;
   } else if (!strcmp(make,"Sony") && raw_width == 8000) {
     width -= 32;
-    if (!strncmp(model,"DSC",3)) {
-      tiff_bps = 14;
-      load_raw = &CLASS unpacked_load_raw;
-      black = 512;
-    }
   } else if (!strcmp(model,"DSLR-A100")) {
     if (width == 3880) {
       height--;
@@ -9831,7 +10087,7 @@ void CLASS write_ppm_tiff()
           FORCC ppm [col*colors+c] = curve[image[soff][c]] >> 8;
       else FORCC ppm2[col*colors+c] = curve[image[soff][c]];
     if (output_bps == 16 && !output_tiff && htons(0x55aa) != 0x55aa)
-      swab (ppm2, ppm2, width*colors*2);
+      swabb(ppm2, ppm2, width*colors*2);
     fwrite (ppm, colors*output_bps/8, width, ofp);
   }
   free (ppm);
index 0f04db36ef40904eb66e98aa3de260418e303896..3a12493236be862390313e07de195cbfa8e0d598 100644 (file)
@@ -163,6 +163,8 @@ private:
        unsigned pana_bits(int nbits);
        void panasonic_load_raw(void);
        void olympus_load_raw(void);
+       void canon_crx_load_raw();
+       void fuji_xtrans_load_raw();
        void minolta_rd175_load_raw(void);
        void quicktake_100_load_raw(void);
        void kodak_radc_load_raw(void);
@@ -255,6 +257,7 @@ private:
        void parse_fuji(int offset);
        int parse_jpeg(int offset);
        void parse_riff(void);
+       void parse_crx(int end);
        void parse_qt(int end);
        void parse_smal(int offset,int fsize);
        void parse_cine(void);
index ba27ce4ec648e34973603f598b6ab765e7030d4b..5142b3b6799bf3a672396a4d7706b071cba49dcc 100644 (file)
@@ -145,6 +145,12 @@ void InterfacePrefs::create_objects()
        add_subwindow(shbtn_prefs);
        y += shbtn_prefs->get_h() + 30;
 
+       add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
+       y += title->get_h() + 10;
+       PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-30);
+       add_subwindow(lv2_path_text);
+       y += 30;
+
        y2 = y;
        x = x0;  y = y1;
        add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y));
@@ -165,37 +171,36 @@ void InterfacePrefs::create_objects()
        add_subwindow(yuv420p_dvdlace);
        y += 30;
 
-       if( y2 > y ) y = y2;
-       add_subwindow(title = new BC_Title(x, y + 5, _("Min DB for meter:")));
-       x += title->get_w() + 10;
+       add_subwindow(title = new BC_Title(x1=x, y + 5, _("Min DB for meter:")));
+       x1 += title->get_w() + 10;
        sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
-       add_subwindow(min_db = new MeterMinDB(pwindow, string, x, y));
-       x += min_db->get_w() + 10;
-       add_subwindow(title = new BC_Title(x, y + 5, _("Max DB:")));
-       x += title->get_w() + 10;
+       add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y));
+       x1 += min_db->get_w() + 10;
+       add_subwindow(title = new BC_Title(x1, y + 5, _("Max DB:")));
+       x1 += title->get_w() + 10;
        sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
-       add_subwindow(max_db = new MeterMaxDB(pwindow, string, x, y));
+       add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y));
        y += 30;
 
        StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
-               pwindow->thread->edl->session->si_useduration, x2, y2);
+               pwindow->thread->edl->session->si_useduration, x, y);
        add_subwindow(use_stduration);
-       int tw = 0, th = 0;
-       BC_CheckBox::calculate_extents(this, &tw, &th, 0, 0);
-       x2 += tw + 3;
-       y2 += use_stduration->get_h() + 3;
-       StillImageDuration *stduration = new StillImageDuration(pwindow, x2, y2);
+       x1 = x + use_stduration->get_w() + 10;
+       StillImageDuration *stduration = new StillImageDuration(pwindow, x1, y);
        add_subwindow(stduration);
-       x2 += stduration->get_w() + 10;
-       y2 += 3;
-       add_subwindow(new BC_Title(x2, y2, _("Seconds")));
-       y2 += 30;
+       x1 += stduration->get_w() + 10;
+       add_subwindow(new BC_Title(x1, y, _("Seconds")));
+       y += 30;
 
-       x = x0;  y = y2;
+       PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x, y,pwindow);
+       add_subwindow(autostart_lv2ui);
+       y += autostart_lv2ui->get_h() + 10;
+
+       if( y2 > y ) y = y2;
+       x = x0;
        add_subwindow(new BC_Bar(5, y,  get_w() - 10));
        y += 5;
 
-
        add_subwindow(new BC_Title(x, y, _("Index files:"), LARGEFONT, resources->text_default));
        y += 30;
 
@@ -628,3 +633,33 @@ int SnapshotPathText::handle_event()
        return 1;
 }
 
+PrefsAutostartLV2UI::PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow)
+ : BC_CheckBox(x, y,
+       pwindow->thread->preferences->autostart_lv2ui, _("Auto start lv2 gui"))
+{
+       this->pwindow = pwindow;
+}
+int PrefsAutostartLV2UI::handle_event()
+{
+       pwindow->thread->preferences->autostart_lv2ui = get_value();
+       return 1;
+}
+
+PrefsLV2PathText::PrefsLV2PathText(PreferencesWindow *pwindow,
+       InterfacePrefs *subwindow, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->lv2_path)
+{
+       this->pwindow = pwindow;
+       this->subwindow = subwindow;
+}
+
+PrefsLV2PathText::~PrefsLV2PathText()
+{
+}
+
+int PrefsLV2PathText::handle_event()
+{
+       strcpy(pwindow->thread->preferences->lv2_path, get_text());
+       return 1;
+}
+
index de0029cc3dbf0e801e0868ab3704f264a56fb662..1a912d3715d6217ea877c3e05dc5b587d9c62e7d 100644 (file)
@@ -286,4 +286,25 @@ public:
        InterfacePrefs *subwindow;
 };
 
+class PrefsAutostartLV2UI : public BC_CheckBox
+{
+public:
+       PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow);
+       int handle_event();
+       PreferencesWindow *pwindow;
+};
+
+class PrefsLV2PathText : public BC_TextBox
+{
+public:
+       PrefsLV2PathText(PreferencesWindow *pwindow,
+               InterfacePrefs *subwindow, int x, int y, int w);
+       ~PrefsLV2PathText();
+
+       int handle_event();
+       PreferencesWindow *pwindow;
+       InterfacePrefs *subwindow;
+};
+
+
 #endif
index 3ea5ba170f8ba006a2bddaca2ea58fef9c51df68..23b26a3e03db20e06022e9fe85358d40ed10cb98 100644 (file)
@@ -34,9 +34,9 @@ int PluginLV2ChildUI::run(int ac, char **av)
                ForkBase::ppid = atoi(av[3]);
        }
        else {
-               int sample_rate = 48000;
+               int sample_rate = 48000, bfrsz = 4096;
                if( ac > 2 ) sample_rate = atoi(av[2]);
-               if( init_ui(av[1], sample_rate) ) {
+               if( init_ui(av[1], sample_rate, bfrsz) ) {
                        fprintf(stderr," init_ui failed\n");
                        return 1;
                }
index 79ce0e3b53b4a7ddbbaa37a53caa35ee3be2a278..9de65dba075855f78b5c4aa1234f471cbb4350d1 100644 (file)
@@ -881,10 +881,25 @@ int MWindow::plugin_exists(char *plugin_path)
        return !plugindb ? 0 : plugin_exists(plugin_path, *plugindb);
 }
 
+void MWindow::remove_plugin_index()
+{
+       char index_path[BCTEXTLEN];
+       MWindow::create_defaults_path(index_path, PLUGIN_FILE);
+       ::remove(index_path);
+}
+
 void MWindow::init_preferences()
 {
        preferences = new Preferences;
        preferences->load_defaults(defaults);
+       const char *lv2_path = getenv("LV2_PATH");
+       if( lv2_path && strcmp(lv2_path, preferences->lv2_path) ) {
+               strncpy(preferences->lv2_path, lv2_path, sizeof(preferences->lv2_path));
+               remove_plugin_index();
+       }
+       else if( !lv2_path && preferences->lv2_path[0] ) {
+               File::setenv_path("LV2_PATH",preferences->lv2_path, 0);
+       }
        session = new MainSession(this);
        session->load_defaults(defaults);
        // set x11_host, screens, window_config
index 30ecbec58059fcd6b72db3d512610eab59d8420f..08c46c0f7f437e91e3b3277f357094d14d50bda0 100644 (file)
@@ -690,6 +690,7 @@ public:
        static PluginServer *new_ffmpeg_server(MWindow *mwindow, const char *name);
        static int init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
        static PluginServer *new_lv2_server(MWindow *mwindow, const char *name);
+       static void remove_plugin_index();
 
        void init_preferences();
        void init_signals();
index 4ec32648ae3441d44048cee56fc570852b736473..c894bd0a92e7669aa5cb8c6b64ce3b2cd4b8a17a 100644 (file)
@@ -125,7 +125,7 @@ int PluginLV2::load_lv2(const char *path, char *title)
        return 0;
 }
 
-int PluginLV2::init_lv2(PluginLV2ClientConfig &conf, int sample_rate)
+int PluginLV2::init_lv2(PluginLV2ClientConfig &conf, int sample_rate, int bfrsz)
 {
        reset_lv2();
 
@@ -191,6 +191,7 @@ int PluginLV2::init_lv2(PluginLV2ClientConfig &conf, int sample_rate)
        ui_updateRate = uri_table.map(LV2_UI__updateRate);
 
        samplerate = sample_rate;
+       block_length = bfrsz;
        options.add(param_sampleRate, sizeof(float), atom_float, &samplerate);
        options.add(bufsz_minBlockLength, sizeof(int), atom_int, &block_length);
        options.add(bufsz_maxBlockLength, sizeof(int), atom_int, &block_length);
index 9cd516a084e8fa4c2ac3f39e1b6dbba854823ee4..913caed068b44e2fcf35616a2b0234a5575877c4 100644 (file)
@@ -62,7 +62,7 @@ public:
 
        void reset_lv2();
        int load_lv2(const char *path,char *title=0);
-       int init_lv2(PluginLV2ClientConfig &conf, int sample_rate);
+       int init_lv2(PluginLV2ClientConfig &conf, int sample_rate, int bfrsz);
        virtual int is_forked() { return 0; }
 
        static LV2_URID uri_table_map(LV2_URID_Map_Handle handle, const char *uri);
@@ -143,7 +143,7 @@ public:
        int worker_done;
 };
 
-typedef struct { int sample_rate;  char path[1]; } open_bfr_t;
+typedef struct { int sample_rate, bfrsz;  char path[1]; } open_bfr_t;
 
 enum { NO_COMMAND,
        LV2_OPEN,
index 6163f2dfd9867e1c7e16550d465acc15e51c785a..3e204acb44cf551ebd06677bdc46409a8067dea0 100644 (file)
 #include "bchash.h"
 #include "clip.h"
 #include "cstrdup.h"
+#include "edl.h"
+#include "edlsession.h"
 #include "file.h"
+#include "filesystem.h"
 #include "filexml.h"
 #include "language.h"
 #include "mainerror.h"
@@ -164,8 +167,15 @@ NEW_WINDOW_MACRO(PluginLV2Client, PluginLV2ClientWindow)
 
 int PluginLV2Client::init_lv2()
 {
+       int bfrsz = 4096;
+       EDL *edl = server->edl;
+       if( edl ) {
+               PlaybackConfig *playback_config = edl->session->playback_config;
+               bfrsz = playback_config->aconfig->fragment_size;
+       }
        int sample_rate = get_project_samplerate();
-       return PluginLV2::init_lv2(config, sample_rate);
+       if( sample_rate < 64 ) sample_rate = 48000;
+       return PluginLV2::init_lv2(config, sample_rate, bfrsz);
 }
 
 int PluginLV2Client::load_configuration()
@@ -332,8 +342,9 @@ PluginLV2BlackList::~PluginLV2BlackList()
 
 int PluginLV2BlackList::is_badboy(const char *uri)
 {
+       FileSystem fs;
        for( int i=size(); --i>=0; )
-               if( !strcmp(uri, get(i)) ) return 1;
+               if( !fs.test_filter(uri, get(i)) ) return 1;
        return 0;
 }
 
@@ -390,7 +401,7 @@ PluginLV2ParentUI::PluginLV2ParentUI(Plugin *plugin)
        output_bfr = new Condition(0, "PluginLV2ParentUI::output_bfr", 1);
        client = 0;
        gui = 0;
-       hidden = 1;
+       hidden = -1;
 }
 
 PluginLV2ParentUI::~PluginLV2ParentUI()
@@ -407,6 +418,8 @@ void PluginLV2ParentUI::start_parent(PluginLV2Client *client)
        char bfr[len];  memset(bfr, 0, len);
        open_bfr_t *open_bfr = (open_bfr_t *)bfr;
        open_bfr->sample_rate = client->get_project_samplerate();
+       PlaybackConfig *playback_config = client->server->edl->session->playback_config;
+       open_bfr->bfrsz = playback_config->aconfig->fragment_size;
        strcpy(open_bfr->path, path);
        send_child(LV2_OPEN, open_bfr, len);
        PluginLV2ClientConfig &conf = client->config;
@@ -426,6 +439,8 @@ int PluginLV2ParentUI::handle_parent()
                hidden = 1;
                break; }
        case LV2_SHOW: {
+               if( hidden < 0 )
+                       gui->lv2_ui_enable();
                hidden = 0;
                break; }
        case LV2_SHMID: {
index 7d9f0e9c9671268af48b6b6a7d0c2b3397b7321f..ea5a102356094b5becc8a659e7f9b5e7a04fa300 100644 (file)
@@ -214,6 +214,7 @@ void PluginLV2ClientWindow::create_objects()
        add_subwindow(title = new BC_Title(x, y, client->title));
        x1 = get_w() - BC_GenericButton::calculate_w(this, _("UI")) - 8;
        add_subwindow(ui = new PluginLV2ClientUI(this, x1, y));
+       ui->disable();
        y += title->get_h() + 10;
        add_subwindow(varbl = new BC_Title(x, y, ""));
        add_subwindow(range = new BC_Title(x+160, y, ""));
@@ -354,4 +355,11 @@ void PluginLV2ClientWindow::lv2_set(int idx, float val)
        lv2_update();
 }
 
+void PluginLV2ClientWindow::lv2_ui_enable()
+{
+       lock_window("PluginLV2ClientWindow::lv2_update");
+       ui->enable();
+       unlock_window();
+}
+
 #endif
index a3e6624dfd3baedbcf2c0b4bbd2836159d48e653..c9f1aa67359d66839c6d8eb6efe65545c4910fc6 100644 (file)
@@ -90,6 +90,7 @@ public:
        void update(PluginLV2Client_Opt *opt);
        void lv2_update();
        void lv2_update(float *vals);
+       void lv2_ui_enable();
        void lv2_set(int idx, float val);
        PluginLV2ParentUI *find_ui();
        PluginLV2ParentUI *get_ui();
index 03e656d7cb39d4523c9d4c949a8aad9c6e4e45ae..24faecf1bbf9708361b7b18c5d52ef4e6f9da90a 100644 (file)
@@ -160,13 +160,38 @@ void PluginLV2UI::run_lilv(int samples)
 
 void PluginLV2ChildUI::start_gui()
 {
-       gui->start_gui();
+       if( gui ) gui->start_gui();
        update_lv2_input(config.ctls, 1);
        connect_ports(config, PORTS_CONTROL | PORTS_ATOM);
+       int n = 0;
+#if 1
+// some plugins must have pointers, or they crash
+       float inp[nb_inputs], out[nb_outputs];
+       memset(&inp, 0, nb_inputs*sizeof(float));
+       memset(&out, 0, nb_outputs*sizeof(float));
+       int ich = 0, och = 0;
+       for( int i=0; i<config.nb_ports; ++i ) {
+               const LilvPort *lp = lilv_plugin_get_port_by_index(lilv, i);
+               if( !lp ) continue;
+               int port = config.ports[i];
+               if( !(port & PORTS_AUDIO) ) continue;
+               if( (port & PORTS_INPUT) ) {
+                       lilv_instance_connect_port(inst, i, &inp[ich++]);
+                       continue;
+               }
+               if( (port & PORTS_OUTPUT) ) {
+                       lilv_instance_connect_port(inst, i, &out[och++]);
+                       continue;
+               }
+       }
+       n = 1;
+#endif
        updates = 0;
-       run_lilv(0);
-       send_host(LV2_SHOW, 0, 0);
-       hidden = 0;
+       run_lilv(n);
+       if( gui ) {
+               send_host(LV2_SHOW, 0, 0);
+               hidden = 0;
+       }
 }
 
 void PluginLV2UI::update_host()
@@ -183,19 +208,14 @@ static void lv2ui_extui_host_ui_closed(void *p)
        ui->hidden = -1;
 }
 
-int PluginLV2ChildUI::init_ui(const char *path, int sample_rate)
+int PluginLV2ChildUI::init_ui(const char *path, int sample_rate, int bfrsz)
 {
        char *title = PluginLV2UI::title;
        if( load_lv2(path, title) ) return 1;
-       if( init_lv2(config, sample_rate) ) return 1;
+       if( init_lv2(config, sample_rate, bfrsz) ) return 1;
 
        lilv_uis = lilv_plugin_get_uis(lilv);
-       if( !lilv_uis ) {
-               printf("lv2: lilv_plugin_get_uis(%s) failed\n", path);
-               return 1;
-       }
-
-       if( !gui && wgt_type ) {
+       if( !gui && lilv_uis && wgt_type ) {
                LilvNode *gui_type = lilv_new_uri(world, wgt_type);
                LILV_FOREACH(uis, i, lilv_uis) {
                        const LilvUI *ui = lilv_uis_get(lilv_uis, i);
@@ -209,7 +229,7 @@ int PluginLV2ChildUI::init_ui(const char *path, int sample_rate)
                }
                lilv_node_free(gui_type);
        }
-       if( !gui && gtk_type ) {
+       if( !gui && lilv_uis && gtk_type ) {
                LilvNode *gui_type = lilv_new_uri(world, gtk_type);
                LILV_FOREACH(uis, i, lilv_uis) {
                        const LilvUI *ui = lilv_uis_get(lilv_uis, i);
@@ -224,18 +244,13 @@ int PluginLV2ChildUI::init_ui(const char *path, int sample_rate)
                ui_type = gtk_type;
        }
 
-       if( !gui ) {
-               printf("lv2_gui: init_ui failed: %s\n", title);
-               return 1;
-       }
-
        lilv_instance_activate(inst);
        return 0;
 }
 
 void PluginLV2ChildUI::reset_gui()
 {
-       gui->reset_gui();
+       if( gui ) gui->reset_gui();
        if( sinst )     { suil_instance_free(sinst);  sinst = 0; }
        if( ui_host )   { suil_host_free(ui_host);    ui_host = 0; }
 
@@ -254,7 +269,7 @@ int PluginLV2ChildUI::run_ui()
        done = 0;
        while( !done ) {
                if( hidden < 0 ) {
-                       gui->top_level = 0;
+                       if( gui ) gui->top_level = 0;
                        reset_gui();
                        if( !is_forked() ) {
                                done = -1;
@@ -295,13 +310,16 @@ int PluginLV2ChildUI::child_iteration(int64_t usec)
        int ret = 0;
        if( is_forked() )
                ret = read_child(usec);
-       else
+       else if( gui )
                usleep(usec);
+       else
+               ret = -1;
+
        if( ret > 0 ) {
                switch( child_token ) {
                case LV2_OPEN: {
                        open_bfr_t *open_bfr = (open_bfr_t *)child_data;
-                       if( init_ui(open_bfr->path, open_bfr->sample_rate) ) {
+                       if( init_ui(open_bfr->path, open_bfr->sample_rate, open_bfr->bfrsz) ) {
                                printf("lv2ui: unable to init: %s\n", open_bfr->path);
                                exit(1);
                        }
index e61bd8b86de906b40a061775f6e4eb11dff67ef6..2e5f7932e70f019c6ac16766d45139d596ff458b 100644 (file)
@@ -140,7 +140,7 @@ public:
        PluginLV2ChildUI();
        ~PluginLV2ChildUI();
 
-       int init_ui(const char *path, int sample_rate);
+       int init_ui(const char *path, int sample_rate, int bfrsz);
        void reset_gui();
        void start_gui();
        int handle_child();
index e94a77fa0f795ea0cb4bb1462d309406ecce2a51..5f9d40ea241dc280b8181a5a357ec0b2248fd937 100644 (file)
@@ -64,6 +64,7 @@ Preferences::Preferences()
        use_thumbnails = 1;
        keyframe_reticle = HAIRLINE_DRAGGING;
        perpetual_session = 0;
+       strcpy(lv2_path, DEFAULT_LV2_PATH);
        autostart_lv2ui = 0;
        trap_sigsegv = 1;
        trap_sigintr = 1;
@@ -189,6 +190,7 @@ void Preferences::copy_from(Preferences *that)
        cache_size = that->cache_size;
        project_smp = that->project_smp;
        force_uniprocessor = that->force_uniprocessor;
+       strcpy(lv2_path, that->lv2_path);
        autostart_lv2ui = that->autostart_lv2ui;
        trap_sigsegv = that->trap_sigsegv;
        trap_sigintr = that->trap_sigintr;
@@ -305,6 +307,8 @@ int Preferences::load_defaults(BC_Hash *defaults)
        index_count = defaults->get("INDEX_COUNT", index_count);
        keyframe_reticle = defaults->get("KEYFRAME_RETICLE", keyframe_reticle);
        perpetual_session = defaults->get("PERPETUAL_SESSION", perpetual_session);
+       strcpy(lv2_path, DEFAULT_LV2_PATH);
+       defaults->get("LV2_PATH", lv2_path);
        autostart_lv2ui = defaults->get("AUTOSTART_LV2UI", autostart_lv2ui);
        trap_sigsegv = defaults->get("TRAP_SIGSEGV", trap_sigsegv);
        trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr);
@@ -446,6 +450,7 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("USE_THUMBNAILS", use_thumbnails);
        defaults->update("KEYFRAME_RETICLE", keyframe_reticle);
        defaults->update("PERPETUAL_SESSION", perpetual_session);
+       defaults->update("LV2_PATH", lv2_path);
        defaults->update("AUTOSTART_LV2UI", autostart_lv2ui);
        defaults->update("TRAP_SIGSEGV", trap_sigsegv);
        defaults->update("TRAP_SIGINTR", trap_sigintr);
index 8a7db3577ca9ad65ecd25ed228a100574f2b4e28..0500641c985e7045272f5660010df60c7a888d55 100644 (file)
@@ -92,7 +92,6 @@ public:
        int perpetual_session;
        int trap_sigsegv;
        int trap_sigintr;
-       int autostart_lv2ui;
 // Title of theme
        char theme[BCTEXTLEN];
 // plugin icon set
@@ -176,6 +175,8 @@ public:
 
 // ====================================== Plugin Set ==============================
        char plugin_dir[BCTEXTLEN];
+       char lv2_path[BCTEXTLEN];
+       int autostart_lv2ui;
 
 // Required when updating renderfarm rates
        Mutex *preferences_lock;
index 69e4a7a8b9061c3419bd66c3fa19c9bada0df48e..93a78f8e3a11672185d1ecf5eedef4741126a227 100644 (file)
@@ -26,6 +26,7 @@
 #define DEAMON_PORT 400
 #define BACKUP_FILE "backup.xml"
 #define BACKUP_FILE1 "backup.prev"
+#define DEFAULT_LV2_PATH CINDAT_DIR "/lv2"
 #define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n   Click to: Try FFMpeg last")
 #define FFMPEG_LATE_TIP  _("Currently: Try FFMpeg last\n   Click to: Try FFMpeg first")
 
index bf921724d531bee53da724ae209c508aa9aae89b..01fb08b2357655fef946140f5dc1f6bc31817823 100644 (file)
@@ -32,6 +32,7 @@
 #include "bchash.h"
 #include "edl.h"
 #include "edlsession.h"
+#include "file.h"
 #include "filesystem.h"
 #include "fonts.h"
 #include "interfaceprefs.h"
@@ -234,6 +235,11 @@ int PreferencesThread::apply_settings()
                mwindow->restart_status = -1; // reload, need new bcresources
        if( strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) != 0 )
                mwindow->restart_status = -1;
+       if( strcmp(preferences->lv2_path, mwindow->preferences->lv2_path) != 0 ) {
+               MWindow::remove_plugin_index();
+               File::setenv_path("LV2_PATH", preferences->lv2_path, 1);
+               mwindow->restart_status = -1;
+       }
 
        mwindow->edl->copy_session(edl, 1);
        mwindow->preferences->copy_from(preferences);
index 62bf1a5a47573522a7568c8d6aeb91343b393bdc..60cdadb5f993f1fbc1a162b777ed33afcdd7c367 100644 (file)
@@ -43,7 +43,7 @@ FileItem::FileItem()
        reset();
 }
 
-FileItem::FileItem(char *path, char *name, int is_dir,
+FileItem::FileItem(const char *path, const char *name, int is_dir,
        int64_t size, time_t mtime, int item_no)
 {
        this->path = new char[strlen(path)];
@@ -284,125 +284,89 @@ int FileSystem::combine(ArrayList<FileItem*> *dir_list, ArrayList<FileItem*> *fi
        return 0;
 }
 
-int FileSystem::test_filter(FileItem *file)
+int FileSystem::test_filter(const char *url, const char *filter)
 {
-       char *filter1 = 0, *filter2 = filter, *subfilter1, *subfilter2;
-       int result = 0;
-       int done = 0, token_done;
-       int token_number = 0;
-
-// Don't filter directories
-       if(file->is_dir) return 0;
+       char string[BCTEXTLEN], string2[BCTEXTLEN];
+       const char *filter1 = 0, *filter2 = filter;
+       int done = 0, result = 0, token_number = 0;
 
-// Empty filename string
-       if(!file->name) return 1;
-
-       do
-       {
-// Get next token
+       do { // Get next token
                filter1 = strchr(filter2, '[');
                string[0] = 0;
-
-// Get next filter
-               if(filter1)
-               {
-                       filter1++;
-                       filter2 = strchr(filter1, ']');
-
-                       if(filter2)
-                       {
-                               int i;
-                               for(i = 0; filter1 + i < filter2; i++)
-                                       string[i] = filter1[i];
-                               string[i] = 0;
+               if( filter1 ) { // Get next filter
+                       filter2 = strchr(++filter1, ']');
+                       if( filter2 ) {
+                               int n = filter2 - filter1;
+                               for( int i=0; i<n; ++i ) string[i] = filter1[i];
+                               string[n] = 0;
                        }
-                       else
-                       {
+                       else {
                                strcpy(string, filter1);
                                done = 1;
                        }
                }
-               else
-               {
-                       if(!token_number)
+               else {
+                       if( !token_number )
                                strcpy(string, filter);
                        else
                                done = 1;
                }
 
-// Process the token
-               if(string[0] != 0)
-               {
-                       char *path = file->name;
-                       subfilter1 = string;
-                       token_done = 0;
-                       result = 0;
-
-                       do
-                       {
+               if( string[0] ) { // Process the token
+                       const char *path = url;
+                       const char *subfilter1 = string, *subfilter2 = 0;
+                       int token_done = 0;
+                       do {
                                string2[0] = 0;
                                subfilter2 = strchr(subfilter1, '*');
-
-                               if(subfilter2)
-                               {
-                                       int i;
-                                       for(i = 0; subfilter1 + i < subfilter2; i++)
-                                               string2[i] = subfilter1[i];
-
-                                       string2[i] = 0;
+                               if( subfilter2 ) {
+                                       int n = subfilter2 - subfilter1;
+                                       for( int i=0; i<n; ++i ) string2[i] = subfilter1[i];
+                                       string2[n] = 0;
                                }
-                               else
-                               {
+                               else {
                                        strcpy(string2, subfilter1);
                                        token_done = 1;
                                }
 
-                               if(string2[0] != 0)
-                               {
-// Subfilter must exist at some later point in the string
-                                       if(subfilter1 > string)
-                                       {
-                                               if(!strstr(path, string2))
-                                               {
-                                                       result = 1;
-                                                       token_done = 1;
-                                               }
+                               if( string2[0] ) { // Subfilter exists
+                                       if( subfilter1 > string ) {
+                                               const char *cp = strstr(path, string2);
+                                               if( !cp )
+                                                       result = token_done = 1;
                                                else
-                                               path = strstr(path, string2) + strlen(string2);
+                                                       path = cp + strlen(string2);
                                        }
-                                       else
-// Subfilter must exist at this point in the string
-                                       {
-                                               if(strncmp(path, string2, strlen(string2)))
-//                                             if(strncasecmp(path, string2, strlen(string2)))
-                                               {
-                                                       result = 1;
-                                                       token_done = 1;
-                                               }
+                                       else { // Subfilter exists
+                                               if( strncmp(path, string2, strlen(string2)) ) // strncasecmp?
+                                                       result = token_done = 1;
                                                else
-                                               path += strlen(string2);
+                                                       path += strlen(string2);
                                        }
 
 // String must terminate after subfilter
-                                       if(!subfilter2)
-                                       {
-                                               if(*path != 0)
-                                               {
-                                                       result = 1;
-                                                       token_done = 1;
-                                               }
+                                       if( !subfilter2 ) {
+                                               if( *path )
+                                                       result = token_done = 1;
                                        }
                                }
                                subfilter1 = subfilter2 + 1;
 // Let pass if no subfilter
-                       }while(!token_done && !result);
+                       } while( !token_done && !result );
                }
-               token_number++;
-       }while(!done && result);
+               ++token_number;
+       } while( !done && result );
 
        return result;
 }
 
+int FileSystem::test_filter(FileItem *file)
+{
+// Don't filter directories
+       if( file->is_dir ) return 0;
+       if( !file->name ) return 1;
+       return test_filter(file->name, this->filter);
+}
 
 int FileSystem::scan_directory(const char *new_dir)
 {
index 75110c6af9d48341091f7863f5e494897b4691b8..c976135b0459739e75ca9bb9e70ca71ff1c4f48d 100644 (file)
@@ -30,7 +30,7 @@ class FileItem
 {
 public:
        FileItem();
-       FileItem(char *path, char *name, int is_dir,
+       FileItem(const char *path, const char *name, int is_dir,
                int64_t size, time_t mtime, int item_no=-1);
        ~FileItem();
 
@@ -96,6 +96,7 @@ public:
        int parse_directories(char *new_dir);  // add directories
        int parse_dots(char *new_dir);         // move up directory tree after expanding tildas
        static char *basepath(const char *path); // collapse ".", "..", "//" elements
+       static int test_filter(const char *url, const char *filter); // returns 0 if url matches filter
 
 // Array of files and directories in the directory pointed to by current_dir.
 // Directories are first.
@@ -144,7 +145,6 @@ private:
        int want_directory;
        int show_all_files;       // shows . files
        char current_dir[BCTEXTLEN];
-       char string[BCTEXTLEN], string2[BCTEXTLEN];
        int sort_order;
        int sort_field;
 };
diff --git a/cinelerra-5.1/lv2_blacklist.txt b/cinelerra-5.1/lv2_blacklist.txt
new file mode 100644 (file)
index 0000000..4f5d9cc
--- /dev/null
@@ -0,0 +1,33 @@
+# last updated 2018/06/13 gg/pys
+http:*midi*
+http:*MIDI*
+http://lsp-plug.in/plugins/lv2/comp_delay_x2_stereo
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x16_lr
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x16_ms
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x16_stereo
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x32_lr
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x32_ms
+http://lsp-plug.in/plugins/lv2/graph_equalizer_x32_stereo
+http://lsp-plug.in/plugins/lv2/para_equalizer_x16_lr
+http://lsp-plug.in/plugins/lv2/para_equalizer_x16_mono
+http://lsp-plug.in/plugins/lv2/para_equalizer_x16_ms
+http://lsp-plug.in/plugins/lv2/para_equalizer_x16_stereo
+http://lsp-plug.in/plugins/lv2/para_equalizer_x32_lr
+http://lsp-plug.in/plugins/lv2/para_equalizer_x32_mono
+http://lsp-plug.in/plugins/lv2/para_equalizer_x32_ms
+http://lsp-plug.in/plugins/lv2/para_equalizer_x32_stereo
+http://lsp-plug.in/plugins/lv2/sc_compressor_lr
+http://lsp-plug.in/plugins/lv2/sc_dyna_processor_lr
+http://lsp-plug.in/plugins/lv2/sc_dyna_processor_mono
+http://lsp-plug.in/plugins/lv2/sc_dyna_processor_ms
+http://lsp-plug.in/plugins/lv2/sc_dyna_processor_stereo
+http://plugin.org.uk/swh-plugins/bandpass_a_iir
+http://plugin.org.uk/swh-plugins/bandpass_iir
+http://plugin.org.uk/swh-plugins/butthigh_iir
+http://plugin.org.uk/swh-plugins/buttlow_iir
+http://plugin.org.uk/swh-plugins/bwxover_iir
+http://plugin.org.uk/swh-plugins/highpass_iir
+http://plugin.org.uk/swh-plugins/lowpass_iir
+http://yoshimi.sourceforge.net/lv2_plugin
+http://yoshimi.sourceforge.net/lv2_plugin_multi
+urn:juced:DrumSynth