doc: Update

This commit is contained in:
github-actions[bot]
2025-08-07 20:52:32 +00:00
parent 61208a5613
commit f1364955e8
9 changed files with 951 additions and 2 deletions

View File

@@ -0,0 +1,272 @@
<!--
SPDX-FileCopyrightText: Rafał Dzięgiel
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper &ndash; 0.0: Clapper Enhancers</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="clapper-logo.svg"/>
<meta property="og:image:alt" content="Clapper-0.0"/>
<meta property="og:title" content="Clapper: Clapper Enhancers"/>
<meta property="og:description" content="Reference for Clapper-0.0: Clapper Enhancers"/>
<meta name="twitter:title" content="Clapper: Clapper Enhancers"/>
<meta name="twitter:description" content="Reference for Clapper-0.0: Clapper Enhancers"/>
<meta name="twitter:card" content="summary"/>
<link rel="search" type="application/opensearchdescription+xml" title="Clapper" href="opensearch.xml">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<a href="index.html"><img src="clapper-logo.svg" class="logo"/></a>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Clapper</a></h3>
<p>API Version: 0.0</p>
<p>Library Version: 0.9.1</p>
</div>
<div class="section generator">
<p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2025.4</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<h4 id="title" style="display:flex;">
Clapper Enhancers
<a href="#title" class="anchor"></a>
</h4>
<section>
<div class="docblock">
<h3 id="overview">Overview<a class="md-anchor" href="#overview" title="Permanent link"></a></h3>
<p>Clapper Enhancers are special plugins loaded through <code>libpeas</code> for Clapper library.
The idea is to enhance it (including applications that use Clapper) with new
capabilities that do stuff outside of <code>GStreamer</code> scope of things without increasing
number of dependencies of Clapper itself (especially for features that not everyone&nbsp;needs).</p>
<p>To avoid confusion with term &#8220;plugins&#8221; that <code>GStreamer</code> uses, the name &#8220;enhancers&#8221;
was choosen&nbsp;instead.</p>
<p>In addition to writing enhancers in pure <code>C</code>, they can be written in any programmable
language that is supported by <code>libpeas</code> and works with Clapper library bindings
(examples being <code>Python</code>, <code>GJS</code> and <code>Vala</code>). This makes it possible for individual users
to add their own custom functionalities that they want to use&nbsp;individually.</p>
<h3 id="types">Types<a class="md-anchor" href="#types" title="Permanent link"></a></h3>
<p>Clapper gives three interfaces for writing enhancers for different things, these&nbsp;are:</p>
<ul>
<li><a href="extractable-enhancers.html">Extractable</a></li>
<li><a href="playlistable-enhancers.html">Playlistable</a></li>
<li><a href="reactable-enhancers.html">Reactable</a></li>
</ul>
<h3 id="basics">Basics<a class="md-anchor" href="#basics" title="Permanent link"></a></h3>
<p>Each enhancer is a <code>libpeas</code> compatible module. As such it follows its requirements for
writing plugins and is a <a href="javascript:void(0)" data-namespace="GObject" data-link="class.Object.html" class="external"><code>GObject</code></a> sublass implementing one or more of interfaces
that Clapper library&nbsp;provides.</p>
<p>Due to the plugins nature, written enhancer can be either submitted to the main <a href="https://github.com/Rafostar/clapper-enhancers">Clapper Enhancers
repository</a> when it seems useful for more than a single
application. Alternatively, it can be shipped as part your application. Users can also write their
own/custom local enhancer&nbsp;plugins.</p>
<h3 id="loading-enhancers">Loading Enhancers<a class="md-anchor" href="#loading-enhancers" title="Permanent link"></a></h3>
<p>Clapper will try to lazy load enhancer modules, meaning they will not be loaded unless they are used.
As an additional safety precaution, enhancers can be disallowed from their instances being created with
<a href="property.EnhancerProxy.target-creation-allowed.html"><code>ClapperEnhancerProxy:target-creation-allowed</code></a>. Enhancers that operate on-demand
(when supported <span class="caps">URI</span> is given) such as <a href="iface.Extractable.html"><code>ClapperExtractable</code></a> and <a href="iface.Playlistable.html"><code>ClapperPlaylistable</code></a>
are allowed (enabled) by default, while <a href="iface.Reactable.html"><code>ClapperReactable</code></a> are&nbsp;not.</p>
<p>Environment&nbsp;variables:</p>
<ul>
<li><code>CLAPPER_ENHANCERS_PATH</code> - override for default path where Clapper loads enhancers&nbsp;from</li>
<li><code>CLAPPER_ENHANCERS_EXTRA_PATH</code> - additional path to scan for enhancer&nbsp;plugins</li>
</ul>
<p>While both allow to specify multiple directories (with <code>:</code> separation), applications and
users should mostly use extra path in order to add their own enhancers from non-standard
installation directory. They can override default path in case where they want to forbid
using stock enhancers for some&nbsp;reason.</p>
<h3 id="enhancer-proxies">Enhancer Proxies<a class="md-anchor" href="#enhancer-proxies" title="Permanent link"></a></h3>
<p>In order to create enhancers when needed and use them only within thread they were created in,
Clapper manages enhancer instances on its own. It gives applications proxy objects for
browsing and configuring&nbsp;them.</p>
<p>Only after Clapper library is initialized, you can get either the global (application scope) list
(<a href="class.EnhancerProxyList.html"><code>ClapperEnhancerProxyList</code></a>) of enhancers proxies with <a href="func.get_global_enhancer_proxies.html"><code>clapper_get_global_enhancer_proxies()</code></a>
or player scope with <a href="method.Player.get_enhancer_proxies.html"><code>clapper_player_get_enhancer_proxies()</code></a>.</p>
<p>Properties set on the global list will carry over to all created player instances afterwards.
While these set on a list from a player are applied to enhancers created by this player only.
You can use that to your advantage to only allow creation of some type of enhancer in only some
player&nbsp;instances.</p>
<h3 id="properties">Properties<a class="md-anchor" href="#properties" title="Permanent link"></a></h3>
<p>Some enhancers might want to expose some configuration. For this cases they should install
<a href="javascript:void(0)" data-namespace="GObject" data-link="class.Object.html" class="external"><code>GObject</code></a> properties in their class. They must only use fundamental types from the list&nbsp;below:</p>
<ul>
<li>boolean</li>
<li>int</li>
<li>uint</li>
<li>double</li>
<li>string</li>
</ul>
<p>They should include one or more of <a href="flags.EnhancerParamFlags.html"><code>ClapperEnhancerParamFlags</code></a>.
Properties in object can have <code>global</code>, <code>local</code>, neither or both flags at&nbsp;once.</p>
<p>The ones with [Clapper.EnhancerParamFlags.<span class="caps">GLOBAL</span>] are for user to configure. They should
be exposed (ideally in the <span class="caps">UI</span>) and used for things that make sense to be set for all
applications at once (e.g. supported media codec by user device, preferred language,&nbsp;etc.).</p>
<p>On the other hand, properties with [Clapper.EnhancerParamFlags.<span class="caps">LOCAL</span>] are for application scope
usage only. They never carry over to other apps, nor they can be set on global enhancers list.
Instead they are configured per player&nbsp;instance.</p>
<p>When property is neither <code>global</code> or <code>local</code> it is considered to be plugin internal property.
Clapper will never access them, as such they can be of any type (not limited to above list).
This also makes properties that are already installed in base classes of subclassed object
not appear in the <span class="caps">UI</span>.</p>
<p>When both flags are set, property will initially use globally set value by user while still
allowing application to override this value locally per player&nbsp;instance.</p>
<p>Extra flags like [Clapper.EnhancerParamFlags.<span class="caps">FILEPATH</span>] and [Clapper.EnhancerParamFlags.<span class="caps">DIRPATH</span>]
can be used (usually with <code>string</code> type of property) in order to let application know that this
field holds a file/directory path and allow it to present file selection dialog to the user instead
of text&nbsp;entry.</p>
<h3 id="configuring-enhancers">Configuring Enhancers<a class="md-anchor" href="#configuring-enhancers" title="Permanent link"></a></h3>
<p>Applications browse properties of enhancer via <a href="method.EnhancerProxy.get_target_properties.html"><code>clapper_enhancer_proxy_get_target_properties()</code></a>
which returns a list of <a href="javascript:void(0)" data-namespace="GObject" data-link="class.ParamSpec.html" class="external"><code>GParamSpec</code></a>. By inspecting their <code>flags</code> application can know
whether property is <code>global</code>, <code>local</code> or&nbsp;both.</p>
<p>Use <a href="method.EnhancerProxy.get_settings.html"><code>clapper_enhancer_proxy_get_settings()</code></a> to get a <a href="javascript:void(0)" data-namespace="Gio" data-link="class.Settings.html" class="external"><code>GSettings</code></a> with <code>global</code> properties
to read and write (note that only users should be able to change them, thus you might want to bind these
into some <span class="caps">UI</span> widgets for that). These can be (with user consent) set on either proxy from global proxies
list or the player&nbsp;one.</p>
<p>Use <a href="method.EnhancerProxy.set_locally.html"><code>clapper_enhancer_proxy_set_locally()</code></a> to set <code>local</code> properties. These are meant for applications
to freely customize as they please. Remember that you can only set them on a enhancer proxy object belonging
to some player instance and not the global&nbsp;one.</p>
<h3 id="plugin-info-file">Plugin Info File<a class="md-anchor" href="#plugin-info-file" title="Permanent link"></a></h3>
<p>An enhancer plugin should be placed within directory that includes its [Peas] plugin
description file. It should be a text file with a <code>.plugin</code> extension and contain at least
following&nbsp;content:</p>
<div class="codehilite"><pre><span></span><code>[Plugin]
Module=example_enhancer
Name=Example Enhancer
Description=This enhancer serves as an example
Version=0.0.1
</code></pre></div>
<ul>
<li><code>Module</code> - module entry file name. It also acts as enhancer <span class="caps">ID</span> and should be unique for each.
It is recommended to use app/custom prefix in its&nbsp;name.</li>
<li><code>Name</code> - module friendly name for displaying in <span class="caps">UI</span> and&nbsp;such.</li>
<li><code>Description</code> - description to present to the user for what it&nbsp;does.</li>
<li><code>Version</code> - enhancer version. In order to lazy load enhancers, Clapper will cache each
enhancer data and olny reload it if version changes, so keep this always&nbsp;updated.</li>
</ul>
<p>If module is written in interpretable programming language it must also contain <code>Loader</code> key
with interpreter name (e.g. <code>Loader=python</code>).</p>
<p>Some enhancer interfaces require additional fields to be put in this file. They are described
in the requirements of each one in their documentation pages that are listed in the
<a href="clapper-enhancers.html#types">Types section</a>.</p>
<h3 id="adding-enhancers-to-flatpak-app">Adding Enhancers to Flatpak App<a class="md-anchor" href="#adding-enhancers-to-flatpak-app" title="Permanent link"></a></h3>
<p>If you are using Clapper as part of a <code>Flatpak</code> application, you can get all the enhancers from their main repo as an extension
(info <a href="https://github.com/flathub/com.github.rafostar.Clapper?tab=readme-ov-file#comgithubrafostarclapperenhancers">here</a>),
thus you do not need to build them&nbsp;yourself.</p>
</div>
</section>
</section>
<div id="toc" class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#overview"><span class="link-text">Overview</span></a></li>
<li class="toc-list-item"><a href="#types"><span class="link-text">Types</span></a></li>
<li class="toc-list-item"><a href="#basics"><span class="link-text">Basics</span></a></li>
<li class="toc-list-item"><a href="#loading-enhancers"><span class="link-text">Loading Enhancers</span></a></li>
<li class="toc-list-item"><a href="#enhancer-proxies"><span class="link-text">Enhancer Proxies</span></a></li>
<li class="toc-list-item"><a href="#properties"><span class="link-text">Properties</span></a></li>
<li class="toc-list-item"><a href="#configuring-enhancers"><span class="link-text">Configuring Enhancers</span></a></li>
<li class="toc-list-item"><a href="#plugin-info-file"><span class="link-text">Plugin Info File</span></a></li>
<li class="toc-list-item"><a href="#adding-enhancers-to-flatpak-app"><span class="link-text">Adding Enhancers to Flatpak App</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -66,6 +66,11 @@ base_url = "https://github.com/Rafostar/clapper/tree/master/"
[extra]
# The same order will be used when generating the index
content_files = [
"clapper-enhancers.md",
"extractable-enhancers.md",
"playlistable-enhancers.md",
"reactable-enhancers.md",
"migrating-to-010.md",
]
content_images = [
"images/clapper-logo.svg",

View File

@@ -0,0 +1,195 @@
<!--
SPDX-FileCopyrightText: Rafał Dzięgiel
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper &ndash; 0.0: Extractable Enhancers</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="clapper-logo.svg"/>
<meta property="og:image:alt" content="Clapper-0.0"/>
<meta property="og:title" content="Clapper: Extractable Enhancers"/>
<meta property="og:description" content="Reference for Clapper-0.0: Extractable Enhancers"/>
<meta name="twitter:title" content="Clapper: Extractable Enhancers"/>
<meta name="twitter:description" content="Reference for Clapper-0.0: Extractable Enhancers"/>
<meta name="twitter:card" content="summary"/>
<link rel="search" type="application/opensearchdescription+xml" title="Clapper" href="opensearch.xml">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<a href="index.html"><img src="clapper-logo.svg" class="logo"/></a>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Clapper</a></h3>
<p>API Version: 0.0</p>
<p>Library Version: 0.9.1</p>
</div>
<div class="section generator">
<p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2025.4</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<h4 id="title" style="display:flex;">
Extractable Enhancers
<a href="#title" class="anchor"></a>
</h4>
<section>
<div class="docblock">
<h3 id="overview">Overview<a class="md-anchor" href="#overview" title="Permanent link"></a></h3>
<p><a href="iface.Extractable.html"><code>ClapperExtractable</code></a> is an interface to implement enhancers that need to
resolve given <span class="caps">URI</span> into data that <code>GStreamer</code> will be able to play. While not
limited to, main use-case is for media information&nbsp;extraction.</p>
<p>While implementer is free to write whole extraction by hand, he can alternatively
integrate some 3rd party library that does most of this work. In such case, extractable
enhancer is more of a wrapper for integrating said library. This is especially useful
if library that you want to use is written in different programming language than Clapper&nbsp;is.</p>
<p>For the basics about writing enhancers see <a href="clapper-enhancers.html">Clapper Enhancers</a>.</p>
<h3 id="requirements">Requirements<a class="md-anchor" href="#requirements" title="Permanent link"></a></h3>
<p>Additional fields for <code>.plugin</code> info file: <code>X-Schemes</code> and <code>X-Hosts</code>. The former one should
hold the <code>;</code> separated list of supported <span class="caps">URI</span> schemes, while the latter is for&nbsp;hostnames.</p>
<p>Example:</p>
<div class="codehilite"><pre><span></span><code>X-Schemes=https;expl
X-Hosts=example.com;other.example.com
</code></pre></div>
<p>With this in place, enhancer will be loaded and used for URIs that match combinations
of one of the schemes and hosts. The special rule is that when using some custom <span class="caps">URI</span>
scheme other than <code>http(s)</code>, <code>X-Hosts</code> can be skipped since such <span class="caps">URI</span> explicitly
says to use this&nbsp;module.</p>
<p>Considering all of the above, this enhancer would try to extract URIs&nbsp;like:</p>
<ul>
<li><code>https://example.com/video_id=ABCD</code></li>
<li><code>expl://video.it?id=ABCD</code></li>
</ul>
<p>It would not act however&nbsp;for:</p>
<ul>
<li><code>https://video.it?id=ABCD</code></li>
<li><code>qwerty://other.example.com/video_id=ABCD</code></li>
</ul>
<p>An enhancer of this type must implement <a href="vfunc.Extractable.extract.html"><code>Clapper.ExtractableInterface.extract</code></a> virtual&nbsp;method.</p>
<h3 id="harvesting-data">Harvesting data<a class="md-anchor" href="#harvesting-data" title="Permanent link"></a></h3>
<p>When <a href="vfunc.Extractable.extract.html"><code>Clapper.ExtractableInterface.extract</code></a> is called, newly made <a href="class.Harvest.html"><code>ClapperHarvest</code></a>
is passed as this function argument. Implementation is responsible for filling it with
data (see <a href="method.Harvest.fill.html"><code>clapper_harvest_fill()</code></a>) that can be played. Such content can be either
a resolved <span class="caps">URI</span> to actual media file or some streaming manifest (like <code>HLS</code> or <code>DASH</code>).</p>
<p>During extract function, implementation might optionally add media tags such as title
(which will be merged with tags of <a href="class.MediaItem.html"><code>ClapperMediaItem</code></a>) and extra <span class="caps">HTTP</span> request
headers if any are required to access this&nbsp;content.</p>
<h3 id="multiple-items-extraction">Multiple items extraction<a class="md-anchor" href="#multiple-items-extraction" title="Permanent link"></a></h3>
<p>It is possible to handle URIs which would normally return more than one media item to play.
Examples being playlists, search queries, related videos,&nbsp;etc.</p>
<p>This can be handled in two ways, depending on set media&nbsp;type:</p>
<ol>
<li><code>text/uri-list</code></li>
<li><code>application/clapper-playlist</code></li>
</ol>
<p>If you use the first option, harvest should be filled with idividual URIs one per line.
Clapper will use its built-in <span class="caps">URI</span> list parser to create a media item for each <span class="caps">URI</span> and
place them in its playback queue. This is equivalent of creating <a href="class.MediaItem.html"><code>ClapperMediaItem</code></a>
for each of these URIs without setting any tags in it&nbsp;initially.</p>
<p>The second option requires for this enhancer to also implement <a href="iface.Playlistable.html"><code>ClapperPlaylistable</code></a>
interface. In this case, you can fill harvest with <span class="caps">ANY</span> kind of data considering that
<a href="vfunc.Playlistable.parse.html"><code>Clapper.PlaylistableInterface.parse</code></a> of your own enhancer will be used with the data you
passed. With this, you can add more info to media items such as extra tags, timeline markers
or subtitle <span class="caps">URI</span>. Useful if your extractor extracts both URIs and tags in one&nbsp;go.</p>
</div>
</section>
</section>
<div id="toc" class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#overview"><span class="link-text">Overview</span></a></li>
<li class="toc-list-item"><a href="#requirements"><span class="link-text">Requirements</span></a></li>
<li class="toc-list-item"><a href="#harvesting-data"><span class="link-text">Harvesting data</span></a></li>
<li class="toc-list-item"><a href="#multiple-items-extraction"><span class="link-text">Multiple items extraction</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>

View File

@@ -324,6 +324,16 @@ SPDX-License-Identifier: LGPL-2.1-or-later
<div class="docblock">
<ul>
<li><a href="clapper-enhancers.html">Clapper Enhancers</a></li>
<li><a href="extractable-enhancers.html">Extractable Enhancers</a></li>
<li><a href="playlistable-enhancers.html">Playlistable Enhancers</a></li>
<li><a href="reactable-enhancers.html">Reactable Enhancers</a></li>
<li><a href="migrating-to-010.html">Migrating to Clapper 0.10</a></li>
<li><a href="classes_hierarchy.html">Classes Hierarchy</a></li>
</ul>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,159 @@
<!--
SPDX-FileCopyrightText: Rafał Dzięgiel
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper &ndash; 0.0: Migrating to Clapper 0.10</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="clapper-logo.svg"/>
<meta property="og:image:alt" content="Clapper-0.0"/>
<meta property="og:title" content="Clapper: Migrating to Clapper 0.10"/>
<meta property="og:description" content="Reference for Clapper-0.0: Migrating to Clapper 0.10"/>
<meta name="twitter:title" content="Clapper: Migrating to Clapper 0.10"/>
<meta name="twitter:description" content="Reference for Clapper-0.0: Migrating to Clapper 0.10"/>
<meta name="twitter:card" content="summary"/>
<link rel="search" type="application/opensearchdescription+xml" title="Clapper" href="opensearch.xml">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<a href="index.html"><img src="clapper-logo.svg" class="logo"/></a>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Clapper</a></h3>
<p>API Version: 0.0</p>
<p>Library Version: 0.9.1</p>
</div>
<div class="section generator">
<p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2025.4</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<h4 id="title" style="display:flex;">
Migrating to Clapper 0.10
<a href="#title" class="anchor"></a>
</h4>
<section>
<div class="docblock">
<h3 id="replace-features-with-enhancers">Replace Features with Enhancers<a class="md-anchor" href="#replace-features-with-enhancers" title="Permanent link"></a></h3>
<p>Clapper 0.10 deprecates <a href="class.Feature.html"><code>ClapperFeature</code></a> objects in favour <a href="clapper-enhancers.html">Clapper Enhancers</a>
used via <a href="class.EnhancerProxy.html"><code>ClapperEnhancerProxy</code></a>.</p>
<p>Old <a href="class.Feature.html"><code>ClapperFeature</code></a> objects (including <code>mpris</code>, <code>discoverer</code> and <code>server</code>) are left for compatibility
reasons, but all apps using them are advised to migrate to enhancer plugins which already surpassed former
ones in what can be achieved with&nbsp;them.</p>
<p>Since these are now in the form of plugins scanned during init, one of the differences is that you now check
their availablity at runtime instead of compile time like&nbsp;before.</p>
<p>Something like&nbsp;this:</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#if CLAPPER_HAVE_MPRIS</span>
<span class="w"> </span><span class="n">ClapperFeature</span><span class="w"> </span><span class="o">*</span><span class="n">feature</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">CLAPPER_FEATURE</span><span class="w"> </span><span class="p">(</span><span class="n">clapper_mpris_new</span><span class="w"> </span><span class="p">(</span>
<span class="w"> </span><span class="n">mpris_name</span><span class="p">,</span><span class="w"> </span><span class="n">APP_NAME</span><span class="p">,</span><span class="w"> </span><span class="n">APP_ID</span><span class="p">));</span>
<span class="w"> </span><span class="n">clapper_player_add_feature</span><span class="w"> </span><span class="p">(</span><span class="n">player</span><span class="p">,</span><span class="w"> </span><span class="n">feature</span><span class="p">);</span>
<span class="w"> </span><span class="n">gst_object_unref</span><span class="w"> </span><span class="p">(</span><span class="n">feature</span><span class="p">);</span>
<span class="cp">#endif</span>
</code></pre></div>
<p>Can be implemented like&nbsp;this:</p>
<div class="codehilite"><pre><span></span><code><span class="n">ClapperEnhancerProxyList</span><span class="w"> </span><span class="o">*</span><span class="n">proxies</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">clapper_player_get_enhancer_proxies</span><span class="w"> </span><span class="p">(</span><span class="n">player</span><span class="p">);</span>
<span class="n">ClapperEnhancerProxy</span><span class="w"> </span><span class="o">*</span><span class="n">proxy</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">clapper_enhancer_proxy_list_get_proxy_by_module</span><span class="w"> </span><span class="p">(</span><span class="n">proxies</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;clapper-mpris&quot;</span><span class="p">);</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">proxy</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">clapper_enhancer_proxy_set_locally</span><span class="w"> </span><span class="p">(</span><span class="n">proxy</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;own-name&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">mpris_name</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;identity&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">APP_NAME</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;desktop-entry&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">APP_ID</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
<span class="w"> </span><span class="n">clapper_enhancer_proxy_set_target_creation_allowed</span><span class="w"> </span><span class="p">(</span><span class="n">proxy</span><span class="p">,</span><span class="w"> </span><span class="n">TRUE</span><span class="p">);</span>
<span class="w"> </span><span class="n">gst_object_unref</span><span class="w"> </span><span class="p">(</span><span class="n">proxy</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div>
<p>For more information how to use enhancers and how to write your own,
see <a href="clapper-enhancers.html">Clapper Enhancers</a>&nbsp;documentation.</p>
</div>
</section>
</section>
<div id="toc" class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,162 @@
<!--
SPDX-FileCopyrightText: Rafał Dzięgiel
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper &ndash; 0.0: Playlistable Enhancers</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="clapper-logo.svg"/>
<meta property="og:image:alt" content="Clapper-0.0"/>
<meta property="og:title" content="Clapper: Playlistable Enhancers"/>
<meta property="og:description" content="Reference for Clapper-0.0: Playlistable Enhancers"/>
<meta name="twitter:title" content="Clapper: Playlistable Enhancers"/>
<meta name="twitter:description" content="Reference for Clapper-0.0: Playlistable Enhancers"/>
<meta name="twitter:card" content="summary"/>
<link rel="search" type="application/opensearchdescription+xml" title="Clapper" href="opensearch.xml">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<a href="index.html"><img src="clapper-logo.svg" class="logo"/></a>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Clapper</a></h3>
<p>API Version: 0.0</p>
<p>Library Version: 0.9.1</p>
</div>
<div class="section generator">
<p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2025.4</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<h4 id="title" style="display:flex;">
Playlistable Enhancers
<a href="#title" class="anchor"></a>
</h4>
<section>
<div class="docblock">
<h3 id="overview">Overview<a class="md-anchor" href="#overview" title="Permanent link"></a></h3>
<p><a href="iface.Playlistable.html"><code>ClapperPlaylistable</code></a> is an interface to implement playlist parsers.
Allows to expand Clapper library with an ability to read data from which one
or more media items should be&nbsp;created.</p>
<p>To load playlist within Clapper, just create a new media item which has an <span class="caps">URI</span>
leading to data that playlistable enhancer will act upon. After parsing, that item
will be merged with first parsed item and the rest will be inserted into queue after
its&nbsp;position.</p>
<p>Essentially, such enhancer inserts items from a playlist into playback queue upon
which Clapper operates. It can also handle nested playlits (a playlist <span class="caps">URI</span> within
another playlist) with unlimited amount of nested&nbsp;levels.</p>
<p>For the basics about writing enhancers see <a href="clapper-enhancers.html">Clapper Enhancers</a>.</p>
<h3 id="requirements">Requirements<a class="md-anchor" href="#requirements" title="Permanent link"></a></h3>
<p>Additional fields for <code>.plugin</code> info&nbsp;file:</p>
<ul>
<li><code>X-Data-Prefix</code> - describe text that data should start&nbsp;with</li>
<li><code>X-Data-Contains</code> - data must contain given&nbsp;phrase</li>
<li><code>X-Data-Regex</code> - regular expression to run on&nbsp;data</li>
</ul>
<p>These are used by <code>typefinder</code> to determine whether given data is a playlist for
this enhancer to handle. At least one of the above must be added to plugin info&nbsp;file.</p>
<p>An enhancer of this type must implement <a href="vfunc.Playlistable.parse.html"><code>Clapper.PlaylistableInterface.parse</code></a> virtual&nbsp;method.</p>
<h3 id="parsing-data">Parsing data<a class="md-anchor" href="#parsing-data" title="Permanent link"></a></h3>
<p>When <a href="vfunc.Playlistable.parse.html"><code>Clapper.PlaylistableInterface.parse</code></a> is called, an empty <a href="javascript:void(0)" data-namespace="Gio" data-link="class.ListStore.html" class="external"><code>GListStore</code></a> is
passed as this function argument. Implementation is responsible for parsing data, creating
<a href="class.MediaItem.html"><code>ClapperMediaItem</code></a> objects and adding them to that list store. While doing so, it
can also populate each media item tags, timeline markers and/or set subtitle <span class="caps">URI</span>.</p>
</div>
</section>
</section>
<div id="toc" class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#overview"><span class="link-text">Overview</span></a></li>
<li class="toc-list-item"><a href="#requirements"><span class="link-text">Requirements</span></a></li>
<li class="toc-list-item"><a href="#parsing-data"><span class="link-text">Parsing data</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,146 @@
<!--
SPDX-FileCopyrightText: Rafał Dzięgiel
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper &ndash; 0.0: Reactable Enhancers</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="clapper-logo.svg"/>
<meta property="og:image:alt" content="Clapper-0.0"/>
<meta property="og:title" content="Clapper: Reactable Enhancers"/>
<meta property="og:description" content="Reference for Clapper-0.0: Reactable Enhancers"/>
<meta name="twitter:title" content="Clapper: Reactable Enhancers"/>
<meta name="twitter:description" content="Reference for Clapper-0.0: Reactable Enhancers"/>
<meta name="twitter:card" content="summary"/>
<link rel="search" type="application/opensearchdescription+xml" title="Clapper" href="opensearch.xml">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<a href="index.html"><img src="clapper-logo.svg" class="logo"/></a>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Clapper</a></h3>
<p>API Version: 0.0</p>
<p>Library Version: 0.9.1</p>
</div>
<div class="section generator">
<p>Generated by <a href="https://gitlab.gnome.org/GNOME/gi-docgen">gi-docgen</a> 2025.4</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<h4 id="title" style="display:flex;">
Reactable Enhancers
<a href="#title" class="anchor"></a>
</h4>
<section>
<div class="docblock">
<h3 id="overview">Overview<a class="md-anchor" href="#overview" title="Permanent link"></a></h3>
<p><a href="iface.Reactable.html"><code>ClapperReactable</code></a> is an interface to implement enhancers that react to the
playback and/or events that should influence&nbsp;it.</p>
<p>Such enhancer can work not only in a way that triggers external actions due to some
playback events, but also in reverse - alters playback or its queue due to some
external event. It can do so by getting a hold of the player that given enhancer
instance reacts to with <a href="method.Reactable.get_player.html"><code>clapper_reactable_get_player()</code></a>.</p>
<p>For the basics about writing enhancers see <a href="clapper-enhancers.html">Clapper Enhancers</a>.</p>
<h3 id="requirements">Requirements<a class="md-anchor" href="#requirements" title="Permanent link"></a></h3>
<p>An enhancer of this type should implement any of the <a href="iface.Reactable.html"><code>ClapperReactable</code></a> virtual
methods that it&nbsp;needs.</p>
<p>Note that when implementing <a href="vfunc.Reactable.queue_item_removed.html"><code>Clapper.ReactableInterface.queue_item_removed</code></a> you probably
also want to implement <a href="vfunc.Reactable.queue_cleared.html"><code>Clapper.ReactableInterface.queue_cleared</code></a> as the former is not
called for each item when clearing the whole queue for performance&nbsp;reasons.</p>
</div>
</section>
</section>
<div id="toc" class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#overview"><span class="link-text">Overview</span></a></li>
<li class="toc-list-item"><a href="#requirements"><span class="link-text">Requirements</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>