|
FFmpeg
|
#include "config.h"#include <limits.h>#include <string.h>#include "libavutil/avstring.h"#include "libavutil/avutil.h"#include "libavutil/bprint.h"#include "libavutil/common.h"#include "libavutil/error.h"#include "libavutil/log.h"#include "libavutil/mathematics.h"#include "libavutil/mem.h"#include "libavutil/qsort.h"#include "libavutil/time.h"#include "ffplay_list.h"Go to the source code of this file.
Data Structures | |
| struct | ListSortKey |
| struct | ListHit |
| struct | ListCacheEntry |
| struct | ListStrip |
| struct | ListView |
| struct | ListLayout |
Macros | |
| #define | LIST_FADE_TIME 250000 |
| #define | LIST_HOLD_TIME 500000 |
| #define | LIST_ROWS 7 |
| #define | CMP(a, b) |
| #define | LIST_EVENT "Dialogue: 0:00:00.00,9999:00:00.00," |
| #define | PANEL_COLOR 0xBF000000 |
| #define | HOVER_COLOR 0xCD444444 |
| #define | POPUP_COLOR 0xDF000000 |
Enumerations | |
| enum | { LIST_SORT_NUMBER , LIST_SORT_ARTIST , LIST_SORT_TITLE , LIST_SORT_LENGTH , LIST_SORT_SHUFFLE , LIST_SORT_NB } |
Functions | |
| static double | list_alpha (const ListView *lv, int64_t now) |
| static int | compare_tags (const char *a, const char *b) |
| static uint32_t | shuffle_rank (const ListView *lv, int index) |
| static int | compare_rows (const ListView *lv, const int *a, const int *b) |
| static void | list_sort_by (ListView *lv, int key, int seed_step) |
| static void | list_update_rows (ListView *lv) |
| static void | bprint_box (AVBPrint *script, const char *style, int x, int y, int w, int h) |
| static void | bprint_cell (AVBPrint *script, const char *style, int x, int y, int right, int bottom, const char *text) |
| static ListLayout | list_layout (const ListView *lv) |
| static ListHit | list_hit (const ListLayout *l, int x, int y) |
| static void | bprint_ring (AVBPrint *script, int cx, int cy, int r) |
| static void | bprint_styles (AVBPrint *script, const ListLayout *l) |
| static void | bprint_header_strip (const ListView *lv, AVBPrint *script, const ListLayout *l) |
| static void | bprint_row_strip (const ListView *lv, AVBPrint *script, const ListLayout *l, int r) |
| static void | cache_entry_free (ListCacheEntry **entry) |
| static void | cache_make_room (ListView *lv, size_t bytes) |
| static int | strip_render (ListView *lv, ListCacheEntry *entry) |
| static int | cache_get (ListView *lv, const SDL_Rect *rect, uint32_t background, const AVBPrint *script, ListCacheEntry **entry) |
| static int | strip_add (ListView *lv, ListStrip **strips, int *nb, SDL_Rect rect, uint32_t background, const AVBPrint *script) |
| static int | list_strips (ListView *lv, const ListLayout *l, ListStrip **strips, int *nb) |
| static void | list_discard (ListView *lv) |
| static int | list_configure (ListView *lv, const ListLayout *l, const SDL_Rect *canvas) |
| static int | list_render (ListView *lv) |
| static void | list_select (ListView *lv, int row) |
| void | list_view_text (ListView *lv, const char *text) |
| Appends text typed while the list is pinned to the search, or erases its last character when text is NULL. | |
| ListView * | list_view_alloc (SDL_Renderer *renderer) |
| void | list_view_free (ListView **plv) |
| int | list_view_show (ListView *lv, const ListEntry *entries, int nb_entries, int selected) |
| Replaces the entries and shows the list, fading it in. | |
| void | list_view_clear (ListView *lv) |
| Removes the entries, which may be freed after this, and resets the sort and the search. | |
| void | list_view_pin (ListView *lv, int pinned) |
| Keeps the list on screen and lets it take the keyboard and text input, or lets it fade out again. | |
| int | list_view_pinned (const ListView *lv) |
| int | list_view_visible (const ListView *lv) |
| int | list_view_selected (const ListView *lv) |
| void | list_view_move (ListView *lv, int delta) |
| Moves the selection by delta rows. | |
| int | list_view_key (ListView *lv, SDL_Keycode key) |
| Handles a key while the list is pinned: escape unpins it, up/down move the selection, backspace erases from the search. | |
| void | list_view_clear_search (ListView *lv) |
| Clears the search, listing all entries. | |
| void | list_view_hover (ListView *lv, int x, int y) |
| Keeps the mouse position, in window coordinates, -1 when the mouse left the window. | |
| int | list_view_click (ListView *lv, int x, int y, int *chosen) |
| Handles a left click at window coordinates: a click on an entry chooses it, a click on a column button sorts by it. | |
| void | list_view_set_size (ListView *lv, int width, int height) |
| Sets the size of the window the list is drawn into. | |
| void | list_view_set_playing (ListView *lv, int entry) |
| Marks the entry as playing, -1 for none. | |
| int | list_view_update (ListView *lv) |
| Brings the list up to date for the next frame, once the pending input is handled. | |
| void | list_view_draw (ListView *lv) |
| Draws the list onto the window, between its other content and the present. | |
Variables | ||
| struct { | ||
| const char * label | ||
| int width | ||
| } | sort_buttons [LIST_SORT_NB] | |
| #define LIST_FADE_TIME 250000 |
Definition at line 41 of file ffplay_list.c.
Referenced by list_alpha(), and list_select().
| #define LIST_HOLD_TIME 500000 |
Definition at line 42 of file ffplay_list.c.
Referenced by list_alpha(), and list_view_pin().
| #define LIST_ROWS 7 |
Definition at line 43 of file ffplay_list.c.
Referenced by list_layout().
Referenced by list_update_rows(), and load_rgb_float32_frame().
| #define LIST_EVENT "Dialogue: 0:00:00.00,9999:00:00.00," |
Definition at line 225 of file ffplay_list.c.
Referenced by bprint_box(), bprint_cell(), bprint_header_strip(), bprint_ring(), and bprint_row_strip().
| #define PANEL_COLOR 0xBF000000 |
Definition at line 327 of file ffplay_list.c.
Referenced by list_strips().
| #define HOVER_COLOR 0xCD444444 |
Definition at line 328 of file ffplay_list.c.
Referenced by list_strips().
| #define POPUP_COLOR 0xDF000000 |
Definition at line 329 of file ffplay_list.c.
Referenced by list_strips().
| anonymous enum |
| Enumerator | |
|---|---|
| LIST_SORT_NUMBER | |
| LIST_SORT_ARTIST | |
| LIST_SORT_TITLE | |
| LIST_SORT_LENGTH | |
| LIST_SORT_SHUFFLE | |
| LIST_SORT_NB | |
Definition at line 45 of file ffplay_list.c.
Definition at line 128 of file ffplay_list.c.
Referenced by list_select(), list_view_draw(), list_view_update(), and list_view_visible().
|
static |
Definition at line 140 of file ffplay_list.c.
Referenced by compare_rows().
|
static |
Definition at line 148 of file ffplay_list.c.
Referenced by compare_rows().
|
static |
Definition at line 157 of file ffplay_list.c.
|
static |
Definition at line 179 of file ffplay_list.c.
Referenced by list_view_click().
|
static |
Definition at line 196 of file ffplay_list.c.
Referenced by list_view_clear_search(), list_view_click(), list_view_show(), list_view_text(), and list_view_update().
|
static |
Definition at line 227 of file ffplay_list.c.
Referenced by bprint_header_strip(), and bprint_row_strip().
|
static |
Definition at line 233 of file ffplay_list.c.
Referenced by bprint_header_strip(), bprint_row_strip(), and list_strips().
|
static |
Definition at line 248 of file ffplay_list.c.
Referenced by list_render(), list_view_click(), and list_view_hover().
|
static |
Definition at line 293 of file ffplay_list.c.
Referenced by list_render(), list_view_click(), and list_view_hover().
|
static |
Definition at line 316 of file ffplay_list.c.
Referenced by bprint_row_strip().
|
static |
Definition at line 331 of file ffplay_list.c.
Referenced by list_configure().
|
static |
Definition at line 353 of file ffplay_list.c.
Referenced by list_strips().
|
static |
Definition at line 374 of file ffplay_list.c.
Referenced by list_strips().
|
static |
Definition at line 399 of file ffplay_list.c.
Referenced by cache_get(), cache_make_room(), and list_discard().
|
static |
Definition at line 409 of file ffplay_list.c.
Referenced by cache_get().
|
static |
Definition at line 614 of file ffplay_list.c.
Referenced by cache_get().
|
static |
Definition at line 428 of file ffplay_list.c.
Referenced by strip_add().
|
static |
Definition at line 458 of file ffplay_list.c.
Referenced by list_strips().
|
static |
Definition at line 478 of file ffplay_list.c.
Referenced by list_render().
|
static |
Definition at line 519 of file ffplay_list.c.
Referenced by list_configure(), list_render(), list_view_clear(), list_view_free(), and list_view_set_size().
|
static |
Definition at line 552 of file ffplay_list.c.
Referenced by list_render().
|
static |
Definition at line 648 of file ffplay_list.c.
Referenced by list_view_update().
|
static |
Definition at line 707 of file ffplay_list.c.
Referenced by list_view_click(), list_view_move(), and list_view_show().
| void list_view_text | ( | ListView * | lv, |
| const char * | text ) |
Appends text typed while the list is pinned to the search, or erases its last character when text is NULL.
Definition at line 717 of file ffplay_list.c.
Referenced by event_loop(), and list_view_key().
| ListView * list_view_alloc | ( | SDL_Renderer * | renderer | ) |
| renderer | NULL when there is none, which leaves the list unable to show |
Definition at line 733 of file ffplay_list.c.
Referenced by main().
| void list_view_free | ( | ListView ** | plv | ) |
Definition at line 750 of file ffplay_list.c.
Referenced by do_exit().
Replaces the entries and shows the list, fading it in.
| entries | numbered from 1 in the list; their strings and dictionaries must stay valid until the next call or list_view_free() |
| selected | entry to select, the selection is kept when it is -1 or not listed |
Definition at line 767 of file ffplay_list.c.
Referenced by chapter_list_show(), and file_list_show().
| void list_view_clear | ( | ListView * | lv | ) |
Removes the entries, which may be freed after this, and resets the sort and the search.
Definition at line 802 of file ffplay_list.c.
Referenced by chapter_list_show(), file_list_show(), list_view_alloc(), and stream_replace().
| void list_view_pin | ( | ListView * | lv, |
| int | pinned ) |
Keeps the list on screen and lets it take the keyboard and text input, or lets it fade out again.
Definition at line 812 of file ffplay_list.c.
Referenced by chapter_list_pin(), file_list_listed(), file_list_open(), list_view_key(), and stream_replace().
| int list_view_pinned | ( | const ListView * | lv | ) |
Definition at line 825 of file ffplay_list.c.
Referenced by event_loop().
| int list_view_visible | ( | const ListView * | lv | ) |
Definition at line 830 of file ffplay_list.c.
Referenced by event_loop(), list_view_hover(), list_view_set_size(), and refresh_loop_wait_event().
| int list_view_selected | ( | const ListView * | lv | ) |
Definition at line 835 of file ffplay_list.c.
Referenced by event_loop(), list_update_rows(), list_view_key(), and list_view_show().
| void list_view_move | ( | ListView * | lv, |
| int | delta ) |
Moves the selection by delta rows.
Definition at line 840 of file ffplay_list.c.
Referenced by event_loop(), and list_view_key().
| int list_view_key | ( | ListView * | lv, |
| SDL_Keycode | key ) |
Handles a key while the list is pinned: escape unpins it, up/down move the selection, backspace erases from the search.
Definition at line 846 of file ffplay_list.c.
Referenced by event_loop().
| void list_view_clear_search | ( | ListView * | lv | ) |
Clears the search, listing all entries.
Definition at line 859 of file ffplay_list.c.
Referenced by file_list_listed().
| void list_view_hover | ( | ListView * | lv, |
| int | x, | ||
| int | y ) |
Keeps the mouse position, in window coordinates, -1 when the mouse left the window.
Definition at line 868 of file ffplay_list.c.
Referenced by event_loop().
| int list_view_click | ( | ListView * | lv, |
| int | x, | ||
| int | y, | ||
| int * | chosen ) |
Handles a left click at window coordinates: a click on an entry chooses it, a click on a column button sorts by it.
| chosen | set to the entry clicked, -1 when none was |
Definition at line 883 of file ffplay_list.c.
Referenced by event_loop().
| void list_view_set_size | ( | ListView * | lv, |
| int | width, | ||
| int | height ) |
Sets the size of the window the list is drawn into.
Definition at line 899 of file ffplay_list.c.
Referenced by event_loop(), and video_open().
| void list_view_set_playing | ( | ListView * | lv, |
| int | entry ) |
Marks the entry as playing, -1 for none.
Definition at line 911 of file ffplay_list.c.
Referenced by refresh_loop_wait_event().
| int list_view_update | ( | ListView * | lv | ) |
Brings the list up to date for the next frame, once the pending input is handled.
Definition at line 919 of file ffplay_list.c.
Referenced by refresh_loop_wait_event().
| void list_view_draw | ( | ListView * | lv | ) |
Draws the list onto the window, between its other content and the present.
Definition at line 937 of file ffplay_list.c.
Referenced by video_display().
| const char* label |
Definition at line 215 of file ffplay_list.c.
Referenced by bprint_header_strip(), derive_key(), dump(), extract_inout(), ff_mov_read_chan(), ffat_get_channel_id(), find_linklabel(), inout_add(), label_string(), link_inputs(), link_outputs(), linklabels_parse(), main(), mov_get_channel_id(), mpeg_set_cc_format(), parse_file(), parse_mca_labels(), parse_once(), parse_stream(), print_app5(), print_cie(), print_hdr_plus(), print_lookup(), print_packet_hex(), print_parse_result(), print_peak_matrix(), print_set(), read_classify_label_file(), read_detect_label_file(), remap_layout(), set_control(), and skip_label().
| int width |
Definition at line 216 of file ffplay_list.c.
| const struct { ... } sort_buttons[LIST_SORT_NB] |
Referenced by bprint_header_strip(), list_hit(), list_layout(), and list_view_click().