AgsConversion

AgsConversion — abstract conversion

Functions

Properties

gchar * description Read / Write
gchar * name Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsConversion
        ╰── AgsFunction

Includes

#include <ags/lib/ags_conversion.h>

Description

AgsConversion does a zero conversion it returns during ::convert() the very same value.

Functions

ags_conversion_convert ()

gdouble
ags_conversion_convert (AgsConversion *conversion,
                        gdouble value,
                        gboolean reverse);

Convert a value if reverse is FALSE then use the target format otherwise if TRUE convert back to original format.

Parameters

conversion

the AgsConversion

 

value

the value to convert

 

reverse

the direction to convert

 

Returns

the converted value as gdouble

Since: 1.0.0


ags_conversion_new ()

AgsConversion *
ags_conversion_new ();

Instantiate a new AgsConversion.

Returns

the new instance

Since: 1.0.0


AGS_CONVERSION()

#define AGS_CONVERSION(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_CONVERSION, AgsConversion))

AGS_CONVERSION_CLASS()

#define AGS_CONVERSION_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_CONVERSION, AgsConversionClass))

AGS_CONVERSION_GET_CLASS()

#define AGS_CONVERSION_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS (obj, AGS_TYPE_CONVERSION, AgsConversionClass))

AGS_IS_CONVERSION()

#define AGS_IS_CONVERSION(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_CONVERSION))

ags_conversion_get_type ()

GType
ags_conversion_get_type (void);

Types and Values

AGS_TYPE_CONVERSION

#define AGS_TYPE_CONVERSION                (ags_conversion_get_type())

struct AgsConversion

struct AgsConversion;

struct AgsConversionClass

struct AgsConversionClass {
  GObjectClass gobject;

  gdouble (*convert)(AgsConversion *conversion,
		     gdouble value,
		     gboolean reverse);
};

Property Details

The “description” property

  “description”              gchar *

The description of the conversion.

Flags: Read / Write

Default value: NULL

Since: 1.0.0


The “name” property

  “name”                     gchar *

The name of the conversion.

Flags: Read / Write

Default value: NULL

Since: 1.0.0

Signal Details

The “convert” signal

gdouble
user_function (AgsConversion *conversion,
               gdouble        value,
               gboolean       reverse,
               gpointer       user_data)

The ::convert signal notifies about converted value.

Parameters

conversion

the AgsConversion to modify

 

value

the value to convert

 

reverse

the direction to translate

 

user_data

user data set when the signal handler was connected.

 

Returns

the converted value

Flags: Run Last

Since: 1.0.0