# HG changeset patch # User Matti Hamalainen # Date 1211735028 -10800 # Node ID 45ef6d7c017436115744bbc2f3e1d8fc250bd934 # Parent c2603047a1a3db2a9cc262d1512469eee1280724 Synchronized typedef name changes from XMMS-SID. diff -r c2603047a1a3 -r 45ef6d7c0174 src/sid/xs_config.c --- a/src/sid/xs_config.c Fri May 23 17:17:16 2008 +0200 +++ b/src/sid/xs_config.c Sun May 25 20:03:48 2008 +0300 @@ -84,9 +84,9 @@ * Configuration specific stuff */ XS_MUTEX(xs_cfg); -struct t_xs_cfg xs_cfg; +struct xs_cfg_t xs_cfg; -static t_xs_cfg_item xs_cfgtable[] = { +static xs_cfg_item_t xs_cfgtable[] = { { CTYPE_INT, &xs_cfg.audioBitsPerSample, "audioBitsPerSample" }, { CTYPE_INT, &xs_cfg.audioChannels, "audioChannels" }, { CTYPE_INT, &xs_cfg.audioFrequency, "audioFrequency" }, @@ -135,10 +135,10 @@ { CTYPE_INT, &xs_cfg.subAutoMinTime, "subAutoMinTime" }, }; -static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(t_xs_cfg_item)); +static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(xs_cfgtable[0])); -static t_xs_wid_item xs_widtable[] = { +static xs_wid_item_t xs_widtable[] = { { WTYPE_BGROUP, CTYPE_INT, "cfg_res_16bit", &xs_cfg.audioBitsPerSample, XS_RES_16BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_res_8bit", &xs_cfg.audioBitsPerSample, XS_RES_8BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_mono", &xs_cfg.audioChannels, XS_CHN_MONO }, @@ -199,7 +199,7 @@ { WTYPE_SPIN, CTYPE_INT, "cfg_subauto_mintime", &xs_cfg.subAutoMinTime, 0 }, }; -static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item)); +static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(xs_widtable[0])); /* Reset/initialize the configuration @@ -304,7 +304,7 @@ */ #define XS_FITEM (4 * 2) -static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, t_xs_sid2_filter *pResult) +static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, xs_sid2_filter_t *pResult) { gchar tmpKey[64], *tmpStr; gint i, j; @@ -339,12 +339,12 @@ } -static t_xs_sid2_filter * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) +static xs_sid2_filter_t * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) { - t_xs_sid2_filter *pResult; + xs_sid2_filter_t *pResult; /* Allocate filter struct */ - if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) + if ((pResult = g_malloc0(sizeof(xs_sid2_filter_t))) == NULL) return NULL; if (!xs_filter_load_into(cfg, nFilter, pResult)) { @@ -355,7 +355,7 @@ } #if 0 -static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter) +static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, xs_sid2_filter_t *pFilter, gint nFilter) { gchar *tmpValue, tmpKey[64]; gint i, j; @@ -402,14 +402,14 @@ return (inLine[*linePos] == sep); } -static gboolean xs_filters_import(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters) +static gboolean xs_filters_import(const gchar *pcFilename, xs_sid2_filter_t **pFilters, gint *nFilters) { FILE *inFile; gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE]; gchar *sectName = NULL; gboolean sectBegin; size_t lineNum, i; - t_xs_sid2_filter *tmpFilter; + xs_sid2_filter_t *tmpFilter; fprintf(stderr, "xs_filters_import(%s)\n", pcFilename); @@ -446,7 +446,7 @@ if (sectBegin) { /* Submit definition */ fprintf(stderr, "filter ends: %s\n", sectName); - if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) { + if ((tmpFilter = g_malloc0(sizeof(xs_sid2_filter_t))) == NULL) { fprintf(stderr, "could not allocate ..\n"); } else { @@ -478,10 +478,10 @@ } -static gboolean xs_filters_export(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint nFilters) +static gboolean xs_filters_export(const gchar *pcFilename, xs_sid2_filter_t **pFilters, gint nFilters) { FILE *outFile; - t_xs_sid2_filter *f; + xs_sid2_filter_t *f; gint n; /* Open/create the file */ @@ -575,7 +575,7 @@ xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter); if (xs_cfg.sid2NFilterPresets > 0) { - xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *)); + xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(xs_sid2_filter_t *)); if (!xs_cfg.sid2FilterPresets) { xs_error("Allocation of sid2FilterPresets structure failed!\n"); } else { @@ -896,7 +896,7 @@ } -void xs_cfg_sp2_filter_update(XSCurve *curve, t_xs_sid2_filter *f) +void xs_cfg_sp2_filter_update(XSCurve *curve, xs_sid2_filter_t *f) { assert(curve); assert(f); diff -r c2603047a1a3 -r 45ef6d7c0174 src/sid/xs_config.h --- a/src/sid/xs_config.h Fri May 23 17:17:16 2008 +0200 +++ b/src/sid/xs_config.h Sun May 25 20:03:48 2008 +0300 @@ -68,13 +68,14 @@ typedef struct { - t_xs_int_point points[XS_SIDPLAY2_NFPOINTS]; - gint npoints; - gchar *name; -} t_xs_sid2_filter; + gint type; + xs_int_point_t points[XS_SIDPLAY2_NFPOINTS]; + gint npoints; + gchar *name; +} xs_sid2_filter_t; -extern struct t_xs_cfg { +extern struct xs_cfg_t { /* General audio settings */ gint audioBitsPerSample; gint audioChannels; @@ -99,8 +100,8 @@ gint sid2OptLevel; /* SIDPlay2 emulation optimization */ gint sid2Builder; /* SIDPlay2 "builder" aka SID-emu */ - t_xs_sid2_filter sid2Filter; /* Current SIDPlay2 filter */ - t_xs_sid2_filter **sid2FilterPresets; + xs_sid2_filter_t sid2Filter; /* Current SIDPlay2 filter */ + xs_sid2_filter_t **sid2FilterPresets; gint sid2NFilterPresets; @@ -158,7 +159,7 @@ gint itemType; /* Type of item (CTYPE_*) */ void *itemData; /* Pointer to variable */ gchar *itemName; /* Name of configuration item */ -} t_xs_cfg_item; +} xs_cfg_item_t; typedef struct { @@ -167,7 +168,7 @@ gchar *widName; void *itemData; gint itemSet; -} t_xs_wid_item; +} xs_wid_item_t; /* Functions diff -r c2603047a1a3 -r 45ef6d7c0174 src/sid/xs_curve.c --- a/src/sid/xs_curve.c Fri May 23 17:17:16 2008 +0200 +++ b/src/sid/xs_curve.c Sun May 25 20:03:48 2008 +0300 @@ -252,7 +252,7 @@ GtkStateType state; GtkStyle *style; gint i, ox = -1, oy = -1; - t_xs_point *p0, *p1, *p2, *p3; + xs_point_t *p0, *p1, *p2, *p3; if (!curve->pixmap) return; @@ -624,7 +624,7 @@ { if (npoints != curve->nctlpoints) { curve->nctlpoints = npoints; - curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints, + curve->ctlpoints = (xs_point_t *) g_realloc(curve->ctlpoints, curve->nctlpoints * sizeof(*curve->ctlpoints)); if (curve->ctlpoints == NULL) @@ -635,14 +635,14 @@ } -void xs_curve_get_data(XSCurve *curve, t_xs_point ***points, gint **npoints) +void xs_curve_get_data(XSCurve *curve, xs_point_t ***points, gint **npoints) { *points = &(curve->ctlpoints); *npoints = &(curve->nctlpoints); } -gboolean xs_curve_set_points(XSCurve *curve, t_xs_int_point *points, gint npoints) +gboolean xs_curve_set_points(XSCurve *curve, xs_int_point_t *points, gint npoints) { gint i; @@ -669,13 +669,13 @@ } -gboolean xs_curve_get_points(XSCurve *curve, t_xs_int_point **points, gint *npoints) +gboolean xs_curve_get_points(XSCurve *curve, xs_int_point_t **points, gint *npoints) { gint i, n; n = curve->nctlpoints - 4; - *points = g_malloc(n * sizeof(t_xs_int_point)); + *points = g_malloc(n * sizeof(xs_int_point_t)); if (*points == NULL) return FALSE; diff -r c2603047a1a3 -r 45ef6d7c0174 src/sid/xs_curve.h --- a/src/sid/xs_curve.h Fri May 23 17:17:16 2008 +0200 +++ b/src/sid/xs_curve.h Sun May 25 20:03:48 2008 +0300 @@ -8,12 +8,12 @@ /* Macros for type-classing this GtkWidget/object */ -#define XS_TYPE_CURVE (xs_curve_get_type()) -#define XS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve)) -#define XS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass)) -#define XS_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE)) -#define XS_IS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE)) -#define XS_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass)) +#define XS_TYPE_CURVE (xs_curve_get_type()) +#define XS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve)) +#define XS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass)) +#define XS_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE)) +#define XS_IS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE)) +#define XS_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass)) /* Structures @@ -23,11 +23,11 @@ typedef struct { gfloat x,y; -} t_xs_point; +} xs_point_t; typedef struct { gint x, y; -} t_xs_int_point; +} xs_int_point_t; struct _XSCurve { GtkDrawingArea graph; @@ -42,7 +42,7 @@ /* control points */ gint nctlpoints; /* number of control points */ - t_xs_point *ctlpoints; /* array of control points */ + xs_point_t *ctlpoints; /* array of control points */ }; struct _XSCurveClass { @@ -57,9 +57,9 @@ gfloat min_x, gfloat min_y, gfloat max_x, gfloat max_y); gboolean xs_curve_realloc_data (XSCurve *curve, gint npoints); -void xs_curve_get_data (XSCurve *curve, t_xs_point ***points, gint **npoints); -gboolean xs_curve_set_points (XSCurve *curve, t_xs_int_point *points, gint npoints); -gboolean xs_curve_get_points (XSCurve *curve, t_xs_int_point **points, gint *npoints); +void xs_curve_get_data (XSCurve *curve, xs_point_t ***points, gint **npoints); +gboolean xs_curve_set_points (XSCurve *curve, xs_int_point_t *points, gint npoints); +gboolean xs_curve_get_points (XSCurve *curve, xs_int_point_t **points, gint *npoints); G_END_DECLS diff -r c2603047a1a3 -r 45ef6d7c0174 src/sid/xs_sidplay2.cc --- a/src/sid/xs_sidplay2.cc Fri May 23 17:17:16 2008 +0200 +++ b/src/sid/xs_sidplay2.cc Sun May 25 20:03:48 2008 +0300 @@ -94,7 +94,7 @@ */ gboolean xs_sidplay2_probe(xs_file_t *f) { - gchar tmpBuf[4]; + gchar tmpBuf[5]; if (!f) return FALSE; @@ -115,7 +115,7 @@ gint tmpFreq, i; xs_sidplay2_t *myEngine; sid_filter_t tmpFilter; - t_xs_sid2_filter *f; + xs_sid2_filter_t *f; assert(myStatus); /* Allocate internal structures */ @@ -281,6 +281,7 @@ return FALSE; } +#ifndef HAVE_SIDPLAY2_DISTORTION // FIXME FIX ME: support other configurable parameters ... // ... WHEN/IF resid-builder+libsidplay2 gets fixed rs->sampling(tmpFreq); @@ -288,6 +289,7 @@ xs_error("reSID->sampling(%d) failed.\n", tmpFreq); return FALSE; } +#endif if (tmpFilter.points > 0) rs->filter((sid_filter_t *) &tmpFilter);