Commit Graph

93 Commits

Author SHA1 Message Date
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 324a290040 The code related to t.audio.mixwithsystem=true is run before the audio module is loaded. Fixes issue #1430. 2018-12-26 11:36:23 -04:00
Bart van Strien b2ed16cd7b Error when trying to create a queueable source with newSource (issue #1450) 2018-12-19 11:04:36 +01: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
Bart van Strien 3278ea5580 Fix compilation with lua 5.2 and 5.3
Mostly to have the lua53 "library" work with both lua 5.1 and lua 5.3.
Additionally fixes two other incompatibilities.

--HG--
branch : minor
2017-09-25 10:27:12 +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 3128a127cf Rename love.audio.getSourceCount to getActiveSourceCount and deprecate the old function (resolves issue #1302).
--HG--
branch : minor
2017-08-27 16:23:55 -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 02aa7937a1 Rename love.audio.setMixMode to setMixWithSystem. Fix some copyright notice typos.
--HG--
branch : minor
2017-07-29 23:22:54 -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
Alex Szpakowski 19b4079ecc Merge default into minor
--HG--
branch : minor
2017-07-28 19:14:54 -03:00
Bart van Strien 9ee11409c5 Add vararg versions of love.audio.play/pause/stop (fixes #1295)
The table versions existed already, I guess I forgot about varargs

--HG--
branch : minor
2017-07-27 17:40:56 +02:00
Tiago Koji Castro Shibata 3dfe3808c6 Remove playmuted audio configuration 2017-07-18 15:15:04 -03:00
Alex Szpakowski 34ebe18f14 Use luaL_check/optinteger instead of luaL_check/optnumber when getting integer arguments to functions. Resolves issue #1251.
--HG--
branch : minor
2017-07-16 12:17:50 -03:00
Tiago Koji Castro Shibata 4e9212b152 Add Android support to hasBackgroundMusic 2017-07-13 23:54:37 -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
Tiago Koji Castro Shibata 74c35358bb Move setMixMode to love.audio 2017-06-10 00:07:39 -03:00
Tiago Koji Castro Shibata 4c145e8c13 Support audio mix modes 2017-06-02 19:35:58 -03:00
Bart van Strien b205b8a020 Remove references to old LOVE_ENABLE_module_implementation defines
As far as I know they are no longer used, as autotools was the primary (only)
user and it now switches entire modules.
I've also taken the opportunity to clean up the default list in
src/common/config.h.
Oh yeah, and this fixes linux builds not having graphics or audio backends.

--HG--
branch : minor
2017-03-30 19:09:15 +02: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
Raidho 42f89153ae Named Effect parameters added. Unsupported effects disabled.
Unnamed parameter Effect setting is no longer functional.

--HG--
branch : minor
2017-01-06 08:41:27 +03: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
Bart van Strien 24a7a3d367 Merge minor into dynamiccore2
--HG--
branch : dynamiccore2
2016-11-26 22:19:12 +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
Raidho 57d02dec2b Addressed some criticism
getRecordingDevices internal function is now returns constant reference,
also re-enumerates devices every time it is called; this is a slow operation
getID removed for not being useful

--HG--
branch : minor-mic-input
2016-11-03 06:31:31 +03:00
Raidho 3de68707d1 made device enumeration lazy
made enumerator to first attempt aquire default device name by standard means,
then to fall back to read name from opened device
getRecordingDeviceCount removed for being redundant

--HG--
branch : minor-mic-input
2016-10-25 02:05:53 +03:00
Raidho 87f0b2811e Microphone input implemented.
RecordingDevice class added
(number)love.audio.getRecordingDeviceCount() and (table)love.audio.getRecordingDevices() exposed
(bool):startRecording([samples, sampleRate, bitDepth, channels], (SoundData):stopRecording([SoundData]),
(SoundData):getData([SoundData]), (number):getSampleCount(), (number):getSampleRate(), (number):getBitDepth(),
(number):getChannels(), (string):getName(), (number):getID(), (bool):isRecording() member functions exposed
previously existed stub implementation removed
getFormat moved to love::audio::openal::Audio
getFormat arguments order swapped to (bitDepth, channels)
getFormat now returns AL_NONE if format is invalid

--HG--
branch : minor-mic-input
2016-10-23 17:56:52 +03: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
Bart van Strien dc7b1fb049 Remove the default source type (resolves #1082)
--HG--
branch : minor
2016-03-08 11:44:36 +01:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -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 695ab41915 Added love.audio.set/getDopplerScale. 2015-02-01 00:36:34 -04:00
Alex Szpakowski f1634bc6a8 The existence of the AL_EXT_MCFORMATS OpenAL extension is checked when creating 5.1 and 7.1 (6 and 8 channel) Sources. love.audio.newSource now errors if the channel count and bit-depth combination of the Source isn't supported. 2015-01-15 15:59:15 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 808e533b02 Tweaked streaming Sources to use fewer OpenAL buffers (and increased the amount of decoded data per buffer to compensate), and removed some unnecessary #include statements. 2014-09-28 14:58:59 -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