= AirPlay ======================================================================

DACP client

Support AirPlay, Pulseaudio, or ALSA

DMAPD_AV_RENDER_MODULE=gst:host=192.168.1.XXX ./dmapd -f -m /var/db/BigDisk/Storage/Music/AC-DC/ -o

Check documentation of *_MODULE

Figure out how to handle remote pairing 

Clean up FIXME's in av-render-gst.c

Move GStreamer render module to libdmapsharing?

= Short term ===================================================================

Mike: dynamically adjust database when files are added to directories
(inotify?). See "Kernel Korner - Intro to inotify"

#include <gio/gio.h>
#include <glib.h>
#include <stdio.h>
#include <string.h>

void fn (GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, gpointer user_data)
{
	printf ("CHANGED %s %d\n", g_file_get_basename (file), event_type);
}

void monitor_it (GFile *file)
{
	GError *error = NULL;
	GFileMonitor *monitor = g_file_monitor_directory (file, 0, NULL, &error);
	if (NULL == monitor) {
		printf ("g_file_monitor_directory fail %s\n", error->message);
		return;
	}

	printf ("monitor %s\n", g_file_get_basename (file));
	g_signal_connect (monitor, "changed", (GCallback) fn, NULL);
}

int main (int argc, char *argv[])
{
	g_type_init ();

	GFile *dir = g_file_new_for_uri ("file:///tmp/tmp");
	if (NULL == dir) {
		printf ("g_file_new_for_uri fail\n");
		return 1;
	}

	monitor_it (dir);

	GError *error = NULL;
	GFileEnumerator *enumerator = g_file_enumerate_children (dir, "standard::*", 0, NULL, &error);
	if (NULL == enumerator) {
		printf ("g_file_enumerate_children fail %s\n", error->message);
		return 1;
	}

	GFileInfo *info;
	for (info = g_file_enumerator_next_file (enumerator, NULL, &error); info; info = g_file_enumerator_next_file (enumerator, NULL, &error)) {
		printf ("%s\n", g_file_info_get_name (info));
		GFileType type = g_file_info_get_file_type (info);
		if (type == G_FILE_TYPE_DIRECTORY) {
			printf ("DIRECTORY\n");
		}
		GFile *file = g_file_resolve_relative_path (dir,  g_file_info_get_name (info));
		if (NULL == file) {
			printf ("g_file_resolve_relative_path fail %s\n", error->message);
			return 1;
		}
		monitor_it (file);
		g_object_unref (file);
	}

	g_object_unref (dir);
	g_file_enumerator_close (enumerator, NULL, &error);

	GMainLoop *loop = g_main_loop_new (NULL, 0);
	if (NULL == loop) {
		printf ("g_main_loop_new fail\n");
		return 1;
	}
	g_main_loop_run (loop);

	printf ("DONE\n");
}

Mike: split DB/cache directories; update packages?

Mike: temporary, thumbnail files remain

Mike: crashes when you specify -m on a big picture directory?

Mike: Mac OS memory blows up when interacting with WalletPhoto

Noah: write unit tests

Mike: fix: video playlist override audio playlists when both directories
are listed in dmapd.conf

= Mid term =====================================================================

Mike: modular user interface

Noah: investigate XCode integration

Noah: iOS Wallet Photo App

Noah: support playlists using totem-pl-parser

Mike: fix seeking (see libdmapsharing TODO)

Mike: is dmapd-dmap-db.c really needed? Why can't a loadable module just
implement an interface?

Mike: Migrate command line parsing to dmapd.xml.

See FIXME's in VIPS code

= Long term ====================================================================

Fix BDB code
	Existing DB, are proper ID's used for additional files read
	(e.g., maxint - last used id)?

	See by_location FIXME in db-builder-gdir.c.

Mike: Strings are copied a few times, but this does not seem to be as big a
problem as the GNode / DMAPStructureItem overhead.
	dmapd:dmapd-daap-record.c: g_value_set_string -> g_value_set_static_string
	libdmapsharing:dmap-structure.c: same as above.
should db_dir be in DmapdDMAPDb or
DmapdDMAPGHashTableDb? Should get dup or static_str?
