예제 #1
0
WhsExtractor *
whs_extractor_new (guint sample_rate, guint frame_length, guint min_freq, guint max_freq)
{
  g_return_val_if_fail (frame_length > 0, NULL);
  g_return_val_if_fail (sample_rate > 0, NULL);

  WhsExtractor *self = WHS_EXTRACTOR_CAST (g_type_create_instance (WHS_TYPE_EXTRACTOR));
  self->sample_rate = sample_rate;
  self->frame_length = frame_length;
  self->min_freq = min_freq;
  self->max_freq = max_freq;

  self->priv->fft.freqdata = g_new0 (gdouble, frame_length);
  self->priv->fft.ip = g_new0 (gint, 3 + sqrt (frame_length / 2));
  self->priv->fft.w = g_new0 (gdouble, frame_length / 2 + 1);

  self->priv->dct.freqdata = NULL;
  self->priv->dct.ip = g_new0 (gint, 3 + sqrt (32 / 2));
  self->priv->dct.w = g_new0 (gdouble, 1 + (32 * 5 + 3) / 4); // dct on 32 bins

  self->priv->cos = g_new (gdouble, frame_length);
  
  for (gint i = 0; i < self->frame_length; i++)
    self->priv->cos[i] = 0.53836 - 0.46164 * cos (2.0 * M_PI * i / (self->frame_length-1));

  return self;
}
예제 #2
0
int	main()
{
	SomeObject	*testobj = NULL;

	/* This gets the type system up and running. */
	g_type_init ();

	/* Create an instance object from the system. */
	testobj = SOME_OBJECT (g_type_create_instance (some_object_get_type()));

	/* Call our methods. */
	if (testobj)
	{
		g_print ("%d\n", testobj->m_a);
		some_object_method1 (testobj, 32);

		g_print ("%s\n", testobj->m_b);
		some_object_method2 (testobj, "New string.");

		g_print ("%f\n", testobj->m_c);
		some_object_method3 (testobj, 6.9);
	}

	return	0;
}
예제 #3
0
static GnomenuSerializer* gnomenu_serializer_construct (GType object_type) {
	GnomenuSerializer* self;
	GString* _tmp0_;
	self = (GnomenuSerializer*) g_type_create_instance (object_type);
	self->priv->sb = (_tmp0_ = g_string_new (""), _g_string_free0 (self->priv->sb), _tmp0_);
	return self;
}
예제 #4
0
SystemTextRegularExpressionsCapture* system_text_regular_expressions_capture_construct (GType object_type, const gchar* text, gint i, gint l) {
	SystemTextRegularExpressionsCapture* self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
#line 21 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	g_return_val_if_fail (text != NULL, NULL);
#line 21 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	self = (SystemTextRegularExpressionsCapture*) g_type_create_instance (object_type);
#line 23 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	_tmp0_ = text;
#line 23 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 23 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	_g_free0 (self->_text);
#line 23 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	self->_text = _tmp1_;
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	_tmp2_ = i;
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	self->_index = _tmp2_;
#line 25 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	_tmp3_ = l;
#line 25 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	self->_length = _tmp3_;
#line 21 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	return self;
#line 103 "RegexCapture.c"
}
예제 #5
0
	return self ? g_object_ref (self) : NULL;
#line 86 "DictionaryEntry.c"
}


SystemCollectionsDictionaryEntry* system_collections_dictionary_entry_construct (GType object_type, GObject* key, GObject* value) {
	SystemCollectionsDictionaryEntry* self = NULL;
	GObject* _tmp0_ = NULL;
	GObject* _tmp1_ = NULL;
	GObject* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
#line 31 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	g_return_val_if_fail (key != NULL, NULL);
#line 31 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	g_return_val_if_fail (value != NULL, NULL);
#line 31 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	self = (SystemCollectionsDictionaryEntry*) g_type_create_instance (object_type);
#line 32 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_tmp0_ = key;
#line 32 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 32 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_g_object_unref0 (self->priv->_key);
#line 32 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	self->priv->_key = _tmp1_;
#line 33 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_tmp2_ = value;
#line 33 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 33 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	_g_object_unref0 (self->priv->_value);
#line 33 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
예제 #6
0
RygelResourceInfo* rygel_resource_info_construct (GType object_type, const char* upnp_id, const char* upnp_type, const char* description_path, GType type) {
#line 88 "rygel-resource-info.c"
	RygelResourceInfo* self;
	char* _tmp0_;
	char* _tmp1_;
	char* _tmp2_;
#line 39 "rygel-resource-info.vala"
	g_return_val_if_fail (upnp_id != NULL, NULL);
#line 39 "rygel-resource-info.vala"
	g_return_val_if_fail (upnp_type != NULL, NULL);
#line 39 "rygel-resource-info.vala"
	g_return_val_if_fail (description_path != NULL, NULL);
#line 99 "rygel-resource-info.c"
	self = (RygelResourceInfo*) g_type_create_instance (object_type);
#line 43 "rygel-resource-info.vala"
	self->upnp_type = (_tmp0_ = g_strdup (upnp_type), _g_free0 (self->upnp_type), _tmp0_);
#line 44 "rygel-resource-info.vala"
	self->upnp_id = (_tmp1_ = g_strdup (upnp_id), _g_free0 (self->upnp_id), _tmp1_);
#line 45 "rygel-resource-info.vala"
	self->description_path = (_tmp2_ = g_strdup (description_path), _g_free0 (self->description_path), _tmp2_);
#line 46 "rygel-resource-info.vala"
	self->type = type;
#line 109 "rygel-resource-info.c"
	return self;
}
예제 #7
0
DPAPCopy* dpap_copy_construct (GType object_type, GError** error) {
	DPAPCopy* self = NULL;
	ValaDMAPDb* _tmp0_ = NULL;
	ValaDPAPRecordFactory* _tmp1_ = NULL;
	DMAPMdnsBrowser* _tmp2_ = NULL;
	DMAPMdnsBrowser* _tmp3_ = NULL;
	DMAPMdnsBrowser* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
	self = (DPAPCopy*) g_type_create_instance (object_type);
	_tmp0_ = vala_dmap_db_new ();
	_g_object_unref0 (self->priv->db);
	self->priv->db = _tmp0_;
	_tmp1_ = vala_dpap_record_factory_new ();
	_g_object_unref0 (self->priv->factory);
	self->priv->factory = _tmp1_;
	_tmp2_ = dmap_mdns_browser_new (DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP);
	_g_object_unref0 (self->priv->browser);
	self->priv->browser = _tmp2_;
	_tmp3_ = self->priv->browser;
	g_signal_connect (_tmp3_, "service-added", (GCallback) _dpap_copy_service_added_cb_dmap_mdns_browser_service_added, self);
	_tmp4_ = self->priv->browser;
	dmap_mdns_browser_start (_tmp4_, &_inner_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_dpap_copy_unref0 (self);
		return NULL;
	}
	return self;
}
예제 #8
0
파일: Graph.c 프로젝트: couchjd/playground
soycontrollersgraphEdge* soy_controllers_graph_edge_construct (GType object_type, gfloat dist, soycontrollersgraphINode* begin, soycontrollersgraphINode* end) {
	soycontrollersgraphEdge* self = NULL;
	gfloat _tmp0_ = 0.0F;
	soycontrollersgraphINode* _tmp1_ = NULL;
	soycontrollersgraphINode* _tmp2_ = NULL;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	g_return_val_if_fail (begin != NULL, NULL);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	g_return_val_if_fail (end != NULL, NULL);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	self = (soycontrollersgraphEdge*) g_type_create_instance (object_type);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	_tmp0_ = dist;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	self->distance = _tmp0_;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	_tmp1_ = begin;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	self->begin = _tmp1_;
#line 44 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	_tmp2_ = end;
#line 44 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	self->end = _tmp2_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	return self;
#line 198 "Graph.c"
}
예제 #9
0
GnomenuMnemonicKeys* gnomenu_mnemonic_keys_construct (GType object_type, GnomenuShell* shell) {
	GnomenuMnemonicKeys* self;
	g_return_val_if_fail (shell != NULL, NULL);
	self = (GnomenuMnemonicKeys*) g_type_create_instance (object_type);
	gnomenu_mnemonic_keys_set_shell (self, shell);
	return self;
}
예제 #10
0
DPAPServe* dpap_serve_construct (GType object_type, GError** error) {
	DPAPServe* self = NULL;
	ValaDPAPRecord* _tmp0_ = NULL;
	ValaDPAPRecord* _tmp1_;
	ValaDMAPDb* _tmp2_ = NULL;
	ValaDMAPDb* _tmp3_;
	ValaDMAPContainerDb* _tmp4_ = NULL;
	ValaDMAPContainerDb* _tmp5_;
	DPAPShare* _tmp6_ = NULL;
	DPAPShare* _tmp7_;
	self = (DPAPServe*) g_type_create_instance (object_type);
	_tmp0_ = vala_dpap_record_new ();
	_tmp1_ = _tmp0_;
	_g_object_unref0 (self->priv->record);
	self->priv->record = _tmp1_;
	_tmp2_ = vala_dmap_db_new ();
	_tmp3_ = _tmp2_;
	_g_object_unref0 (self->priv->db);
	self->priv->db = _tmp3_;
	dmap_db_add ((DMAPDb*) self->priv->db, (DMAPRecord*) self->priv->record);
	_tmp4_ = vala_dmap_container_db_new ();
	_tmp5_ = _tmp4_;
	_g_object_unref0 (self->priv->container_db);
	self->priv->container_db = _tmp5_;
	_tmp6_ = dpap_share_new ("dmapserve", NULL, self->priv->db, self->priv->container_db, NULL);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (self->priv->share);
	self->priv->share = _tmp7_;
	return self;
}
예제 #11
0
/*[CCode (has_type_id = "pl_Vector3new")]*/
BulletVector_3* bullet_vector_3_construct (GType object_type) {
	BulletVector_3* self;
	float* _tmp0_;
	self = (BulletVector_3*) g_type_create_instance (object_type);
	_tmp0_ = NULL;
	self->Q = (_tmp0_ = g_new0 (float, 3), self->Q = (g_free (self->Q), NULL), self->Q_length1 = 3, _tmp0_);
	return self;
}
MixVideoConfigParamsDecVC1 *
mix_videoconfigparamsdec_vc1_new(void) {
	MixVideoConfigParamsDecVC1 *ret =
			(MixVideoConfigParamsDecVC1 *) g_type_create_instance(
					MIX_TYPE_VIDEOCONFIGPARAMSDEC_VC1);

	return ret;
}
MixVideoConfigParamsEncMPEG4 *
mix_videoconfigparamsenc_mpeg4_new (void)
{
  MixVideoConfigParamsEncMPEG4 *ret = (MixVideoConfigParamsEncMPEG4 *)
    g_type_create_instance (MIX_TYPE_VIDEOCONFIGPARAMSENC_MPEG4);

  return ret;
}
예제 #14
0
ValaIterator* vala_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	ValaIterator* self = NULL;
	self = (ValaIterator*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}
MixVideoRenderParams *
mix_videorenderparams_new(void) {
	MixVideoRenderParams *ret =
			(MixVideoRenderParams *) g_type_create_instance(
					MIX_TYPE_VIDEORENDERPARAMS);

	return ret;
}
예제 #16
0
SystemLinqError* system_linq_error_construct (GType object_type) {
	SystemLinqError* self = NULL;
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	self = (SystemLinqError*) g_type_create_instance (object_type);
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	return self;
#line 112 "Errors.c"
}
예제 #17
0
SystemLinqstrings* system_linq_strings_construct (GType object_type) {
	SystemLinqstrings* self = NULL;
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	self = (SystemLinqstrings*) g_type_create_instance (object_type);
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	return self;
#line 374 "Errors.c"
}
예제 #18
0
ValaTargetValue* vala_target_value_construct (GType object_type, ValaDataType* value_type) {
	ValaTargetValue* self = NULL;
	ValaDataType* _tmp0_;
	self = (ValaTargetValue*) g_type_create_instance (object_type);
	_tmp0_ = value_type;
	vala_target_value_set_value_type (self, _tmp0_);
	return self;
}
예제 #19
0
Patcher* patcher_construct (GType object_type) {
    Patcher* self;
    MenuBar* _tmp0_;
    Widget* _tmp1_;
    self = (Patcher*) g_type_create_instance (object_type);
    self->priv->menubar = (_tmp0_ = menu_bar_new (), _menu_bar_unref0 (self->priv->menubar), _tmp0_);
    self->priv->widget = (_tmp1_ = widget_new (), _widget_unref0 (self->priv->widget), _tmp1_);
    return self;
}
예제 #20
0
RequestHandler* request_handler_construct (GType object_type, Request* req) {
	RequestHandler* self = NULL;
	Request _tmp0_;
	g_return_val_if_fail (req != NULL, NULL);
	self = (RequestHandler*) g_type_create_instance (object_type);
	_tmp0_ = *req;
	request_handler_set_req (self, &_tmp0_);
	return self;
}
예제 #21
0
/*< private >
 * _clutter_paint_node_create:
 * @gtype: a #ClutterPaintNode type
 *
 * Creates a new #ClutterPaintNode instance using @gtype
 *
 * Return value: (transfer full): the newly created #ClutterPaintNode
 *   sub-class instance; use clutter_paint_node_unref() when done
 */
gpointer
_clutter_paint_node_create (GType gtype)
{
  g_return_val_if_fail (g_type_is_a (gtype, CLUTTER_TYPE_PAINT_NODE), NULL);

  _clutter_paint_node_init_types ();

  return (gpointer) g_type_create_instance (gtype);
}
예제 #22
0
파일: zenmoney.c 프로젝트: bigbn/gzen-money
Zenmoney* zenmoney_construct (GType object_type) {
	Zenmoney* self = NULL;
	OauthZenmoney* _tmp0_ = NULL;
	self = (Zenmoney*) g_type_create_instance (object_type);
	g_print ("New Zenmoney /n");
	_tmp0_ = oauth_zenmoney_new ();
	_oauth_zenmoney_unref0 (self->priv->ot);
	self->priv->ot = _tmp0_;
	return self;
}
예제 #23
0
파일: conn_end.c 프로젝트: felipec/libgmsn
ConnEndObject *
conn_end_object_new (ConnObject *conn)
{
    ConnEndObject *conn_end;

    conn_end = CONN_END_OBJECT (g_type_create_instance (CONN_END_OBJECT_TYPE));

    conn_end->conn = conn;

    return conn_end;
}
예제 #24
0
WhsObject *
whs_object_new (GType type)
{
  WhsObject *object;

  g_return_val_if_fail (g_type_is_a (type, WHS_TYPE_OBJECT), NULL);

  object = WHS_OBJECT (g_type_create_instance (type));

  return object;
}
예제 #25
0
RygelIconInfo* rygel_icon_info_construct (GType object_type, const char* mime_type) {
#line 90 "rygel-icon-info.c"
	RygelIconInfo* self;
	char* _tmp0_;
#line 36 "rygel-icon-info.vala"
	g_return_val_if_fail (mime_type != NULL, NULL);
#line 95 "rygel-icon-info.c"
	self = (RygelIconInfo*) g_type_create_instance (object_type);
#line 37 "rygel-icon-info.vala"
	self->mime_type = (_tmp0_ = g_strdup (mime_type), _g_free0 (self->mime_type), _tmp0_);
#line 99 "rygel-icon-info.c"
	return self;
}
예제 #26
0
파일: ease-main.c 프로젝트: rmujica/Nitido
static EaseMainEditorWindowInfo* ease_main_editor_window_info_construct (GType object_type, EaseEditorWindow* win) {
#line 1138 "ease-main.c"
	EaseMainEditorWindowInfo* self;
	EaseEditorWindow* _tmp0_;
#line 392 "ease-main.vala"
	g_return_val_if_fail (win != NULL, NULL);
#line 1143 "ease-main.c"
	self = (EaseMainEditorWindowInfo*) g_type_create_instance (object_type);
#line 394 "ease-main.vala"
	self->window = (_tmp0_ = _g_object_ref0 (win), _g_object_unref0 (self->window), _tmp0_);
#line 1147 "ease-main.c"
	return self;
}
예제 #27
0
파일: ssl_end.c 프로젝트: felipec/libgmsn
SslEndObject *
ssl_end_object_new (ConnObject *conn)
{
    SslEndObject *ssl_end;
    ConnEndObject *conn_end;

    ssl_end = SSL_END_OBJECT (g_type_create_instance (SSL_END_OBJECT_TYPE));
    conn_end = CONN_END_OBJECT (ssl_end);

    conn_end->conn = conn;

    return ssl_end;
}
예제 #28
0
int main ()
{
	g_type_init ();

	Base *base = (Base *) g_type_create_instance (base_get_type ());
	base_class_set_i (101);
	base_instance_set_i (base, 201);
	Derived *derived = (Derived *) g_type_create_instance (derived_get_type ());
	derived_instance_set_i (derived, 401);

	/* test polymorphism */
	Base *instance [2] = { base, (Base *) derived};
	int i;
	for (i = 0; i < 2; i++)
	{
		Base *inst = instance [i];
		BaseClass *klass = G_TYPE_INSTANCE_GET_CLASS (inst, base_get_type (), BaseClass);
		klass -> base_instance_dump (inst);
	}
	
	return 0;
}
예제 #29
0
GraphMediaModelosSentimiento* graph_media_modelos_sentimiento_construct (GType object_type) {
	GraphMediaModelosSentimiento* self = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self = (GraphMediaModelosSentimiento*) g_type_create_instance (object_type);
	self->id = (gint64) (-1);
	_tmp0_ = g_strdup ("indiferencia");
	_g_free0 (self->nombre);
	self->nombre = _tmp0_;
	_tmp1_ = g_strdup ("sin descripcion");
	_g_free0 (self->descripcion);
	self->descripcion = _tmp1_;
	return self;
}
예제 #30
0
/**
 * gst_mini_object_new:
 * @type: the #GType of the mini-object to create
 *
 * Creates a new mini-object of the desired type.
 *
 * MT safe
 *
 * Returns: the new mini-object.
 */
GstMiniObject *
gst_mini_object_new (GType type)
{
  GstMiniObject *mini_object;

  /* we don't support dynamic types because they really aren't useful,
   * and could cause refcount problems */
  mini_object = (GstMiniObject *) g_type_create_instance (type);

#ifndef GST_DISABLE_TRACE
  gst_alloc_trace_new (_gst_mini_object_trace, mini_object);
#endif

  return mini_object;
}