Commit Graph

64 Commits

Author SHA1 Message Date
Campbell Barton e38ff7c06d Cleanup: use C++ comments for disabled code 2023-09-25 17:06:04 +10:00
Julian Eisel 4c8847ec4f Cleanup: Remove `extern "C"` from DNA headers
`extern "C"` did not actually have an effect here since it only impacts
name mangling of functions, not structs (or other class types). Now this
can get in the way when we add C++ blocks with functions , e.g.
templates are not allowed in code with C-linkage.

Most of these were added in ad4b7741db, even though it was known that
this doesn't have any impact. Reason was because developers thought they
would have to add that to all direct and indirect includes to be able to
use a header in C++ (a common misconception). Now with most files
compiled in C++, it's obvious that this isn't the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111926
2023-09-04 15:59:40 +02:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Campbell Barton d9930d5fd0 Cleanup: spelling, punctuation & repeated words in comments 2022-09-17 15:08:40 +10:00
Marcos Perez 89106a695a VSE: Display sound sample rate and channels
Display information about sound media in "Source" category in side panel
similar to movie resolution and framerate.

The specs are stored in the `Sequence` struct, and are extracted at
the moment of struct creation. If the "source file" is changed,
the specs change also.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14565
2022-05-19 21:05:23 +02:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Sebastian Parborg ded68fb102 VSE: Fix audaspace not reading ffmpeg files with start offset correctly
The duration and start time for audio strips were not correctly read in
audaspace.

Some video files have a "lead in" section of audio that plays before the
video starts playing back. Before this patch, we would play this lead in
audio at the same time as the video started and thus the audio would not
be in sync anymore.

Now the lead in audio is cut off and the duration should be correctly
calculated with this in mind.

If the audio starts after the video, the audio strip is shifted to
account for this, but it will also lead to cut off audio which might not
be wanted. However we don't have a simple way to solve this at this
point.

Differential Revision: http://developer.blender.org/D11917
2021-08-16 15:10:58 +02:00
Julian Eisel ad4b7741db Build-system: Force C linkage for all DNA type headers
Some DNA headers already did this, most did not. Even though many of them would
be included in C++ files and thus compiled as C++. This would be confusing and
developers may think they have to add `extern "C"` too a whole lot of
(indirect) includes to be able to use a C header in C++.

However, this is a misconception.
`extern "C"` does not cause code to be compiled with C rather than C++! It only
causes the linker to not use C++ function name mangling. See
https://stackoverflow.com/a/1041880.
Because extern DNA headers don't have function declarations, using `extern "C"`
actually should not have any effect. On the other hand, adding it causes no
harm and avoids confusion. So let's just have it consistently in C header
files.

Differential Revision: https://developer.blender.org/D9578

Reviewed by: Bastien Montagne, Sybren Stüvel
2020-11-19 13:41:50 +01:00
Harley Acheson 3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

Differential Revision: https://developer.blender.org/D9250

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
Campbell Barton c7cd74fac3 Cleanup: multi-line comment blocks 2020-10-14 15:24:42 +11:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Campbell Barton 716a8241d3 Cleanup: rename 'name' to 'filepath' for DNA types
Using 'name' for the full path of a file reads badly,
especially when id.name is used in related code.
2020-06-23 11:29:36 +10:00
Campbell Barton c6143da27c Cleanup: remove DNA_view2d_types.h from DNA_sound_types.h 2020-03-29 20:32:45 +11:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Campbell Barton 5dcb6fb22f Cleanup: unused enums 2020-02-20 12:19:55 +11:00
Campbell Barton 96ebdbc90f Fix deprecated DNA define checks
Also remove dead code which checked for SPACE_TIME.
2019-12-17 09:49:23 +11:00
Campbell Barton 6529d20d79 Cleanup: spelling in comments 2019-06-12 09:43:49 +10:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 6a03199b50 Cleanup: use '_pad' convention for padding in all DNA structs
Avoids mixing these in with regular variables in code-completion.

Use char for pad members except for 'void *', to make size clearer.

Removed/shrink a few redundant padding vars which were >= 8 bytes.
2019-02-27 15:09:48 +11:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 4ef09cf937 Cleanup: remove author/date info from doxy headers 2019-02-02 11:58:24 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton 88a80fcec8 Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:03:03 +11:00
Campbell Barton 5a43406e1b Cleanup: move DNA comments before struct members
Needed for clang-format in some cases, see: T53211
2019-01-08 00:43:00 +11:00
Bastien Montagne 710a059549 Cleanup: Move 'WAVEFORM_LOADING' of sounds from flags to tags.
This is purely runtime data, so move it to new tags. ;)
2018-07-20 12:11:34 +02:00
Bastien Montagne f48e81e720 Fix T55414: waveforms are reprocessed when undoing
Add new tag to bSound (runtime flags), and make read code to set a 'no
reload waveform' new tag, since it uses a mapping to get existing
waveform in undo case...
2018-07-20 12:01:38 +02:00
Campbell Barton 66f1c3b882 DNA: replace GCC poison with ifdef for enums 2015-07-10 15:58:50 +10:00
Campbell Barton b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
Antony Riakiotakis 773d85ab32 Based on Sergey's suggestion, use spinlocks for threaded loading of
waveforms.
2015-01-28 19:45:29 +01:00
Antony Riakiotakis 649a2bcc3d Politically correct terrible consequencer changes
This patch includes the work done in the terrible consequencer branch
that hasn't been merged to master minus a few controversial and WIP
stuff, like strip parenting, new sequence data structs and cuddly
widgets.

What is included:

* Strip extensions only when slipping. It can very easily be made an
option but with a few strips with overlapping durations it makes view
too crowded and difficult to make out.
* Threaded waveform loading + code that restores waveforms on undo (not
used though, since sound_load recreates everything. There's a patch for
review D876)
* Toggle to enable backdrop in the strip sequence editor
* Toggle to easily turn on/off waveform display
* Snapping during transform on sequence boundaries. Snapping to start or
end of selection depends on position of mouse when invoking the operator
* Snapping of timeline indicator in sequencer to strip boundaries. To
use just press and hold ctrl while dragging.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D904
2014-11-24 18:23:44 +01:00
Campbell Barton cc9372b7e0 DNA Deprecation: add DNA_DEPRECATED_GCC_POISON for enum/structs.
also fully remove freestyle raycasting_algorithm
2013-12-10 13:01:55 +11:00
Campbell Barton 7913604bda remove unused headers and NULL check 2013-07-31 21:34:25 +00:00
Sergey Sharybin fb278a501e Ensure enums in DNA files has got explicit values
See http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Macros.2C_Enums.2C_Inline_functions
2012-06-15 14:11:05 +00:00
Brecht Van Lommel 378765650d Fix makesdna error due to poor comment parsing, should be fixed in makesdna
ideally but for now just tweak code in case it causes issues.

ERROR: still 1 structs unknown
*** Unknown structs: bSound
2012-03-09 19:01:30 +00:00
Campbell Barton 89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton ae771e742b change filepath limit from 240 to 1024 2012-01-21 14:54:53 +00:00
Campbell Barton ea467d3228 use FILE_MAX instead of 240 or comment where define cant be used. 2012-01-16 05:52:33 +00:00
Campbell Barton ca629d5ccc minor dna header cleanup 2011-12-30 07:25:49 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Joerg Mueller fee7337249 3D Audio GSoC:
Adding a mono flag to mixdown non-mono sounds for 3D audio.

* Added mono sound loading.
* Bugfix: AUD_COMPARE_SPECS usage was wrong.
* Bugfix: JOS resampler = instead of ==.
* Bugfix: Change of a sound should apply settings in AUD_SequencerHandle.
* Bugfix: Memory leak when canceling open sound operator.
2011-08-11 11:41:24 +00:00
Joerg Mueller a672ab5e73 3D Audio GSoC:
Improved waveform drawing in the sequencer.

* Drawing the waveform of a sequencer strip is now independent from whether the sound is cached or not.
* Improved drawing of the waveform in the sequencer (especially speed!).
* Making it possible to vertically zoom more in the sequencer to better see the waveform for lipsync.
* Fixed a bug which crashed blender on loading a sound file via ffmpeg.
2011-08-09 14:10:32 +00:00
Joerg Mueller 2d884fc035 3D Audio GSoC:
* Pepper depends on ffmpeg 0.7.1 or higher now, windows and mac build systems set to ffmpeg-0.8
* Fixed orientation retrieval in OpenAL device code.
* Added stopAll() method to AUD_IDevice (also for Python) and call it on BGE exit
* Changed BGE to use audaspace via native C++ instead over the C API.
* Made AUD_SequencerFactory and AUD_SequencerEntry thread safe.
* Changed sound caching into a flag which fixes problems on file loading, especially with undo.
* Removed unused parameter from sound_mute_scene_sound
* Fixed bug: changing FPS didn't update the sequencer sound positions.
* Fixed bug: Properties of sequencer strips weren't set correctly.
* Minor warning fixes.
2011-08-07 11:54:58 +00:00
Nathan Letwory 22dbae84e5 DNA header files are now grouped under the same module. No further documentation done. 2011-02-17 20:48:12 +00:00
Campbell Barton 708ef64663 include cleanup, no functional changes
- removed DNA_brush_types.h from DNA_scene_types.h (and some other similar cases)
- removed DNA_wave_types.h (never used)
- removed Main.wave
2010-08-04 04:01:27 +00:00
Andrea Weikert 1a2ceea381 soundfile loading: fix crash with long path to the sound file (was 160 only and unchecked) 2010-02-28 11:02:06 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Joerg Mueller 9827a3e9ea 2.5 Audio:
- recode of the whole sequencer audio handling
- encode audio flag removed, instead you choose None as audio codec, added None for video codec too
- ffmpeg formats/codecs: enabled: theora, ogg, vorbis; added: matroska, flac (not working, who can fix?), mp3, wav
- sequencer wave drawing
- volume animation (now also working when mixing down to a file!)
- made sequencer strip position and length values unanimatable
2010-02-07 23:41:17 +00:00
Joerg Mueller 47ce314bc5 2.5 Sound:
- Cleaned up DNA_sound_types.h, especially the bSound structure.
- Fixed a caching bug.
2009-08-26 14:19:29 +00:00