[gnome-internet-radio-locator] Release gnome-internet-radio-locator 0.5.0
- From: ole <ole src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-internet-radio-locator] Release gnome-internet-radio-locator 0.5.0
- Date: Mon, 17 Jul 2017 14:53:31 +0000 (UTC)
commit c7def48a6b1f0e764ea4127daae3e4685a2ae4ca
Author: Ole Aamot <oka oka no>
Date: Mon Jul 17 16:52:46 2017 +0200
Release gnome-internet-radio-locator 0.5.0
DEBIAN | 5 +-
HACKING | 8 +-
NEWS | 33 +++++
README | 12 ++-
configure.ac | 2 +-
.../apps/gnome-internet-radio-locator.png | Bin 105392 -> 122926 bytes
.../16x16/apps/gnome-internet-radio-locator.png | Bin 729 -> 749 bytes
.../22x22/apps/gnome-internet-radio-locator.png | Bin 1083 -> 1093 bytes
.../24x24/apps/gnome-internet-radio-locator.png | Bin 1162 -> 1174 bytes
.../256x256/apps/gnome-internet-radio-locator.png | Bin 18799 -> 21035 bytes
.../32x32/apps/gnome-internet-radio-locator.png | Bin 1614 -> 1605 bytes
.../48x48/apps/gnome-internet-radio-locator.png | Bin 2606 -> 2633 bytes
.../512x512/apps/gnome-internet-radio-locator.png | Bin 44028 -> 50346 bytes
data/screenshot.png | Bin 483039 -> 336819 bytes
gnome-internet-radio-locator.doap | 4 +-
gnome-internet-radio-locator.spec.in | 9 +-
src/Makefile.am | 25 ++--
src/gnome-internet-radio-locator-gui.c | 129 ++++++++------------
src/gnome-internet-radio-locator-markers.c | 59 +++++++--
src/gnome-internet-radio-locator-player.c | 20 +++-
src/gnome-internet-radio-locator-player.h | 2 +-
src/gnome-internet-radio-locator-radius.c | 76 ++++++++++++
src/gnome-internet-radio-locator-radius.h | 29 +++++
src/gnome-internet-radio-locator-station.c | 85 ++++++++++++-
src/gnome-internet-radio-locator-tz.c | 8 +-
src/gnome-internet-radio-locator.c | 127 ++++++++++---------
src/gnome-internet-radio-locator.h | 7 +-
src/gnome-internet-radio-locator.xml | 4 +-
28 files changed, 449 insertions(+), 195 deletions(-)
---
diff --git a/DEBIAN b/DEBIAN
index c824838..8e31a58 100644
--- a/DEBIAN
+++ b/DEBIAN
@@ -1,4 +1,5 @@
GNOME Internet Radio Locator runs on Debian GNU/Linux (http://www.debian.org/)
-If you are packaging GNOME Internet Radio Locator for Debian GNU/Linux and/or
-other GNU/Linux distributions, please coordinate this with ole src gnome org.
+If you are packaging GNOME Internet Radio Locator for Debian GNU/Linux
+and/or other GNU/Linux distributions, please coordinate this with
+ole gnome org.
diff --git a/HACKING b/HACKING
index 3ba44e0..3f533b0 100644
--- a/HACKING
+++ b/HACKING
@@ -1,6 +1,6 @@
GNOME Internet Radio Locator is currently available as a GNOME 3
desktop program with source code released under GNU General Public
-License version 2.
+License version 3.
The initial work on this program began in March 2017.
@@ -16,9 +16,9 @@ patches and adding new Internet radio stations in
Any contribution is welcome and always credited in AUTHORS and THANKS.
-To enable debugging messages, modifiy the CC compilation definition
+To enable debugging messages, modify the CC compilation definition
flag from -DGNOME_INTERNET_RADIO_LOCATOR_DEBUG=1 to
-DGNOME_INTERNET_RADIO_LOCATOR_DEBUG=0 in src/Makefile.am
-Enjoy Internet radio,
-Ole Aamot <ole src gnome org>
+Enjoy Free Internet radio,
+Ole Aamot <ole gnome org>
diff --git a/NEWS b/NEWS
index b92a2ed..db6b6f0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,37 @@
=============
+Version 0.5.0
+=============
+
+Artwork
+
+ * data/icons/16x16/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/22x22/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/24x24/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/32x32/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/48x48/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/256x256/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/512x512/apps/gnome-internet-radio-locator.png: New Icon
+ * data/icons/1024x1024/apps/gnome-internet-radio-locator.png: New Icon
+ * data/screenshot.png: New screenshot
+
+GUI
+
+ * src/gnome-internet-radio-locator-gui.c: New Station GUI
+ * src/gnome-internet-radio-locator-markers.c: Marker callback
+ * src/gnome-internet-radio-locator-station.c: New XML parsing
+
+License
+
+ * COPYING: Enforcing GNU General Public License version 3
+ * src/gnome-internet-radio-locator-station.c: GPL version 3
+ * src/gnome-internet-radio-locator-tz.c: GPL version 3
+ * src/gnome-internet-radio-locator.c: GPL version 3
+
+Translations
+
+ * Marek Černocký (cs)
+
+=============
Version 0.4.0
=============
diff --git a/README b/README
index 56251c8..2f78b4f 100644
--- a/README
+++ b/README
@@ -1,7 +1,11 @@
-GNOME Internet Radio Locator allows the user to easily locate and
-listen to Internet radio stations such as WNYC over the Internet.
+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.
-Enjoy Internet Radio.
+GNOME Internet Radio Locator is developed on the GNOME 3 platform and
+it requires gstreamer 1.0 for playback.
+
+Enjoy Free Internet Radio.
Cheers,
-Ole Aamot <ole src gnome org>
+Ole Aamot <ole gnome org>
diff --git a/configure.ac b/configure.ac
index a56ecee..f59474e 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,0.4.0)
+AC_INIT(gnome-internet-radio-locator,0.5.0)
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])
diff --git a/data/icons/1024x1024/apps/gnome-internet-radio-locator.png
b/data/icons/1024x1024/apps/gnome-internet-radio-locator.png
index ac6584a..b4262ed 100644
Binary files a/data/icons/1024x1024/apps/gnome-internet-radio-locator.png and
b/data/icons/1024x1024/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/16x16/apps/gnome-internet-radio-locator.png
b/data/icons/16x16/apps/gnome-internet-radio-locator.png
index 904f3c6..ba6ccd8 100644
Binary files a/data/icons/16x16/apps/gnome-internet-radio-locator.png and
b/data/icons/16x16/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/22x22/apps/gnome-internet-radio-locator.png
b/data/icons/22x22/apps/gnome-internet-radio-locator.png
index 19e7b95..4e27caa 100644
Binary files a/data/icons/22x22/apps/gnome-internet-radio-locator.png and
b/data/icons/22x22/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/24x24/apps/gnome-internet-radio-locator.png
b/data/icons/24x24/apps/gnome-internet-radio-locator.png
index 986eff1..51b5976 100644
Binary files a/data/icons/24x24/apps/gnome-internet-radio-locator.png and
b/data/icons/24x24/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/256x256/apps/gnome-internet-radio-locator.png
b/data/icons/256x256/apps/gnome-internet-radio-locator.png
index de7146d..6727eef 100644
Binary files a/data/icons/256x256/apps/gnome-internet-radio-locator.png and
b/data/icons/256x256/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/32x32/apps/gnome-internet-radio-locator.png
b/data/icons/32x32/apps/gnome-internet-radio-locator.png
index 1f0f99b..9df1509 100644
Binary files a/data/icons/32x32/apps/gnome-internet-radio-locator.png and
b/data/icons/32x32/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/48x48/apps/gnome-internet-radio-locator.png
b/data/icons/48x48/apps/gnome-internet-radio-locator.png
index 804c801..ed0db78 100644
Binary files a/data/icons/48x48/apps/gnome-internet-radio-locator.png and
b/data/icons/48x48/apps/gnome-internet-radio-locator.png differ
diff --git a/data/icons/512x512/apps/gnome-internet-radio-locator.png
b/data/icons/512x512/apps/gnome-internet-radio-locator.png
index 7503bfa..1fa9b0c 100644
Binary files a/data/icons/512x512/apps/gnome-internet-radio-locator.png and
b/data/icons/512x512/apps/gnome-internet-radio-locator.png differ
diff --git a/data/screenshot.png b/data/screenshot.png
index 861a1be..eacae80 100644
Binary files a/data/screenshot.png and b/data/screenshot.png differ
diff --git a/gnome-internet-radio-locator.doap b/gnome-internet-radio-locator.doap
index d540895..9908b4b 100644
--- a/gnome-internet-radio-locator.doap
+++ b/gnome-internet-radio-locator.doap
@@ -5,7 +5,7 @@
xmlns="http://usefulinc.com/ns/doap#">
<name xml:lang="en">GNOME Internet Radio Locator</name>
<shortdesc xml:lang="en">Locate Internet Radio Stations</shortdesc>
- <description>GNOME Internet Radio Locator allows users to easily find live radio programs on radio
broadcasters on the Internet. This software is developed on the GNOME 3 platform and requires GStreamer 1.0
to be installed for playback. Enjoy Internet Radio.</description>
+ <description>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. Enjoy Free Internet
Radio.</description>
<homepage rdf:resource="https://wiki.gnome.org/Apps/GNOMEInternetRadioLocator" />
<mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gnome-internet-radio-locator-list" />
<download-page rdf:resource="http://download.gnome.org/sources/gnome-internet-radio-locator/" />
@@ -15,7 +15,7 @@
<maintainer>
<foaf:Person>
<foaf:name>Ole Aamot</foaf:name>
- <foaf:mbox rdf:resource="mailto:oka oka no" />
+ <foaf:mbox rdf:resource="mailto:ole gnome org" />
<gnome:userid>ole</gnome:userid>
</foaf:Person>
</maintainer>
diff --git a/gnome-internet-radio-locator.spec.in b/gnome-internet-radio-locator.spec.in
index 897d5ae..45e1548 100644
--- a/gnome-internet-radio-locator.spec.in
+++ b/gnome-internet-radio-locator.spec.in
@@ -23,13 +23,13 @@ Requires: gstreamer1-plugins-ugly >= 1.8.3
%description
GNOME Internet Radio Locator is a Free Software program that allows
-you to easily locate radio programs by broadcasters on the Internet
-with the help of a map.
+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.
-Enjoy Internet Radio.
+Enjoy Free Internet Radio.
%prep
%setup -q
@@ -72,6 +72,9 @@ fi
%{_datadir}/help/*/%{name}
%changelog
+* Sun Jul 09 2017 Ole Aamot - 0.5.0-1.fc25
+- gnome-internet-radio-locator 0.5.0 build on Fedora Linux 25
+
* Tue Jun 27 2017 Ole Aamot - 0.4.0-1.fc25
- gnome-internet-radio-locator 0.4.0 build on Fedora Linux 25
diff --git a/src/Makefile.am b/src/Makefile.am
index b6f8b9f..740c8df 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,17 +9,18 @@ AM_CFLAGS = $(GNOME_INTERNET_RADIO_LOCATOR_CFLAGS) \
bin_PROGRAMS = gnome-internet-radio-locator
gnome_internet_radio_locator_SOURCES = \
- gnome-internet-radio-locator-gui.c \
- gnome-internet-radio-locator-listener.c \
- gnome-internet-radio-locator-markers.c \
- gnome-internet-radio-locator-player.c \
- gnome-internet-radio-locator-program.c \
- gnome-internet-radio-locator-runners.c \
- gnome-internet-radio-locator-station.c \
- gnome-internet-radio-locator-stations-map.c \
- gnome-internet-radio-locator-streams.c \
- gnome-internet-radio-locator-tz.c \
- gnome-internet-radio-locator.c
+ gnome-internet-radio-locator-gui.c \
+ gnome-internet-radio-locator-listener.c \
+ gnome-internet-radio-locator-markers.c \
+ gnome-internet-radio-locator-player.c \
+ gnome-internet-radio-locator-program.c \
+ gnome-internet-radio-locator-radius.c \
+ gnome-internet-radio-locator-runners.c \
+ gnome-internet-radio-locator-station.c \
+ gnome-internet-radio-locator-stations-map.c \
+ gnome-internet-radio-locator-streams.c \
+ gnome-internet-radio-locator-tz.c \
+ gnome-internet-radio-locator.c
gnome_internet_radio_locator_CFLAGS = $(GNOME_INTERNET_RADIO_LOCATOR_CFLAGS) \
-DGNOME_INTERNET_RADIO_LOCATOR_DATADIR=\"$(datadir)/gnome-internet-radio-locator\" \
@@ -34,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-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-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
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 5ccce34..624549b 100644
--- a/src/gnome-internet-radio-locator-gui.c
+++ b/src/gnome-internet-radio-locator-gui.c
@@ -6,9 +6,9 @@
*
* Author: Ole Aamot <oka oka no>
*
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
@@ -43,11 +42,12 @@
extern GtkWidget *gnome_internet_radio_locator_app;
extern GtkWidget *search_selector;
+GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
GtkWidget *create_stations_selector(char *selected_station_uri,
char *filename)
{
- GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
+
GtkWidget *stations_selector;
GtkWidget *align, *menu, *drop_down, *item;
@@ -61,7 +61,9 @@ GtkWidget *create_stations_selector(char *selected_station_uri,
memset(&stats, 0, sizeof(stats));
/* The Stations dialog */
- stations_selector = gtk_dialog_new_with_buttons("Select a station",
GTK_WINDOW(gnome_internet_radio_locator_app), 0, /* flags */
+ stations_selector = gtk_dialog_new_with_buttons("Select a station",
+ GTK_WINDOW(gnome_internet_radio_locator_app),
+ 0, /* flags */
NULL,
GTK_RESPONSE_ACCEPT,
NULL);
@@ -211,9 +213,28 @@ on_location_matches(GtkEntryCompletion *widget,
return FALSE;
}
+void
+save_cb (GtkWidget *widget, gpointer data) {
+
+ /* g_print("%s\n", data); */
+
+ char *nameentry, *locationentry, *urientry, *websiteentry, *descriptionentry;
+
+ nameentry = g_object_get_data(G_OBJECT(widget), "station_name");
+ locationentry = g_object_get_data(G_OBJECT(widget), "station_location");
+ urientry = g_object_get_data(G_OBJECT(widget), "station_uri");
+ websiteentry = g_object_get_data(G_OBJECT(widget), "station_website");
+ descriptionentry = g_object_get_data(G_OBJECT(widget), "station_description");
+
+ g_print("%s\n", nameentry);
+ g_print("%s\n", locationentry);
+ g_print("%s\n", urientry);
+ g_print("%s\n", websiteentry);
+ g_print("%s\n", descriptionentry);
+}
+
GtkWidget *create_new_station_selector(void) {
- GNOMEInternetRadioLocatorStationInfo *localstation, *stationinfo;
GtkWidget *station_selector, *content_area;
GtkWidget *align;
GtkWidget *bandentry, *descriptionentry, *nameentry, *locationentry, *urientry, *websiteentry;
@@ -225,6 +246,7 @@ GtkWidget *create_new_station_selector(void) {
guint i;
char *pixmap_dir = NULL;
gchar *path = NULL;
+ GtkWidget *item = NULL;
setlocale (LC_ALL, "C");
gchar *world_station_xml_filename, *local_station_xml_file;
@@ -237,33 +259,37 @@ GtkWidget *create_new_station_selector(void) {
memset(&stats, 0, sizeof(stats));
/* The Stations dialog */
- /* station_selector = gtk_dialog_new_with_buttons(_("New radio station"),
GTK_WINDOW(GNOMEInternetRadioLocator_app), 0, /\* flags *\/ */
- /* GTK_STOCK_SAVE, */
- /* GTK_RESPONSE_ACCEPT, */
- /* NULL); */
+ station_selector = gtk_dialog_new_with_buttons("New Internet Radio Station",
+ GTK_WINDOW(gnome_internet_radio_locator_app),
+ 0,
+ ("_Save"),
+ GTK_RESPONSE_ACCEPT,
+ NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (station_selector));
+
+ g_signal_connect(G_OBJECT(station_selector), "response", G_CALLBACK(save_cb), NULL);
/* gtk_container_set_border_width */
- /* (GTK_CONTAINER(GTK_DIALOG(station_selector)->vbox), 6); */
+ /* (GTK_CONTAINER(GTK_DIALOG(station_selector)->vbox), 6); */
- /* align = gtk_alignment_new(0.5, 0.5, 0, 0); */
+ /* align = gtk_alignment_new(0.5, 0.5, 0, 0); */
/* gtk_container_add(GTK_CONTAINER */
- /* (GTK_DIALOG(station_selector)->vbox), align); */
- gtk_container_set_border_width(GTK_CONTAINER(align), 6);
- gtk_widget_show(align);
+ /* (GTK_DIALOG(station_selector)->vbox), align); */
+ /* gtk_container_set_border_width(GTK_CONTAINER(align), 6); */
+ /* gtk_widget_show(align); */
+ bandentry = gtk_entry_new();
nameentry = gtk_entry_new();
locationentry = gtk_entry_new();
urientry = gtk_entry_new();
- bandentry = gtk_entry_new();
websiteentry = gtk_entry_new();
descriptionentry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(nameentry), "Station name");
+ gtk_entry_set_text(GTK_ENTRY(bandentry), "Bandwidth");
gtk_entry_set_text(GTK_ENTRY(locationentry), "City name");
gtk_entry_set_text(GTK_ENTRY(urientry), "http://uri-to-stream/");
- gtk_entry_set_text(GTK_ENTRY(bandentry), "FM/AM bandwidth");
- gtk_entry_set_text(GTK_ENTRY(websiteentry), "http://uri-to-website/");
gtk_entry_set_text(GTK_ENTRY(descriptionentry), "Description");
+ gtk_entry_set_text(GTK_ENTRY(websiteentry), "http://uri-to-website/");
completion = gtk_entry_completion_new();
gtk_entry_completion_set_text_column(completion, STATION_LOCATION);
gtk_entry_set_completion(GTK_ENTRY(locationentry), completion);
@@ -293,49 +319,9 @@ GtkWidget *create_new_station_selector(void) {
g_warning("Failed to open %s.\n", local_station_xml_file);
}
-/* g_free (local_station_xml_file); */
+ stationinfo = gnome_internet_radio_locator_station_load_from_file(localstation,
+ world_station_xml_filename);
- stationinfo =
- gnome_internet_radio_locator_station_load_from_file(localstation,
- world_station_xml_filename);
-
- // gnome_internet_radio_locator_stations = NULL;
-
- while (stationinfo != NULL) {
- /* Timezone map */
- db = tz_load_db ();
- locs = tz_get_locations (db);
- for (i = 0; i < locs->len ; i++) {
- TzLocation *loc = locs->pdata[i];
- TzInfo *info;
- char *filename;
- gdouble selected_offset;
- char buf[16];
- info = tz_info_from_location (loc);
- selected_offset = tz_location_get_utc_offset (loc)
- / (60.0*60.0) + ((info->daylight) ? -1.0 : 0.0);
- filename = g_strdup_printf ("timezone_%s.png",
- g_ascii_formatd (buf, sizeof (buf),
- "%g", selected_offset));
- path = g_build_filename (pixmap_dir, filename, NULL);
- g_printf("Name is %s\n", tz_info_get_clean_name(db, loc->zone));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("%s\n", loc->zone);
- if (g_file_test (path, G_FILE_TEST_IS_REGULAR) == FALSE) {
- g_message ("File '%s' missing for zone '%s'", filename, loc->zone);
- gtk_list_store_append(location_model, &iter);
- g_print("%s %s", stationinfo->location, loc->zone);
- if (g_strcmp0(stationinfo->location, loc->zone)==0) {
- gtk_list_store_set(location_model,
- &iter,
- STATION_LOCATION,
- loc->zone,
- -1);
- }
- retval = 1;
- }
- stationinfo = stationinfo->next;
- }
- gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(location_model));
gtk_widget_show(nameentry);
gtk_widget_show(locationentry);
gtk_widget_show(urientry);
@@ -343,30 +329,28 @@ GtkWidget *create_new_station_selector(void) {
gtk_widget_show(descriptionentry);
gtk_widget_show(websiteentry);
gtk_container_add(GTK_CONTAINER(content_area), nameentry);
+ gtk_container_add(GTK_CONTAINER(content_area), bandentry);
gtk_container_add(GTK_CONTAINER(content_area), locationentry);
gtk_container_add(GTK_CONTAINER(content_area), urientry);
- gtk_container_add(GTK_CONTAINER(content_area), bandentry);
gtk_container_add(GTK_CONTAINER(content_area), descriptionentry);
gtk_container_add(GTK_CONTAINER(content_area), websiteentry);
/* g_signal_connect(G_OBJECT(station_selector), GTK_RESPONSE_ACCEPT, */
/* G_CALLBACK(on_new_station_selector_changed), */
/* NULL); */
- g_object_set_data(G_OBJECT(station_selector), "station_location",
- (gpointer) gtk_entry_get_text(GTK_ENTRY(locationentry)));
g_object_set_data(G_OBJECT(station_selector), "station_name",
(gpointer) gtk_entry_get_text(GTK_ENTRY(nameentry)));
- g_object_set_data(G_OBJECT(station_selector), "station_uri",
- (gpointer) gtk_entry_get_text(GTK_ENTRY(urientry)));
g_object_set_data(G_OBJECT(station_selector), "station_band",
(gpointer) gtk_entry_get_text(GTK_ENTRY(bandentry)));
+ g_object_set_data(G_OBJECT(station_selector), "station_location",
+ (gpointer) gtk_entry_get_text(GTK_ENTRY(locationentry)));
+ g_object_set_data(G_OBJECT(station_selector), "station_uri",
+ (gpointer) gtk_entry_get_text(GTK_ENTRY(urientry)));
g_object_set_data(G_OBJECT(station_selector), "station_description",
(gpointer) gtk_entry_get_text(GTK_ENTRY(descriptionentry)));
g_object_set_data(G_OBJECT(station_selector), "station_website",
(gpointer) gtk_entry_get_text(GTK_ENTRY(websiteentry)));
#if 0 /* FIXME: Add input fields */
- g_object_set_data(G_OBJECT(station_selector), "station_band",
- (gpointer) station_band);
g_object_set_data(G_OBJECT(station_selector), "station_description",
(gpointer) station_description);
g_object_set_data(G_OBJECT(station_selector), "station_website",
@@ -385,7 +369,6 @@ GtkWidget *create_new_station_selector(void) {
/* g_free (filename); */
/* g_free (path); */
return station_selector;
- }
}
GtkWidget *create_gnome_internet_radio_locator_app(void)
@@ -414,8 +397,6 @@ GtkWidget *create_gnome_internet_radio_locator_app(void)
gnome_config_get_string("selected_listener_name=");
gnome_internet_radio_locator->selected_listener_location =
gnome_config_get_string("selected_listener_location=");
- gnome_internet_radio_locator->selected_listener_band =
- gnome_config_get_string("selected_listener_band=");
gnome_internet_radio_locator->selected_listener_description =
gnome_config_get_string("selected_listener_description=");
@@ -436,8 +417,6 @@ GtkWidget *create_gnome_internet_radio_locator_app(void)
gnome_config_get_string("selected_station_name=");
gnome_internet_radio_locator->selected_station_location =
gnome_config_get_string("selected_station_location=");
- gnome_internet_radio_locator->selected_station_band =
- gnome_config_get_string("selected_station_band=");
gnome_internet_radio_locator->selected_station_description =
gnome_config_get_string("selected_station_description=");
@@ -445,8 +424,6 @@ GtkWidget *create_gnome_internet_radio_locator_app(void)
gnome_config_get_string("selected_station_name=");
gnome_internet_radio_locator->selected_station_location =
gnome_config_get_string("selected_station_location=");
- gnome_internet_radio_locator->selected_station_band =
- gnome_config_get_string("selected_station_band=");
gnome_internet_radio_locator->selected_station_description =
gnome_config_get_string("selected_station_description=");
@@ -456,8 +433,6 @@ GtkWidget *create_gnome_internet_radio_locator_app(void)
gnome_internet_radio_locator->selected_station_name);
GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("gnome_internet_radio_locator->selected_station_location:
%s\n",
gnome_internet_radio_locator->selected_station_location);
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("gnome_internet_radio_locator->selected_station_band: %s\n",
- gnome_internet_radio_locator->selected_station_band);
GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("gnome_internet_radio_locator->selected_station_description:
%s\n",
gnome_internet_radio_locator->selected_station_description);
diff --git a/src/gnome-internet-radio-locator-markers.c b/src/gnome-internet-radio-locator-markers.c
index 99b026e..0653c1d 100644
--- a/src/gnome-internet-radio-locator-markers.c
+++ b/src/gnome-internet-radio-locator-markers.c
@@ -16,9 +16,43 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <gtk/gtk.h>
#include <champlain/champlain.h>
+#include "gnome-internet-radio-locator.h"
#include "gnome-internet-radio-locator-markers.h"
+extern GtkWidget *input;
+extern GtkEntryCompletion *completion;
+
+typedef struct
+{
+ ChamplainView *view;
+ ChamplainMarker *marker;
+} LocationCallbackData;
+
+static gboolean
+location_callback (LocationCallbackData *data)
+{
+ /* champlain_view_center_on (data->view, lat, lon); */
+ /* champlain_location_set_location (CHAMPLAIN_LOCATION (data->marker), lat, lon); */
+ g_print("%s\n", __FUNCTION__);
+ return TRUE;
+}
+
+void
+marker_function (ChamplainMarker *self,
+ gdouble dx,
+ gdouble dy,
+ ClutterEvent *event,
+ gpointer user_data)
+{
+ gchar *station;
+ station = (gchar *)champlain_label_get_text (CHAMPLAIN_LABEL (self));
+ gtk_entry_set_text(GTK_ENTRY(input),(gchar *)station);
+ return;
+}
+
+
ChamplainMarkerLayer *
create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **path)
{
@@ -26,11 +60,17 @@ create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **pat
ChamplainMarkerLayer *layer;
ClutterActor *layer_actor;
ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb };
+ LocationCallbackData callback_data;
*path = champlain_path_layer_new ();
layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_SINGLE);
layer_actor = CLUTTER_ACTOR (layer);
+ /* Create callback that updates the map periodically */
+ /* callback_data.view = CHAMPLAIN_VIEW (view); */
+ /* callback_data.marker = CHAMPLAIN_MARKER (layer); */
+ /* g_timeout_add (1000, (GSourceFunc) location_callback, &callback_data); */
+
#if 0
marker = champlain_label_new_with_text ("Norway\n<span size=\"xx-small\">Oslo</span>",
"Serif 14", NULL, NULL);
@@ -38,35 +78,32 @@ create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **pat
champlain_label_set_alignment (CHAMPLAIN_LABEL (marker), PANGO_ALIGN_RIGHT);
champlain_label_set_color (CHAMPLAIN_LABEL (marker), &orange);
- champlain_location_set_location (CHAMPLAIN_LOCATION (marker),
- 59.9264569, 10.7960955);
+ 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));
#endif
marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
- champlain_label_set_text (CHAMPLAIN_LABEL (marker), "New York");
- champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 40.77, -73.98);
+ champlain_label_set_text (CHAMPLAIN_LABEL (marker), "Berkeley, CA");
+ 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);
+
#if 0
marker = champlain_label_new_from_file ("icons/emblem-important.png", NULL);
- champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 47.130885,
- -70.764141);
+ 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));
marker = champlain_point_new ();
- champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 45.130885,
- -65.764141);
+ 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));
marker = champlain_label_new_from_file ("icons/emblem-favorite.png", NULL);
champlain_label_set_draw_background (CHAMPLAIN_LABEL (marker), FALSE);
- champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 45.41484,
- -71.918907);
+ 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));
#endif
diff --git a/src/gnome-internet-radio-locator-player.c b/src/gnome-internet-radio-locator-player.c
index b9d669b..24e76fe 100644
--- a/src/gnome-internet-radio-locator-player.c
+++ b/src/gnome-internet-radio-locator-player.c
@@ -40,10 +40,12 @@ GST_DEBUG_CATEGORY (play_debug);
#define GST_CAT_DEFAULT play_debug
extern GstPlay *player;
+#if 0
static gboolean play_next (GstPlay * play);
static gboolean play_prev (GstPlay * play);
static void play_reset (GstPlay * play);
static void play_set_relative_volume (GstPlay * play, gdouble volume_step);
+#endif
void
gnome_internet_radio_locator_player_main(gchar *streamuri, gchar *name)
@@ -69,6 +71,7 @@ gnome_internet_radio_locator_player_main(gchar *streamuri, gchar *name)
exit (0);
}
+#if 0
static void
end_of_stream_cb (GstPlayer * player, GstPlay * play)
{
@@ -79,7 +82,8 @@ end_of_stream_cb (GstPlayer * player, GstPlay * play)
g_main_loop_quit (play->loop);
}
}
-
+#endif
+#if 0
static void
error_cb (GstPlayer * player, GError * err, GstPlay * play)
{
@@ -94,7 +98,7 @@ error_cb (GstPlayer * player, GError * err, GstPlay * play)
g_main_loop_quit (play->loop);
}
}
-
+#endif
static void
position_updated_cb (GstPlayer * player, GstClockTime pos, GstPlay * play)
{
@@ -358,6 +362,7 @@ media_info_cb (GstPlayer * player, GstPlayerMediaInfo * info, GstPlay * play)
}
}
+#if 0
static GstPlay *
play_new (gchar ** uris, gdouble initial_volume)
{
@@ -405,7 +410,7 @@ play_free (GstPlay * play)
g_strfreev (play->uris);
g_free (play);
}
-
+#endif
/* reset for new file/stream */
static void
play_reset (GstPlay * play)
@@ -434,7 +439,7 @@ get_volume (GtkWidget *widget, GstPlay *play)
return volume;
}
-
+#if 0
static gchar *
play_uri_get_display_name (GstPlayer * player, const gchar * uri)
{
@@ -468,6 +473,7 @@ play_uri (GstPlayer *player, const gchar * next_uri)
}
/* returns FALSE if we have reached the end of the playlist */
+#if 0
static gboolean
play_next (GstPlay * play)
{
@@ -654,6 +660,8 @@ keyboard_cb (const gchar * key_input, gpointer user_data)
break;
}
}
+#endif
+#endif
void
gnome_internet_radio_locator_player_new (GstPlayer * player, const gchar * next_uri)
@@ -664,7 +672,9 @@ gnome_internet_radio_locator_player_new (GstPlayer * player, const gchar * next_
void
gnome_internet_radio_locator_player_stop (GstPlayer *player)
{
- gst_player_stop(player);
+ if (player != NULL) {
+ gst_player_stop(GST_PLAYER(player));
+ }
}
void
diff --git a/src/gnome-internet-radio-locator-player.h b/src/gnome-internet-radio-locator-player.h
index 22ab096..f9524e8 100644
--- a/src/gnome-internet-radio-locator-player.h
+++ b/src/gnome-internet-radio-locator-player.h
@@ -41,7 +41,7 @@ typedef struct
GMainLoop *loop;
} GstPlay;
-static void play_uri (GstPlayer * player, const gchar * next_uri);
+void play_uri (GstPlayer *player, const gchar * next_uri);
void gnome_internet_radio_locator_player_new (GstPlayer * player, const gchar * next_uri);
diff --git a/src/gnome-internet-radio-locator-radius.c b/src/gnome-internet-radio-locator-radius.c
new file mode 100644
index 0000000..cc03718
--- /dev/null
+++ b/src/gnome-internet-radio-locator-radius.c
@@ -0,0 +1,76 @@
+/* $id$
+ *
+ * GNOME Internet Radio Locator
+ *
+ * Copyright (C) 2017 Ole Aamot Software
+ *
+ * Author: Ole Aamot <oka oka no>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <geoclue/geoclue-geocode.h>
+
+#define foreach(item, array) \
+ for(int keep = 1, \
+ count = 0,\
+ size = sizeof (array) / sizeof *(array); \
+ keep && count != size; \
+ keep = !keep, count++) \
+ for(item = (array) + count; keep; keep = !keep)
+
+#define min(a,b) \
+ ({ typedef (a) _a = (a); \
+ typeof (b) _b = (b); \
+ _a < _b ? _a : _b; })
+
+typedef struct _Position {
+ char *url;
+ float lat;
+ float lon;
+} Position;
+
+int
+gnome_internet_radio_locator_radius (float latitude, float longitude, int radius)
+{
+ int values[] = {0,1,2};
+ Position pos;
+ float xdelta;
+ float ydelta;
+ float zdelta;
+ char *nearest_station;
+ float shortest = 1000;
+ Position stations[3][3] = {{"http://www.nrk.no/",60.18526,11.08224},
+ {"http://www.srib.no/",60.29230,5.22210},
+ {"http://www.nrksørlandet.no/",58.20733,8.07991}};
+ foreach(int *v, values) {
+ if ((stations[*v]->lat+radius >= latitude) && (stations[*v]->lon+radius >= longitude) &&
(stations[*v]->lat <= latitude+radius) && (stations[*v]->lon <= (longitude+radius))) {
+ g_print ("value: %d = %s\n", *v, stations[*v]->url);
+ g_print ("value: %d = %4.2f\n", *v, stations[*v]->lat);
+ g_print ("value: %d = %4.2f\n", *v, stations[*v]->lon);
+ xdelta = abs(latitude-stations[*v]->lat);
+ ydelta = abs(longitude-stations[*v]->lon);
+ zdelta = abs(xdelta-ydelta);
+ if (shortest > zdelta) {
+ printf("url = %s\n", stations[*v]->url);
+ nearest_station = strdup(stations[*v]->url);
+ shortest = zdelta;
+ }
+ }
+ }
+ g_print ("%s\n", nearest_station);
+}
diff --git a/src/gnome-internet-radio-locator-radius.h b/src/gnome-internet-radio-locator-radius.h
new file mode 100644
index 0000000..0d9f0ea
--- /dev/null
+++ b/src/gnome-internet-radio-locator-radius.h
@@ -0,0 +1,29 @@
+/* $Id$
+ *
+ * GNOME Internet Radio Locator
+ *
+ * Copyright (C) 2017 Ole Aamot Software
+ *
+ * Author: Ole Aamot <oka oka no>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef GNOME_INTERNET_RADIO_LOCATOR_RADIUS_H
+#define GNOME_INTERNET_RADIO_LOCATOR_RADIUS_H
+
+int gnome_internet_radio_locator_radius (float latitude, float longitude, int radius);
+
+#endif /* GNOME_INTERNET_RADIO_LOCATOR_RADIUS_H */
diff --git a/src/gnome-internet-radio-locator-station.c b/src/gnome-internet-radio-locator-station.c
index 5a20350..c9058ef 100644
--- a/src/gnome-internet-radio-locator-station.c
+++ b/src/gnome-internet-radio-locator-station.c
@@ -6,9 +6,9 @@
*
* Author: Ole Aamot <oka oka no>
*
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -39,6 +38,15 @@
#include "gnome-internet-radio-locator-station.h"
extern GNOMEInternetRadioLocatorData *gnome_internet_radio_locator;
+extern GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
+
+extern gchar *world_station_xml_filename, *local_station_xml_file;
+
+extern GStatBuf stats;
+
+extern GtkEntryCompletion *completion;
+GtkListStore *model = NULL;
+GtkTreeIter iter;
void gnome_internet_radio_locator_helper_run(gchar *url, gchar *name, GNOMEInternetRadioLocatorStreamType
type, GNOMEInternetRadioLocatorHelperType helper)
{
@@ -600,7 +608,7 @@ gint gnome_internet_radio_locator_station_update (GNOMEInternetRadioLocatorStati
if (local_gnome_internet_radio_locator_file == 0) {
- gchar *local_gnome_internet_radio_locator_directory = g_strconcat(g_get_home_dir(),
"/.gnome_internet_radio_locator", NULL);
+ gchar *local_gnome_internet_radio_locator_directory = g_strconcat(g_get_home_dir(),
"/.gnome-internet-radio-locator", NULL);
g_mkdir_with_parents (local_gnome_internet_radio_locator_directory, 0700);
}
@@ -618,7 +626,7 @@ gint gnome_internet_radio_locator_station_update (GNOMEInternetRadioLocatorStati
new_station->stream->uri = g_strdup(station_uri);
new_station->uri = g_strdup(station_website);
fp = g_fopen(stations, "w+");
- g_fprintf(fp, "<?xml version='1.0' encoding='UTF-8'?>\n<!DOCTYPE gnome_internet_radio_locator SYSTEM
'gnome_internet_radio_locator-9.1.dtd'>\n<gnome_internet_radio_locator version='9.1'>\n");
+ g_fprintf(fp, "<?xml version='1.0' encoding='UTF-8'?>\n<!DOCTYPE gnome_internet_radio_locator SYSTEM
'gnome_internet_radio_locator-0.1.dtd'>\n<gnome_internet_radio_locator version='%s'>\n", VERSION);
// stationinfo-> = l->data;
while (stationinfo != NULL) {
local_station_uri = g_strdup(stationinfo->stream->uri);
@@ -636,9 +644,74 @@ gint gnome_internet_radio_locator_station_update (GNOMEInternetRadioLocatorStati
g_fprintf(fp, "</gnome_internet_radio_locator>\n");
fclose(fp);
gnome_internet_radio_locator_stations = g_list_append(gnome_internet_radio_locator_stations,
(GNOMEInternetRadioLocatorStationInfo *)new_station);
+
g_free(stations);
g_free(new_station);
g_free(stationinfo);
+ model = gtk_list_store_new(11, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING);
+
+ world_station_xml_filename = g_strconcat(GNOME_INTERNET_RADIO_LOCATOR_DATADIR,
"/gnome-internet-radio-locator.xml", NULL);
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("world_station_xml_filename = %s\n",
+ world_station_xml_filename);
+
+ if (world_station_xml_filename == NULL) {
+ g_warning(("Failed to open %s. Please install it.\n"),
+ world_station_xml_filename);
+ }
+
+ local_station_xml_file =
+ g_strconcat(g_get_home_dir(), "/.gnome-internet-radio-locator/gnome-internet-radio-locator.xml",
NULL);
+
+ if (!g_stat(local_station_xml_file, &stats)) {
+ localstation = gnome_internet_radio_locator_station_load_from_file(NULL,
local_station_xml_file);
+ } else {
+ localstation = NULL;
+ }
+
+ if (localstation == NULL) {
+ printf("Failed to open %s.\n", local_station_xml_file);
+ }
+
+/* g_free (local_station_xml_file); */
+
+ stationinfo = gnome_internet_radio_locator_station_load_from_file(localstation,
world_station_xml_filename);
+
+ gnome_internet_radio_locator_stations = NULL;
+
+ while (stationinfo != NULL) {
+
+ gtk_list_store_append(model, &iter);
+ gtk_list_store_set(model,
+ &iter,
+ STATION_NAME,
+ stationinfo->name,
+ STATION_LOCATION,
+ stationinfo->location,
+ STATION_URI,
+ stationinfo->stream->uri,
+ STATION_DESCRIPTION,
+ stationinfo->description,
+ STATION_FREQUENCY,
+ stationinfo->frequency,
+ STATION_BAND,
+ stationinfo->band,
+ STATION_TYPE,
+ stationinfo->type,
+ STATION_RANK,
+ stationinfo->rank,
+ STATION_BITRATE,
+ stationinfo->bitrate,
+ STATION_SAMPLERATE,
+ stationinfo->samplerate,
+ STATION_ID,
+ stationinfo->id,
+ -1);
+
+ stationinfo = stationinfo->next;
+ }
+
+ gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(model));
+
return (0);
}
diff --git a/src/gnome-internet-radio-locator-tz.c b/src/gnome-internet-radio-locator-tz.c
index a90fcfa..3f441e5 100644
--- a/src/gnome-internet-radio-locator-tz.c
+++ b/src/gnome-internet-radio-locator-tz.c
@@ -7,9 +7,9 @@
*
* Author: Ole Aamot <oka oka no>
*
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,9 +18,7 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/src/gnome-internet-radio-locator.c b/src/gnome-internet-radio-locator.c
index fefeb8f..97ae80d 100644
--- a/src/gnome-internet-radio-locator.c
+++ b/src/gnome-internet-radio-locator.c
@@ -6,9 +6,9 @@
*
* Author: Ole Aamot <oka oka no>
*
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -17,11 +17,11 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
+#include <gst/player/player.h>
#include <champlain/champlain.h>
#include <champlain-gtk/champlain-gtk.h>
#include <clutter-gtk/clutter-gtk.h>
@@ -32,6 +32,7 @@
#include "gnome-internet-radio-locator-gui.h"
#include "gnome-internet-radio-locator-markers.h"
#include "gnome-internet-radio-locator-player.h"
+#include "gnome-internet-radio-locator-radius.h"
#define N_COLS 2
#define COL_ID 0
@@ -41,13 +42,16 @@ static ChamplainPathLayer *path_layer;
static ChamplainPathLayer *path;
static gboolean destroying = FALSE;
-
static ChamplainView *champlain_view;
GApplication *app;
GtkWidget *search_selector;
GtkWidget *window;
GNOMEInternetRadioLocatorData *gnome_internet_radio_locator;
+GtkWidget *input;
+
+GtkEntryCompletion *completion;
+
GList *gnome_internet_radio_locator_archivers;
GList *gnome_internet_radio_locator_listeners;
GList *gnome_internet_radio_locator_programs;
@@ -66,8 +70,13 @@ gchar *list_item_data_key ="list_item_data";
GtkWidget *gnome_internet_radio_locator_app;
GstPlayer *player;
+gchar *world_station_xml_filename, *local_station_xml_file;
+
+extern GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
+
extern struct GNOMEInternetRadioLocatorMedia *media;
+GStatBuf stats;
/*
* Terminate the main loop.
@@ -102,11 +111,16 @@ static gboolean
mouse_click_cb (ClutterActor *actor, ClutterButtonEvent *event, ChamplainView *view)
{
gdouble lat, lon;
-
+ /* GeocodeNominatim *nom; */
+ /* GeocodeForward *fwd; */
+ /* GList *list; */
+ /* GError **err; */
lon = champlain_view_x_to_longitude (view, event->x);
lat = champlain_view_y_to_latitude (view, event->y);
- g_print ("Mouse click at: %f %f\n", lat, lon);
-
+ /* fwd = geocode_forward_new_for_string ("Oslo, Norway"); */
+ /* list = geocode_forward_search (fwd, err); */
+ /* gnome_internet_radio_locator_radius (lat, lon, 100); */
+ g_print ("Mouse click at: %f %f\n", lat, lon);
return TRUE;
}
@@ -402,8 +416,7 @@ void on_new_station_changed(GtkWidget * a, gpointer user_data)
/* if (gnome_internet_radio_locator->selected_station_uri != NULL) */
/* g_free(gnome_internet_radio_locator->selected_station_uri); */
- gnome_internet_radio_locator->selected_station_uri =
- g_strdup(g_object_get_data(G_OBJECT(a), "station_uri"));
+ gchar *selected_station_uri = g_strdup(g_object_get_data(G_OBJECT(a), "station_uri"));
GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_changed: %s\n",
gnome_internet_radio_locator->selected_station_uri);
gnome_internet_radio_locator->selected_station_name =
@@ -429,17 +442,15 @@ void on_new_station_changed(GtkWidget * a, gpointer user_data)
/* appbar_send_msg(_("Selected the radio station %s in %s: %s"), */
/* gnome_internet_radio_locator->selected_station_name, */
/* gnome_internet_radio_locator->selected_station_location, */
- /* gnome_internet_radio_locator->selected_station_uri, */
+ /* selected_station_uri, */
/* gnome_internet_radio_locator->selected_station_band); */
-
- gnome_internet_radio_locator_station_update(stationinfo,
gnome_internet_radio_locator->selected_station_band,
gnome_internet_radio_locator->selected_station_description,
gnome_internet_radio_locator->selected_station_name,
- gnome_internet_radio_locator->selected_station_location,
- gnome_internet_radio_locator->selected_station_uri,
gnome_internet_radio_locator->selected_station_website);
-
- /* gnome_internet_radio_locator_helper_run(gnome_internet_radio_locator->selected_streams_uri, */
- /* gnome_internet_radio_locator->selected_streams_mime, */
- /* GNOME_INTERNET_RADIO_LOCATOR_STREAM_SHOUTCAST, */
- /* GNOME_INTERNET_RADIO_LOCATOR_STREAM_PLAYER); */
+ gnome_internet_radio_locator_station_update(stationinfo,
+ gnome_internet_radio_locator->selected_station_band,
+
gnome_internet_radio_locator->selected_station_description,
+ gnome_internet_radio_locator->selected_station_name,
+ gnome_internet_radio_locator->selected_station_location,
+ gnome_internet_radio_locator->selected_station_uri,
+ gnome_internet_radio_locator->selected_station_website);
}
void on_stations_selector_changed(GtkWidget * a, gpointer user_data)
@@ -476,32 +487,26 @@ void on_stations_selector_changed(GtkWidget * a, gpointer user_data)
/* appbar_send_msg(_("Selected the radio station %s in %s: %s"), */
/* gnome_internet_radio_locator->selected_station_name, */
/* gnome_internet_radio_locator->selected_station_location, */
- /* gnome_internet_radio_locator->selected_station_uri, */
+ /* selected_station_uri, */
/* gnome_internet_radio_locator->selected_station_band); */
- station->name = g_strdup(g_object_get_data(G_OBJECT(a), "station_name"));
+ gnome_internet_radio_locator->selected_station_name = g_strdup(g_object_get_data(G_OBJECT(a),
"station_name"));
/* gnome_internet_radio_locator_history = g_list_add(GLIST(gnome_internet_radio_locator_history),
(GNOMEInternetRadioLocatorStationInfo *)station); */
- /* gnome_internet_radio_locator_helper_main(gnome_internet_radio_locator->selected_station_uri); */
+ /* gnome_internet_radio_locator_helper_main(selected_station_uri); */
}
static void
gnome_internet_radio_locator_window_cb (GtkApplication *app,
gpointer user_data)
{
- GtkWidget *widget, *grid, *toolbar, *new, *search, *input, *listen, *stop, *prev, *stations, *next,
*station, *program, *quit;
+ GtkWidget *widget, *grid, *toolbar, *new, *search, *listen, *stop, *prev, *stations, *next, *station,
*program, *quit;
window = gtk_application_window_new (app);
widget = gtk_champlain_embed_new();
toolbar = gtk_toolbar_new();
input = gtk_entry_new();
-#if 0
- new = gtk_tool_button_new(gtk_image_new_from_icon_name(NULL, GTK_ICON_SIZE_BUTTON), "New");
- gtk_tool_item_set_is_important(GTK_TOOL_ITEM(new), TRUE);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(new), 0);
- gtk_widget_show (GTK_WIDGET(new));
- gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM(new), "New Station");
- g_signal_connect(new, "clicked", G_CALLBACK (on_new_station_clicked), GTK_WINDOW (window));
+#if 0
search = gtk_tool_button_new(gtk_image_new_from_icon_name(NULL, GTK_ICON_SIZE_BUTTON), "Search");
gtk_tool_item_set_is_important(GTK_TOOL_ITEM(search), TRUE);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(search), 1);
@@ -561,7 +566,7 @@ gnome_internet_radio_locator_window_cb (GtkApplication *app,
gnome_internet_radio_locator_app = create_gnome_internet_radio_locator_app();
gtk_widget_show(gnome_internet_radio_locator_app);
- /* stations_selector = create_stations_selector(gnome_internet_radio_locator->selected_station_uri,
"gnome_internet_radio_locator.xml"); */
+ /* stations_selector = create_stations_selector(selected_station_uri,
"gnome_internet_radio_locator.xml"); */
/* g_object_add_weak_pointer(G_OBJECT(stations_selector), */
/* (void **) &(stations_selector)); */
@@ -576,31 +581,31 @@ void on_new_station_clicked(GtkWidget *a,
GtkWidget *station;
GNOMEInternetRadioLocatorStationInfo *stationinfo = NULL;
/* GList *l = g_list_first(gnome_internet_radio_locator_stations); */
-
+ gchar *selected_station_uri, *selected_station_band, *selected_station_description,
*selected_station_name, *selected_station_location, *selected_station_website;
/* stationinfo = l->data; */
gint result;
// appbar_send_msg(_("New radio station"));
- /* station = create_new_station_selector(); */
+ station = create_new_station_selector();
result = gtk_dialog_run (GTK_DIALOG(station));
switch (result) {
case GTK_RESPONSE_ACCEPT:
-
GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("Squeak!\n\n");
- gnome_internet_radio_locator->selected_station_uri =
g_strdup(g_object_get_data(G_OBJECT(station), "station_uri"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
gnome_internet_radio_locator->selected_station_uri);
- gnome_internet_radio_locator->selected_station_description =
g_strdup(g_object_get_data(G_OBJECT(station), "station_description"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
gnome_internet_radio_locator->selected_station_description);
- gnome_internet_radio_locator->selected_station_band =
g_strdup(g_object_get_data(G_OBJECT(station), "station_band"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
gnome_internet_radio_locator->selected_station_band);
- gnome_internet_radio_locator->selected_station_website =
g_strdup(g_object_get_data(G_OBJECT(station), "station_website"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
gnome_internet_radio_locator->selected_station_website);
- gnome_internet_radio_locator->selected_station_name =
g_strdup(g_object_get_data(G_OBJECT(station), "station_name"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
- gnome_internet_radio_locator->selected_station_name);
- gnome_internet_radio_locator->selected_station_location =
g_strdup(g_object_get_data(G_OBJECT(station), "station_location"));
- GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
- gnome_internet_radio_locator->selected_station_location);
- gnome_internet_radio_locator_station_update (stationinfo,
gnome_internet_radio_locator->selected_station_band,
gnome_internet_radio_locator->selected_station_description,
gnome_internet_radio_locator->selected_station_name, gnome_internet_radio_locator->selected_station_location,
gnome_internet_radio_locator->selected_station_uri, gnome_internet_radio_locator->selected_station_website);
+
+ selected_station_uri = g_strdup(g_object_get_data(G_OBJECT(station), "station_uri"));
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_uri);
+
+ selected_station_description = g_strdup(g_object_get_data(G_OBJECT(station),
"station_description"));
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_description);
+ selected_station_band = g_strdup(g_object_get_data(G_OBJECT(station), "station_band"));
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_band);
+ selected_station_website = g_strdup(g_object_get_data(G_OBJECT(station), "station_website"));
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_website);
+ selected_station_name = g_strdup(g_object_get_data(G_OBJECT(station), "station_name"));
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_name);
+ selected_station_location = g_strdup(g_object_get_data(G_OBJECT(station),
"station_location"));
+
+ GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("on_new_station_select_changed: %s\n",
selected_station_location);
+ gnome_internet_radio_locator_station_update (stationinfo, selected_station_band,
selected_station_description, selected_station_name, selected_station_location, selected_station_uri,
selected_station_website);
break;
default:
g_print ("Nothing\n\n");
@@ -608,7 +613,6 @@ void on_new_station_clicked(GtkWidget *a,
}
gtk_widget_destroy(station);
/* gtk_widget_show(station); */
-
}
#if 0
@@ -626,7 +630,7 @@ on_location_matches(GtkEntryCompletion *widget,
/* appbar_send_msg(_("Found location %s"), */
/* gnome_internet_radio_locator->selected_station_location); */
- /* gnome_internet_radio_locator_helper_run(gnome_internet_radio_locator->selected_station_uri, */
+ /* gnome_internet_radio_locator_helper_run(selected_station_uri, */
/* gnome_internet_radio_locator->selected_station_name, */
/* GNOME_INTERNET_RADIO_LOCATOR_STREAM_SHOUTCAST, */
/* GNOME_INTERNET_RADIO_LOCATOR_STREAM_PLAYER); */
@@ -634,7 +638,7 @@ on_location_matches(GtkEntryCompletion *widget,
}
#endif
-static gboolean
+gboolean
on_search_matches(GtkEntryCompletion *widget,
GtkTreeModel *model,
GtkTreeIter *iter,
@@ -655,13 +659,11 @@ main (int argc,
char **argv)
{
GtkWidget *window;
- GtkWidget *widget, *vbox, *bbox, *button, *viewport, *image, *input;
- GtkEntryCompletion *completion;
+ GtkWidget *widget, *vbox, *bbox, *button, *viewport, *image;
ChamplainView *view;
ChamplainMarkerLayer *layer;
ClutterActor *scale;
ChamplainLicense *license_actor;
- gchar *world_station_xml_filename, *local_station_xml_file;
GtkListStore *model;
GtkTreeIter iter;
GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
@@ -713,7 +715,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), 45.466, -73.75);
+ 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));
@@ -748,11 +750,18 @@ main (int argc,
button = gtk_button_new();
image = gtk_image_new_from_icon_name("media-playback-start", GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
+ gtk_button_set_label (GTK_BUTTON (button), "New");
+ g_signal_connect(button, "clicked", G_CALLBACK (on_new_station_clicked), view);
+ gtk_container_add (GTK_CONTAINER (bbox), button);
+
+#if 0
+ button = gtk_button_new();
+ image = gtk_image_new_from_icon_name("media-playback-start", GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (button), image);
gtk_button_set_label (GTK_BUTTON (button), "Listen");
g_signal_connect(button, "clicked", G_CALLBACK (listen_station), view);
gtk_container_add (GTK_CONTAINER (bbox), button);
-
- GStatBuf stats;
+#endif
memset(&stats, 0, sizeof(stats));
diff --git a/src/gnome-internet-radio-locator.h b/src/gnome-internet-radio-locator.h
index a4111c2..b650590 100644
--- a/src/gnome-internet-radio-locator.h
+++ b/src/gnome-internet-radio-locator.h
@@ -91,7 +91,12 @@ void about_app(GtkWidget *, gpointer user_data);
void about_listener(GtkWidget *, gpointer user_data);
void about_station(GSimpleAction *simple, GVariant *parameter, gpointer user_data);
void about_program(GSimpleAction *simple, GVariant *parameter, gpointer user_data);
-
+
+gboolean on_search_matches(GtkEntryCompletion *widget,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer user_data);
+
struct _GNOMEInternetRadioLocatorData {
GtkImage *pixmap;
GtkProgressBar *progress;
diff --git a/src/gnome-internet-radio-locator.xml b/src/gnome-internet-radio-locator.xml
index b3ae73f..a2e70c1 100644
--- a/src/gnome-internet-radio-locator.xml
+++ b/src/gnome-internet-radio-locator.xml
@@ -1,9 +1,9 @@
<?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="0.4.0">
+<gnome_internet_radio_locator version="0.5.0">
<station band="88.1FM" id="hpr" lang="en" name="Hawaii Public Radio" rank="1.0" type="org">
- <frequency uri="http://www.hawaiipublicradio.org/">FM 88.1 & FM 88.5 in Honololulu</frequency>
+ <frequency uri="http://www.hawaiipublicradio.org/">FM 88.1 & FM 88.5 in Honolulu</frequency>
<frequency uri="http://www.hawaiipublicradio.org/">FM 89.1 in Hilo</frequency>
<frequency uri="http://www.hawaiipublicradio.org/">FM 90.7 in Wailuku</frequency>
<frequency uri="http://www.hawaiipublicradio.org/">FM 94.9 Waimea</frequency>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]