AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
+PKG_CHECK_MODULES(CURL, [libcurl])
+AC_SUBST(CURL_CFLAGS)
+AC_SUBST(CURL_LIBS)
+
AC_ARG_WITH([ommedia],
[AS_HELP_STRING([--with-ommedia=path], [path to ommedia /Media API/])],
[OMMEDIA_PATH=$withval],
INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- @GTHREAD_CFLAGS@ @GTK_CFLAGS@ @OM_CFLAGS@
+ @GTHREAD_CFLAGS@ @GTK_CFLAGS@ @OM_CFLAGS@ @CURL_CFLAGS@
bin_PROGRAMS = omnplay
ui_buttons.c ui_buttons.h \
opts.c opts.h \
playlist.c \
+ library.c \
timecode.c timecode.h \
omnplay.cpp omnplay.h
-omnplay_LDADD = @GTHREAD_LIBS@ @GTK_LIBS@ @OM_LIBS@
+omnplay_LDADD = @GTHREAD_LIBS@ @GTK_LIBS@ @OM_LIBS@ @CURL_LIBS@
--- /dev/null
+/*
+ * playlist.c -- GTK+ 2 omnplay
+ * Copyright (C) 2011 Maksym Veremeyenko <verem@m1stereo.tv>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <pthread.h>
+
+#include "omnplay.h"
+#include "ui.h"
+#include "timecode.h"
+
+void omnplay_library_load(omnplay_instance_t* app)
+{
+};
+
+void omnplay_library_save(omnplay_instance_t* app)
+{
+};
+
+void omnplay_library_refresh(omnplay_instance_t* app)
+{
+};
omnplay_ctl(app, button);
break;
case BUTTON_LIBRARY_ADD:
+ break;
case BUTTON_LIBRARY_REFRESH:
+ omnplay_library_refresh(app);
break;
};
gtk_signal_connect(GTK_OBJECT(app->buttons[i]), "clicked",
GTK_SIGNAL_FUNC( on_button_click), app );
+ /* create lock */
+ pthread_mutex_init(&app->library.lock, &attr);
+
+ /* load library */
+ omnplay_library_load(app);
};
void omnplay_release(omnplay_instance_t* app)
/* destroy lock */
pthread_mutex_destroy(&app->playlist.lock);
+
+ /* load library */
+ omnplay_library_save(app);
+
+ /* destroy library lock */
+ pthread_mutex_destroy(&app->library.lock);
};
} playlist_item_type_t;
#define MAX_PLAYLIST_ITEMS 1024
+#define MAX_LIBRARY_ITEMS 10240
typedef struct playlist_item
{
char* path;
GdkPixbuf *block_icons[8];
} playlist;
+ struct
+ {
+ playlist_item_t item[MAX_LIBRARY_ITEMS];
+ int count;
+ char filename[PATH_MAX];
+ char whois[PATH_MAX];
+ pthread_mutex_t lock;
+ } library;
} omnplay_instance_t;
omnplay_instance_t* omnplay_create(int argc, char** argv);
void omnplay_playlist_draw(omnplay_instance_t* app);
void omnplay_playlist_draw_item(omnplay_instance_t* app, int idx);
void omnplay_playlist_draw_item_rem(omnplay_instance_t* app, int idx, char* rem);
+void omnplay_library_load(omnplay_instance_t* app);
+void omnplay_library_save(omnplay_instance_t* app);
+void omnplay_library_refresh(omnplay_instance_t* app);
#ifdef __cplusplus
};
{
{ "directory", required_argument, NULL, '0'},
{ "player", required_argument, NULL, '1'},
+ { "library", required_argument, NULL, '2'},
+ { "whois", required_argument, NULL, '3'},
{ "help", no_argument, NULL, 'h'},
{ 0, 0, 0, 0}
};
};
break;
+ /** --library */
+ case '2':
+ strncpy(app->library.filename, optarg, PATH_MAX);
+ break;
+
+ /** --whois */
+ case '3':
+ strncpy(app->library.whois, optarg, PATH_MAX);
+ break;
+
default:
fprintf(stderr, "ERROR: Incorrect argument!\n");
return 1;