Commit 39e64341 authored by W. Michael Petullo's avatar W. Michael Petullo

Big indent patch

Signed-off-by: 's avatarW. Michael Petullo <mike@flyn.org>
parent e8c41928
......@@ -31,7 +31,7 @@ struct DAAPConnectionPrivate {
*/
static DMAPContentCode
get_protocol_version_cc (DMAPConnection *connection)
get_protocol_version_cc (DMAPConnection * connection)
{
return DMAP_CC_APRO;
}
......@@ -48,7 +48,8 @@ get_query_metadata (void)
}
static DMAPRecord *
handle_mlcl (DMAPConnection *connection, DMAPRecordFactory *factory, GNode *n, int *item_id)
handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
GNode * n, int *item_id)
{
GNode *n2;
DMAPRecord *record = NULL;
......@@ -73,53 +74,57 @@ handle_mlcl (DMAPConnection *connection, DMAPRecordFactory *factory, GNode *n, i
meta_item = n2->data;
switch (meta_item->content_code) {
case DMAP_CC_MIID:
*item_id = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_MINM:
title = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASAL:
album = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASAR:
artist = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASFM:
format = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASGN:
genre = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASTM:
length = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASTN:
track_number = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASDN:
disc_number = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASYR:
year = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASSZ:
size = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASBR:
bitrate = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASUL:
streamURI = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSA:
sort_artist = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSU:
sort_album = g_value_get_string (&(meta_item->content));
break;
default:
break;
case DMAP_CC_MIID:
*item_id = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_MINM:
title = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASAL:
album = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASAR:
artist = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASFM:
format = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASGN:
genre = g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASTM:
length = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASTN:
track_number =
g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASDN:
disc_number = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASYR:
year = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASSZ:
size = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASBR:
bitrate = g_value_get_int (&(meta_item->content));
break;
case DMAP_CC_ASUL:
streamURI =
g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSA:
sort_artist =
g_value_get_string (&(meta_item->content));
break;
case DMAP_CC_ASSU:
sort_album =
g_value_get_string (&(meta_item->content));
break;
default:
break;
}
}
......@@ -128,68 +133,65 @@ handle_mlcl (DMAPConnection *connection, DMAPRecordFactory *factory, GNode *n, i
goto _return;
}
g_object_set (record,
"year", year,
"track", track_number,
"disc", disc_number,
"bitrate", bitrate,
"duration", length / 1000,
"filesize", (guint64) size,
"format", format,
"title", title,
"songalbum", album,
"songartist", artist,
"songgenre", genre,
"sort-artist", sort_artist,
"sort-album", sort_album,
NULL);
_return:
"year", year,
"track", track_number,
"disc", disc_number,
"bitrate", bitrate,
"duration", length / 1000,
"filesize", (guint64) size,
"format", format,
"title", title,
"songalbum", album,
"songartist", artist,
"songgenre", genre,
"sort-artist", sort_artist,
"sort-album", sort_album, NULL);
_return:
return record;
}
static void
daap_connection_class_init (DAAPConnectionClass *klass)
daap_connection_class_init (DAAPConnectionClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
DMAPConnectionClass *parent_class = DMAP_CONNECTION_CLASS (object_class);
DMAPConnectionClass *parent_class =
DMAP_CONNECTION_CLASS (object_class);
parent_class->get_protocol_version_cc = get_protocol_version_cc;
parent_class->get_query_metadata = get_query_metadata;
parent_class->handle_mlcl = handle_mlcl;
/* FIXME:
g_type_class_add_private (klass, sizeof (DAAPConnectionPrivate));
*/
* g_type_class_add_private (klass, sizeof (DAAPConnectionPrivate));
*/
}
DAAPConnection *
daap_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb *db,
DMAPRecordFactory *factory)
daap_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb * db, DMAPRecordFactory * factory)
{
DAAPConnection *connection;
connection = g_object_new (DAAP_TYPE_CONNECTION,
"name", name,
"password-protected", password_protected,
"db", db,
"host", host,
"port", port,
"factory", factory,
NULL);
"name", name,
"password-protected", password_protected,
"db", db,
"host", host,
"port", port, "factory", factory, NULL);
return connection;
}
static void
daap_connection_init (DAAPConnection *connection)
daap_connection_init (DAAPConnection * connection)
{
/* FIXME:
connection->priv = DAAP_CONNECTION_GET_PRIVATE (connection);
*/
* connection->priv = DAAP_CONNECTION_GET_PRIVATE (connection);
*/
}
G_DEFINE_TYPE (DAAPConnection, daap_connection, DMAP_TYPE_CONNECTION)
......@@ -23,7 +23,6 @@
#include <libdmapsharing/dmap-db.h>
G_BEGIN_DECLS
/**
* DAAP_TYPE_CONNECTION:
*
......@@ -71,26 +70,26 @@ G_BEGIN_DECLS
* Returns: pointer to object class structure.
*/
#define DAAP_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DAAP_TYPE_CONNECTION, DAAPConnectionClass))
typedef struct DAAPConnectionPrivate DAAPConnectionPrivate;
typedef struct {
typedef struct
{
DMAPConnectionClass dmap_connection_class;
} DAAPConnectionClass;
typedef struct {
typedef struct
{
DMAPConnection dmap_connection_instance;
DAAPConnectionPrivate *priv;
} DAAPConnection;
GType daap_connection_get_type (void);
GType daap_connection_get_type (void);
DAAPConnection * daap_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb *db,
DMAPRecordFactory *factory);
DAAPConnection *daap_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb * db,
DMAPRecordFactory * factory);
G_END_DECLS
#endif /* __DAAP_CONNECTION_H */
This diff is collapsed.
......@@ -28,7 +28,6 @@
#include <libdmapsharing/dmap-db.h>
G_BEGIN_DECLS
/**
* DAAP_TYPE_RECORD:
*
......@@ -63,18 +62,18 @@ G_BEGIN_DECLS
*/
#define DAAP_RECORD_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), \
DAAP_TYPE_RECORD, DAAPRecordIface))
typedef struct _DAAPRecord DAAPRecord;
typedef struct _DAAPRecordIface DAAPRecordIface;
struct _DAAPRecordIface {
struct _DAAPRecordIface
{
GTypeInterface parent;
gboolean (*itunes_compat) (DAAPRecord *record);
GInputStream * (*read) (DAAPRecord *record, GError **err);
gboolean (*itunes_compat) (DAAPRecord * record);
GInputStream *(*read) (DAAPRecord * record, GError ** err);
};
GType daap_record_get_type (void);
GType daap_record_get_type (void);
/**
* daap_record_itunes_compat:
......@@ -82,7 +81,7 @@ GType daap_record_get_type (void);
*
* Returns: TRUE if record is compatible with iTunes, else FALSE.
*/
gboolean daap_record_itunes_compat (DAAPRecord *record);
gboolean daap_record_itunes_compat (DAAPRecord * record);
/**
* daap_record_read:
......@@ -92,7 +91,7 @@ gboolean daap_record_itunes_compat (DAAPRecord *record);
* Returns: A GInputStream that provides read-only access to the data stream
* associated with record.
*/
GInputStream *daap_record_read (DAAPRecord *record, GError **err);
GInputStream *daap_record_read (DAAPRecord * record, GError ** err);
/**
* daap_record_cmp_by_album:
......@@ -102,8 +101,8 @@ GInputStream *daap_record_read (DAAPRecord *record, GError **err);
*
* Compares the two records associated with the provided keys according
* to album. Suitable to sort lists of albums.
*/
gint daap_record_cmp_by_album (gpointer a, gpointer b, DMAPDb *db);
*/
gint daap_record_cmp_by_album (gpointer a, gpointer b, DMAPDb * db);
#endif /* __DAAP_RECORD_H */
......
This diff is collapsed.
......@@ -31,7 +31,6 @@
#include <libdmapsharing/dmap-container-db.h>
G_BEGIN_DECLS
/**
* DAAP_TYPE_SHARE:
*
......@@ -83,19 +82,20 @@ G_BEGIN_DECLS
*/
#define DAAP_SHARE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
DAAP_TYPE_SHARE, DAAPShareClass))
typedef struct DAAPSharePrivate DAAPSharePrivate;
typedef struct {
typedef struct
{
DMAPShareClass dmap_share_class;
} DAAPShareClass;
typedef struct {
typedef struct
{
DMAPShare dmap_share_instance;
DAAPSharePrivate *priv;
} DAAPShare;
GType daap_share_get_type (void);
GType daap_share_get_type (void);
/**
* daap_share_new:
......@@ -109,9 +109,9 @@ GType daap_share_get_type (void);
*
* Returns: a pointer to a DAAPShare.
*/
DAAPShare *daap_share_new (const char *name, const char *password,
DMAPDb *db, DMAPContainerDb *container_db,
gchar *transcode_mimetype);
DAAPShare *daap_share_new (const char *name, const char *password,
DMAPDb * db, DMAPContainerDb * container_db,
gchar * transcode_mimetype);
#endif /* __DAAP_SHARE_H */
......
......@@ -31,7 +31,7 @@ struct DACPConnectionPrivate {
*/
static DMAPContentCode
get_protocol_version_cc (DMAPConnection *connection)
get_protocol_version_cc (DMAPConnection * connection)
{
/* FIXME: */
g_error ("Not implemented");
......@@ -45,55 +45,54 @@ get_query_metadata (void)
}
static DMAPRecord *
handle_mlcl (DMAPConnection *connection, DMAPRecordFactory *factory, GNode *n, int *item_id)
handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
GNode * n, int *item_id)
{
/* FIXME: */
g_error ("Not implemented");
}
static void
dacp_connection_class_init (DACPConnectionClass *klass)
dacp_connection_class_init (DACPConnectionClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
DMAPConnectionClass *parent_class = DMAP_CONNECTION_CLASS (object_class);
DMAPConnectionClass *parent_class =
DMAP_CONNECTION_CLASS (object_class);
parent_class->get_protocol_version_cc = get_protocol_version_cc;
parent_class->get_query_metadata = get_query_metadata;
parent_class->handle_mlcl = handle_mlcl;
/* FIXME:
g_type_class_add_private (klass, sizeof (DACPConnectionPrivate));
*/
* g_type_class_add_private (klass, sizeof (DACPConnectionPrivate));
*/
}
DACPConnection *
dacp_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb *db,
DMAPRecordFactory *factory)
dacp_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb * db, DMAPRecordFactory * factory)
{
DACPConnection *connection;
connection = g_object_new (DACP_TYPE_CONNECTION,
"name", name,
"password-protected", password_protected,
"db", db,
"host", host,
"port", port,
"factory", factory,
NULL);
"name", name,
"password-protected", password_protected,
"db", db,
"host", host,
"port", port, "factory", factory, NULL);
return connection;
}
static void
dacp_connection_init (DACPConnection *connection)
dacp_connection_init (DACPConnection * connection)
{
/* FIXME:
connection->priv = DACP_CONNECTION_GET_PRIVATE (connection);
*/
* connection->priv = DACP_CONNECTION_GET_PRIVATE (connection);
*/
}
G_DEFINE_TYPE (DACPConnection, dacp_connection, DMAP_TYPE_CONNECTION)
......@@ -23,7 +23,6 @@
#include <libdmapsharing/dmap-db.h>
G_BEGIN_DECLS
/**
* DACP_TYPE_CONNECTION:
*
......@@ -71,26 +70,26 @@ G_BEGIN_DECLS
* Returns: pointer to object class structure.
*/
#define DACP_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DACP_TYPE_CONNECTION, DACPConnectionClass))
typedef struct DACPConnectionPrivate DACPConnectionPrivate;
typedef struct {
typedef struct
{
DMAPConnectionClass dmap_connection_class;
} DACPConnectionClass;
typedef struct {
typedef struct
{
DMAPConnection dmap_connection_instance;
DACPConnectionPrivate *priv;
} DACPConnection;
GType dacp_connection_get_type (void);
GType dacp_connection_get_type (void);
DACPConnection * dacp_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb *db,
DMAPRecordFactory *factory);
DACPConnection *dacp_connection_new (const char *name,
const char *host,
guint port,
gboolean password_protected,
DMAPDb * db,
DMAPRecordFactory * factory);
G_END_DECLS
#endif /* __DACP_CONNECTION_H */
......@@ -20,7 +20,7 @@
#include <libdmapsharing/daap-record.h>
static void
dacp_player_init (DACPPlayerIface *iface)
dacp_player_init (DACPPlayerIface * iface)
{
static gboolean initialized = FALSE;
......@@ -28,50 +28,48 @@ dacp_player_init (DACPPlayerIface *iface)
initialized = TRUE;
g_object_interface_install_property (iface,
g_param_spec_ulong ("playing-time",
"Playing time",
"Playing time (ms)",
0,
G_MAXULONG,
0,
G_PARAM_READWRITE));
g_param_spec_ulong
("playing-time",
"Playing time",
"Playing time (ms)", 0,
G_MAXULONG, 0,
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_boolean ("shuffle-state",
"Shuffle state",
"Shufle state",
FALSE,
G_PARAM_READWRITE));
g_param_spec_boolean
("shuffle-state",
"Shuffle state",
"Shufle state", FALSE,
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_enum ("repeat-state",
"Repeat state",
"Repeat state",
DMAP_TYPE_DACP_REPEAT_STATE,
REPEAT_NONE,
G_PARAM_READWRITE));
g_param_spec_enum
("repeat-state",
"Repeat state",
"Repeat state",
DMAP_TYPE_DACP_REPEAT_STATE,
REPEAT_NONE,
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_enum ("play-state",
"Play state",
"Play state",
DMAP_TYPE_DACP_PLAY_STATE,
PLAY_STOPPED,
G_PARAM_READWRITE));
g_param_spec_enum
("play-state",
"Play state",
"Play state",
DMAP_TYPE_DACP_PLAY_STATE,
PLAY_STOPPED,
G_PARAM_READWRITE));
g_object_interface_install_property (iface,
g_param_spec_ulong ("volume",
"Volume",
"Volume",
0,
100,
0,
G_PARAM_READWRITE));
g_param_spec_ulong
("volume", "Volume",
"Volume", 0, 100, 0,
G_PARAM_READWRITE));
}
}
static void
dacp_player_finalize (DACPPlayerIface *iface)
dacp_player_finalize (DACPPlayerIface * iface)
{
}
......@@ -79,65 +77,69 @@ GType
dacp_player_get_type (void)
{
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof(DACPPlayerIface),
sizeof (DACPPlayerIface),
(GBaseInitFunc) dacp_player_init,
(GBaseFinalizeFunc) dacp_player_finalize
};
object_type = g_type_register_static(G_TYPE_INTERFACE,
"DACPPlayer",
&object_info, 0);
g_type_interface_add_prerequisite (object_type, G_TYPE_OBJECT);
object_type = g_type_register_static (G_TYPE_INTERFACE,
"DACPPlayer",
&object_info, 0);
g_type_interface_add_prerequisite (object_type,
G_TYPE_OBJECT);
}
return object_type;
}
DAAPRecord *
dacp_player_now_playing_record (DACPPlayer *player)
dacp_player_now_playing_record (DACPPlayer * player)
{
return DACP_PLAYER_GET_INTERFACE (player)->now_playing_record (player);
return DACP_PLAYER_GET_INTERFACE (player)->
now_playing_record (player);
}
const guchar *
dacp_player_now_playing_artwork (DACPPlayer *player, guint width, guint height)
dacp_player_now_playing_artwork (DACPPlayer * player, guint width,
guint height)
{
return DACP_PLAYER_GET_INTERFACE (player)->now_playing_artwork (player, width, height);
return DACP_PLAYER_GET_INTERFACE (player)->
now_playing_artwork (player, width, height);
}
void
dacp_player_play_pause (DACPPlayer *player)
void
dacp_player_play_pause (DACPPlayer * player)
{
DACP_PLAYER_GET_INTERFACE (player)->play_pause (player);
}
void
dacp_player_pause (DACPPlayer *player)
void
dacp_player_pause (DACPPlayer * player)
{
DACP_PLAYER_GET_INTERFACE (player)->pause (player);
}
void
dacp_player_next_item (DACPPlayer *player)
void
dacp_player_next_item (DACPPlayer * player)
{
DACP_PLAYER_GET_INTERFACE (player)->next_item (player);
}
void
dacp_player_prev_item (DACPPlayer *player)
void
dacp_player_prev_item (DACPPlayer * player)
{
DACP_PLAYER_GET_INTERFACE (player)->prev_item (player);
}
void
dacp_player_cue_clear (DACPPlayer *player)
void
dacp_player_cue_clear (DACPPlayer * player)
{
DACP_PLAYER_GET_INTERFACE (player)->cue_clear (player);
}
void
dacp_player_cue_play (DACPPlayer *player, GList *records, guint index)
void
dacp_player_cue_play (DACPPlayer * player, GList * records, guint index)
{
DACP_PLAYER_GET_INTERFACE (player)->cue_play (player, records, index);
}
......@@ -23,14 +23,12 @@
#include "daap-record.h"
G_BEGIN_DECLS
/**
* DACP_TYPE_PLAYER:
*
* The type for #DACPPlayer.
*/
#define DACP_TYPE_PLAYER (dacp_player_get_type ())
/**
* DACP_PLAYER:
* @o: Object which is subject to casting.
......@@ -40,7 +38,6 @@ G_BEGIN_DECLS
* certain runtime checks to identify invalid casts.
*/
#define DACP_PLAYER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DACP_TYPE_PLAYER, DACPPlayer))
/**
* IS_DACP_PLAYER:
* @o: Instance to check for being a %DACP_TYPE_PLAYER.
......@@ -48,7 +45,6 @@ G_BEGIN_DECLS
* Checks whether a valid #GTypeInstance pointer is of type %DACP_TYPE_PLAYER.
*/
#define IS_DACP_PLAYER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DACP_TYPE_PLAYER))
/**
* DACP_PLAYER_GET_INTERFACE:
* @o: a #DACPPlayer instance.
......@@ -59,17 +55,18 @@ G_BEGIN_DECLS
*/
#define DACP_PLAYER_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), \