[CinCV TNG] [PATCH] New file cinelerra.h

Johannes Sixt j6t at kdbg.org
Wed Aug 23 22:22:41 CEST 2017


Am 23.08.2017 um 19:14 schrieb Einar Rünkaru:
> Contains program-wide limits.
> Limits will be used to check user input values
> ---
>   cinelerra/Makefile.am |  1 +
>   cinelerra/cinelerra.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 53 insertions(+)
>   create mode 100644 cinelerra/cinelerra.h

Hm, these values are nowhere used? Can we have a patch that shows how 
the values are going to be used?

Why do you give the file such a generic name, cinelerra.h? This is 
certainly not suited when the purpose is "contains program-wide limits". 
Then you should better name it "cinelerralimits.h".

> diff --git a/cinelerra/Makefile.am b/cinelerra/Makefile.am
> index 39fc8d9..279038b 100644
> --- a/cinelerra/Makefile.am
> +++ b/cinelerra/Makefile.am
> @@ -395,6 +395,7 @@ noinst_HEADERS = aattachmentpoint.h \
>   		 canvas.h \
>   		 canvastools.h \
>   		 cicolors.h \
> +		 cinelerra.h \
>   		 channeledit.h \
>   		 channel.h \
>   		 channeldb.h \
> diff --git a/cinelerra/cinelerra.h b/cinelerra/cinelerra.h
> new file mode 100644
> index 0000000..2718e9e
> --- /dev/null
> +++ b/cinelerra/cinelerra.h
> @@ -0,0 +1,52 @@
> +
> +
> +/*
> + * CINELERRA
> + * Copyright (C) 2017 Einar Rünkaru<einarry at smail.ee>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> + *
> + */
> +
> +#ifndef CINELERRA_H
> +#define CINELERRA_H
> +
> +// Frame size limits
> +#define MIN_FRAME_HEIGHT 16
> +#define MAX_FRAME_HEIGHT 4096
> +#define MIN_FRAME_WIDTH 16
> +#define MAX_FRAME_WIDTH 4096

Can we please have a more modern language?

const int MIN_FRAME_HEIGHT = 16;
const int MAX_FRAME_HEIGHT = 4096;
const int MIN_FRAME_WIDTH = 16;
const int MAX_FRAME_WIDTH = 4096;

Etc.

(Note that these variables have internal linkage because they are 
const-qualified. There will not be multiple definitions.)

> +
> +// Samplerate limits
> +#define MIN_SAMPLE_RATE 8000
> +#define MAX_SAMPLE_RATE 192000
> +
> +// Framerate limits
> +#define MIN_FRAME_RATE 1
> +#define MAX_FRAME_RATE 1500
> +
> +// Audio sample formats (must be bits)

(and these should then be unsigned ints.)

> +#define SBITS_LINEAR8    0x0001
> +#define SBITS_LINEAR16   0x0002
> +#define SBITS_LINEAR24   0x0004
> +#define SBITS_LINEAR32   0x0008
> +#define SBITS_ULAW       0x0100
> +#define SBITS_IMA4       0x0200
> +#define SBITS_ADPCM      0x0400
> +#define SBITS_FLOAT      0x0800
> +
> +#define SBITS_LINEAR    (SBITS_LINEAR8 | SBITS_LINEAR16 | SBITS_LINEAR24 | SBITS_LINEAR32)
> +
> +#endif

-- Hannes


More information about the Cinelerra mailing list