Commit 4b641b84 authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Work on dmapserve.vala and related changes to libdmapsharing


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 23815d00
......@@ -23,13 +23,13 @@
static gint dmap_container_db_init_count = 0;
static void
dmap_container_db_init (DMAPContainerDbInterface *iface)
dmap_container_db_init (DMAPContainerDbIface *iface)
{
dmap_container_db_init_count++;
}
static void
dmap_container_db_finalize (DMAPContainerDbInterface *iface)
dmap_container_db_finalize (DMAPContainerDbIface *iface)
{
dmap_container_db_init_count--;
}
......@@ -41,7 +41,7 @@ dmap_container_db_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof(DMAPContainerDbInterface),
sizeof(DMAPContainerDbIface),
(GBaseInitFunc) dmap_container_db_init,
(GBaseFinalizeFunc) dmap_container_db_finalize
};
......
......@@ -28,11 +28,11 @@
G_BEGIN_DECLS
/**
* TYPE_DMAP_CONTAINER_DB:
* DMAP_TYPE_CONTAINER_DB:
*
* The type for #DMAPContainerDb.
*/
#define TYPE_DMAP_CONTAINER_DB (dmap_container_db_get_type ())
#define DMAP_TYPE_CONTAINER_DB (dmap_container_db_get_type ())
/**
* DMAP_CONTAINER_DB:
* @o: Object which is subject to casting.
......@@ -42,16 +42,16 @@ G_BEGIN_DECLS
* certain runtime checks to identify invalid casts.
*/
#define DMAP_CONTAINER_DB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
TYPE_DMAP_CONTAINER_DB, DMAPContainerDb))
DMAP_TYPE_CONTAINER_DB, DMAPContainerDb))
/**
* IS_DMAP_CONTAINER_DB:
* @o: Instance to check for being a %TYPE_DMAP_CONTAINER_DB.
* @o: Instance to check for being a %DMAP_TYPE_CONTAINER_DB.
*
* Checks whether a valid #GTypeInstance pointer is of type
* %TYPE_DMAP_CONTAINER_DB.
* %DMAP_TYPE_CONTAINER_DB.
*/
#define IS_DMAP_CONTAINER_DB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
TYPE_DMAP_CONTAINER_DB))
DMAP_TYPE_CONTAINER_DB))
/**
* DMAP_CONTAINER_DB_GET_INTERFACE:
* @o: a #DMAPContainerDb instance.
......@@ -61,12 +61,12 @@ G_BEGIN_DECLS
* Returns: pointer to object interface structure.
*/
#define DMAP_CONTAINER_DB_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), \
TYPE_DMAP_CONTAINER_DB, DMAPContainerDbInterface))
DMAP_TYPE_CONTAINER_DB, DMAPContainerDbIface))
typedef struct _DMAPContainerDb DMAPContainerDb;
typedef struct _DMAPContainerDbInterface DMAPContainerDbInterface;
typedef struct _DMAPContainerDbIface DMAPContainerDbIface;
struct _DMAPContainerDbInterface {
struct _DMAPContainerDbIface {
GTypeInterface parent;
DMAPContainerRecord *(*lookup_by_id) (DMAPContainerDb *db, guint id);
......
noinst_PROGRAMS = test-dmap-client test-dmap-server
if HAVE_VALA
noinst_PROGRAMS += dpapview dmapcopy
noinst_PROGRAMS += dpapview dmapcopy dmapserve
endif
test_dmap_client_SOURCES = \
......@@ -43,7 +43,7 @@ test_dmap_server_LDADD = \
$(MDNS_LIBS)
if MAINTAINER_MODE
BUILT_SOURCES = dpapview.stamp dmapcopy.stamp
BUILT_SOURCES = dpapview.stamp dmapcopy.stamp dmapserve.stamp
dpapview.stamp: $(dpapview_VALASOURCES)
$(VALAC) --vapidir=$(srcdir) --pkg gee-1.0 --pkg gtk+-2.0 --pkg gstreamer-0.10 --pkg libdmapsharing-2.2 --pkg libsoup-2.4 --pkg glib-2.0 $^ -C
......@@ -52,6 +52,10 @@ dpapview.stamp: $(dpapview_VALASOURCES)
dmapcopy.stamp: $(dmapcopy_VALASOURCES)
$(VALAC) --vapidir=$(srcdir) --pkg gee-1.0 --pkg gstreamer-0.10 --pkg libdmapsharing-2.2 --pkg libsoup-2.4 --pkg glib-2.0 $^ -C
touch $@
dmapserve.stamp: $(dmapserve_VALASOURCES)
$(VALAC) --vapidir=$(srcdir) --pkg gee-1.0 --pkg gstreamer-0.10 --pkg libdmapsharing-2.2 --pkg libsoup-2.4 --pkg glib-2.0 $^ -C
touch $@
endif
if HAVE_VALA
......@@ -83,6 +87,21 @@ dmapcopy_SOURCES = \
dmapcopy_LDADD = \
$(top_builddir)/libdmapsharing/libdmapsharing-3.0.la \
$(GEE_LIBS)
dmapserve_VALASOURCES = \
dmapserve.vala \
vala-dmap-db.vala \
vala-dpap-record.vala \
vala-dmap-container-db.vala
dmapserve_VALABUILTSOURCES = $(dmapserve_VALASOURCES:.vala=.c)
dmapserve_SOURCES = \
$(dmapserve_VALABUILTSOURCES)
dmapserve_LDADD = \
$(top_builddir)/libdmapsharing/libdmapsharing-3.0.la \
$(GEE_LIBS)
endif
AM_CPPFLAGS = \
......
......@@ -23,7 +23,8 @@
private class ValaDMAPDb : GLib.Object, DMAP.Db {
// A dumb database that stores everything in an array
private Gee.ArrayList<ValaDPAPRecord> db = new Gee.ArrayList<ValaDPAPRecord> ();
/* FIXME: What is with this unowned? */
private Gee.ArrayList<unowned ValaDPAPRecord> db = new Gee.ArrayList<ValaDPAPRecord> ();
public uint add (DMAP.Record record) {
db.add (((ValaDPAPRecord) record));
......@@ -50,7 +51,7 @@ private class ValaDMAPDb : GLib.Object, DMAP.Db {
}
public unowned DMAP.Record lookup_by_id (uint id) {
GLib.error ("lookup_by_id not implemented");
return db.get ((int) id);
}
......
......@@ -105,6 +105,10 @@ private class ValaDPAPRecord : GLib.Object, DMAP.Record, DPAP.Record {
public unowned GLib.ByteArray to_blob () {
GLib.error ("to_blob not implemented");
}
public ValaDPAPRecord () {
location = "FIXME";
}
}
private class ValaDPAPRecordFactory : GLib.Object, DMAP.RecordFactory {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment