SyncTV, built on GTK+

Really excited to be able to share some information about a project that we have been working on lately!

SyncTV

Pioneer recently released their new service SyncTV in a private beta. What makes it very interesting is that it’s built using GTK+ and GStreamer. SyncTV is an application and service to watch movies and TV-series over the internet.

SyncTV provide this service on Linux, Mac OS X and Windows, all through the cross platform capabilities of GTK+. SyncTV also shows that you can make really slick applications with GTK+ that look identical no matter which platform you run it on.

At Imendio we have worked on the project since spring 2007, mainly by improving the GTK+ Mac OS X port, but also packaging the application into an easily installable application bundle.

The project also included making Webkit/GTK+ run smoothly on Mac OS X which involved replacing the font backend to make it use Pango. Sven blogged briefly about this last year.

The observant follower of All Things Imendio (TM) would also realize that part of this project was to create hooks for GTK+ to integrate with the Mac OS X menubar which Mitch blogged about.

For a more in-depth review, see Download Squad.

Happenings in GTK+

A lot of cool stuff is going on in GTK+ at the moment.

New Website
Most visible is probably the much needed revamp of the website. Martyn started the work last year and with Andreas joining Imendio earlier this year, he got help to put the final pieces in place and improve the draft even further.

The site went live yesterday and it’s a really great improvement. Great work all involved!

GTK+ Hackweek in Berlin
In March there will be a GTK+ invitation only gathering in Berlin where the core team have invited those that could help bring GTK+ to the next level. We at Imendio are really excited about this and decided to join as gold sponsor together with Nokia and Red Hat.

Time to get some excitement and vision back into to the project, there is a lot of cool stuff going on around us!

GTK+ on Mac OS X
Earlier this week James Livingston blogged about getting Rhythmbox and Totem up and running on Mac OS X with the native GTK+ port that we have been working on over the last years. Richard has been doing an awesome job in hashing out issues with it and making sure it works as it should.

If you have a spare Mac OS X machine and haven’t tried out the native port yet, get over to our developer pages and learn how to set it up.

Our aim is to have an easily installable framework for Mac OS X finished within the next couple of weeks to make it very easy to setup your Mac OS X machine for cross platform application development with GTK+.

Quick “unlock slider” hack in GTK+

Went to town and bought an ipod touch during the weekend in order to be able to try out the UI a bit first hand. Quite a lot of the effects and animations should be possible to implement in a GTK+ UI fairly easily while some others will obviously want some kind of 3D acceleration.

I hacked up a quick test for making the kind of “unlock slider” that the ipod have for locking the screen from input. I am simply subclassing the GtkHScale and adding some animation to it.

Unlock Slider
For better resolution, see unlock-slider.mov

I started by adding my own handler for value-changed which checks whether the threshold for when to emit the unlocked signal is met. Otherwise an animation to bring the slider back to the original state is started:

static void
slider_value_changed (GtkRange *range)
{
	UnlockSliderPriv *priv;

	priv = GET_PRIV (range);

	if (priv->start_value != 0.0) {
		return;
	}

	if (gtk_range_get_value (range) < THRESHOLD) {
		priv->start_value = gtk_range_get_value (range);
		gtk_timeline_start (priv->timeline);
	} else {
		gtk_range_set_value (range, 1.0);
		priv->start_value = 0.0;
		g_signal_emit (range, signals[UNLOCKED], 0);
	}
}

This is using the GtkTimeline from #444659 . I’m then using the frame and finished signals from the timeline to update the slider to create the desired animation.

static void
slider_frame_cb (GtkTimeline  *timeline,
				 gdouble       progress,
				 UnlockSlider *slider)
{
	UnlockSliderPriv *priv;

	priv = GET_PRIV (slider);

	gtk_range_set_value (GTK_RANGE (slider), (1.0 - progress) * priv->start_value);
}

static void
slider_finished_cb (GtkTimeline *timeline, UnlockSlider *slider)
{
	UnlockSliderPriv *priv;

	priv = GET_PRIV (slider);

	gtk_range_set_value (GTK_RANGE (slider), 0.0);
	priv->start_value = 0.0;
	gtk_timeline_rewind (priv->timeline);
}

That’s about it for creating a simple animation looking as the video above. The full code (including the boilerplate and window creation code can be found in our git repository.

It would obviously need some artistic love and subclassing the GtkHScale is probably not the approach I would take for a real world application but it served well for a quick example.

« Previous PageNext Page »

Close
E-mail It