Commit Graph

93 Commits

Author SHA1 Message Date
Sasha Szpakowski 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski 38cb56f168 Use doubles instead of floats for the time argument in Source:seek. This probably won't affect anything meaningfully, but in theory it's more precise. 2019-05-26 14:46:52 -03:00
Bart van Strien 00e7d640c7 Also test source pitch is positive and clarify error (resolves #1474)
According to the OpenAL 1.1 specification AL_PITCH, values must be in the range (0.0f, any]. Though I guess any does not include infinity.
2019-03-09 15:24:02 +01:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 9cdb4300de Merged in PabloMayobre/love/PabloMayobre/fix-seteffecteffect-true-and-geteffectef-1540253791471 (pull request #114)
Fix Source:setEffect and Source:getEffect.
2018-12-12 18:20:42 +00:00
Pablo Mayobre 1670edf4ba Fix Source:setEffect working incorrectly when a fourth or more arguments are passed
--HG--
branch : PabloMayobre/fix-seteffecteffect-true-and-geteffectef-1540253791471
2018-11-30 04:01:52 +00:00
Pablo Mayobre b53f3de4a7 Add Source:setAirAbsorption() and Source:getAirAbsorption() 2018-10-23 03:22:33 +00:00
Pablo Mayobre e840631388 Fix :setEffect("effect", true) and :getEffect("effect") when no filter is associated to the effect.
Fixes #1449

--HG--
branch : PabloMayobre/fix-seteffecteffect-true-and-geteffectef-1540253791471
2018-10-23 00:17:19 +00:00
Alex Szpakowski 613de97b58 Fix Source:queue to show the correct argument in the error message when an invalid data parameter is passed in. 2018-04-02 16:34:48 -03:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Alex Szpakowski 4ee85e1793 love get* APIs which return tables with fields can optionally accept a table argument to fill in, instead of creating a new table.
--HG--
branch : minor
2017-09-22 19:47:55 -03:00
Alex Szpakowski fcd9f1526c Use different output messages for deprecated methods versus functions.
--HG--
branch : minor
2017-08-27 16:55:33 -03:00
Alex Szpakowski bf6983beac Rename Source/SoundData/Decoder:getChannels to getChannelCount (resolves issue #1307). Deprecate the old methods rather than completely removing them.
--HG--
branch : minor
2017-08-27 14:40:46 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski 5fc2190ce4 Rename love.audio.getEffectsList and Source:getEffectsList to getActiveEffects. They now return an empty table instead of nil when there are no active effects, as well.
--HG--
branch : minor
2017-07-28 19:28:50 -03:00
raidho36 157d94fae3 Effects re-made to operate on literal names instead of numerical indices.
Added buffer count parameter to queueable source constructor.
Added getEffectsList function.
Internal cleanup.

--HG--
branch : minor
2017-06-22 15:07:31 +03:00
Bart van Strien 42b8249b60 Remove extra whitespace
--HG--
branch : minor
2017-02-11 20:12:44 +01:00
Bart van Strien cbaf9e047b Merged in rcoaxil/love-patches/minor (pull request #75)
EFX implemented

Approved-by: Bart van Strien
Approved-by: Alex Szpakowski

--HG--
branch : minor
2017-02-11 19:04:53 +00:00
Raidho 94b4d2bdef naming updated, Filters patched up
--HG--
branch : minor
2017-02-07 03:15:05 +03:00
Alex Szpakowski 06cb7a6db6 Error instead of crash when Source:setLooping is called on a queueable Source (thanks zorg)
--HG--
branch : minor
2017-01-09 22:37:49 -04:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Raidho e60f3c6cda EFX implemented
--HG--
branch : minor
2016-12-08 19:27:47 +03:00
Alex Szpakowski 8e2d9c5138 Minor code style cleanup. Fix a couple compiler warnings.
--HG--
branch : minor
2016-12-03 17:23:46 -04:00
Raidho 332ba76e62 Implement audio filters
Use Source:setFilter(type, params...) to set a filter.
Use Source:setFilter() to detach the current filter.
Use Source:getFilter() to get the currently set filter (or nil).

Squashed from pull request 27, and the clean-pr27 branch in love-experiments.

--HG--
branch : minor
2016-12-03 20:54:48 +01:00
Bart van Strien 9f6aa716fa Pass Type to luax_register_type by pointer instead of reference
Since the type is passed to va_start, and apparently that's undefined behaviour if it's a reference.

<Textmode> the best kind of behavior

--HG--
branch : dynamiccore2
2016-11-14 21:51:47 +01:00
Bart van Strien d967a755e5 Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type

--HG--
branch : dynamiccore2
2016-11-14 21:06:53 +01:00
Bart van Strien 5d43c9601a Automatically deduce the type in luax_pushtype, if possible
--HG--
branch : dynamiccore2
2016-11-13 17:38:42 +01:00
Bart van Strien 7dd960619d Automatically deduce the type in luax_checktype, luax_getmodule, luax_optmodule and luax_totype
--HG--
branch : dynamiccore2
2016-11-13 17:13:40 +01:00
Bart van Strien c761202486 Build type information on first use (load-time), instead of using a hardcoded list
--HG--
branch : dynamiccore2
2016-11-13 16:38:57 +01:00
Alex Szpakowski 0653ec9564 Address some compiler warnings about implicit integer conversions.
--HG--
branch : minor
2016-10-18 22:32:35 -03:00
rcoaxil 38a6176665 issues addressed
cropped trailing spaces
put TYPE_MAX_ENUM in getDurationAtomic
moved around variables in seekAtomic

--HG--
branch : minor
2016-10-15 20:04:08 +03:00
rcoaxil 00c02adcd0 issues addressed
warnings fixed
added type checking to Lua functions
stopping queueable source clears buffered data
getting queueable source to auto-play if it underruns and then gets re-filled
will probably require re-designing pool usage strategy

--HG--
branch : minor
2016-10-13 18:18:08 +03:00
rcoaxil b757a0534e pull request feedback addressed
newQueueableSource added
isQueueable removed, getFreeBufferCount added
queueData renamed to queue; added 3 argument variant with (data, offset, length)
lightuserdata variant now requires offset (pointer, offset, length, samplerate, bitdepth, channels)
setLooping now throws exception if called on queueable source

--HG--
branch : minor
2016-10-13 04:40:41 +03:00
raidho36 10710d3428 queueData now returns success state, couple bug fixes
success state return added to queueData functions
queueable source is now seekable while stopped
fixed bug with creating queueable source with invalid format silently crashing LOVE
fixed bug with stopped queueable source reported as not queueable

--HG--
branch : minor
2016-10-12 18:53:49 +03:00
raidho36 7934bfaf7f ported TYPE_QUEUE Source from default to minor
--HG--
branch : minor
2016-10-11 06:30:30 +03:00
Bart van Strien f76879c6b7 New audio playback API
Instead of having three states, stopped, paused and playing, now there's only
two states: paused and playing.

This means resume() is gone, as is isStopped(), and isPaused() has become
isPlaying(). stop() now pauses and rewinds, whereas pause() only pauses.
rewind() has been removed, and should either be replaced with stop() or
seek(0).

The same has been applied to the functions in the love.audio module, except they
get some extra magic:

- love.audio.pause() now returns a table/list of Source objects, which contains
  only the sources it has just paused. This means you can then later restart
  only them, instead of everything (as before).
- love.audio.play/pause/stop now have variants that take a list of Source
  objects, and it starts or stops them all at the same time, this means calling
  play(srcA, srcB) should mean srcA and srcB are much more (but possibly not
  exactly) synchronised than they were with play(srcA); play(srcB).

--HG--
branch : minor
2016-04-02 17:38:19 +02:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -04:00
Alex Szpakowski 2c4e713114 Imported some of the dynamiccore branch from love-experiments:
- Type names for love's Lua objects are specified as an argument to luax_register_type, rather than being statically defined in an array.

- luax_register_type takes a variable number of method array arguments, for registering superclass methods without copying them into the subclass' method array.

Also removed most of the header declarations for wrapper functions.
2015-11-29 20:38:12 -04:00
Alex Szpakowski 0558fcdbd4 Added Source:getDuration (thanks Boolsheet!)
For streaming sources, the duration may not always be sample-accurate and may return -1 if it cannot be determined at all.
2015-11-07 01:49:37 -04:00
Alex Szpakowski 2f419c1c83 Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.
--HG--
branch : minor
2015-03-01 18:32:41 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 9b1f7d7a6e Merged default into minor
--HG--
branch : minor
2014-08-09 19:55:29 -03:00
Alex Szpakowski da7cd267ea Changed luax_pushtype to retain the pushed object itself, but only if the object isn't in the Lua state already.
Previously, calling e.g. love.graphics.getFont() 10,000 times would retain the object 10,000 times (and release it 10,000 times when the Font object was garbage-collected in the Lua state.) Now it will only retain it once and release it once.
2014-08-09 16:04:59 -03:00
Alex Szpakowski bfa3ec9369 Merged default into minor
--HG--
branch : minor
2014-06-05 03:02:50 -03:00
Alex Szpakowski dfa319e01a Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments. 2014-06-03 19:27:00 -03:00
Aesthete 70fabedc09 Aesthete: Bug #829: Added exceptions for all spatial audio calls on stereo
sources. I had to backout the last couple of changes because the diff tool
thought I had changed the entire file, and made it impossible to see what
I had actually changed.

--HG--
branch : minor
2014-04-23 11:39:36 +10:00
Aesthete 5e7452034a Backed out changeset: 6efefad30fe1
--HG--
branch : minor
2014-04-23 11:29:41 +10:00