Aamot Software - Free Software Engineering Company (logo) Aamot Software (icon) GNU Network Object Model Environment Gingerblue (icon) GNU Network Object Model Environment Goodbye (icon) GNU Network Object Model Environment Voice (icon) GNU Network Object Model Environment Radio (icon)
GoodBye (logo)

GTK 4 World Radio Software App

GoodBye (icon)
Voice (icon)
Radio (icon)
Radio (icon)
Norwegian (icon)
BBC World Service
Voice
GoodBye.fm
Radio
Radio Norwegian

Build

git clone https://gitlab.stud.idi.ntnu.no/olekaam/goodbye.git
cd goodbye/
./configure --prefix=/opt
make install

MacOS

13.0.1 Ventura

Running

/opt/bin/GoodBye

Release

GoodBye 0.0.1 (2022-12-22)

Source

$ cat org.aamot.GoodBye.cpp
#include <gtk/gtk.h>
#include <gst/player/player.h>
#include <webkit2/webkit2.h>

static void
activate(GtkApplication * app, gpointer user_data)
{
	GtkWidget      *grid;
	GstPlayer      *player;
	WebKitWebView  *webView;
	GtkWidget      *window;
	window = gtk_application_window_new(app);
	grid = gtk_grid_new();
	gtk_window_set_application(GTK_WINDOW(window), GTK_APPLICATION(app));
	gtk_window_set_title(GTK_WINDOW(window), "GoodBye");
	gtk_window_set_default_size(GTK_WINDOW(window), 800, 600);
	webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
	gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(webView), 0, 1, 2, 1);
	webkit_web_view_load_uri(webView, "https://goodbye.aamot.org/#App");
	gtk_widget_grab_focus(GTK_WIDGET(webView));
	gtk_container_add(GTK_CONTAINER(window), grid);
	gtk_widget_show(window);
	player = gst_player_new(NULL, gst_player_g_main_context_signal_dispatcher_new(NULL));
	gst_player_set_uri(GST_PLAYER(player), "http://stream.live.vc.bbcmedia.co.uk/bbc_world_service");
	gst_player_play(GST_PLAYER(player));
}

int
main(int argc, char **argv)
{
	GtkApplication *app;
	int		status;

	gst_init(&argc, &argv);

	app = gtk_application_new("org.aamot.GoodBye", G_APPLICATION_FLAGS_NONE);
	g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
	status = g_application_run(G_APPLICATION(app), argc, argv);
	g_object_unref(app);

	return status;
}
$ c++ org.aamot.GoodBye.cpp -o GoodBye $(pkg-config --cflags gstreamer-player-1.0 webkit2gtk-4.0 gtk4 --libs)
$ ./GoodBye

References

Programming with gtkmm 4 ("Mixing C and C++ APIs") [developer-old.gnome.org, 2022-12-22]