diff options
| author | 2025-05-11 15:10:54 -0400 | |
|---|---|---|
| committer | 2025-05-11 15:10:54 -0400 | |
| commit | cb342b234defc1205de5d8b10ddf79deae0a551a (patch) | |
| tree | 135a8f17ef297dcfa71cfa24de0170797add999e /src/fruits | |
| parent | bbdc4ed66aa171f89f675aa1c82316477d5fd47e (diff) | |
| download | camu-cb342b234defc1205de5d8b10ddf79deae0a551a.tar.gz camu-cb342b234defc1205de5d8b10ddf79deae0a551a.tar.bz2 camu-cb342b234defc1205de5d8b10ddf79deae0a551a.zip | |
Add keybind to disable scaling filter
- Fix no FFmpeg build.
- Cleanup commented code from cmc ui.
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/fruits')
| -rw-r--r-- | src/fruits/cmc/cmc.c | 8 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/panes/list.c | 163 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/panes/search.h | 13 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/ui.c | 8 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/ui.h | 66 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/util/waveform.c | 4 | ||||
| -rw-r--r-- | src/fruits/cmc/ui/widgets/now_playing.c | 23 | ||||
| -rw-r--r-- | src/fruits/cmsrv/ui.c | 2 | ||||
| -rw-r--r-- | src/fruits/cmv/cmv.c | 2 |
9 files changed, 45 insertions, 244 deletions
diff --git a/src/fruits/cmc/cmc.c b/src/fruits/cmc/cmc.c index 39423c1..b9810f6 100644 --- a/src/fruits/cmc/cmc.c +++ b/src/fruits/cmc/cmc.c @@ -108,10 +108,10 @@ static void client_callback(void *userdata, u8 op, void *opaque) al_array_foreach(c->lists, i, list) { cmc_list_pane_add_list(&c->ui.lists, list); } - struct cmc_search *search; - al_array_foreach(c->searches, i, search) { - //cmc_sp_add_search(&c->ui, search); - } + //struct cmc_search *search; + //al_array_foreach(c->searches, i, search) { + // cmc_sp_add_search(&c->ui, search); + //} break; case CLI_ADD: { str *arg; diff --git a/src/fruits/cmc/ui/panes/list.c b/src/fruits/cmc/ui/panes/list.c index 15554b6..b599cc5 100644 --- a/src/fruits/cmc/ui/panes/list.c +++ b/src/fruits/cmc/ui/panes/list.c @@ -291,166 +291,3 @@ void cmc_list_pane_render(struct cmc_list_pane *lp) render_list_entries(lp, tab, lp->page_length); cmc_now_playing_render(&lp->np, tab_current_entry(tab)); } - -//static void render_now_playing(struct cmc_ui *ui, struct cmc_list_tab *tab, u32 y, u32 height) -//{ -// struct ncplane *n = ui->lp.n; -// u32 width = ncplane_dim_x(n); -// -// struct cmc_list_entry *entry = NULL; -// if (tab->list->entries.count > (u32)tab->list->current) { -// entry = al_array_at(tab->list->entries, tab->list->current); -// } -// -// u64 pos = 0; -// u64 duration = 0; -// u64 remaining = 0; -// u32 y_off = height - 7; -// -// ncplane_set_styles(n, NCSTYLE_BOLD); -// if (entry) { -// pos = entry->offset; -// duration = entry->duration; -// u64 now = nn_get_timestamp(); -// bool paused = entry->start == LIANA_TIMESTAMP_INVALID; -// if (!paused && now > entry->start) { -// pos += now - entry->start; -// } -// pos = MIN(pos, duration); -// remaining = duration - pos; -// //ncplane_putstr_yx(n, y_off, 2, "▸"); -// //ncplane_putstr_yx(n, y_off, 2, "▶"); -// //ncplane_putstr_yx(n, y_off, 2, "⏵ "); -// //ncplane_putstr_yx(n, y_off, 2, "|"); -// //ncplane_putstr_yx(n, y_off, 2, "|"); -// //ncplane_putstr_yx(n, y_off, 2, "⏵"); -// //ncplane_putstr_yx(n, y_off, 2, "⏸"); -// if (remaining == 0) { -// ncplane_putstr_yx(n, y_off - 1, 2, "∨"); -// } else { -// ncplane_putstr_yx(n, y_off - 1, 2, paused ? "^": ">"); -// } -// } else { -// ncplane_putstr_yx(n, y_off - 1, 2, "∨"); -// } -// ncplane_set_styles(n, NCSTYLE_NONE); -// -// f32 percent = 1.f; -// if (duration > 0) percent = MIN(pos / (f32)duration, 1.f); -// for (u32 i = 0; i < (width - 2) * percent; i++) { -// ncplane_putchar_yx(n, y_off, i + 1, '-'); -// } -// -// y_off--; -// -// char timestr[16] = { 0 }; // max = 829128280:01:49\0 -// s32 offset = camu_print_time(timestr, sizeof(timestr), pos, true, 4); -// ncplane_putstr_yx(n, y_off, 4, timestr); -// ncplane_putstr_yx(n, y_off, 4 + offset, "⎹"); -// -// if (entry) { -// cmc_ui_putnwstr_yx(n, y_off, 6 + offset, MIN(entry->name.length, (u32)60), &entry->name); -// } -// -// bool show_remaining = false; -// if (show_remaining) { -// offset = camu_print_time(timestr, sizeof(timestr), remaining, true, 4); -// } else { -// offset = camu_print_time(timestr, sizeof(timestr), duration, true, 4); -// } -// ncplane_putstr_yx(n, y_off, width - 4 - offset, "⎸"); -// // "=" Duration, "+" Segment, "-" Remaining. -// if (show_remaining) { -// ncplane_putstr_yx(n, y_off, width - 3 - offset, "-"); -// } else { -// ncplane_putstr_yx(n, y_off, width - 3 - offset, "="); -// } -// ncplane_putstr_yx(n, y_off, width - 2 - offset, timestr); -// -// /* -// ncplane_putchar_yx(n, height - 5, 2, 'A'); -// ncplane_putchar_yx(n, height - 4, 2, 'A'); -// ncplane_putchar_yx(n, height - 3, 2, 'A'); -// ncplane_putchar_yx(n, height - 2, 2, 'A'); -// */ -// -// if (entry && entry->raw.data != NULL) { -// u32 length = width - 2; -// u32 top = height - 6; -// u32 wave_height = 5; -// if (entry->raw.drawing == NULL || entry != ui->lp.blitted) { -// entry->raw.drawing = al_malloc(sizeof(char **) * wave_height); -// for (u32 j = 0; j < wave_height; j++) { -// entry->raw.drawing[j] = al_malloc(sizeof(char *) * length); -// for (u32 i = 0; i < length; i++) { -// entry->raw.drawing[j][i] = al_calloc(1, 6); -// } -// } -// if (!ui->lp.w) { -// struct ncplane_options opts = { 0 }; -// opts.x = 1; -// opts.y = top; -// opts.cols = length; -// opts.rows = wave_height; -// ui->lp.w = ncplane_create(n, &opts); -// } -// /* -// struct nccell ncl; -// nccell_init(&ncl); -// nccell_load(w, &ncl, " "); -// nccell_set_bg_palindex(&ncl, 3); -// ncplane_polyfill_yx(w, 0, 0, &ncl); -// */ -// u32 *rgba; -// u32 pixel_width, pixel_height; -// ncplane_pixel_geom(ui->lp.w, &pixel_height, &pixel_width, NULL, NULL, NULL, NULL); -// //cmc_draw_waveform(entry, length, wave_height, false, entry->raw.drawing, &rgba); -// cmc_draw_waveform(entry, pixel_width, pixel_height, false, entry->raw.drawing, &rgba); -// if (ui->lp.vis) { -// ncvisual_destroy(ui->lp.vis); -// } -// ui->lp.vis = ncvisual_from_rgba(rgba, pixel_height, pixel_width * 4, pixel_width); -// } -// -// if (entry != ui->lp.blitted) { -// ncplane_erase(ui->lp.w); -// struct ncvisual_options vopts = { 0 }; -// vopts.blitter = NCBLIT_PIXEL; -// vopts.scaling = NCSCALE_STRETCH; -// vopts.flags = NCVISUAL_OPTION_NOINTERPOLATE; -// vopts.n = ui->lp.w; -// vopts.x = 0; -// vopts.y = 0; -// ncvisual_blit(ui->nc, ui->lp.vis, &vopts); -// ui->lp.blitted = entry; -// } -// -// /* -// ncplane_set_fg_palindex(n, 5); -// for (u32 j = 0; j < wave_height; j++) { -// for (u32 i = 0; i < length; i++) { -// char *cell = entry->raw.drawing[j][i]; -// if (cell[0] == 'R') { -// ncplane_set_bg_palindex(n, 2); -// } -// ncplane_putstr_yx(n, top + j, 1 + i, cell + 1); -// if (cell[0] == 'R') { -// ncplane_set_bg_default(n); -// } -// } -// } -// ncplane_set_fg_default(n); -// */ -// } -// -// /* -// char buf[24]; -// al_snprintf(buf, sizeof(buf), "%u, %u | %u, %u", ui->last_mouse_x, ui->last_mouse_y, width, height); -// ncplane_putstr_yx(n, height - 5, 5, buf); -// */ -// -// u64 c = 0; -// ncchannels_set_fg_default(&c); -// ncplane_cursor_move_yx(n, y, 0); -// ncplane_light_box(n, NCSTYLE_NONE, c, height - 1, width - 1, 0); -//} diff --git a/src/fruits/cmc/ui/panes/search.h b/src/fruits/cmc/ui/panes/search.h new file mode 100644 index 0000000..7f9a2a7 --- /dev/null +++ b/src/fruits/cmc/ui/panes/search.h @@ -0,0 +1,13 @@ +#pragma once + +/* +struct cmc_search_tab { + struct cmc_search *search; + struct ncplane *input; + u32 cursor; + u32 visual_cursor; + bool input_active; + wstr input_text; + bool input_changed; +}; +*/ diff --git a/src/fruits/cmc/ui/ui.c b/src/fruits/cmc/ui/ui.c index a5d9125..bc01a22 100644 --- a/src/fruits/cmc/ui/ui.c +++ b/src/fruits/cmc/ui/ui.c @@ -81,14 +81,6 @@ void cmc_ui_queue_render(struct cmc_ui *ui) } if (ui->overlay_shown) { - /* - struct nccell ncl; - nccell_init(&ncl); - nccell_load(ui->oln, &ncl, "I"); - //nccell_set_bg_palindex(&ncl, 3); - nccell_set_fg_palindex(&ncl, 3); - ncplane_polyfill_yx(ui->oln, 0, 0, &ncl); - */ u64 c = 0; ncchannels_set_fg_default(&c); ncplane_cursor_move_yx(ui->oln, 0, 0); diff --git a/src/fruits/cmc/ui/ui.h b/src/fruits/cmc/ui/ui.h index 7abf105..dad2c6b 100644 --- a/src/fruits/cmc/ui/ui.h +++ b/src/fruits/cmc/ui/ui.h @@ -16,30 +16,6 @@ enum { CMC_PANE_LOG }; -/* -struct cmc_list_tab { - struct cmc_list *list; - s32 page_length; - s32 selected; - bool leader_pressed; - struct { - bool active; - s32 selected; - s32 offset; - } move; -}; - -struct cmc_search_tab { - struct cmc_search *search; - struct ncplane *input; - u32 cursor; - u32 visual_cursor; - bool input_active; - wstr input_text; - bool input_changed; -}; -*/ - struct cmc; struct cmc_ui { struct notcurses *nc; @@ -56,25 +32,6 @@ struct cmc_ui { u64 last_mouse_ts; struct cmc_list_pane lists; struct cmc_log_pane log; - /* - struct { - struct ncplane *n; - struct ncplane *w; - struct ncvisual *vis; - struct cmc_list_entry *blitted; - array(struct cmc_list_tab) tabs; - u32 current; - } lp; // list pane. - struct { - struct ncplane *n; - array(struct cmc_search_tab) tabs; - u32 current; - } sp; // search pane. - struct { - struct ncplane *n; - array(char *) messages; - } logp; - */ struct nn_poll input_poll; struct nn_timer render_timer; struct cmc *c; @@ -97,26 +54,3 @@ bool cmc_ui_init(struct cmc_ui *ui, struct nn_event_loop *loop, struct cmc *c); void cmc_ui_queue_render(struct cmc_ui *ui); void cmc_ui_toggle_overlay(struct cmc_ui *ui); void cmc_ui_close(struct cmc_ui *ui); - -/* -void cmc_lp_init(struct cmc_ui *ui); -void cmc_lp_layout(struct cmc_ui *ui, struct ncplane *parent); -void cmc_lp_add_list(struct cmc_ui *ui, struct cmc_list *list); -bool cmc_lp_handle_input(struct cmc_ui *ui, struct ncinput *input); -void cmc_lp_erase(struct cmc_ui *ui); -void cmc_lp_render(struct cmc_ui *ui); - -void cmc_sp_init(struct cmc_ui *ui); -void cmc_sp_layout(struct cmc_ui *ui, struct ncplane *parent); -void cmc_sp_add_search(struct cmc_ui *ui, struct cmc_search *search); -bool cmc_sp_handle_input(struct cmc_ui *ui, struct ncinput *input); -void cmc_sp_erase(struct cmc_ui *ui); -void cmc_sp_render(struct cmc_ui *ui); - -void cmc_logp_init(struct cmc_ui *ui); -void cmc_logp_layout(struct cmc_ui *ui, struct ncplane *parent); -void cmc_logp_push_message(struct cmc_ui *ui, char *message); -bool cmc_logp_handle_input(struct cmc_ui *ui, struct ncinput *input); -void cmc_logp_erase(struct cmc_ui *ui); -void cmc_logp_render(struct cmc_ui *ui); -*/ diff --git a/src/fruits/cmc/ui/util/waveform.c b/src/fruits/cmc/ui/util/waveform.c index 8d37543..535f219 100644 --- a/src/fruits/cmc/ui/util/waveform.c +++ b/src/fruits/cmc/ui/util/waveform.c @@ -103,6 +103,7 @@ static void test_write_bitmap(struct cmc_list_entry *entry, u32 width, u32 heigh } #endif +/* static const char *octant_lut[] = { " ", "", "", "🮂", "", "▘", "", "", "", "", "▝", "", "", "", "", "▀", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", @@ -121,11 +122,14 @@ static const char *octant_lut[] = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "▄", "", "", "", "", "▙", "", "", "", "", "▟", "", "▆", "", "", "█" }; +*/ #define RMS_BIT (1 << 8) void cmc_draw_waveform(struct cmc_list_entry *entry, u32 width, u32 height, bool include_rms, char ***buf, u32 **rgba) { + (void)include_rms; + (void)buf; #ifdef OUTPUT_WAVEFORM_PNG test_write_bitmap(entry, width, height, rgba); return; diff --git a/src/fruits/cmc/ui/widgets/now_playing.c b/src/fruits/cmc/ui/widgets/now_playing.c index a90c7e0..748462b 100644 --- a/src/fruits/cmc/ui/widgets/now_playing.c +++ b/src/fruits/cmc/ui/widgets/now_playing.c @@ -230,3 +230,26 @@ void cmc_now_playing_render(struct cmc_now_playing *np, struct cmc_list_entry *e } ncplane_set_fg_default(np->n); } + +/* Text waveform stuff +struct nccell ncl; +nccell_init(&ncl); +nccell_load(w, &ncl, " "); +nccell_set_bg_palindex(&ncl, 3); +ncplane_polyfill_yx(w, 0, 0, &ncl); + +ncplane_set_fg_palindex(n, 5); +for (u32 j = 0; j < wave_height; j++) { + for (u32 i = 0; i < length; i++) { + char *cell = entry->raw.drawing[j][i]; + if (cell[0] == 'R') { + ncplane_set_bg_palindex(n, 2); + } + ncplane_putstr_yx(n, top + j, 1 + i, cell + 1); + if (cell[0] == 'R') { + ncplane_set_bg_default(n); + } + } +} +ncplane_set_fg_default(n); +*/ diff --git a/src/fruits/cmsrv/ui.c b/src/fruits/cmsrv/ui.c index c8e9dcb..e5d0798 100644 --- a/src/fruits/cmsrv/ui.c +++ b/src/fruits/cmsrv/ui.c @@ -1,8 +1,6 @@ #include <al/lib.h> #include <al/log.h> -#include "../../server/common.h" - #include "ui.h" #define LOG_RATIO 1.25 diff --git a/src/fruits/cmv/cmv.c b/src/fruits/cmv/cmv.c index c5bb22a..70a0b28 100644 --- a/src/fruits/cmv/cmv.c +++ b/src/fruits/cmv/cmv.c @@ -96,7 +96,7 @@ static bool parse_exe_name_params(str *exe_name, str *addr, struct lia_prefs *pr return true; def: prefs->enabled_mask = CAMU_MASK_AUDIO | CAMU_MASK_VIDEO | CAMU_MASK_SUBTITLE; - prefs->audio_lang = CAMU_LANG_ENGLISH; + prefs->audio_lang = CAMU_LANG_JAPANESE; prefs->subtitle_lang = CAMU_LANG_ENGLISH; return false; |