gnome-internet-radio-locator-markers.c 35.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

Ole Aamot's avatar
Ole Aamot committed
19
#include <string.h>
20
#include <gtk/gtk.h>
21
#include <gst/player/player.h>
22
#include <champlain/champlain.h>
23
#include "gnome-internet-radio-locator.h"
24
#include "gnome-internet-radio-locator-markers.h"
Ole Aamot's avatar
Ole Aamot committed
25
#include "gnome-internet-radio-locator-player.h"
26

27 28
extern GtkWidget *input;
extern GtkEntryCompletion *completion;
29 30 31
extern GNOMEInternetRadioLocatorStationInfo *stationinfo, *localstation;
extern gchar *world_station_xml_filename;
extern GstPlayer *player;
32
extern ChamplainMarkerLayer *layer;
33 34
extern GtkWidget *window;
extern ChamplainView *view;
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

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)
{
58 59
        gchar *station, *station_link;
	gchar *markup;
60
	station = (gchar *)champlain_label_get_text (CHAMPLAIN_LABEL (self));
61 62
	station_link = strtok(station, "\n");
	gtk_entry_set_text(GTK_ENTRY(input),(gchar *)station_link);
63 64 65 66
	gst_player_stop(player);
	player = gst_player_new (NULL, gst_player_g_main_context_signal_dispatcher_new(NULL));
	stationinfo = gnome_internet_radio_locator_station_load_from_file(localstation, world_station_xml_filename);
	while (stationinfo != NULL) {
67
		if (strcasecmp(stationinfo->location, station_link)==0) {
68
			gst_player_stop(player);
Ole Aamot's avatar
Ole Aamot committed
69
			gnome_internet_radio_locator_player_new(GST_PLAYER(player), stationinfo->stream->uri);
70 71 72 73
			gst_player_play(player);
		}
		stationinfo = stationinfo->next;
	}
74 75 76 77
	if (user_data != NULL) {
		champlain_label_set_text (CHAMPLAIN_LABEL (self), user_data);
	}
	/* g_signal_connect(CHAMPLAIN_LOCATION(self), "button-press", G_CALLBACK (on_new_station_clicked), user_data); */
78 79 80
	return;
}

81 82 83 84 85
ChamplainMarkerLayer *
create_marker_layer (G_GNUC_UNUSED ChamplainView *view, ChamplainPathLayer **path)
{
  ClutterActor *marker;
  ClutterActor *layer_actor;
86 87
  ClutterColor city_color = { 0xf3, 0x94, 0x07, 0xbb };
  ClutterColor text_color = { 0xff, 0xff, 0xff, 0xff };
88
  LocationCallbackData callback_data;
89
  gchar *station = NULL;
90 91 92
  *path = champlain_path_layer_new ();
  layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_SINGLE);
  layer_actor = CLUTTER_ACTOR (layer);
93 94 95 96 97
  /* 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); */

98 99 100 101 102
  /* marker = champlain_point_new (); */
  /* champlain_location_set_location (CHAMPLAIN_LOCATION (marker),  37.873093, -122.303769); */
  /* 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)); */
103
#if 0
104
  marker = champlain_label_new_with_text ("Norway\n<span size=\"small\">Oslo</span>", "Helvetica 14", NULL, NULL);
105 106
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_alignment (CHAMPLAIN_LABEL (marker), PANGO_ALIGN_RIGHT);
107 108
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
109
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker),  37.873093, -122.303769);
110 111 112
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker));
#endif
Ole Aamot's avatar
Ole Aamot committed
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Ayr, Scotland\n<span size=\"small\">UWS Radio</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 55.4594119, -4.6326702);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Bergen, Norway\n<span size=\"small\">SRIB</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 60.3943034, 5.3258117);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
135
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
136
  station = g_strdup("Berkeley, California\n<span size=\"small\">KALX</span>");
137 138
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
139 140
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
141
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.873093, -122.303769);
142
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
143
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
144
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
145
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
146
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
147
  station = g_strdup("Boston, Massachusetts\n<span size=\"small\">WMBR</span>");
148 149
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
150 151
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 42.3604823, -71.0595678);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Bruxelles, Belgium\n<span size=\"small\">Radio Campus</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 50.84404145, 4.36720169448285);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
169 170 171 172 173 174 175 176 177 178 179
  station = g_strdup("Calgary, Canada\n<span size=\"small\">CJSW</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 51.0534234, -114.0625892);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
Ole Aamot's avatar
Ole Aamot committed
180 181 182 183 184 185
  station = g_strdup("Cambridge, United Kingdom\n<span size=\"small\">Cam FM</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 52.2033051, 0.124862);
186
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
187
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
188
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
189
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
190
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
191
  station = g_strdup("Cape Town, South Africa\n<span size=\"small\">UCT Radio</span>");
192 193
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
194 195
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
196
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), -33.928992, 18.417396);
197
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
198
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
199
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
200
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
Ole Aamot's avatar
Ole Aamot committed
201
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
202 203 204 205 206 207 208 209 210 211 212
  station = g_strdup("Copenhagen, Denmark\n<span size=\"small\">Danmarks Radio Nyheder</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 55.6867243, 12.5700724);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
213
  station = g_strdup("Chicago, Illinois\n<span size=\"small\">WHPK</span>");
214 215
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
216 217
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
218
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 41.8755546, -87.6244212);
Ole Aamot's avatar
Ole Aamot committed
219
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
220
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
Ole Aamot's avatar
Ole Aamot committed
221
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
222 223
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
#if 0 /* Non-streamble as of 2018/03/26 */
224
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
225
  station = g_strdup("Dublin, Ireland\n<span size=\"small\">UWS Radio</span>");
226 227
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
228 229
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
230
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 53.3497645, -6.2602732);
231 232
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
233 234
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
#endif
235
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
236
  station = g_strdup("Guatemala City, Guatemala\n<span size=\"small\">Radio Universidad</span>");
237 238
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
239 240
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
241
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 14.6417889, -90.5132239);
242
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
243
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
244
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
245
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
246
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
247
  station = g_strdup("Honolulu, Hawaii\n<span size=\"small\">Hawaii Public Radio</span>");
248 249
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
250 251
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
252 253 254 255 256
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 21.304547, -157.8556764);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
257 258 259 260 261 262 263 264 265 266 267 268
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Kingston, Canada\n<span size=\"small\">CFRC</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 44.230687, -76.481323);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);

Ole Aamot's avatar
Ole Aamot committed
269 270 271 272 273 274 275
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Kristiansand, Norway\n<span size=\"small\">NRK Sørlandet</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 58.14615, 7.9957333);
276 277 278 279
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
280
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
281
  station = g_strdup("Houston, Texas\n<span size=\"small\">Coog Radio, University of Houston</span>");
282 283
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
284 285
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
286
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 29.7589382, -95.3676974);
287 288 289 290 291
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
292
  station = g_strdup("London, United Kingdom\n<span size=\"small\">Imperial College Radio</span>");
293 294
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
295 296
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
297
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 51.5073219, -0.1276474);
298 299 300 301
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
302
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
303
  station = g_strdup("Los Angeles, California\n<span size=\"small\">KXSC</span>");
304 305
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
306 307
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
308
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 34.1430079, -118.14176172581);
309 310 311 312 313
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
314
  station = g_strdup("México City, México\n<span size=\"small\">Radio UNAM</span>");
315 316
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
317 318
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
319
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 19.647012, -101.22900565);
320 321 322 323 324 325
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
#if 0 /* Non-streamable as of 2018/03/26 */
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
326
  station = g_strdup("Moscow, Russia\n<span size=\"small\">Echo of Moscow</span>");
327 328
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
329 330
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
331 332 333 334 335 336
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 55.4792046, 37.3273304);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
#endif
337
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
338
  station = g_strdup("Newcastle, Australia\n<span size=\"small\">2NURFM</span>");
339 340
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
341 342
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
343
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), -32.9272881, 151.7812534);
344
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
345
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
346
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
347
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
348
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
349
  station = g_strdup("New York City, New York\n<span size=\"small\">WKCR</span>");
350 351
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
352 353
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
354
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 40.7306458, -73.9866136);
355
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
356
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
357
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
358
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
359
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
360
  station = g_strdup("Oslo, Norway\n<span size=\"small\">NRK Sport</span>");
361 362
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
363 364
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
365 366 367 368 369 370 371 372 373 374 375 376
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 59.9132694, 10.7391112);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Oxford, United Kingdom\n<span size=\"small\">Oxide Radio</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 51.7520131, -1.2578499);
377
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
378 379 380 381
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
382 383 384 385 386 387 388 389 390 391 392
  station = g_strdup("Ottawa, Canada\n<span size=\"small\">CHUO</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 45.421106, -75.690308);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
393
  station = g_strdup("Paris, France\n<span size=\"small\">Radio Campus Paris</span>");
394 395
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
396 397
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
398
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 48.8566101, 2.3514992);
399
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
400 401 402 403
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
404
  station = g_strdup("Phoenix, Arizona\n<span size=\"small\">KASC</span>");
405 406
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
407 408
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
409
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 33.4485866, -112.0773456);
410
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
411
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
412
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
413
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
414
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
415
  station = g_strdup("San Francisco, California\n<span size=\"small\">SomaFM</span>");
416 417
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
418 419
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
420
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.7792808, -122.4192363);
421
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
422
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
423
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
424
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
425
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
426
  station = g_strdup("Seattle, Washington\n<span size=\"small\">KSUB</span>");
427 428
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
429 430
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
431
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 47.6038321, -122.3300624);
432 433 434 435 436
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
437
  station = g_strdup("Stanford, California\n<span size=\"small\">KZSU</span>");
438 439
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
440 441
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
Ole Aamot's avatar
Ole Aamot committed
442 443 444 445 446 447
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.4248398, -122.1677058);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
448 449 450 451 452 453 454 455 456 457 458
  station = g_strdup("Stockholm, Sweden\n<span size=\"small\">Sveriges Radio P1</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 59.3251172, 18.0710935);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
  station = g_strdup("Sydney, Canada\n<span size=\"small\">Caper Radio</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 46.1654766, -60.1735637935906);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);

  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Toronto, Canada\n<span size=\"small\">CIUT</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 43.653963, -79.387207);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
Ole Aamot's avatar
Ole Aamot committed
482 483 484 485 486 487
  station = g_strdup("Trondheim, Norway\n<span size=\"small\">Radio Revolt</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 63.4305658, 10.3951929);
488 489 490 491 492
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
493
  station = g_strdup("Washington, District of Columbia\n<span size=\"small\">WAMU</span>");
494 495
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
496 497
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
498 499
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 38.8949549, -77.0366456);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
500
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
501
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
502
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
503 504 505 506 507 508 509 510 511 512 513
  marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
  station = g_strdup("Waterloo, Canada\n<span size=\"small\">SoundFM</span>");
  champlain_label_set_text (CHAMPLAIN_LABEL (marker), station);
  champlain_label_set_use_markup (CHAMPLAIN_LABEL (marker), TRUE);
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 43.466874, -80.524635);
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_marker_animate_in(CHAMPLAIN_MARKER (marker));
  /* champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker)); */
  g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), station);
514 515
#if 0
  marker = champlain_label_new_from_file ("icons/emblem-important.png", NULL);
516 517
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
518
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.873093, -122.303769);
519 520 521
  champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
  champlain_path_layer_add_node (*path, CHAMPLAIN_LOCATION (marker));
  marker = champlain_point_new ();
522 523
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
524
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.873093, -122.303769);
525 526 527 528
  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);
529 530
  champlain_label_set_color (CHAMPLAIN_LABEL (marker), &city_color);
  champlain_label_set_text_color (CHAMPLAIN_LABEL (marker), &text_color);
531
  champlain_location_set_location (CHAMPLAIN_LOCATION (marker), 37.873093, -122.303769);
532 533 534 535 536 537 538
  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);
  return layer;
}