| Commit message (Collapse) | Author | Age |
| |
|
|
|
| |
This is shorter and conveys enough information. Rename the static para_exec()
as well.
|
| |
|
|
|
| |
The version string is shown in the version bar, so this internal command is
kind of moot.
|
| |
|
|
|
| |
Rename in to sbar and sb to vbar, as this is still short but conveys the
meaning of both one-line windows better.
|
| |
|
|
|
|
| |
The variables sep_y and sep_lines should have been renamed to pbar_y and
pbar_lines when the progress bar was implemented, but we may as well simply
remove them because sep_y always equals top_lines, and sep_lines is always one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the array of struct stat_item_data by a function pointer. The
array approach is still used by the colorful blackness theme, which now
defines its own array in gui_theme.c. This allows the definition of struct
stat_item_data to be private to gui_theme.c.
The "simple" theme now tries to display a suitable string to describe the
current audio file rather than always showing the basename. Drop the server
and audiod status items it used to show. It's called "simple", after all.
Both themes need to align the strings they print, so align_str() has
to become public.
|
| |
|
|
|
|
|
|
|
|
|
| |
The FreeBSD and NetBSD installations on which this software is tested both
provide the ncurses headers and libraries these days. This is enough reason to
justify the change because the non-ncurses build no longer gets any testing
and may well be broken already.
This change allows us to make use of extensions that are not part of the
standard. For starters, drop an ncurses specific #define, and prefer getmaxy()
over the silly get_num_lines() dance we do right now.
|
| |
|
|
| |
Only one caller.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes gui.c to no longer spawn a para_audioc process to get the status
items from para_audiod. Instead, the para_gui process connects directly to
audiod using the same mechanism as para_audioc. Besides being more efficient,
this approach has the advantage that status item updates are now atomic in
the sense that complete sideband packages (containing any number of status
items) are received, so torn status items can no longer occur.
To implement this, move the code that can be shared between gui and audioc
to a separate file, audioc_common.c. This file contains only one public
function: connect_audiod(). Since this function uses unix socket magic and
employs the sideband API, para_gui needs to link in net.o and sideband.o,
in addition to the new audioc_common.o.
With these changes in place, para_gui's --stat-command option becomes
unused. Drop it, as it's not worth the pain to introduce a depreciation
period. On the other hand, para_gui now needs an option to specify the path
to the socket on which para_audiod is expected to listen, so move the lopsub
stanza of para_audioc's --socket option to the new socket.m4 file and include
it from both the audioc and the gui lopsub suites.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old function received a callback, and called it once per item received.
This inevitably leads to situations where one status item is already uptodate
but others are not.
The replacement function no longer takes a callback pointer but a pointer
to the array of status items to update, and returns the mask of items that
have changed. Parse errors are now regarded as implementation bugs. We
still detect them and log an error, but the function can no longer fail.
Remove print_all_items() from gui.c since this can now be done in one line
by passing ~0 to print_stat_items().
|
| |
|
|
|
| |
This may lead to a busy loop when the external command is started at an
unfortunate moment.
|
| |
|
|
|
|
|
|
| |
This restores the formula that was changed by the commit cited below.
The simple DIV_ROUND_UP() we had since then is incorrect and causes problems
when scrolling or jumping to the beginning of the buffer of the bottom window.
Fixes: 809b4f272777bb8a209eaa5448ed3ea131ab4c42
|
| |
|
|
| |
The second condition is the negation of the first.
|
| |
|
|
|
| |
Due to the missing call to print_progress_bar(), the bar and the duration
remain visible even if there is no status connection to audiod.
|
| |
|
|
|
|
|
| |
This replaces the separator bar and its associated curses window by a
progress bar, using the characters "▒" and "░". The duration of the
current file is shown next to the bar. The colors of the bar and the duration
are configurable in the theme.
|
| |
|
|
|
|
|
| |
Switching themes currently messes up the display when the size of the new
theme's bottom window is larger than the old one. To fix that, redraw
the bottom window and reset the scroll position rather than refreshing
curses. Also print the name of the new theme in the input window.
|
| |
|
|
| |
In 2026 this should be no constraint. Affects only para_gui.
|
| |
|
|
| |
This is even shown in stopped mode. Just emit the empty string instead.
|
| |
|
|
|
|
|
| |
The math was slightly off, and we have the generic DIV_ROUND_UP macro for
this type of calculation. All callers pass a size_t so convert NUM_LINES
to a function while at it. Rename it because we also have get_num_lines(),
which is a different beast (it returns the y dimension of the given window).
|
| |
|
|
|
| |
The value stored there was returned by strwidth(), It denotes the number of
characters, not the number of bytes. So "width" seems to be a better name.
|
| |
|
|
| |
All subwindows have full width, so we may as well use COLS.
|
| |
|
|
| |
It's more natural to use the .dflt colors only for color pair 0.
|
| |
|
|
|
|
| |
It's just annoying to see this message scroll by when para_audiod is not
running. The basename field says "no connection to para_audiod" in this case,
and this should be enough for the default loglevel.
|
| |
|
|
|
|
|
|
|
| |
There is no point in having an init function for each theme that just
initializes the theme structure with values which are compile-time constant.
Make the array constant and change theme_init() to just set the static
global current_theme_num. Also make current_theme_num unsigned, as we perform
decrement and modulo operations on it.
|
| |
|
|
|
|
| |
The global exec_fd array is only initialized after the two file descriptors
are set to non-blocking mode. Thus, if the call to mark_fd_nonblocking()
fails, we have to use the local fd array to close the descriptors.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the status connection between server and audiod is down, audiod sets
the basename status item to indicate this fact, knowing that both themes of
para_gui show this item at the top of the output. Remove this layer violation
by creating the message in para_gui instead. This is easy to do because an
empty SI_status_flags field indicates this condition. So modify gui.c to
replace the empty value of this field by "down".
Similarly, avoid the SI_basename abuse in gui.c where the item is repurposed
to show the "stat command terminated" message if the link between gui and
audiod went down. Simply drop this hack so that all status items appear
empty in this case.
|
| |
|
|
|
|
|
| |
Currently we use at several places the package version, i.e. the version
that was checked out when the package was configured. The paraslash version
is recomputed every time the package is build, so this is more up-to-date.
So use paraslash_version() everywhere and remove PACKAGE_VERSION.
|
| |
|
|
|
|
|
|
|
|
| |
Currently the function (a) closes the write end of the signal pipe and (b)
frees the signal task structure. (a) is not really needed because the function
is only called just before the process terminates anyway, and (b) can easily
be avoided by having the callers allocate the structure on the stack.
With signal_shutdown() gone, all signal task structures can be made local,
although some need to remain static.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Improvements to para_gui
A short series which implements the new clear_bot_win internal gui command. On
top of that follow a bunch of other small improvements. Nothing scary here.
* t/gui:
gui: Drop terminating dummy command from command_list[].
gui: Remove dead post-schedule code.
gui: Drop SIGUSR1 handling.
gui: Ignore SIGINT.
gui: Do not request minimal timeout on notifications.
gui: Drop refresh_window().
gui: Use normal output color for help text.
gui: Show file size in human-readable form.
gui: New internal command: clear_bot_win.
|
| | |
| |
| |
| | |
This makes the code more readable and saves a slot in the array.
|
| | |
| |
| |
| |
| | |
Since setup_tasks_and_schedule never returns, we may drop the cleanup
code.
|
| | |
| |
| |
| |
| |
| | |
With this applied, unrelated processes can no longer signal para_gui to
trigger a reload of the configuration file, but this feature has no real
use because there is also an internal gui command to do that.
|
| | |
| |
| |
| |
| | |
We currently catch the signal, but the handler does nothing. So we may as
well just ignore the signal.
|
| | |
| |
| |
| |
| | |
The scheduler itself requests a minimal delay if at least one task has a
pending notification. No need to do that in the pre-monitor step.
|
| | |
| |
| |
| | |
Just open-code the one-liner.
|
| | |
| |
| |
| |
| | |
This seems to be more natural because we normally use COLOR_MSG only to
print to the status bar.
|
| | |
| |
| |
| | |
That's easy to do, and quite useful.
|
| | |
| |
| |
| |
| | |
Introduce ringbuffer_flush() to remove all entries and call the new function
from the command handler of the new "clear_bot_win" command.
|
| |/
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
The latter looks much more natural.
|
| |
|
|
| |
To add the name of the local host to the status bar.
|
| |
|
|
| |
The new file comment, dedox of gui.c, and some minor cleanups.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves the declaration of the structure from sched.h to sched.c because
the information stored in this structure has almost no users outside of the
scheduler core.
As a result, the size of the structure is no longer known outside of sched.c.
To initialize a scheduler instance, users now must call the new sched_new(),
passing an alternative poll function if needed, We don't let applications
set the default timeout anymore because the value is kind of arbitrary anyway
and most users specified one second. So hardcode this as the default.
Besides allocating the scheduler structure, sched_new() also initializes the
task list and the poll function pointer. Thanks to these initializations,
the two conditions of sched.c removed in this patch are never true.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A medium sized series for the build system which improves the way the git
version string is stored in the executables and man pages. Subsequent patches
of the series remove some warts from the makefile: we no longer use order-only
dependencies and the .PRECIOUS target.
The merge results in a conflict against the "remove regex include" commit
67388cd4fae0. This is trivial to resolve, though.
* refs/heads/t/build:
Doxify version functions.
Doxify OV_EXCLUDE_STATIC_CALLBACKS #define.
Makefile: Fix braino in tarball target.
build: Remove superfluous dependency in Makefile.real.
build: Remove the .PRECIOUS target.
build: Improve clean targets.
build: Get rid of directory order-only dependencies.
build: Compile with -Wunused -Wall also on BSD.
build: Revamp git versioning.
build: Merge version.{c,h} into string.{c,h}.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a preparatory patch for the upcoming revamp of the git
version script. The revamped script generates version.c, a file
which is currently tracked by git. We can easily get rid of it (and
of version.h) since all paraslash executables link in both string.o
and version.o. So let's move the three small functions of version.c
to string.c and their declarations from version.h to string.h.
|
| |/
|
|
| |
Every .c file includes it anyway.
|
| |
|
|
|
|
| |
Make the EOF case silent because this is no real error, but print the
log message with a high severity level if the read operation failed
for any other reason.
|
| |
|
|
|
|
|
|
|
|
| |
When executing para_client or para_audioc from para_mixer or para_gui
we currently pass an absolute path whose directory part is BINDIR
to execvp(2). This is unnecessary because execvp(2) honors $PATH.
This commit modifies gui.c and mixer.c to pass only the basename of
the executable instead, allowing us to remove the BINDIR preprocessor
define. We still need the bindir make variable, though, because it
is referenced in the recipe of the two install targets.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a command is executed as a display command from para_gui, and
the command is interrupted from within para_gui by pressing any key,
para_gui only kills the spawned process but leaves alone its child
processes.
Address this problem by putting the spawned process into a separate
process group so that we can easily kill all processes of the group
by passing the negated PID of the child to kill(2).
In theory, the change in exec.c also affects para_mixer, which executes
para_client and para_audioc. However, para_mixer never kills any of
its child processes.
|
| |
|
|
|
|
|
|
|
| |
Without this a stale message such as
"scrolled view: 1-36/42"
remains although the window has been updated to show the bottom of
the ringbuffer.
|
| |
|
|
|
| |
When changing the log level, show the new severity string rather than
its numerical representation.
|