Example #1
0
void engine_volume_up ( int ammount )
{
	if ( ammount >= 0 && ammount <= 100 )
	{
		volume += ammount;
		if ( volume > 100 )
		{
			volume = 100;
		}
		engine_volume ( volume );
	}
}
Example #2
0
void engine_volume_down ( int ammount )
{
	if ( ammount >= 0 && ammount <= 100 )
	{
		volume -= ammount;
		if ( volume < 0 )
		{
			volume = 0;
		}
		engine_volume ( volume );
	}
}
Example #3
0
gboolean
handle_set_property (GDBusConnection * connection,
    const gchar * sender,
    const gchar * object_path,
    const gchar * interface_name,
    const gchar * property_name,
    GVariant * value, GError ** error, gpointer user_data)
{
  SnappyMP *myobj = user_data;

  if (g_strcmp0 (property_name, "Name") == 0) {
    if (value != NULL)
      myobj->name = g_strdup (g_variant_get_string (value, NULL));

  } else if (g_strcmp0 (property_name, "Volume") == 0) {
    gdouble level;

    level = g_variant_get_double (value);
    engine_volume (myobj->engine, level);
  }

  return TRUE;
}