Example #1
0
static void
dmi_toggle_cb(GtkCheckMenuItem *menuitem, gpointer aux)
{
  dyn_menu_item_t *dmi = aux;
  int set = gtk_check_menu_item_get_active(menuitem);
  prop_set_int_ex(prop_create(dmi->dmi_prop, "value"),
		  dmi->dmi_value_sub, set);
}
Example #2
0
static void
mip_set(metadb_item_prop_t *mip, const metadb_item_info_t *mii)
{
  prop_set_int_ex(mip->mip_playcount, mip->mip_playcount_sub,
		  mii->mii_playcount);
  prop_set_int(mip->mip_lastplayed, mii->mii_lastplayed);
  prop_set_float(mip->mip_restartpos, mii->mii_restartpos / 1000.0);
}
Example #3
0
static void
decrease_sleeptimer(callout_t *c, void *aux)
{
  if(!sleeptimer_enabled)
    return;

  sleeptime--;

  if(sleeptime < 0) {
    TRACE(TRACE_INFO, "runcontrol", "Automatic standby by sleep timer");
    app_shutdown(APP_EXIT_STANDBY);
    return;
  }
  prop_set_int_ex(sleeptime_prop, sleeptime_sub, sleeptime);
  callout_arm(&sleep_timer, decrease_sleeptimer, NULL, 60);

}
Example #4
0
/**
 * Sink input updated, reflect master volume and mute status into
 * showtime's properties.
 */
static void
update_sink_input_info(pa_context *c, const pa_sink_input_info *i, 
		       int eol, void *userdata)
{
  pa_audio_mode_t *pam = (pa_audio_mode_t *)userdata;
  int n;
  pa_volume_t max = PA_VOLUME_MUTED;

  if(i == NULL)
    return;

  for(n = 0; n < i->volume.channels; n++) {
    if(i->volume.values[n] > max)
      max = i->volume.values[n];
  }

  pam->mastervol = max;
  pam->muted = !!i->mute;

  prop_set_float_ex(prop_mastervol, pam->sub_mvol, 
		    pa_sw_volume_to_dB(pam->mastervol), 0);
  prop_set_int_ex(prop_mastermute, pam->sub_mute, pam->muted);
}