Innovative Interfaces with Clutter
Listing 3. Clutter Rotating a Video
import clutter
import gst
from clutter import cluttergst
class HelloWorld:
def __init__ (self):
self.stage = clutter.Stage()
self.stage.set_color(clutter.color_parse('Black'))
self.stage.set_size(500, 400)
self.stage.set_title('Clutter 3-D Video Player')
# Setup video.
video_tex = cluttergst.VideoTexture()
self.pipeline = gst.Pipeline("mypipe")
playbin = video_tex.get_playbin()
movfile = "file:///home/user/Videos/Video.mov"
playbin.set_property('uri', movfile)
self.pipeline.add(playbin)
video_tex.set_position(90,80)
self.stage.add(video_tex)
self.pipeline.set_state(gst.STATE_PLAYING)
# Create timeline that lasts for 100 frames
# at ten frames per second.
timeline = clutter.Timeline(100, 10)
# Set timeline to loop forever.
timeline.set_loop(True)
# Create an alpha.
alpha = clutter.Alpha(timeline, clutter.smoothstep_dec_func)
# Set up rotation.
Rotation = clutter.BehaviourRotate(
axis=clutter.Y_AXIS,
direction=clutter.ROTATE_CW,
angle_start=0,
angle_end=360,
alpha=alpha)
Rotation.set_center(160, 160, 0)
Rotation.apply(video_tex)
# Start it all up.
timeline.start()
self.stage.show_all()
clutter.main()
# Run program.
main = HelloWorld()
The Alpha Functions
At first, especially to those who've forgotten their Calculus and Algebra, the alpha functions may seem unpredictable or confusing. There is a large list of the number of available functions: exp_dec_func, exp_inc_func, ramp_dec_func, ramp_func, ramp_inc_func, sine_dec_func, sine_func, sine_half_func, sine_inc_func, smoothstep_dec_func, smoothstep_inc_func and square_func. Here's a brief explanation of each type:
Exponential functions: depending on whether you're using a decaying function or an increasing function, exponential functions make the animation speed up or slow down at an exponential rate.
Ramp functions: ramp functions animate at a constant speed. However, the full ramp function animates at both a negative and a positive constant speed by switching directions.
Sine functions: sine functions make the animation reverse. Like the graph of a sine function, the animation would speed up, slow down, change directions, speed up in the reverse direction, and then slow down again.
Smooth step functions: the smooth step function works logistically. It starts slowly, then quickly increases and finally slows down toward the end of the animation.
Square functions: square functions follow a step pattern, which results in quick changes between two constant animation speeds.
Hopefully, you've learned a good deal about how Clutter works, and you can start developing and programming using the Clutter API. Using just the features you've seen here, you'll be able to create any interface that uses text, buttons, images and video with Clutter. Of course, after learning the basics, the more advanced UI elements will become easier to understand and work with.
In the future, the Clutter developers will continue to improve and update the API, and many new improvements are expected in the Clutter 1.0 release. You can learn more about the Clutter development process from the Web site (see Resources). Clutter is going to power many innovative open-source applications in the future.
Resources
Clutter Home Page: clutter-project.org
Elisa Project Page: elisa.fluendo.com
Clutter Source Files: www.clutter-project.org/sources
Alex Crits-Christoph has been working with Linux for some time now. He enjoys developing and designing open-source graphical user interfaces.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Evernote is much more...
1 hour 29 min ago - Reply to comment | Linux Journal
10 hours 14 min ago - Dynamic DNS
10 hours 48 min ago - Reply to comment | Linux Journal
11 hours 47 min ago - Reply to comment | Linux Journal
12 hours 37 min ago - Not free anymore
16 hours 39 min ago - Great
20 hours 26 min ago - Reply to comment | Linux Journal
20 hours 34 min ago - Understanding the Linux Kernel
22 hours 49 min ago - General
1 day 1 hour ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?





Comments
Incorrect statements about Elisa
Alex,
Thanks for posting an article about clutter. It is a great toolkit and worth talking about. However, your introduction makes statements that are simply incorrect.
You reference the Elisa project. First, it's interesting because your article was written in October yet Elisa changed its name to Moovida back in June of 2009.
Second, and more importantly, Elisa/Moovida has never used the clutter toolkit. They use the Pigment toolkit which is developed by Fluendo, the same company that develops Moovida (so the Moovida project is pretty invested into using their own toolkit). I'm sure that they work hard to make their toolkit useful for their purposes and wouldn't want to have their work mis-credited to some other toolkit.
I'm keenly aware that Moovida uses Pigment because I develop code for the Entertainer Media Center, another media center application that *does* use clutter. I probably wouldn't be working on this other project if there was already a larger media center application that used clutter.
I realize that your article is mostly tailored to be a HOWTO for using clutter, but I would expect that as a journalist for Linux Journal, you would research and verify your statements. I hope that my journalistic critique is not received negatively. I just want to give people credit where credit is due. The Fluendo developers deserve that much.
Thanks,
Matt