Ejemplo n.º 1
0
static GParamSpec *
mark_child_property (GParamSpec *pspec)
{
  if (pspec)
    g_param_spec_set_qdata (pspec, g_quark_from_string ("is-child-prop"), GINT_TO_POINTER (TRUE));
  return pspec;
}
Ejemplo n.º 2
0
static void
gstbt_wave_replay_class_init (GstBtWaveReplayClass * klass)
{
  GObjectClass *gobject_class = (GObjectClass *) klass;
  GstElementClass *element_class = (GstElementClass *) klass;
  GstBtAudioSynthClass *audio_synth_class = (GstBtAudioSynthClass *) klass;
  GParamSpec *pspec;

  audio_synth_class->process = gstbt_wave_replay_process;
  audio_synth_class->setup = gstbt_wave_replay_setup;

  gobject_class->set_property = gstbt_wave_replay_set_property;
  gobject_class->get_property = gstbt_wave_replay_get_property;
  gobject_class->dispose = gstbt_wave_replay_dispose;

  // describe us
  gst_element_class_set_static_metadata (element_class,
      "Wave Replay",
      "Source/Audio",
      "Wavetable player", "Stefan Sauer <*****@*****.**>");
  gst_element_class_add_metadata (element_class, GST_ELEMENT_METADATA_DOC_URI,
      "file://" DATADIR "" G_DIR_SEPARATOR_S "gtk-doc" G_DIR_SEPARATOR_S "html"
      G_DIR_SEPARATOR_S "" PACKAGE "" G_DIR_SEPARATOR_S "GstBtWaveReplay.html");

  // register own properties
  g_object_class_install_property (gobject_class, PROP_WAVE_CALLBACKS,
      g_param_spec_pointer ("wave-callbacks", "Wavetable Callbacks",
          "The wave-table access callbacks",
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  pspec = g_param_spec_uint ("wave", "Wave", "Wave index", 1, 200, 1,
      G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS);
  g_param_spec_set_qdata (pspec, gstbt_property_meta_quark,
      GUINT_TO_POINTER (1));
  g_param_spec_set_qdata (pspec, gstbt_property_meta_quark_flags,
      GUINT_TO_POINTER (GSTBT_PROPERTY_META_WAVE));
  g_object_class_install_property (gobject_class, PROP_WAVE, pspec);

  g_object_class_install_property (gobject_class, PROP_WAVE_LEVEL,
      g_param_spec_uint ("wave-level", "Wavelevel", "Wave level index",
          0, 100, 0,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
}
Ejemplo n.º 3
0
static void
pspec_free(pspec_holder *holder)
{
    if (holder->instance) {
        rbgobj_instance_call_cinfo_free(holder->instance);
        g_param_spec_set_qdata(holder->instance, qparamspec, NULL);
        g_param_spec_unref(holder->instance);
    }
    free(holder);
}
Ejemplo n.º 4
0
/**
 * gom_resource_class_set_property_transform: (skip)
 */
void
gom_resource_class_set_property_transform (GomResourceClass         *resource_class,
                                           const gchar              *property_name,
                                           GomResourceToBytesFunc    to_bytes_func,
                                           GomResourceFromBytesFunc  from_bytes_func)
{
   GParamSpec *pspec;

   g_return_if_fail(GOM_IS_RESOURCE_CLASS(resource_class));
   g_return_if_fail(property_name != NULL);
   g_return_if_fail(to_bytes_func != NULL);
   g_return_if_fail(from_bytes_func != NULL);

   pspec = g_object_class_find_property(G_OBJECT_CLASS(resource_class), property_name);
   g_assert(pspec);

   g_param_spec_set_qdata(pspec, GOM_RESOURCE_TO_BYTES_FUNC, to_bytes_func);
   g_param_spec_set_qdata(pspec, GOM_RESOURCE_FROM_BYTES_FUNC, from_bytes_func);
}
Ejemplo n.º 5
0
/**
 * uca_camera_pspec_set_writable: (skip)
 * @pspec: A #GParamSpec
 * @writable: %TRUE if property can be written during acquisition
 *
 * Sets a flag that defines if the property defined by @pspec can be written
 * during an acquisition. This can be used during UcaCamera class
 * initialization.
 *
 * Since: 2.1
 */
void
uca_camera_pspec_set_writable (GParamSpec *pspec,
                               gboolean writable)
{
    if (pspec != NULL) {
        if (g_param_spec_get_qdata (pspec, UCA_WRITABLE_QUARK) != NULL)
            g_warning ("::%s is already fixed", pspec->name);
        else
            g_param_spec_set_qdata (pspec, UCA_WRITABLE_QUARK, GINT_TO_POINTER (writable));
    }
}
Ejemplo n.º 6
0
static void
uca_camera_set_property_unit (GParamSpec *pspec, UcaUnit unit)
{
    UcaUnit old_unit;

    old_unit = (UcaUnit) GPOINTER_TO_INT (g_param_spec_get_qdata (pspec, UCA_UNIT_QUARK));

    if (old_unit != unit && old_unit != UCA_UNIT_NA)
        g_warning ("::%s already has a different unit", pspec->name);
    else
        g_param_spec_set_qdata (pspec, UCA_UNIT_QUARK, GINT_TO_POINTER (unit));
}
Ejemplo n.º 7
0
void
rbgobj_param_spec_initialize(VALUE self, GParamSpec *pspec)
{
    pspec_holder* holder;
    Data_Get_Struct(self, pspec_holder, holder);

    pspec = g_param_spec_ref(pspec);
    g_param_spec_sink(pspec);

    holder->instance = pspec;
    holder->cinfo    = GTYPE2CINFO(G_PARAM_SPEC_TYPE(pspec));
    g_param_spec_set_qdata(pspec, qparamspec, (gpointer)self);
}
Ejemplo n.º 8
0
void
gom_resource_class_set_property_set_mapped (GomResourceClass *resource_class,
                                            const gchar      *property_name,
                                            gboolean          is_mapped)
{
   GParamSpec *pspec;

   g_return_if_fail(GOM_IS_RESOURCE_CLASS(resource_class));
   g_return_if_fail(property_name != NULL);

   pspec = g_object_class_find_property(G_OBJECT_CLASS(resource_class), property_name);
   g_assert(pspec);

   g_param_spec_set_qdata(pspec, GOM_RESOURCE_NOT_MAPPED, GINT_TO_POINTER(!is_mapped));
}
Ejemplo n.º 9
0
static void
uca_camera_finalize (GObject *object)
{
    GParamSpec **props;
    guint n_props;

    /* We will reset property units of all subclassed objects  */
    props = g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &n_props);

    for (guint i = 0; i < n_props; i++) {
        g_param_spec_set_qdata (props[i], UCA_UNIT_QUARK, NULL);
    }

    g_free (props);

    G_OBJECT_CLASS (uca_camera_parent_class)->finalize (object);
}
Ejemplo n.º 10
0
void
gom_resource_class_set_property_new_in_version (GomResourceClass *resource_class,
                                                const gchar      *property_name,
                                                guint             version)
{
   GParamSpec *pspec;

   g_return_if_fail(GOM_IS_RESOURCE_CLASS(resource_class));
   g_return_if_fail(property_name != NULL);
   g_return_if_fail(version >= 1);

   pspec = g_object_class_find_property(G_OBJECT_CLASS(resource_class), property_name);
   g_assert(pspec);

   /* See is_new_in_version() in gom-repository.c for the reasoning
    * behind the "- 1" */
   g_param_spec_set_qdata(pspec, GOM_RESOURCE_NEW_IN_VERSION, GINT_TO_POINTER(version - 1));
}
Ejemplo n.º 11
0
// FIXME: use rb_protect
static void
set_prop_func(GObject* object,
              guint property_id,
              const GValue* value,
              GParamSpec* pspec)
{
    ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter);
    if (!ruby_setter) {
        gchar* name = g_strconcat(g_param_spec_get_name(pspec), "=", NULL);
        gchar* p;
        for (p = name; *p; p++) {
          if (*p == '-')
            *p = '_';
        }
        ruby_setter = rb_intern(name);
        g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter);
        g_free(name);
    }

    rb_funcall(GOBJ2RVAL(object), ruby_setter, 1, GVAL2RVAL(value));
}
Ejemplo n.º 12
0
// FIXME: use rb_protect
static void
get_prop_func(GObject* object,
              guint property_id,
              GValue* value,
              GParamSpec* pspec)
{
    ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter);
    if (!ruby_getter) {
        gchar* name = g_strdup(g_param_spec_get_name(pspec));
        gchar* p;
        for (p = name; *p; p++) {
          if (*p == '-')
            *p = '_';
        }
        ruby_getter = rb_intern(name);
        g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter);
        g_free(name);
    }

    {
        VALUE ret = rb_funcall(GOBJ2RVAL(object), ruby_getter, 0);
        rbgobj_rvalue_to_gvalue(ret, value);
    }
}
Ejemplo n.º 13
0
static void
gst_fameenc_class_init (GstFameEncClass * klass)
{
  GObjectClass *gobject_class = NULL;
  GstElementClass *gstelement_class = NULL;
  fame_context_t *context;
  fame_list_t *walk;
  GList *props = NULL, *props_walk;
  gint current_prop = ARG_FAME_PROPS_START;

  gobject_class = (GObjectClass *) klass;
  gstelement_class = (GstElementClass *) klass;

  parent_class = g_type_class_peek_parent (klass);

  gobject_class->set_property = gst_fameenc_set_property;
  gobject_class->get_property = gst_fameenc_get_property;
  gobject_class->finalize = gst_fameenc_finalize;

  fame_object_name = g_quark_from_string ("GstFameObjectName");

  context = fame_open ();
  g_assert (context);

  /* first sort the list */
  walk = context->type_list;
  while (walk) {
    props =
        g_list_insert_sorted (props, walk,
        (GCompareFunc) gst_fameenc_item_compare);
    walk = walk->next;
  }

  props_walk = props;
  while (props_walk) {
    GArray *array;
    const gchar *current_type;
    gint current_len;
    gint current_value;
    fame_object_t *current_default;
    gint default_index;

    walk = (fame_list_t *) props_walk->data;
    array = g_array_new (TRUE, FALSE, sizeof (GEnumValue));

    current_type = walk->type;
    current_value = 0;
    current_len = strlen (walk->type);
    current_default = fame_get_object (context, current_type);
    default_index = 1;

    do {
      if (strstr (walk->type, "/")) {
        GEnumValue value;

        if (current_default == walk->item)
          default_index = current_value;

        value.value = current_value++;
        value.value_name = g_strdup (walk->type);
        value.value_nick = g_strdup (walk->item->name);

        g_array_append_val (array, value);
      }

      props_walk = g_list_next (props_walk);
      if (props_walk)
        walk = (fame_list_t *) props_walk->data;

    } while (props_walk && !strncmp (walk->type, current_type, current_len));

    if (array->len > 0) {
      GType type;
      GParamSpec *pspec;

      type =
          g_enum_register_static (g_strdup_printf ("GstFameEnc_%s",
              current_type), (GEnumValue *) array->data);

      pspec =
          g_param_spec_enum (current_type, current_type,
          g_strdup_printf ("The FAME \"%s\" object", current_type), type,
          default_index, G_PARAM_READWRITE);

      g_param_spec_set_qdata (pspec, fame_object_name, (gpointer) current_type);

      g_object_class_install_property (G_OBJECT_CLASS (klass), current_prop++,
          pspec);
    }
  }

  g_object_class_install_property (gobject_class, ARG_BITRATE,
      g_param_spec_int ("bitrate", "Bitrate", "Target bitrate (0 = VBR)",
          0, 5000000, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, ARG_QUALITY,
      g_param_spec_int ("quality", "Quality",
          "Percentage of quality of compression (versus size)", 0, 100, 75,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, ARG_PATTERN,
      g_param_spec_string ("pattern", "Pattern",
          "Encoding pattern of I, P, and B frames", "IPPPPPPPPPPP",
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, ARG_FRAMES_PER_SEQUENCE,
      g_param_spec_int ("frames-per-sequence", "Frames Per Sequence",
          "The number of frames in one sequence", 1, G_MAXINT, 12,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, ARG_FAME_VERBOSE,
      g_param_spec_boolean ("fame-verbose", "Fame Verbose",
          "Make FAME produce verbose output", FALSE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, ARG_BUFFER_SIZE,
      g_param_spec_int ("buffer-size", "Buffer Size",
          "Set the decoding output buffer size", 0, 1024 * 1024,
          FAMEENC_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
Ejemplo n.º 14
0
GParamSpec *
gimp_param_spec_duplicate (GParamSpec *pspec)
{
  GParamSpec  *copy = NULL;
  GParamFlags  flags;

  g_return_val_if_fail (pspec != NULL, NULL);

  flags = pspec->flags | GIMP_CONFIG_PARAM_SERIALIZE;

  if (G_IS_PARAM_SPEC_STRING (pspec))
    {
      GParamSpecString *spec = G_PARAM_SPEC_STRING (pspec);

      if (GEGL_IS_PARAM_SPEC_FILE_PATH (pspec))
        {
          copy = gimp_param_spec_config_path (pspec->name,
                                              g_param_spec_get_nick (pspec),
                                              g_param_spec_get_blurb (pspec),
                                              GIMP_CONFIG_PATH_FILE,
                                              spec->default_value,
                                              flags);
        }
      else
        {
          static GQuark multiline_quark = 0;

          if (! multiline_quark)
            multiline_quark = g_quark_from_static_string ("multiline");

          copy = g_param_spec_string (pspec->name,
                                      g_param_spec_get_nick (pspec),
                                      g_param_spec_get_blurb (pspec),
                                      spec->default_value,
                                      flags);

          if (GEGL_IS_PARAM_SPEC_MULTILINE (pspec))
            {
              g_param_spec_set_qdata (copy, multiline_quark,
                                      GINT_TO_POINTER (TRUE));
            }
        }
    }
  else if (G_IS_PARAM_SPEC_BOOLEAN (pspec))
    {
      GParamSpecBoolean *spec = G_PARAM_SPEC_BOOLEAN (pspec);

      copy = g_param_spec_boolean (pspec->name,
                                   g_param_spec_get_nick (pspec),
                                   g_param_spec_get_blurb (pspec),
                                   spec->default_value,
                                   flags);
    }
  else if (G_IS_PARAM_SPEC_ENUM (pspec))
    {
      GParamSpecEnum *spec = G_PARAM_SPEC_ENUM (pspec);

      copy = g_param_spec_enum (pspec->name,
                                g_param_spec_get_nick (pspec),
                                g_param_spec_get_blurb (pspec),
                                G_TYPE_FROM_CLASS (spec->enum_class),
                                spec->default_value,
                                flags);
    }
  else if (GEGL_IS_PARAM_SPEC_DOUBLE (pspec))
    {
      GeglParamSpecDouble *gspec = GEGL_PARAM_SPEC_DOUBLE (pspec);
      GParamSpecDouble    *spec = G_PARAM_SPEC_DOUBLE (pspec);

      copy = gegl_param_spec_double (pspec->name,
                                     g_param_spec_get_nick (pspec),
                                     g_param_spec_get_blurb (pspec),
                                     spec->minimum,
                                     spec->maximum,
                                     spec->default_value,
                                     gspec->ui_minimum,
                                     gspec->ui_maximum,
                                     gspec->ui_gamma,
                                     flags);
    }
  else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
    {
      GParamSpecDouble *spec = G_PARAM_SPEC_DOUBLE (pspec);

      copy = g_param_spec_double (pspec->name,
                                  g_param_spec_get_nick (pspec),
                                  g_param_spec_get_blurb (pspec),
                                  spec->minimum,
                                  spec->maximum,
                                  spec->default_value,
                                  flags);
    }
  else if (G_IS_PARAM_SPEC_FLOAT (pspec))
    {
      GParamSpecFloat *spec = G_PARAM_SPEC_FLOAT (pspec);

      copy = g_param_spec_float (pspec->name,
                                 g_param_spec_get_nick (pspec),
                                 g_param_spec_get_blurb (pspec),
                                 spec->minimum,
                                 spec->maximum,
                                 spec->default_value,
                                 flags);
    }
  else if (GEGL_IS_PARAM_SPEC_INT (pspec))
    {
      GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (pspec);
      GParamSpecInt    *spec  = G_PARAM_SPEC_INT (pspec);

      copy = gegl_param_spec_int (pspec->name,
                                  g_param_spec_get_nick (pspec),
                                  g_param_spec_get_blurb (pspec),
                                  spec->minimum,
                                  spec->maximum,
                                  spec->default_value,
                                  gspec->ui_minimum,
                                  gspec->ui_maximum,
                                  gspec->ui_gamma,
                                  flags);
    }
  else if (GEGL_IS_PARAM_SPEC_SEED (pspec))
    {
      copy = gegl_param_spec_seed (pspec->name,
                                   g_param_spec_get_nick (pspec),
                                   g_param_spec_get_blurb (pspec),
                                   pspec->flags |
                                   GIMP_CONFIG_PARAM_SERIALIZE);
    }
  else if (G_IS_PARAM_SPEC_INT (pspec))
    {
      GParamSpecInt *spec = G_PARAM_SPEC_INT (pspec);

      copy = g_param_spec_int (pspec->name,
                               g_param_spec_get_nick (pspec),
                               g_param_spec_get_blurb (pspec),
                               spec->minimum,
                               spec->maximum,
                               spec->default_value,
                               flags);
    }
  else if (G_IS_PARAM_SPEC_UINT (pspec))
    {
      GParamSpecUInt *spec = G_PARAM_SPEC_UINT (pspec);

      copy = g_param_spec_uint (pspec->name,
                                g_param_spec_get_nick (pspec),
                                g_param_spec_get_blurb (pspec),
                                spec->minimum,
                                spec->maximum,
                                spec->default_value,
                                flags);
    }
  else if (GIMP_IS_PARAM_SPEC_RGB (pspec))
    {
      GValue  value = G_VALUE_INIT;
      GimpRGB color;

      g_value_init (&value, GIMP_TYPE_RGB);
      g_param_value_set_default (pspec, &value);
      gimp_value_get_rgb (&value, &color);
      g_value_unset (&value);

      copy = gimp_param_spec_rgb (pspec->name,
                                  g_param_spec_get_nick (pspec),
                                  g_param_spec_get_blurb (pspec),
                                  gimp_param_spec_rgb_has_alpha (pspec),
                                  &color,
                                  flags);
    }
  else if (GEGL_IS_PARAM_SPEC_COLOR (pspec))
    {
      GeglColor *gegl_color;
      GimpRGB    gimp_color;
      gdouble    r = 0.0;
      gdouble    g = 0.0;
      gdouble    b = 0.0;
      gdouble    a = 1.0;
      GValue     value = { 0, };

      g_value_init (&value, GEGL_TYPE_COLOR);
      g_param_value_set_default (pspec, &value);

      gegl_color = g_value_get_object (&value);
      if (gegl_color)
        gegl_color_get_rgba (gegl_color, &r, &g, &b, &a);

      gimp_rgba_set (&gimp_color, r, g, b, a);

      g_value_unset (&value);

      copy = gimp_param_spec_rgb (pspec->name,
                                  g_param_spec_get_nick (pspec),
                                  g_param_spec_get_blurb (pspec),
                                  TRUE,
                                  &gimp_color,
                                  flags);
    }
  else if (G_IS_PARAM_SPEC_OBJECT (pspec) ||
           G_IS_PARAM_SPEC_POINTER (pspec))
    {
      /*  silently ignore object properties  */
    }
  else
    {
      g_warning ("%s: not supported: %s (%s)\n", G_STRFUNC,
                 g_type_name (G_TYPE_FROM_INSTANCE (pspec)), pspec->name);
    }

  if (copy)
    {
      GQuark      quark = g_quark_from_static_string ("gegl-property-keys");
      GHashTable *keys  = g_param_spec_get_qdata (pspec, quark);

      if (keys)
        g_param_spec_set_qdata (copy, quark, g_hash_table_ref (keys));
    }

  return copy;
}
Ejemplo n.º 15
0
static void
gstbt_wave_tab_syn_class_init (GstBtWaveTabSynClass * klass)
{
  GObjectClass *gobject_class = (GObjectClass *) klass;
  GstElementClass *element_class = (GstElementClass *) klass;
  GstBtAudioSynthClass *audio_synth_class = (GstBtAudioSynthClass *) klass;
  GParamSpec *pspec;

  audio_synth_class->process = gstbt_wave_tab_syn_process;
  audio_synth_class->setup = gstbt_wave_tab_syn_setup;

  gobject_class->set_property = gstbt_wave_tab_syn_set_property;
  gobject_class->get_property = gstbt_wave_tab_syn_get_property;
  gobject_class->dispose = gstbt_wave_tab_syn_dispose;

  // describe us
  gst_element_class_set_static_metadata (element_class,
      "WaveTabSyn",
      "Source/Audio",
      "Wavetable synthesizer", "Stefan Sauer <*****@*****.**>");
  gst_element_class_add_metadata (element_class, GST_ELEMENT_METADATA_DOC_URI,
      "file://" DATADIR "" G_DIR_SEPARATOR_S "gtk-doc" G_DIR_SEPARATOR_S "html"
      G_DIR_SEPARATOR_S "" PACKAGE "" G_DIR_SEPARATOR_S "GstBtWaveTabSyn.html");

  // register own properties
  g_object_class_install_property (gobject_class, PROP_WAVE_CALLBACKS,
      g_param_spec_pointer ("wave-callbacks", "Wavetable Callbacks",
          "The wave-table access callbacks",
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_TUNING,
      g_param_spec_enum ("tuning", "Tuning", "Harmonic tuning",
          GSTBT_TYPE_TONE_CONVERSION_TUNING,
          GSTBT_TONE_CONVERSION_EQUAL_TEMPERAMENT,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_NOTE,
      g_param_spec_enum ("note", "Musical note",
          "Musical note (e.g. 'c-3', 'd#4')", GSTBT_TYPE_NOTE, GSTBT_NOTE_NONE,
          G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_NOTE_LENGTH,
      g_param_spec_uint ("length", "Note length", "Note length in ticks",
          1, 255, 1,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  pspec = g_param_spec_uint ("wave", "Wave", "Wave index", 1, 200, 1,
      G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS);
  g_param_spec_set_qdata (pspec, gstbt_property_meta_quark,
      GUINT_TO_POINTER (1));
  g_param_spec_set_qdata (pspec, gstbt_property_meta_quark_flags,
      GUINT_TO_POINTER (GSTBT_PROPERTY_META_WAVE));
  g_object_class_install_property (gobject_class, PROP_WAVE, pspec);

  g_object_class_install_property (gobject_class, PROP_OFFSET,
      g_param_spec_uint ("offset", "Offset", "Wave table offset", 0, 0xFFFF, 0,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_ATTACK,
      g_param_spec_double ("attack", "Attack",
          "Volume attack of the tone in seconds", 0.001, 4.0, 0.1,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_PEAK_VOLUME,
      g_param_spec_double ("peak-volume", "Peak Volume", "Peak volume of tone",
          0.0, 1.0, 0.8,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_DECAY,
      g_param_spec_double ("decay", "Decay",
          "Volume decay of the tone in seconds", 0.001, 4.0, 0.5,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_SUSTAIN_VOLUME,
      g_param_spec_double ("sustain-volume", "Sustain Volume",
          "Sustain volume of tone", 0.0, 1.0, 0.4,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_RELEASE,
      g_param_spec_double ("release", "RELEASE",
          "Volume release of the tone in seconds", 0.001, 4.0, 0.5,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
}
Ejemplo n.º 16
0
static void
histogram_imager_init_render_params (GObjectClass *object_class)
{
    GParamSpec *spec;
    const gchar *current_group = "Rendering";

    spec = g_param_spec_double       ("exposure",
				      "Exposure",
				      "The relative strength, darkness, or brightness of the image",
				      0, 100, 0.05,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      G_PARAM_LAX_VALIDATION | PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    param_spec_set_increments        (spec, 0.001, 0.01, 3);
    g_object_class_install_property  (object_class, PROP_EXPOSURE, spec);

    spec = g_param_spec_double       ("gamma",
				      "Gamma",
				      "A gamma correction applied while rendering the image",
				      0, 10, 1,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      G_PARAM_LAX_VALIDATION | PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    param_spec_set_increments        (spec, 0.01, 0.1, 3);
    g_object_class_install_property  (object_class, PROP_GAMMA, spec);

    spec = g_param_spec_double       ("oversample_gamma",
				      "Oversampling gamma",
				      "Gamma correction used when downconverting oversampled histograms",
				      0, 10, 1.66,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      G_PARAM_LAX_VALIDATION | PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    param_spec_set_increments        (spec, 0.01, 0.1, 3);
    param_spec_set_dependency        (spec, "oversample-enabled");
    g_object_class_install_property  (object_class, PROP_OVERSAMPLE_GAMMA, spec);

    spec = g_param_spec_string       ("fgcolor",
				      "Foreground",
				      "The foreground color, as a color name or #RRGGBB hex triple",
				      "#000000",
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED);
    g_object_class_install_property  (object_class, PROP_FGCOLOR, spec);

    spec = g_param_spec_string       ("bgcolor",
				      "Background",
				      "The background color, as a color name or #RRGGBB hex triple",
				      "#FFFFFF",
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED);
    g_object_class_install_property  (object_class, PROP_BGCOLOR, spec);

    spec = g_param_spec_boxed        ("fgcolor_gdk",
				      "Foreground",
				      "The foreground color, as a GdkColor",
				      GDK_TYPE_COLOR,
				      G_PARAM_READWRITE | PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    g_param_spec_set_qdata           (spec, g_quark_from_static_string("opacity-property"), "fgalpha");
    g_object_class_install_property  (object_class, PROP_FGCOLOR_GDK, spec);

    spec = g_param_spec_boxed        ("bgcolor_gdk",
				      "Background",
				      "The background color, as a GdkColor",
				      GDK_TYPE_COLOR,
				      G_PARAM_READWRITE | PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    g_param_spec_set_qdata           (spec, g_quark_from_static_string("opacity-property"), "bgalpha");
    g_object_class_install_property  (object_class, PROP_BGCOLOR_GDK, spec);

    spec = g_param_spec_uint         ("fgalpha",
				      "Foreground alpha",
				      "The foreground color's opacity",
				      0, 65535, 65535,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      PARAM_INTERPOLATE);
    g_object_class_install_property  (object_class, PROP_FGALPHA, spec);

    spec = g_param_spec_uint         ("bgalpha",
				      "Background alpha",
				      "The background color's opacity",
				      0, 65535, 65535,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      PARAM_INTERPOLATE);
    g_object_class_install_property  (object_class, PROP_BGALPHA, spec);

    spec = g_param_spec_boolean      ("clamped",
				      "Clamped",
				      "When set, luminances are clamped to [0,1] before linear interpolation",
				      FALSE,
				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | PARAM_SERIALIZED |
				      PARAM_INTERPOLATE | PARAM_IN_GUI);
    param_spec_set_group             (spec, current_group);
    g_object_class_install_property  (object_class, PROP_CLAMPED, spec);
}