This commit is contained in:
2017-07-15 02:24:50 +02:00
parent ba37edf785
commit 67fa9bee6c
10 changed files with 127 additions and 50 deletions

View File

@@ -48,7 +48,7 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/pnmixerlib/errors.rs.html#1-116' title='goto source code'>[src]</a></span></h1>
</span><a class='srclink' href='../../src/pnmixerlib/errors.rs.html#1-109' title='goto source code'>[src]</a></span></h1>
<h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>

View File

@@ -48,8 +48,36 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/pnmixerlib/lib.rs.html#1-61' title='goto source code'>[src]</a></span></h1>
<h2 id='reexports' class='section-header'><a href="#reexports">Reexports</a></h2>
</span><a class='srclink' href='../src/pnmixerlib/lib.rs.html#1-90' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>PNMixer-rs is a mixer for the system tray.</p>
<h1 id='design-overview' class='section-header'><a href='#design-overview'>Design Overview</a></h1>
<p>The lowest level part of the code is the sound backend. Only Alsa is supported
at the moment, but more backends may be added in the future.</p>
<p>The backend is hidden behind a frontend, defined in <code>audio.rs</code>. Only <code>audio.rs</code>
deals with audio backends. This means that the whole of the code is blissfully
ignorant of the audio backend in use.</p>
<p><code>audio.rs</code> is also in charge of emitting signals whenever a change happens.
This means that PNMixer-rs design is quite signal-oriented, so to say.</p>
<p>The ui code is nothing fancy. Each ui element...</p>
<ul>
<li>is defined in a single file</li>
<li>strives to be standalone</li>
<li>accesses the sound system with function calls</li>
<li>listens to signals from the audio subsystem to update its appearance</li>
</ul>
<p>There&#39;s something you should keep in mind. Audio on a computer is a shared
resource. PNMixer-rs isn&#39;t the only one that can change it. At any moment the
audio volume may be modified by someone else, and we must update the ui
accordingly. So listening to changes from the audio subsystem (and therefore
having a signal-oriented design) is the most obvious solution to solve that
problem.</p>
</div><h2 id='reexports' class='section-header'><a href="#reexports">Reexports</a></h2>
<table><tr><td><code>pub extern crate <a class="mod" href="../flexi_logger/index.html" title="mod flexi_logger">flexi_logger</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../log/index.html" title="mod log">log</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../error_chain/index.html" title="mod error_chain">error_chain</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../serde_derive/index.html" title="mod serde_derive">serde_derive</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../toml/index.html" title="mod toml">toml</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../serde/index.html" title="mod serde">serde</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../alsa/index.html" title="mod alsa">alsa</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../alsa_sys/index.html" title="mod alsa_sys">alsa_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../ffi/index.html" title="mod ffi">ffi</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gdk/index.html" title="mod gdk">gdk</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gdk_pixbuf/index.html" title="mod gdk_pixbuf">gdk_pixbuf</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gdk_pixbuf_sys/index.html" title="mod gdk_pixbuf_sys">gdk_pixbuf_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gdk_sys/index.html" title="mod gdk_sys">gdk_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gio/index.html" title="mod gio">gio</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../glib/index.html" title="mod glib">glib</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../glib_sys/index.html" title="mod glib_sys">glib_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gobject_sys/index.html" title="mod gobject_sys">gobject_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gtk/index.html" title="mod gtk">gtk</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../gtk_sys/index.html" title="mod gtk_sys">gtk_sys</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../libc/index.html" title="mod libc">libc</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../png/index.html" title="mod png">png</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../which/index.html" title="mod which">which</a>;</code></td></tr><tr><td><code>pub extern crate <a class="mod" href="../xdg/index.html" title="mod xdg">xdg</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
@@ -178,35 +206,32 @@ in the binary and decodes it.</p>
<td><a class="macro" href="macro.try_e.html"
title='macro pnmixerlib::try_e'>try_e</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="macro" href="macro.try_er.html"
title='macro pnmixerlib::try_er'>try_er</a></td>
<td class='docblock-short'>
<p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print an error and exit the program.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="macro" href="macro.try_r.html"
title='macro pnmixerlib::try_r'>try_r</a></td>
<td class='docblock-short'>
<p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise return from the function with the given value.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="macro" href="macro.try_w.html"
title='macro pnmixerlib::try_w'>try_w</a></td>
<td class='docblock-short'>
<p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print a warning and <code>return ()</code> from the function.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="macro" href="macro.try_wr.html"
title='macro pnmixerlib::try_wr'>try_wr</a></td>
<td class='docblock-short'>
<p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print a warning and return from the function with the given value.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>

View File

@@ -48,14 +48,16 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#78-88' title='goto source code'>[src]</a></span></h1>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#85-109' title='goto source code'>[src]</a></span></h1>
<pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">try_e</span> {
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>, $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">arg</span>:<span class="ident">tt</span>)<span class="op">+</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>, $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">arg</span>:<span class="ident">tt</span>)<span class="op">+</span>) <span class="op">=&gt;</span> { ... };
}</pre>
</section>
<div class='docblock'><p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print an error and exit the program.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>

View File

@@ -48,12 +48,14 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#66-73' title='goto source code'>[src]</a></span></h1>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#72-79' title='goto source code'>[src]</a></span></h1>
<pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">try_r</span> {
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ret</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
}</pre>
</section>
<div class='docblock'><p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise return from the function with the given value.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>

View File

@@ -48,14 +48,16 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#24-34' title='goto source code'>[src]</a></span></h1>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#26-36' title='goto source code'>[src]</a></span></h1>
<pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">try_w</span> {
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>, $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">arg</span>:<span class="ident">tt</span>)<span class="op">+</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
}</pre>
</section>
<div class='docblock'><p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print a warning and <code>return ()</code> from the function.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>

View File

@@ -48,14 +48,16 @@
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#38-62' title='goto source code'>[src]</a></span></h1>
</span><a class='srclink' href='../src/pnmixerlib/errors.rs.html#42-66' title='goto source code'>[src]</a></span></h1>
<pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">try_wr</span> {
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ret</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ret</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>) <span class="op">=&gt;</span> { ... };
(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">expr</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ret</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">fmt</span>:<span class="ident">expr</span>, $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">arg</span>:<span class="ident">tt</span>)<span class="op">+</span>) <span class="op">=&gt;</span> { ... };
}</pre>
</section>
<div class='docblock'><p>Try to unwrap a <code>Result&lt;T, E&gt;</code>. If there is a value <code>T</code>, yield it,
otherwise print a warning and return from the function with the given value.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>

View File

@@ -1 +1 @@
initSidebarItems({"macro":[["create_builder_item",""],["pixbuf_new_from_png","Create a pixbuf from the given PNG file. Includes the file as bytes in the binary and decodes it."],["try_e",""],["try_er",""],["try_r",""],["try_w",""],["try_wr",""]],"mod":[["alsa_card","Alsa audio subsystem."],["app_state","Global application state."],["audio","High-level audio subsystem."],["errors",""],["glade_helpers",""],["prefs","The preferences subsystem."],["support_alsa","Alsa audio helper functions."],["support_audio","Helper functions of the audio subsystem."],["support_cmd","Helper functions for invoking system commands."],["support_ui","Helper functions for the UI, mostly pixbuf functions."],["ui_entry","Global GUI state."],["ui_popup_menu","The popup menu subsystem when the user right-clicks on the tray icon."],["ui_popup_window","The popup window subsystem when the user left-clicks on the tray icon."],["ui_prefs_dialog","The preferences window subsystem, when the user clicks the \"Preferences\" menu item on the popup menu."],["ui_tray_icon","The tray icon subsystem."]]});
initSidebarItems({"macro":[["create_builder_item",""],["pixbuf_new_from_png","Create a pixbuf from the given PNG file. Includes the file as bytes in the binary and decodes it."],["try_e","Try to unwrap a `Result<T, E>`. If there is a value `T`, yield it, otherwise print an error and exit the program."],["try_r","Try to unwrap a `Result<T, E>`. If there is a value `T`, yield it, otherwise return from the function with the given value."],["try_w","Try to unwrap a `Result<T, E>`. If there is a value `T`, yield it, otherwise print a warning and `return ()` from the function."],["try_wr","Try to unwrap a `Result<T, E>`. If there is a value `T`, yield it, otherwise print a warning and return from the function with the given value."]],"mod":[["alsa_card","Alsa audio subsystem."],["app_state","Global application state."],["audio","High-level audio subsystem."],["errors",""],["glade_helpers",""],["prefs","The preferences subsystem."],["support_alsa","Alsa audio helper functions."],["support_audio","Helper functions of the audio subsystem."],["support_cmd","Helper functions for invoking system commands."],["support_ui","Helper functions for the UI, mostly pixbuf functions."],["ui_entry","Global GUI state."],["ui_popup_menu","The popup menu subsystem when the user right-clicks on the tray icon."],["ui_popup_window","The popup window subsystem when the user left-clicks on the tray icon."],["ui_prefs_dialog","The preferences window subsystem, when the user clicks the \"Preferences\" menu item on the popup menu."],["ui_tray_icon","The tray icon subsystem."]]});