示例#1
0
static void
update_value_delta(glw_slider_t *s, float d)
{
  if(s->p != NULL)
    prop_add_float(s->p, d * (s->max - s->min));
  else {
    s->value = GLW_MAX(s->min, GLW_MIN(s->max, s->value + d));
    if(s->bound_widget != NULL) {
      glw_scroll_t gs;
      gs.value = s->value;
      glw_signal0(s->bound_widget, GLW_SIGNAL_SCROLL, &gs);
    }
  }
}
示例#2
0
static void
update_value_delta(glw_slider_t *s, float d)
{
  if(s->p != NULL) {
    s->interpolate = 2;
    prop_add_float(s->p, d * (s->max - s->min));
  } else {
    s->value = GLW_MAX(s->min, GLW_MIN(s->max, s->value + d));
    s->interpolate = 1;
    if(s->bound_widget != NULL) {
      glw_scroll_t gs;
      gs.value = s->value;
      glw_signal0(s->bound_widget, GLW_SIGNAL_SCROLL, &gs);
    }
    glw_need_refresh(s->w.glw_root, 0);
  }
}
示例#3
0
void
event_dispatch(event_t *e)
{
  prop_t *p;
  event_int_t *eu = (event_int_t *)e;

  if(event_is_type(e, EVENT_UNICODE) && eu->val == 32) {
    // Convert [space] into playpause
    event_release(e);
    e = event_create_action(ACTION_PLAYPAUSE);
  }

  event_to_prop(prop_get_by_name(PNVEC("global", "eventsink"),
				 1, NULL), e);
  
  if(event_is_action(e, ACTION_QUIT)) {
    showtime_shutdown(0);

  } else if(event_is_action(e, ACTION_STANDBY)) {
    showtime_shutdown(10);

  } else if(event_is_action(e, ACTION_POWER_OFF)) {
    showtime_shutdown(11);

  } else if(event_is_action(e, ACTION_NAV_BACK) ||
	    event_is_action(e, ACTION_NAV_FWD) ||
	    event_is_action(e, ACTION_HOME) ||
	    event_is_action(e, ACTION_RELOAD_DATA) ||
	    event_is_type(e, EVENT_OPENURL)) {

    event_to_prop(prop_get_by_name(PNVEC("global", "nav", "eventsink"),
				   1, NULL), e);

  } else if(event_is_action(e, ACTION_VOLUME_UP) ||
	    event_is_action(e, ACTION_VOLUME_DOWN)) {

    p = prop_get_by_name(PNVEC("global", "audio", "mastervolume"), 1, NULL);
    prop_add_float(p, event_is_action(e, ACTION_VOLUME_DOWN) ? -1 : 1);
    prop_ref_dec(p);
    
  } else if(event_is_action(e, ACTION_VOLUME_MUTE_TOGGLE)) {

    p = prop_get_by_name(PNVEC("global", "audio", "mastermute"), 1, NULL);
    prop_toggle_int(p);
    prop_ref_dec(p);

  } else if(event_is_action(e, ACTION_SEEK_FAST_BACKWARD) ||
	    event_is_action(e, ACTION_SEEK_BACKWARD) ||
	    event_is_action(e, ACTION_SEEK_FAST_FORWARD) ||
	    event_is_action(e, ACTION_SEEK_FORWARD) ||
	    event_is_action(e, ACTION_PLAYPAUSE) ||
	    event_is_action(e, ACTION_PLAY) ||
	    event_is_action(e, ACTION_PAUSE) ||
	    event_is_action(e, ACTION_STOP) ||
	    event_is_action(e, ACTION_EJECT) ||
	    event_is_action(e, ACTION_PREV_TRACK) ||
	    event_is_action(e, ACTION_NEXT_TRACK) ||
	    event_is_action(e, ACTION_SHOW_MEDIA_STATS) ||
	    event_is_action(e, ACTION_SHUFFLE) ||
	    event_is_action(e, ACTION_REPEAT) ||
	    event_is_action(e, ACTION_NEXT_CHANNEL) ||
	    event_is_action(e, ACTION_PREV_CHANNEL) ||
	    event_is_action(e, ACTION_CYCLE_AUDIO) ||
	    event_is_action(e, ACTION_CYCLE_SUBTITLE) ||
	    event_is_type(e, EVENT_SELECT_AUDIO_TRACK) || 
	    event_is_type(e, EVENT_SELECT_SUBTITLE_TRACK)
	    ) {

    event_to_prop(prop_get_by_name(PNVEC("global", "media", "eventsink"),
				   1, NULL), e);
  } else if(event_is_type(e, EVENT_PLAYTRACK)) {
    event_to_prop(prop_get_by_name(PNVEC("global", "playqueue", "eventsink"),
				   1, NULL), e);

  }

  event_release(e);
}