<feed xmlns='http://www.w3.org/2005/Atom'>
<title>paraslash/score.c, branch master</title>
<subtitle>paraslash - network audio streaming tools</subtitle>
<id>https://git.tue.mpg.de/cgit/paraslash/atom?h=master</id>
<link rel='self' href='https://git.tue.mpg.de/cgit/paraslash/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/'/>
<updated>2026-03-26T15:50:54Z</updated>
<entry>
<title>Merge topic branch t/spdx into master</title>
<updated>2026-03-26T15:50:54Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-03-26T15:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=c7d8695602cdde107a85cb63db846d92e48d9437'/>
<id>urn:sha1:c7d8695602cdde107a85cb63db846d92e48d9437</id>
<content type='text'>
Switch to SPDX licence identifiers

A single patch which replaces the first comment line of most .c and .h files
containing the copyright notice by standardized SPDX (Software/System Package
Data Exchange) nomenclature.

* t/spdx:
  Switch to SPDX identifiers.
</content>
</entry>
<entry>
<title>Switch to SPDX identifiers.</title>
<updated>2026-03-17T22:45:43Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-03-15T14:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=ea0cecf96e08c489fdcc94d046019f4ce46f58e2'/>
<id>urn:sha1:ea0cecf96e08c489fdcc94d046019f4ce46f58e2</id>
<content type='text'>
Generated with

	sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h

followed by manually tweaking the result a bit. No license change intended.
</content>
</entry>
<entry>
<title>Improve selector loop.</title>
<updated>2026-03-17T18:25:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-03-04T23:13:43Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=ae183bc39f3c824f91d038a739ee705e7e5e50bd'/>
<id>urn:sha1:ae183bc39f3c824f91d038a739ee705e7e5e50bd</id>
<content type='text'>
Currently code outside of score.c needs to deal with two types of osl table
rows: rows of the audio file table and rows of the score table. This foils
type safety because the row pointers to different tables have the same type.

We currently expose score rows to functions outside of score.c because the
code in aft.c loops over the score table, and the osl loop callback receives
a pointer to the current row as its first argument.

This commit implements the static call_callback() in score.c, used as the
osl callback, to avoid exposing the score row. The new function decodes the
cells of the row to obtain the aft row and the score. These two values are
then passed to the callback function passed to score_loop().
</content>
</entry>
<entry>
<title>Rename get_score_and_aft_row() -&gt; score_get().</title>
<updated>2026-03-17T18:25:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-03-04T20:39:36Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=4caff16814a5c71441ae72c97783bd7804f99f7c'/>
<id>urn:sha1:4caff16814a5c71441ae72c97783bd7804f99f7c</id>
<content type='text'>
It corresponds to the -&gt;get() selector method.
</content>
</entry>
<entry>
<title>Implement selector abstraction.</title>
<updated>2026-03-17T18:25:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-02-23T18:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=8981b82878ca3e49fb36ce8405725eb41dd75836'/>
<id>urn:sha1:8981b82878ca3e49fb36ce8405725eb41dd75836</id>
<content type='text'>
Currently mood.c and playlist.c contain similar public functions. For example,
there is mood_load() and playlist_load(), mood_loop() and playlist_loop().

Introduce struct selector_ops which contains methods such as -&gt;load()
and loop(). We define two instances of the new structure, one for the mood
selector and one for the playlist selector. The structures can be constant,
but need to be public. The methods can be static.

The score table is now regarded as owned by the mood or playlist. It is no
longer listed in afs_tables[] and afs_table_operations can go away.

We don't need the global score_table variable anymore because all public
functions of score.c now take a pointer to the table to operate on. Similarly,
current_mood and current_playlist can be removed.
</content>
</entry>
<entry>
<title>Avoid double lookup on score row deletion.</title>
<updated>2026-03-17T18:25:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-02-07T21:02:36Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=67e4a134d53475573e5f89fc9614961e88bb901b'/>
<id>urn:sha1:67e4a134d53475573e5f89fc9614961e88bb901b</id>
<content type='text'>
The way mood.c and playlist.c call score_delete() ends up looking up the
row in the score table twice. The problem is that score_delete() returns
negative if the given row does not belong to the score table. All call sites
handle this by first calling row_belongs_to_score_table(), which results in
an additional lookup.

Change score_delete() to return zero in the "row does not belong to the score
table" case, and one if the row did exist (and was removed successfully). This
not only avoids the double lookup but also simplifies the callers a bit.
</content>
</entry>
<entry>
<title>Simplify and rename score_update().</title>
<updated>2026-03-17T18:25:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-02-01T20:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=47afa77982b4ca211af84e7a7812ceca99576a56'/>
<id>urn:sha1:47afa77982b4ca211af84e7a7812ceca99576a56</id>
<content type='text'>
We no longer need the percent parameter since the only remaining caller
passes zero. Rename the function to score_move_to_end() since this it what
it now does.
</content>
</entry>
<entry>
<title>Kill OSL_ERRNO_TO_PARA_ERROR.</title>
<updated>2025-07-13T14:38:46Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-06-29T17:47:30Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=c59f85ab018df2be5e6abe3299253f4e946339b2'/>
<id>urn:sha1:c59f85ab018df2be5e6abe3299253f4e946339b2</id>
<content type='text'>
The users outside of error.h may as well call osl(), which leaves only
a single caller in error.h. Open-code the macro there and remove it.
</content>
</entry>
<entry>
<title>Include regex.h from para.h.</title>
<updated>2025-05-19T17:35:58Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-05-18T20:05:45Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=67388cd4fae0cfd1674aada937f4f4d2faeeee1f'/>
<id>urn:sha1:67388cd4fae0cfd1674aada937f4f4d2faeeee1f</id>
<content type='text'>
Every .c file includes it anyway.
</content>
</entry>
<entry>
<title>Implement ls --admissible=m/foo.</title>
<updated>2023-05-12T10:16:23Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2022-03-23T22:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=2d2637cb4c9ab76fea6bc336b9af88fd00bf5e08'/>
<id>urn:sha1:2d2637cb4c9ab76fea6bc336b9af88fd00bf5e08</id>
<content type='text'>
Currently there can be only one score table at a time because the
functions of score.c refer to the global score_table variable.
To implement the new feature, we need to overcome this restriction
so that the callback of the ls command can populate an independent
score table to print its output without interfering with the score
table that is currently active.

This commit changes most functions of score.c to receive an additional
table pointer argument. All current users of the score table pass a
NULL pointer to instruct the functions to operate on the global score
table as before.

However, if the ls command is invoked with an optional mood argument
to -a. the callback calls mood_load(), followed by mood_loop() and
mood_unload(). The former returns an opaque handle which is then
passed to the other two functions to instruct them to operate on the
temporary score table instead of the global one.

To make the feature work for playlists as well, analogous functionality
is implemented in playlist.c. The new mop_loop() of aft.c performs
the disambiguation in a similar way as the activate_mood_or_playlist()
does. It is a bit simpler though, since the ls command does not have
to deal with NULL arguments and does not need to fall back to the
dummy mood.
</content>
</entry>
</feed>
