[girl] Further work on refactoring code from gst-player.
- From: ole <ole src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [girl] Further work on refactoring code from gst-player.
- Date: Tue, 11 Apr 2017 12:32:35 +0000 (UTC)
commit 82ab4c0dcceab9a421aa36bfcbf96cb9f35698da
Author: Ole Aamot <oka oka no>
Date: Tue Apr 11 14:31:47 2017 +0200
Further work on refactoring code from gst-player.
src/GIRL-PLAYER.c | 22 +++++++---------------
src/GIRL-PLAYER.h | 21 ++++++++++++++++++++-
src/GIRL.c | 7 ++++++-
3 files changed, 33 insertions(+), 17 deletions(-)
---
diff --git a/src/GIRL-PLAYER.c b/src/GIRL-PLAYER.c
index 8078525..2b0fac9 100644
--- a/src/GIRL-PLAYER.c
+++ b/src/GIRL-PLAYER.c
@@ -29,29 +29,16 @@
#include <string.h>
#include <math.h>
+#include <gst/player/player.h>
#include "GIRL.h"
+#include "GIRL-PLAYER.h"
#include "GIRL-PLAYER-KB.h"
-#include <gst/player/player.h>
#define VOLUME_STEPS 20
GST_DEBUG_CATEGORY (play_debug);
#define GST_CAT_DEFAULT play_debug
-typedef struct
-{
- gchar **uris;
- guint num_uris;
- gint cur_idx;
-
- GstPlayer *player;
- GstState desired_state;
-
- gboolean repeat;
-
- GMainLoop *loop;
-} GstPlay;
-
static gboolean play_next (GstPlay * play);
static gboolean play_prev (GstPlay * play);
static void play_reset (GstPlay * play);
@@ -658,6 +645,11 @@ keyboard_cb (const gchar * key_input, gpointer user_data)
}
}
+void
+girl_player_new (GstPlay * play, const gchar * next_uri)
+{
+}
+
#if 0
int
main (int argc, char **argv)
diff --git a/src/GIRL-PLAYER.h b/src/GIRL-PLAYER.h
index 9963c87..7ddfc00 100644
--- a/src/GIRL-PLAYER.h
+++ b/src/GIRL-PLAYER.h
@@ -24,6 +24,25 @@
#ifndef GIRL_PLAYER_H
#define GIRL_PLAYER_H
-int girl_player_main (char *uri);
+#include <gst/gst.h>
+#include <gst/player/player.h>
+
+typedef struct
+{
+ gchar **uris;
+ guint num_uris;
+ gint cur_idx;
+
+ GstPlayer *player;
+ GstState desired_state;
+
+ gboolean repeat;
+
+ GMainLoop *loop;
+} GstPlay;
+
+static void play_uri (GstPlay * play, const gchar * next_uri);
+
+void girl_player_new (GstPlay * play, const gchar * next_uri);
#endif /* GIRL_PLAYER_H */
diff --git a/src/GIRL.c b/src/GIRL.c
index 02db378..688c438 100644
--- a/src/GIRL.c
+++ b/src/GIRL.c
@@ -27,7 +27,10 @@
#include <clutter-gtk/clutter-gtk.h>
#include <glib/gstdio.h>
#include <string.h>
+
#include "GIRL.h"
+#include "GIRL-GUI.h"
+#include "GIRL-PLAYER.h"
static ChamplainView *champlain_view;
GApplication *app;
@@ -68,7 +71,9 @@ search_station(GSimpleAction *simple, GVariant *parameter, gpointer user_data) {
static void
listen_station(GSimpleAction *simple, GVariant *parameter, gpointer user_data) {
- girl_player_main (")http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk");
+ GstPlayer *player = gst_player_new (NULL, gst_player_g_main_context_signal_dispatcher_new
+ (NULL));
+ girl_player_new(player, "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk");
g_print("Listening to BBC World Service\n");
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]