tmus

TUI Music Player
git clone https://git.sinitax.com/sinitax/tmus
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

tui.h (724B)


      1#pragma once
      2
      3#include "list.h"
      4#include "listnav.h"
      5#include "pane.h"
      6
      7#include <stdbool.h>
      8
      9#define USER_STATUS(...) do { \
     10		free(user_status); \
     11		user_status = aprintf(__VA_ARGS__); \
     12		user_status_uptime = 10; \
     13	} while (0)
     14
     15void tui_init(void);
     16void tui_deinit(void);
     17bool tui_update(void);
     18
     19extern struct pane *cmd_pane, *tag_pane, *track_pane;
     20extern struct pane *pane_sel, *pane_after_cmd;
     21
     22extern struct list *tracks_vis;
     23extern int track_show_playlist;
     24
     25extern struct listnav tag_nav;
     26extern struct listnav track_nav;
     27
     28extern char *user_status;
     29extern int user_status_uptime;
     30
     31static inline bool
     32tui_enabled(void)
     33{
     34	return !isendwin();
     35}
     36
     37static inline void
     38tui_restore(void)
     39{
     40	if (!isendwin())
     41		endwin();
     42}