--- /dev/null	Thu Jan  1 01:00:00 1970
+++ src/ui/ggi/Makefile.am	Sat Jul 22 22:16:05 2000
@@ -0,0 +1,32 @@
+##
+## Process this file with automake to produce Makefile.in
+##
+
+
+AUTOMAKE_OPTIONS = no-dependencies foreign
+
+
+DEFS = -fPIC $(CFLAGS) $(GLIB_CFLAGS) @DEFS@
+INCLUDES = -I. -I.. -I$(top_builddir)/include -I$(top_builddir)/src \
+	 -I$(top_srcdir)/include -I$(top_srcdir)/src
+
+
+bin_PROGRAMS = ggidvd
+
+ggidvd_SOURCES = ggidvd.c
+ggidvd_DEPENDENCIES = libsdeps
+ggidvd_LDADD = $(top_builddir)/src/oms/liboms.la -ldl -lpthread
+
+
+libsdeps:
+	@cd $(top_builddir)/src/oms; $(MAKE) liboms.la
+
+
+mostlyclean-generic:
+	-rm -f *~ \#* .*~ .\#*
+
+
+maintainer-clean-generic:
+	-@echo "This command is intended for maintainers to use;"
+	-@echo "it deletes files that may require special tools to rebuild."
+	-rm -f Makefile.in
--- /dev/null	Thu Jan  1 01:00:00 1970
+++ src/ui/ggi/ggidvd.c	Sat Jul 22 22:22:16 2000
@@ -0,0 +1,128 @@
+/* Version 0.1 - 2000-07-22
+******************************************************************************
+
+   OMS console frontend, suitable for usage with GGI output
+
+   Copyright (C) 2000	Marcus Sundberg	[marcus@ggi-project.org]
+  
+   Permission is hereby granted, free of charge, to any person obtaining a
+   copy of this software and associated documentation files (the "Software"),
+   to deal in the Software without restriction, including without limitation
+   the rights to use, copy, modify, merge, publish, distribute, sublicense,
+   and/or sell copies of the Software, and to permit persons to whom the
+   Software is furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+   THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+   IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************************************************
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <oms.h>
+
+static volatile u_char next_chapter = 0;
+static int start_chapter = 0;
+static char *dvd_device = "/dev/dvd";
+static char *vid_device = "ggi";
+static char *snd_device = "oss";
+static char out_device[1024];
+
+
+static void
+cb_chapter_change(void *data, int my_part)
+{
+	fprintf(stderr, "playing chapter %d\n", my_part);
+	next_chapter = 1;
+}
+
+
+void
+print_usage(char *argv[])
+{
+	fprintf(stderr,"usage: %s [-v video] [-s sound] [-c chapter] device\n",
+		argv[0]);
+}
+
+
+static void 
+handle_args(int argc, char *argv[])
+{
+	int c;
+
+	while ((c = getopt(argc,argv,"c:s:v:")) != EOF) {
+		switch (c) {
+		case 'c':
+			start_chapter = strtoul(optarg, NULL, 0);
+			break;
+		case 's':
+			snd_device = optarg;
+			break;
+		case 'v':
+			vid_device = optarg;
+			break;
+		default:
+			print_usage(argv);
+			exit(1);
+		}
+	}
+
+	if (optind < argc) {
+		dvd_device = argv[optind];
+	}
+}
+
+
+int main(int argc, char *argv[])
+{
+	int err, s;
+
+	handle_args(argc, argv);
+
+	if (strlen(vid_device) + strlen(snd_device) >= sizeof(out_device)) {
+		fprintf(stderr, "ERROR, output name too long.\n");
+		exit(1);
+	}
+
+	sprintf(out_device, "%s:%s", vid_device, snd_device);
+
+	err = omsOpenOutput(OMS_PLUGINDIR"/codec_sw.so", out_device);
+	if (err) {
+		fprintf(stderr, "ERROR opening output.\n");
+		exit(1);
+	}
+
+	if (omsOpenInput(dvd_device)) {
+		fprintf(stderr, "ERROR opening input %s.\n", dvd_device);
+		exit(1);
+	}
+
+	omsRegisterCb(CB_CHANGE, cb_chapter_change, NULL);
+
+	s = start_chapter;
+	while (1) {
+		if (PartPlay(0, s++) != 0) break;
+
+		while (!next_chapter) sleep(1);
+		next_chapter = 0;
+	}
+
+	omsUnregisterCb(CB_CHANGE);
+
+	return 0;
+}
Index: src/ui/Makefile.am
===================================================================
RCS file: /cvs/livid/oms/src/ui/Makefile.am,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile.am
--- src/ui/Makefile.am	2000/06/12 06:20:02	1.2
+++ src/ui/Makefile.am	2000/07/22 23:07:10
@@ -10,7 +10,7 @@
 GTK_DIR = 
 endif
 
-SUBDIRS = shell $(GTK_DIR)
+SUBDIRS = ggi shell $(GTK_DIR)
 
 
 mostlyclean-generic:
