<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rockbox/apps/plugins/lua/rocklib_aux.pl, branch wolf3d</title>
<subtitle>My Rockbox tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/'/>
<entry>
<title>Lua optimize combine and rework similar functions</title>
<updated>2018-11-02T17:00:06+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-11-01T18:20:33+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=f6e10b84882387e304467f22ea2f6126cbaa1264'/>
<id>f6e10b84882387e304467f22ea2f6126cbaa1264</id>
<content type='text'>
rb.strncasecmp
    strcasecmp just exclude count -&gt; rb.strncasecmp(s1, s2)

rb.backlight_brightness_set
    backlight_set_brightness -- redundant
    rb.backlight_brightness_use_setting -&gt; rb.backlight_brightness_set()

rb.buttonlight_brightness_set
    buttonlight_set_brightness -- redundant
    rb.buttonlight_brightness_use_setting -&gt; rb.buttonlight_brightness_set()

rb.mixer_frequency
    rb.mixer_set_frequency -&gt; mixer_frequency(freq)
    rb.mixer_get_frequency -&gt; mixer_frequency

rb.backlight_onoff
    rb.backlight_on  -&gt; rb.backlight_onoff(true)
    rb.backlight_off -&gt; rb.backlight_onoff(false)

rb.touchscreen_mode
    rb.touchscreen_set_mode -&gt; rb.touchscreen_mode(mode)
    rb.touchscreen_get_mode -&gt; rb.touchscreen_mode()

rb.schedule_cpu_boost
    rb.trigger_cpu_boost -&gt; rb.schedule_cpu_boost(true)
    rb.cancel_cpu_boost -&gt; rb.schedule_cpu_boost(false)

Includes rbcompat.lua for backwards compatibility
if your script is broken by this change you simply add
`require("rbcompat")` to the top for the old functionality

Change-Id: Ibffd79a0d9be6d7d6a65cc4af5c0a1c6a0f3f94d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rb.strncasecmp
    strcasecmp just exclude count -&gt; rb.strncasecmp(s1, s2)

rb.backlight_brightness_set
    backlight_set_brightness -- redundant
    rb.backlight_brightness_use_setting -&gt; rb.backlight_brightness_set()

rb.buttonlight_brightness_set
    buttonlight_set_brightness -- redundant
    rb.buttonlight_brightness_use_setting -&gt; rb.buttonlight_brightness_set()

rb.mixer_frequency
    rb.mixer_set_frequency -&gt; mixer_frequency(freq)
    rb.mixer_get_frequency -&gt; mixer_frequency

rb.backlight_onoff
    rb.backlight_on  -&gt; rb.backlight_onoff(true)
    rb.backlight_off -&gt; rb.backlight_onoff(false)

rb.touchscreen_mode
    rb.touchscreen_set_mode -&gt; rb.touchscreen_mode(mode)
    rb.touchscreen_get_mode -&gt; rb.touchscreen_mode()

rb.schedule_cpu_boost
    rb.trigger_cpu_boost -&gt; rb.schedule_cpu_boost(true)
    rb.cancel_cpu_boost -&gt; rb.schedule_cpu_boost(false)

Includes rbcompat.lua for backwards compatibility
if your script is broken by this change you simply add
`require("rbcompat")` to the top for the old functionality

Change-Id: Ibffd79a0d9be6d7d6a65cc4af5c0a1c6a0f3f94d
</pre>
</div>
</content>
</entry>
<entry>
<title>Lua Fix utf8encode, remove utf16 functions</title>
<updated>2018-11-01T15:34:02+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-31T02:40:23+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=be7a58c33155e0f72ad7b1fb23cf931d085e12cb'/>
<id>be7a58c33155e0f72ad7b1fb23cf931d085e12cb</id>
<content type='text'>
The auto generated utf8/16 encode/decode functions did not work.
Upon implementing them correctly I found that lua handles the utf-8
form properly but I could not get utf-16 to work without crashing
maybe someone can come along later and implement utf-16 safe string
functions but for now utf-16 is removed.

Change-Id: I97a044e200dc27f683a45487cd93fce667c670c4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The auto generated utf8/16 encode/decode functions did not work.
Upon implementing them correctly I found that lua handles the utf-8
form properly but I could not get utf-16 to work without crashing
maybe someone can come along later and implement utf-16 safe string
functions but for now utf-16 is removed.

Change-Id: I97a044e200dc27f683a45487cd93fce667c670c4
</pre>
</div>
</content>
</entry>
<entry>
<title>lua consolidate pcm_ functions</title>
<updated>2018-10-30T18:16:01+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-30T17:56:36+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=74fe5203d06aee3ad3498fa9164762cfa1efa3d5'/>
<id>74fe5203d06aee3ad3498fa9164762cfa1efa3d5</id>
<content type='text'>
The way to call the pcm functions has changed
rb.pcm("option", var)
rb.pcm_set_frequency(freq) = becomes rb.pcm("pcmsetfrequency", freq)

added pcm.lua to the includes for conversion to old functions
if your script is broken by this change you simply add
`require("pcm")` to the top for the old functionality

added rb.pcm("calculatepeaks")

Change-Id: I092057b0c0b5575e567862661f122da1ca2680e8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The way to call the pcm functions has changed
rb.pcm("option", var)
rb.pcm_set_frequency(freq) = becomes rb.pcm("pcmsetfrequency", freq)

added pcm.lua to the includes for conversion to old functions
if your script is broken by this change you simply add
`require("pcm")` to the top for the old functionality

added rb.pcm("calculatepeaks")

Change-Id: I092057b0c0b5575e567862661f122da1ca2680e8
</pre>
</div>
</content>
</entry>
<entry>
<title>Lua restore audio_set_recording_gain, audio_set_output,input</title>
<updated>2018-10-30T16:05:15+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-30T16:05:15+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=2e1ca200974ca4c60e651c199ec5883b308ac38b'/>
<id>2e1ca200974ca4c60e651c199ec5883b308ac38b</id>
<content type='text'>
Did not mean to wipe out these function when I consolidated audio

Made the regex for audio_ and playlist_ exact matches instead of fuzzy

Change-Id: I7537d1b494afb114c8b6333ea177b1e482f6b672
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Did not mean to wipe out these function when I consolidated audio

Made the regex for audio_ and playlist_ exact matches instead of fuzzy

Change-Id: I7537d1b494afb114c8b6333ea177b1e482f6b672
</pre>
</div>
</content>
</entry>
<entry>
<title>Lua expand multiple screen support</title>
<updated>2018-10-30T03:16:23+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-27T10:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=df8233e4abbd0d626158abc5388957cc28b06c50'/>
<id>df8233e4abbd0d626158abc5388957cc28b06c50</id>
<content type='text'>
Some of the lcd functions had support for multiple screens but this wasn't
very safe since the screen number wasn't bounded within the screens[] array
This adds support for all the lcd functions along with checking that screen#
is bounded properly, adds around 600 bytes to devices with a remote screen
devices without a remote screen lock to SCREEN_MAIN

Change-Id: I618bbc7b3919c7b0ff375fb2d71949d7cab43c87
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of the lcd functions had support for multiple screens but this wasn't
very safe since the screen number wasn't bounded within the screens[] array
This adds support for all the lcd functions along with checking that screen#
is bounded properly, adds around 600 bytes to devices with a remote screen
devices without a remote screen lock to SCREEN_MAIN

Change-Id: I618bbc7b3919c7b0ff375fb2d71949d7cab43c87
</pre>
</div>
</content>
</entry>
<entry>
<title>lua consolidate playlist_ functions</title>
<updated>2018-10-25T09:59:42+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-25T01:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=e4c5f5d412d94b10545980eea0b47d98e79712da'/>
<id>e4c5f5d412d94b10545980eea0b47d98e79712da</id>
<content type='text'>
The way to call the playlist functions has changed
rb.playlist("option", var)
rb.playlist_add(filename) = becomes rb.playlist("add", filename)

added playlist.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("playlist")`
to the top for the old functionality

added rb.playlist_tracks(dir, filename) to playlist.lua
this will allow you to add all tracks in a playlist.m3u8
to a lua table

Change-Id: I87fcc56be365d8495d214f069331b6ddbfbef1db
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The way to call the playlist functions has changed
rb.playlist("option", var)
rb.playlist_add(filename) = becomes rb.playlist("add", filename)

added playlist.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("playlist")`
to the top for the old functionality

added rb.playlist_tracks(dir, filename) to playlist.lua
this will allow you to add all tracks in a playlist.m3u8
to a lua table

Change-Id: I87fcc56be365d8495d214f069331b6ddbfbef1db
</pre>
</div>
</content>
</entry>
<entry>
<title>lua add audio_play consolidate audio_ functions</title>
<updated>2018-10-24T16:37:29+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-24T14:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=b670fcd50d42085a2db978bbcf2ccfd889d740ef'/>
<id>b670fcd50d42085a2db978bbcf2ccfd889d740ef</id>
<content type='text'>
audio_play was removed from the rocklib I assume due to inconsistent
behavior I've readded it with a check for audio paused which instead
uses rewind/ff and then resumes audio

the way to call the audio functions has changed as well
rb.audio("option", var)
so rb.audio_play(0, 0) becomes rb.audio("play", 0, 0)
audio_audio_flush_and_reload_tracks becomes
rb.audio("flushandreloadtracks")

all functions except audio("getfilepos") return the previous (or still current)
status

added audio.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("audio")`
to the top for the old functionality

Change-Id: I364adf0c85d9c12b98cde29c26fbe5ee05b9d331
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
audio_play was removed from the rocklib I assume due to inconsistent
behavior I've readded it with a check for audio paused which instead
uses rewind/ff and then resumes audio

the way to call the audio functions has changed as well
rb.audio("option", var)
so rb.audio_play(0, 0) becomes rb.audio("play", 0, 0)
audio_audio_flush_and_reload_tracks becomes
rb.audio("flushandreloadtracks")

all functions except audio("getfilepos") return the previous (or still current)
status

added audio.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("audio")`
to the top for the old functionality

Change-Id: I364adf0c85d9c12b98cde29c26fbe5ee05b9d331
</pre>
</div>
</content>
</entry>
<entry>
<title>Lua fix strip_extension and create_numbered_filename</title>
<updated>2018-10-24T04:05:53+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-23T04:11:34+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=df4cb9bafc66c3d88945b70389e0cb87cbcecf15'/>
<id>df4cb9bafc66c3d88945b70389e0cb87cbcecf15</id>
<content type='text'>
Both of these functions modified the string in the lua stack

per lua manual:
'When a C function receives a string argument from Lua,
there are only two rules that it must observe: Not to pop the string
from the stack while accessing it and never to modify the string'

strip_extension will still work with old parameters
and is thus backwards compatible
strip_extension("filename")

create_numbered_filename has changed slightly and IS NOT backwards compatible

create_numbered_filename(path, prefix, suffix, [number])
(number defaults to -1)

Change-Id: I34cf7e2f6f691f33d5ac2b2e995855a171fb99b3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both of these functions modified the string in the lua stack

per lua manual:
'When a C function receives a string argument from Lua,
there are only two rules that it must observe: Not to pop the string
from the stack while accessing it and never to modify the string'

strip_extension will still work with old parameters
and is thus backwards compatible
strip_extension("filename")

create_numbered_filename has changed slightly and IS NOT backwards compatible

create_numbered_filename(path, prefix, suffix, [number])
(number defaults to -1)

Change-Id: I34cf7e2f6f691f33d5ac2b2e995855a171fb99b3
</pre>
</div>
</content>
</entry>
<entry>
<title>lua move rocklib_img to its own separate loadable module</title>
<updated>2018-10-22T18:00:58+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-22T18:00:58+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=948984309a3c1dd6b92f018926e9831083c803e3'/>
<id>948984309a3c1dd6b92f018926e9831083c803e3</id>
<content type='text'>
allows rocklib_img to be excluded if needed

stops rocklib_aux from generating redundant prototypes for
lcd_mono_bitmap[_part]

Change-Id: Ie208ad71ab5f9a7deb026dc01a5b0a0631a0d29c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
allows rocklib_img to be excluded if needed

stops rocklib_aux from generating redundant prototypes for
lcd_mono_bitmap[_part]

Change-Id: Ie208ad71ab5f9a7deb026dc01a5b0a0631a0d29c
</pre>
</div>
</content>
</entry>
<entry>
<title>Lua remove unusable/unneeded functions from rocklib_aux</title>
<updated>2018-10-12T21:31:25+00:00</updated>
<author>
<name>William Wilgus</name>
<email>me.theuser@yahoo.com</email>
</author>
<published>2018-10-12T15:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764'/>
<id>0b7a8d5afd3d751fd0f6454098bc9fd1d05ee764</id>
<content type='text'>
rocklib_aux is auto generated from plugin.h
there are a few functions that get added automatically that
are unusable without their companion functions or duplicate
functionality already supplied by lua

Duplicated functionality:
rb-&gt;rand, rb-&gt;srand
-- see math.rand math.srand

rb-&gt;remove, rb-&gt;rename
-- see os.remove, os.rename

Unusable:
rb-&gt;open_utf8
-- this should be added to the lua file open routines (if at all)

rb-&gt;codec_run_proc, rb-&gt;codec_close
-- without rb-&gt;codec_load_file these are pointless

rb-&gt;timer_set_period, timer_unregister
-- even with timer_register implemented lua is not
-- reentrant and crashes the state when timer fires

Shouldn't be used!:
rb-&gt;strlcpy, rb-&gt;strlcat, rb-&gt;strcpy, rb-&gt;strcat
-- lua reuses strings by hashed values you break this contract if
-- you change strings behind its back plus lua provides a way to
-- do these functions safely within the strings api

Change-Id: I2f65704a90930378cbbceb254e52f61e8074471e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rocklib_aux is auto generated from plugin.h
there are a few functions that get added automatically that
are unusable without their companion functions or duplicate
functionality already supplied by lua

Duplicated functionality:
rb-&gt;rand, rb-&gt;srand
-- see math.rand math.srand

rb-&gt;remove, rb-&gt;rename
-- see os.remove, os.rename

Unusable:
rb-&gt;open_utf8
-- this should be added to the lua file open routines (if at all)

rb-&gt;codec_run_proc, rb-&gt;codec_close
-- without rb-&gt;codec_load_file these are pointless

rb-&gt;timer_set_period, timer_unregister
-- even with timer_register implemented lua is not
-- reentrant and crashes the state when timer fires

Shouldn't be used!:
rb-&gt;strlcpy, rb-&gt;strlcat, rb-&gt;strcpy, rb-&gt;strcat
-- lua reuses strings by hashed values you break this contract if
-- you change strings behind its back plus lua provides a way to
-- do these functions safely within the strings api

Change-Id: I2f65704a90930378cbbceb254e52f61e8074471e
</pre>
</div>
</content>
</entry>
</feed>
