[gnome-internet-radio-locator] gnome-internet-radio-locator version 1.0.3
- From: ole <ole src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-internet-radio-locator] gnome-internet-radio-locator version 1.0.3
- Date: Sat, 17 Feb 2018 12:01:14 +0000 (UTC)
commit 124d96e07619a2e51bb018c406a441c1ef036e65
Author: Ole Aamot <oka oka no>
Date: Sat Feb 17 13:00:30 2018 +0100
gnome-internet-radio-locator version 1.0.3
HACKING | 3 +-
NEWS | 10 +++
README | 31 +++++++-
configure.ac | 27 +++++--
data/Makefile.am | 12 +--
....gnome.gnome-internet-radio-locator.gschema.xml | 12 +++
...ome.gnome-internet-radio-locator.gschema.xml.in | 12 +++
meson.build | 1 +
src/Makefile.am | 2 +-
src/gnome-internet-radio-locator-gui.c | 20 ++++-
src/gnome-internet-radio-locator-markers.c | 17 ++++-
src/gnome-internet-radio-locator-radius.c | 2 +-
src/gnome-internet-radio-locator-radius.h | 2 +-
src/gnome-internet-radio-locator-station.c | 2 +-
src/gnome-internet-radio-locator-station.h | 2 +-
src/gnome-internet-radio-locator.c | 78 +++++++++++++++++---
src/gnome-internet-radio-locator.h | 3 +-
src/gnome-internet-radio-locator.xml | 2 +-
18 files changed, 195 insertions(+), 43 deletions(-)
---
diff --git a/HACKING b/HACKING
index 3f533b0..a32d93e 100644
--- a/HACKING
+++ b/HACKING
@@ -2,7 +2,8 @@ GNOME Internet Radio Locator is currently available as a GNOME 3
desktop program with source code released under GNU General Public
License version 3.
-The initial work on this program began in March 2017.
+The initial work on this program began in March 2017 and the work
+continues in 2018.
The Git source code repository is at
diff --git a/NEWS b/NEWS
index 4dcc52b..7664e45 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,15 @@
Version 1.0.3
=============
+Configuration
+
+ * configure.ac: Add dependency on libsoup and gsettings-desktop-schemas
+ * data/org.gnome.gnome-internet-radio-locator.gschema.xml: Add gschema
+ * data/Makefile.am: Add gsettings
+ * src/gnome-internet-radio-locator-gui.c: Add initial work on gsettings
+ * src/gnome-internet-radio-locator-keys.c: Add gsetting keys
+ * src/gnome-internet-radio-locator-keys.h: Add gsetting keys
+
Credits
* AUTHORS: Add Nathan Follens (Dutch translation)
@@ -11,6 +20,7 @@ Credits
Translations
+ * Daniel Mustieles (es)
* Nathan Follens (nl)
=============
diff --git a/README b/README
index 2f78b4f..3f1e203 100644
--- a/README
+++ b/README
@@ -2,10 +2,35 @@ GNOME Internet Radio Locator is a Free Software program that allows
you to easily locate Free Internet Radio stations by broadcasters on
the Internet with the help of a map.
-GNOME Internet Radio Locator is developed on the GNOME 3 platform and
-it requires gstreamer 1.0 for playback.
+GNOME Internet Radio Locator is developed on the GNOME 3 platform with
+GNOME Maps, libchamplain and geocode-lib and it requires gstreamer 1.0
+for audio playback.
+
+You can view all the stations in src/gnome-internet-radio-locator.xml
+and enter city names in the GUI search input field in order to locate
+radio stations in the city using the text search with auto-completion.
+
+To launch the program, you can click on Activies in GNOME 3 and enter
+
+ gnome-internet-radio-locator
+
+in the Search field or launch
+
+ gnome-internet-radio-locator
+
+from gnome-terminal.
+
+You can download pre-compiled binaries for Debian GNU/Linux i386,
+Fedora Core x86_64 and Ubuntu Linux amd64 from the web site at
+
+ https://people.gnome.org/~ole/gnome-internet-radio-locator/
+
+You can download the latest release from the official GNOME site:
+
+ ftp://ftp.gnome.org/pub/GNOME/sources/gnome-internet-radio-locator/
+ https://download.gnome.org/sources/gnome-internet-radio-locator/
Enjoy Free Internet Radio.
Cheers,
-Ole Aamot <ole gnome org>
+Ole Aamot <ole gnome org>
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
index c52492a..6b50fc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(gnome-internet-radio-locator,1.0.2)
+AC_INIT(gnome-internet-radio-locator,1.0.3)
AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/gnome-internet-radio-locator.c])
@@ -64,19 +64,21 @@ AC_SUBST([HAVE_GNOME_INTERNET_RADIO_LOCATOR_RECORD])
AC_CHECK_LIB(m, pow, [], [], [])
PKG_CHECK_MODULES(GNOME_INTERNET_RADIO_LOCATOR,
- gtk+-3.0 >= 3.0 \
- glib-2.0 >= 2.38.0 \
- gobject-2.0 >= 2.38.0 \
- pangoft2 >= 0.28 \
champlain-gtk-0.12 >= 0.12.10 \
- libxml-2.0 >= 2.0 \
geocode-glib-1.0 >= 3.20 \
- gstreamer-tag-1.0 >= 1.0 \
+ glib-2.0 >= 2.38.0 \
+ gobject-2.0 >= 2.38.0 \
gstreamer-1.0 >= 1.0 \
+ gsettings-desktop-schemas >= 2.91.92 \
gstreamer-player-1.0 >= 1.0 \
- gstreamer-video-1.0)
+ gstreamer-tag-1.0 >= 1.0 \
+ gstreamer-video-1.0 \
+ gtk+-3.0 >= 3.0 \
+ libsoup-2.4 >= 0.29.1 \
+ libxml-2.0 >= 2.0 \
+ pangoft2 >= 0.28)
-GNOME_INTERNET_RADIO_LOCATOR_PKG_DEPS="geocode-glib-1.0 gtk+-3.0 glib-2.0 gobject-2.0 pangoft2
champlain-gtk-0.12 libxml-2.0, gstreamer-1.0 gstreamer-player-1.0 gstreamer-video-1.0"
+GNOME_INTERNET_RADIO_LOCATOR_PKG_DEPS="champlain-gtk-0.12 geocode-glib-1.0 glib-2.0 gobject-2.0
gstreamer-1.0 gstreamer-player-1.0 gstreamer-video-1.0 gtk+-3.0 libxml-2.0 pangoft2"
GTK_DOC_CHECK([1.16], [--flavour no-tmpl])
@@ -124,10 +126,17 @@ AC_SUBST(GNOME_INTERNET_RADIO_LOCATOR_PKG_DEPS)
dnl Enable yelp-tools
# YELP_HELP_INIT
+# *********
+# GSettings
+# *********
+
+GLIB_GSETTINGS
+
AC_OUTPUT([
Makefile
data/Makefile
data/gnome-internet-radio-locator.desktop
+data/org.gnome.gnome-internet-radio-locator.gschema.xml
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 197057f..53e0fab 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -13,12 +13,11 @@ appdatadir = $(datadir)/appdata
appdata_in_files = gnome-internet-radio-locator.appdata.xml.in
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
-# gsettings_ENUM_NAMESPACE = org.gnome.gnome-internet-radio-locator
-# gsettings_ENUM_FILES = $(top_srcdir)/src/eog-scroll-view.h \
-# $(top_srcdir)/src/eog-window.h
-# gsettings_SCHEMAS = org.gnome.gnome-internet-radio-locator.gschema.xml
+gsettings_ENUM_NAMESPACE = org.gnome.gnome-internet-radio-locator
+gsettings_ENUM_FILES = $(top_srcdir)/src/gnome-internet-radio-locator-gui.h
+gsettings_SCHEMAS = org.gnome.gnome-internet-radio-locator.gschema.xml
-# @GSETTINGS_RULES@
+@GSETTINGS_RULES@
# gsettingsconvertdir = $(datadir)/GConf/gsettings
# gsettingsconvert_DATA = eog.convert
@@ -34,7 +33,6 @@ EXTRA_DIST = $(DESKTOP_IN_FILES) $(appdata_in_files)
CLEANFILES = $(appdata_DATA)
-DISTCLEANFILES = $(DESKTOP_FILES)
-# $(gsettings_SCHEMAS)
+DISTCLEANFILES = $(DESKTOP_FILES) $(gsettings_SCHEMAS)
-include $(top_srcdir)/git.mk
diff --git a/data/org.gnome.gnome-internet-radio-locator.gschema.xml
b/data/org.gnome.gnome-internet-radio-locator.gschema.xml
new file mode 100644
index 0000000..a73ec34
--- /dev/null
+++ b/data/org.gnome.gnome-internet-radio-locator.gschema.xml
@@ -0,0 +1,12 @@
+<schemalist>
+ <schema gettext-domain="gnome-internet-radio-locator" id="org.gnome.gnome-internet-radio-locator"
path="/org/gnome/gnome-internet-radio-locator/">
+ <child name="ui" schema="org.gnome.gnome-internet-radio-locator.ui"/>
+ </schema>
+ <schema gettext-domain="gnome-internet-radio-locator" id="org.gnome.gnome-internet-radio-locator.ui"
path="/org/gnome/gnome-internet-radio-locator/ui/">
+ <key name="station" type="s">
+ <default>'San Francisco, California'</default>
+ <summary>Default station</summary>
+ <description>Default Internet Radio station.</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/data/org.gnome.gnome-internet-radio-locator.gschema.xml.in
b/data/org.gnome.gnome-internet-radio-locator.gschema.xml.in
new file mode 100644
index 0000000..8fb3c5a
--- /dev/null
+++ b/data/org.gnome.gnome-internet-radio-locator.gschema.xml.in
@@ -0,0 +1,12 @@
+<schemalist>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gnome-internet-radio-locator"
path="/org/gnome/gnome-internet-radio-locator/">
+ <child name="ui" schema="org.gnome.gnome-internet-radio-locator.ui"/>
+ </schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gnome-internet-radio-locator.ui"
path="/org/gnome/gnome-internet-radio-locator/ui/">
+ <key name="station" type="s">
+ <default>'San Francisco, California'</default>
+ <summary>Default station</summary>
+ <description>Default Internet Radio station.</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/meson.build b/meson.build
index b7f2008..09bc82a 100644
--- a/meson.build
+++ b/meson.build
@@ -9,6 +9,7 @@ champlain_gtk_dep = dependency('champlain-gtk-0.12')
champlain_dep = dependency('champlain-0.12')
geocode_dep = dependency('geocode-glib-1.0')
libxml_dep = dependency('libxml-2.0')
+gsettings_dep = dependency('gsettings-desktop-schemas', version: '>= 2.91.92')
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required : false)
inc = include_directories('src')
diff --git a/src/Makefile.am b/src/Makefile.am
index b8a108d..90bba45 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,7 +35,7 @@ gnomeinternetradiolocatordir = $(datadir)/gnome-internet-radio-locator
gnomeinternetradiolocator_DATA = gnome-internet-radio-locator-0.1.dtd gnome-internet-radio-locator.xml
-EXTRA_DIST = gnome-internet-radio-locator.h gnome-internet-radio-locator-player.h
gnome-internet-radio-locator-markers.h gnome-internet-radio-locator-player-kb.h
gnome-internet-radio-locator-player-resource.h gnome-internet-radio-locator-station.h
gnome-internet-radio-locator-stations-map.h gnome-internet-radio-locator-tz.h
gnome-internet-radio-locator-gui.h gnome-internet-radio-locator-listener.h
gnome-internet-radio-locator-program.h gnome-internet-radio-locator-radius.h
gnome-internet-radio-locator-runners.h gnome-internet-radio-locator-streams.h
gnome-internet-radio-locator-0.1.dtd gnome-internet-radio-locator.xml gnome-internet-radio-locator.xsl
+EXTRA_DIST = gnome-internet-radio-locator.h gnome-internet-radio-locator-player.h
gnome-internet-radio-locator-keys.h gnome-internet-radio-locator-markers.h
gnome-internet-radio-locator-nominatim.h gnome-internet-radio-locator-player-kb.h
gnome-internet-radio-locator-player-resource.h gnome-internet-radio-locator-station.h
gnome-internet-radio-locator-stations-map.h gnome-internet-radio-locator-tz.h
gnome-internet-radio-locator-gui.h gnome-internet-radio-locator-listener.h
gnome-internet-radio-locator-program.h gnome-internet-radio-locator-radius.h
gnome-internet-radio-locator-runners.h gnome-internet-radio-locator-streams.h
gnome-internet-radio-locator-0.1.dtd gnome-internet-radio-locator.xml gnome-internet-radio-locator.xsl
LDADD = $(GNOME_INTERNET_RADIO_LOCATOR_LIBS)
diff --git a/src/gnome-internet-radio-locator-gui.c b/src/gnome-internet-radio-locator-gui.c
index 6dc9e60..b48f45b 100644
--- a/src/gnome-internet-radio-locator-gui.c
+++ b/src/gnome-internet-radio-locator-gui.c
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2014, 2015, 2016, 2017 Ole Aamot Software
+ * Copyright (C) 2014, 2015, 2016, 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
@@ -30,8 +30,10 @@
#include <gtk/gtk.h>
#include <gtk/gtkcombobox.h>
#include <glib/gstdio.h>
+#include <gio/gio.h>
#include "gnome-internet-radio-locator.h"
#include "gnome-internet-radio-locator-gui.h"
+#include "gnome-internet-radio-locator-keys.h"
#include "gnome-internet-radio-locator-program.h"
#include "gnome-internet-radio-locator-station.h"
#include "gnome-internet-radio-locator-streams.h"
@@ -377,14 +379,24 @@ GtkWidget *create_gnome_internet_radio_locator_app(void)
GtkWidget *appbar;
GtkWidget *progress;
+ gsize length;
+ const gchar *selected_station, *selected_station_uri, *selected_station_name,
*selected_station_location, *selected_station_description;
GNOMEInternetRadioLocatorData *gnome_internet_radio_locator_data =
g_new0(GNOMEInternetRadioLocatorData, 1);
char *pmf;
-
gtk_window_set_title(GTK_WINDOW(gnome_internet_radio_locator_app), "GNOME Internet Radio Locator");
-
gnome_internet_radio_locator = gnome_internet_radio_locator_data;
-
+ gnome_internet_radio_locator_data->settings = g_settings_new(GNOME_INTERNET_RADIO_LOCATOR_UI);
+ selected_station_uri = g_variant_get_string(g_settings_get_value
(gnome_internet_radio_locator_data->settings, "selected_station_uri"), &length);
+ selected_station =
g_variant_get_string(g_settings_get_value(gnome_internet_radio_locator_data->settings, "station"), &length);
+ g_print ("XYZ STATION = %s\n", selected_station);
+ /* gnome_internet_radio_locator->selected_station_uri = selected_station_uri; */
+ selected_station_name = g_variant_get_string(g_settings_get_value
(gnome_internet_radio_locator_data->settings, "selected_station_name"), &length);
+ /* gnome_internet_radio_locator->selected_station_name = selected_station_name; */
+ selected_station_location = g_variant_get_string(g_settings_get_value
(gnome_internet_radio_locator_data->settings, "selected_station_location"), &length);
+ /* gnome_internet_radio_locator->selected_station_location = selected_station_location; */
+ selected_station_description = g_variant_get_string(g_settings_get_value
(gnome_internet_radio_locator_data->settings, "selected_station_description"), &length);
+ /* gnome_internet_radio_locator->selected_station_description = selected_station_description; */
#if GNOME_INTERNET_RADIO_LOCATOR_CFG_GNOME_CONFIG
gnome_config_push_prefix("/gnome-internet-radio-locator/General/");
diff --git a/src/gnome-internet-radio-locator-markers.c b/src/gnome-internet-radio-locator-markers.c
index c7d5386..9928718 100644
--- a/src/gnome-internet-radio-locator-markers.c
+++ b/src/gnome-internet-radio-locator-markers.c
@@ -99,13 +99,19 @@ create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **pat
champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker));
#endif
-
+
marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Berkeley, California");
champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.873093, -122.303769);
champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
/* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), NULL);
+ marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
+ champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Dublin, Ireland");
+ champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 53.3497645,-6.2602732);
+ champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
+ /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
+ g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), NULL);
marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Moscow, Russia");
@@ -122,6 +128,13 @@ create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **pat
g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), NULL);
marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
+ champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Reykjavik, Iceland");
+ champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 64.145981,-21.9422367);
+ champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
+ /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
+ g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), NULL);
+
+ marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Cape Town, South Africa");
champlain_location_set_location (CHAMPLAIN_LOCATION (marker),-33.928992,18.417396);
champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
@@ -180,7 +193,7 @@ create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **pat
champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker));
#endif
-
+
champlain_marker_layer_set_all_markers_draggable (layer);
clutter_actor_show (layer_actor);
diff --git a/src/gnome-internet-radio-locator-radius.c b/src/gnome-internet-radio-locator-radius.c
index 2b2c575..aac6c30 100644
--- a/src/gnome-internet-radio-locator-radius.c
+++ b/src/gnome-internet-radio-locator-radius.c
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2017 Ole Aamot Software
+ * Copyright (C) 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
diff --git a/src/gnome-internet-radio-locator-radius.h b/src/gnome-internet-radio-locator-radius.h
index 0d9f0ea..5b0b029 100644
--- a/src/gnome-internet-radio-locator-radius.h
+++ b/src/gnome-internet-radio-locator-radius.h
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2017 Ole Aamot Software
+ * Copyright (C) 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
diff --git a/src/gnome-internet-radio-locator-station.c b/src/gnome-internet-radio-locator-station.c
index c9058ef..7ada00f 100644
--- a/src/gnome-internet-radio-locator-station.c
+++ b/src/gnome-internet-radio-locator-station.c
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2014, 2015, 2016, 2017 Ole Aamot Software
+ * Copyright (C) 2014, 2015, 2016, 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
diff --git a/src/gnome-internet-radio-locator-station.h b/src/gnome-internet-radio-locator-station.h
index 585f52c..24d2f36 100644
--- a/src/gnome-internet-radio-locator-station.h
+++ b/src/gnome-internet-radio-locator-station.h
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2014, 2015, 2017 Ole Aamot Software
+ * Copyright (C) 2014, 2015, 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
diff --git a/src/gnome-internet-radio-locator.c b/src/gnome-internet-radio-locator.c
index 0ff3864..2ee942c 100644
--- a/src/gnome-internet-radio-locator.c
+++ b/src/gnome-internet-radio-locator.c
@@ -2,7 +2,7 @@
*
* GNOME Internet Radio Locator
*
- * Copyright (C) 2014, 2015, 2016, 2017 Ole Aamot Software
+ * Copyright (C) 2014, 2015, 2016, 2017, 2018 Ole Aamot Software
*
* Author: Ole Aamot <oka oka no>
*
@@ -81,6 +81,8 @@ extern struct GNOMEInternetRadioLocatorMedia *media;
GStatBuf stats;
+ChamplainView *view;
+
/*
* Terminate the main loop.
*/
@@ -119,12 +121,14 @@ mouse_click_cb (ClutterActor *actor, ClutterButtonEvent *event, ChamplainView *v
GeocodeLocation *location_city;
GeocodeLocation *location_country;
GeocodeReverse *reverse_city, *reverse_country;
+
const char *name, *name_city, *name_country;
/* GeocodeForward *fwd; */
/* GList *list; */
/* GError **err; */
lon = champlain_view_x_to_longitude (view, event->x);
lat = champlain_view_y_to_latitude (view, event->y);
+ /* champlain_view_center_on (CHAMPLAIN_VIEW (view), lat, lon); */
location_city = geocode_location_new (lat, lon, GEOCODE_LOCATION_ACCURACY_CITY);
location_country = geocode_location_new (lat, lon, GEOCODE_LOCATION_ACCURACY_COUNTRY);
reverse_city = geocode_reverse_new_for_location (location_city);
@@ -644,7 +648,6 @@ on_location_matches(GtkEntryCompletion *widget,
gpointer user_data)
{
GValue value = {0, };
-
gtk_tree_model_get_value(model, iter, STATION_LOCATION, &value);
gnome_internet_radio_locator->selected_station_location = g_strdup(g_value_get_string(&value));
g_value_unset(&value);
@@ -665,8 +668,71 @@ on_search_matches(GtkEntryCompletion *widget,
GtkTreeIter *iter,
gpointer user_data)
{
+ GeocodeNominatim *geocode_nominatim;
+ GeocodePlace *place;
+ GeocodeLocation *geocode_location;
+
+ GeocodePlace *place_city, *place_country;
+ GeocodeLocation *location_city;
+ GeocodeLocation *location_country;
+ GeocodeReverse *reverse_city, *reverse_country;
+
+ glong lat, lon;
+ GValue city = {0, };
GValue value = {0, };
+ GValue station_name = {0, };
+ gchar *location;
+ gchar *town;
+ gchar *country;
+ gchar *state;
+ GError **err;
+
+ gtk_tree_model_get_value(model, iter, STATION_LOCATION, &city);
gtk_tree_model_get_value(model, iter, STATION_URI, &value);
+ gtk_tree_model_get_value(model, iter, STATION_NAME, &station_name);
+ g_print ("on_search_matches: %s\n", (gchar *)g_value_get_string(&city));
+ location = (gchar *)g_value_get_string(&city);
+ town = strtok(location, ", ");
+ country = strtok(NULL, " ");
+/* Handle U.S. states
+ geocode_place_set_country (place, "United States of America");
+ country = geocode_place_get_state (country);
+*/
+ place = geocode_place_new((gchar *)g_value_get_string(&station_name),
GEOCODE_PLACE_TYPE_MISCELLANEOUS);
+
+ g_print ("geocode_place_new:town: %s\n", geocode_place_get_town(place));
+ g_print ("geocode_place_new:country: %s\n", geocode_place_get_country(place));
+
+ geocode_place_set_town (place, town);
+ geocode_place_set_country(place, country);
+
+ geocode_nominatim = geocode_nominatim_new ("https://nominatim.gnome.org/", "ole gnome org");
+
+ g_print ("geocode_place_get_town: %s\n", geocode_place_get_town(place));
+ g_print ("geocode_place_get_country: %s\n", geocode_place_get_country(place));
+ /* g_print ("%s\n", geocode_nominatim_get_city(geocode_nominatim)); */
+
+ reverse_city = geocode_reverse_new_for_location(geocode_location);
+ place = geocode_reverse_resolve(reverse_city, err);
+
+ geocode_location = geocode_place_get_location(place);
+ g_print ("%f7.3\n", geocode_location_get_latitude(geocode_location));
+ lat = geocode_location_get_latitude(geocode_location);
+ lon = geocode_location_get_longitude(geocode_location);
+ g_print ("lat: %ld\n", lat);
+ g_print ("lon: %ld\n", lon);
+
+/*
+ location_city = geocode_location_new (lat, lon, GEOCODE_LOCATION_ACCURACY_CITY);
+ location_country = geocode_location_new (lat, lon, GEOCODE_LOCATION_ACCURACY_COUNTRY);
+ reverse_city = geocode_reverse_new_for_location (location_city);
+ reverse_country = geocode_reverse_new_for_location (location_country);
+ place_city = geocode_reverse_resolve (reverse_city, error);
+ place_country = geocode_reverse_resolve (reverse_country, error);
+ name_city = geocode_place_get_town (place_city);
+ name_country = geocode_place_get_country (place_country);
+*/
+ champlain_view_center_on (CHAMPLAIN_VIEW (view),lat,lon);
gnome_internet_radio_locator_player_stop(player);
player = gst_player_new (NULL, gst_player_g_main_context_signal_dispatcher_new(NULL));
/* g_object_set_data(G_OBJECT(widget), "station_uri", g_value_get_string(&value)); */
@@ -681,24 +747,18 @@ main (int argc,
{
GtkWidget *window;
GtkWidget *widget, *vbox, *bbox, *button, *viewport, *image;
- ChamplainView *view;
ClutterActor *scale;
ChamplainLicense *license_actor;
GtkListStore *model;
GtkTreeIter iter;
GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
-
if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
-
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
/* give the window a 10px wide border */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
-
/* give it the title */
gtk_window_set_title (GTK_WINDOW (window), "GNOME Internet Radio Locator");
-
/* Connect the destroy event of the window with our on_destroy function
* When the window is about to be destroyed we get a notificaiton and
* stop the main GTK loop
@@ -734,9 +794,7 @@ main (int argc,
license_actor = champlain_view_get_license_actor (view);
champlain_license_set_extra_text (license_actor, "Free Internet Radio");
-
champlain_view_center_on (CHAMPLAIN_VIEW (view), 37.873093, -122.303769);
-
layer = create_marker_layer (view, &path);
champlain_view_add_layer (view, CHAMPLAIN_LAYER (path));
champlain_view_add_layer (view, CHAMPLAIN_LAYER (layer));
diff --git a/src/gnome-internet-radio-locator.h b/src/gnome-internet-radio-locator.h
index 051bb13..420bf12 100644
--- a/src/gnome-internet-radio-locator.h
+++ b/src/gnome-internet-radio-locator.h
@@ -101,6 +101,7 @@ gboolean on_search_matches(GtkEntryCompletion *widget,
struct _GNOMEInternetRadioLocatorData {
GtkImage *pixmap;
GtkProgressBar *progress;
+ GSettings *settings;
GtkAboutDialog *window;
GtkStatusbar *statusbar;
GtkWidget *player_window;
@@ -127,7 +128,7 @@ struct _GNOMEInternetRadioLocatorData {
gchar *selected_station_name;
gchar *selected_station_location;
gchar *selected_station_band;
- gchar *selected_station_description;
+ gchar *selected_station_description;
gchar *selected_station_website;
gint selected_bitrate;
GNOMEInternetRadioLocatorStreamsInfo *selected_streams;
diff --git a/src/gnome-internet-radio-locator.xml b/src/gnome-internet-radio-locator.xml
index febdc03..6c5f1f5 100644
--- a/src/gnome-internet-radio-locator.xml
+++ b/src/gnome-internet-radio-locator.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href="https://people.gnome.org/~ole/gnome-internet-radio-locator/gnome-internet-radio-locator.xsl" ?>
<!DOCTYPE gnome_internet_radio_locator SYSTEM "gnome-internet-radio-locator-0.1.dtd">
-<gnome_internet_radio_locator version="1.0.2">
+<gnome_internet_radio_locator version="1.0.3">
<station band="ONLINE" id="drnyheder" lang="da" name="Danmarks Radio Nyheder" rank="1.0" type="gov">
<frequency uri="http://www.dr.dk/nyheder">FM 93.3 in Aalborg</frequency>
<location>Copenhagen, Denmark</location>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]