void video_clear(void) { int cnt; TRC("%s\n", __FUNCTION__); if (fd >= 0) close(fd); fd = -1; video_playing = 0; audio_type = 0; if (video_write_thread) { pthread_kill(video_write_thread, SIGURG); } if (audio_write_thread) { pthread_kill(audio_write_thread, SIGURG); } sem_getvalue(&write_threads_idle_sem, &cnt); while ( cnt != 2 ) { sleep(0); sem_getvalue(&write_threads_idle_sem, &cnt); pthread_cond_broadcast(&video_cond); } av_stop(); av_video_blank(); av_reset(); av_reset_stc(); pthread_cond_broadcast(&video_cond); mvpw_set_bg(root, MVPW_BLACK); av_wss_update_aspect(WSS_ASPECT_FULL_4x3); }
void mvpw_set_array_cell_theme(mvp_widget_t *widget, int x, int y, mvpw_array_cell_theme *theme) { int i; mvpw_text_attr_t ta; if(x>widget->data.array.cols || y>widget->data.array.rows || y<0 || x<0) { printf("** SSDEBUG: ERROR %s indexes out of range (%d,%d).\n", __FUNCTION__, x, y); return; } i = widget->data.array.cols * y + x; if(widget->data.array.cell_theme[i] != theme) { if(widget->data.array.cell_viz[i]) { widget->data.array.cell_theme[i] = theme; mvpw_get_text_attr(widget->data.array.cells[i], &ta); if(theme == NULL) { ta.fg = widget->data.array.cell_fg; ta.bg = widget->data.array.cell_bg; } else { ta.fg = theme->cell_fg; ta.bg = theme->cell_bg; } mvpw_set_text_attr(widget->data.array.cells[i], &ta); mvpw_set_bg(widget->data.array.cells[i], ta.bg); } } }
void video_set_root(void) { av_state_t state; if (root_bright > 0) root_color = mvpw_color_alpha(MVPW_WHITE, root_bright*4); else if (root_bright < 0) root_color = mvpw_color_alpha(MVPW_BLACK, root_bright*-4); else root_color = 0; mvpw_set_bg(root, root_color); if (av_get_state(&state) == 0) { if (state.pause) { mvpw_show(pause_widget); } if (state.mute) { mvpw_show(mute_widget); } if (state.ffwd) { mvpw_show(ffwd_widget); } } }
void mvpw_hilite_array_cell(mvp_widget_t *widget, int x, int y, int hlt) { int i; mvpw_text_attr_t ta; if(x>widget->data.array.cols || y>widget->data.array.rows || y<0 || x<0) { printf("** SSDEBUG: ERROR %s indexes out of range (%d,%d).\n", __FUNCTION__, x, y); return; } i = widget->data.array.cols * y + x; if(widget->data.array.cells[i]) { mvpw_get_text_attr(widget->data.array.cells[i], &ta); if(hlt) { if(widget->data.array.cell_theme[i]) { ta.fg = widget->data.array.cell_theme[i]->hilite_fg; ta.bg = widget->data.array.cell_theme[i]->hilite_bg; } else { ta.fg = widget->data.array.hilite_fg; ta.bg = widget->data.array.hilite_bg; } widget->data.array.hilite_x = x; widget->data.array.hilite_y = y; } else { if(widget->data.array.cell_theme[i]) { ta.fg = widget->data.array.cell_theme[i]->cell_fg; ta.bg = widget->data.array.cell_theme[i]->cell_bg; } else { ta.fg = widget->data.array.cell_fg; ta.bg = widget->data.array.cell_bg; } } mvpw_set_text_attr(widget->data.array.cells[i], &ta); mvpw_set_bg(widget->data.array.cells[i], ta.bg); /*mvpw_expose(widget->data.array.cells[i]);*/ } }