Amarok Scripting Sven Krohlas LinuxTag Berlin, 2009-06-24.

Slides:



Advertisements
Similar presentations
Total Resource Management RulesManager New Features August 21, 2012 Al Johnson, VP RulesManager Architecht.
Advertisements

Lecture 4: Embedded Application Framework Qt Tutorial Cheng-Liang (Paul) Hsieh ECE 424 Embedded Systems Design.
PRODUCT FOCUS 6/9/14 – 6/20/14 INTRODUCTION Our Product Focus for the next two weeks is Microsoft Windows 8.1. Windows 8 was released in the Fall of.
A Complete Tool For System Penetration Testing Presented By:- Mahesh Kumar Sharma B.Tech IV Year Computer Science Roll No. :- CS09047.
1 Lecture 7: Implementing a Prototype: Overview of Using PowerPoint, Flash Catalyst, html, Microsoft Sketchflow/Expression Blend, etc. Brad Myers
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Tutorial 10 Programming with JavaScript
Introduction to Linux Chapter 1. Operating Systems Operating System (OS) - most basic and important software on a computer Performs core tasks Organize.
Types of software. Sonam Dema..
An ide for teaching and learning prolog
An Overview of Qt - asankar1. Agenda About Qt –A brief intro of Qt Qt development tools –Tools used for building Qt application Qt Architecture –The underlying.
Open Source Workshop1 IBM Software Group Working with Apache Tuscany A Hands-On Workshop Luciano Resende Haleh.
Next generation e-learning with flex Christophe Herreman Application Indie Group
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
Java Mobile Apps with GWT & PhoneGap Josh Marinacci, webOS Developer Advocate.
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
CHAPTER TEN AUTHORING.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
In the Labs… X-Bot 2003 by Overtech Technologies.
SKYPIAX, how to add Skype capabilities to FreeSWITCH (and Asterisk) CHICAGO, USA, September 2009.
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
. The ideas behind Qt and a live demo Qt in Education.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
XP Tutorial 8 Adding Interactivity with ActionScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
NativeScript – Open source platform to build Native iOS/Android Apps.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Cross desktop Application Scripting Ideas for an implementation Desktop Developer Conference 2006, Ottawa, Canada Tuesday July 18 th 2006 Hubert Figuière.
1 April 14, Starting New Open Source Software Projects William Cohen NCSU CSC 591W April 14, 2008.
Michael DeHaan & Adrian Likins Red Hat. What is Func? A way to communicate with all your machines and query or control them over the network. Func uses.
XNAT 1.7: Getting Started 6 June, Introduction In this presentation we’ll discuss:  Features and functions in XNAT 1.7  Requirements  Installing.
JQuery Fundamentals Introduction Tutorial Videos
Beginning of Xamarin for iOS development
Development Environment
CST 1101 Problem Solving Using Computers
Features of Authoring Tools
PIWIK JUNIOR TIDAL ASSOCIATE PROF., WEB SERVICES & MULTIMEDIA LIBRARIAN NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY.
Tutorial 2 Programming Editors Recommendation & Cordova Plugin Installation and Management Li Xu Department of Systems Engineering.
Tutorial 10 Programming with JavaScript
Jonathan Riddell Canonical Kubuntu Ubuntu KDE
CO6025 Advanced Programming
PHP / MySQL Introduction
Lesson 1: Buttons and Events – 12/18
HOW TO INSTALL AOL DESKTOP GOLD
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Testing REST IPA using POSTMAN
slides borrowed and adapted from Alex Mariakis and CSE 390a
Mobile Application Development with MeeGo™ - Programming with SDK
Gašper Tkačik Cosylab, Slovenia
Cross Platform Charting
Moodle Mobile SCORM 1.2 player Daniel #mootus16.
Social Media And Global Computing Introduction to Visual Studio
Chapter 2: System Structures
Blender API: Part 2: Game Engine
WEBINAR: Test Automation & Robotic Automation of Dynamics AX with Rapise October 18th, 2018 – Adam
I dragged over the label tool (A icon) and put it on the form.
Tutorial 10 Programming with JavaScript
Download from Zotero Home Page
Chapter 2: Operating-System Structures
NIEM Tool Strategy Next Steps for Movement
Presentation transcript:

Amarok Scripting Sven Krohlas LinuxTag Berlin,

Overview Scripting? D-Bus QtScript Hints Example: Free Music Charts script NEW: Scripted Context Applets Further reading Questions?

Scripting? ● Communication with external apps ● Specialized Features ● Easy upgradeable – Lyrics ● Examples: BBC, NPR, LibriVox.org, Alarm, Free Music Charts, etc

Scripting? ● D-Bus interface for external apps – Similar to DCOP in Amarok 1.4 – MPRIS 1.0 compliant ● QtScript for internal enhancements – New in Amarok 2

D-Bus ● Media Player Remote Interfacing Specification ● Very basic interface ● ● Use QtScript for advanced and internal stuff!

D-Bus examples ● Who's here? – qdbus org.kde.amarok / Identity ● Start playback – qdbus org.kde.amarok /Player Play ● Pause playback – qdbus org.kde.amarok /Player Pause ● Change volume – qdbus org.kde.amarok /Player VolumeSet 50

QtScript ● ECMA Script with Qt bindings ● Three kinds of Amarok scripts: – Generic – Scriptable Service – Lyrics ● Type defined in script.spec file

QtScript: Why? ● No extra dependencies ● Works out of the box ● On all supported platforms ● Use QtScript whereever possible!

QtScript: script.spec [Desktop Entry] Icon=amarok Type=script ServiceTypes=KPluginInfo Name=Free Music Charts Comment=Listen to the Darkerradio.com Free Music Charts X-KDE-PluginInfo-Author=Sven Krohlas X-KDE-PluginInfo-Name=Free Music Charts X-KDE-PluginInfo-Version=1.3.0 X-KDE-PluginInfo-Category=Scriptable Service X-KDE-PluginInfo-Website= X-KDE-PluginInfo-Depends=Amarok2.0 X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=false

QtScript: Qt bindings ● Access to nearly all Qt modules: – qt.core – qt.gui – qt.network – qt.xml – qt.sql – qt.uitools

QtScript: Amarok API (1) ● Controlling Amarok: – Amarok.Collection – Amarok.Engine – Amarok.Info – Amarok.Lyrics – Amarok.Playlist – Amarok.Script – Amarok.Window ● Amarok.Window.OSD ● Amarok.Window.Statusbar

QtScript: Amarok API (2) ● “Tools & Utilities”: – Importer ● Importer.loadQtBinding( “qt.foo” ); – Scriptable Services – Downloader ● Downloader: text ● DataDownloader: Binary data

Hints: SVN ● Use our public SVN – amarok/playground/ – Get code reviews – Get help – New maintainers – Fast adoption of API changes – etc.

Hints: Linux/Windows/Mac ● Differences in the QtScript interpreter on different plattforms! ● Example: ● doc=new QDomDocument( "doc" ); ● Amarok.debug( doc ); ● Linux, Qt 4.4: OK - Windows: fail

Hints: Qt 4.4 vs. Qt 4.5 ● Amarok.Window.ToolsMenu.votingGui.trigg ered.connect( onVote ); ● Qt 4.4: OK - Qt 4.5: fail: ● amarok: [ScriptManager] [ERROR!] Script Error: "01:46:50 Error: Function.prototype.connect: ambiguous connect to KAction::triggered(); candidates are ● triggered(), triggered(bool), triggered(Qt::MouseButtons,Qt::KeyboardModifiers) ● Use e.g. object['triggered(Qt::MouseButtons,Qt::KeyboardModifiers)'].connect () to connect to a particular overload on Line: 177"

Hints ● → Test on different platforms with different Qt versions! ● Detailled debug output: – Call amarok -d from a shell (*nix) – Plus DebugView (Windows)

Hints: Script Console ● Great for debugging :-)

Hints: Amarok URLs ● New in Amarok 2.1 ● amarok:/ ● Can be used e.g. in the service info – amarok://navigate/service/Librivox.org/”Jules Verne” – Example: Free Music Charts ● Bookmarks

Hints ● Use our public SVN (again!) ● kde-apps.org – Lots of examples – Release there to show up in our Script Manager

Example: Free Music Charts

Scripted Applets (NEW in 2.2) ● Context Applets written in scripting languages ● Please use QtScript only! – amarok.kde.org /blog/archives/1017-time-to-take-it-away.html

Scripted Applets plasmoid.drawAppletBackground = function() { return true; } plasmoid.dataUpdate = function(a, b) { if ( b.current ) label.text = "Playing " + b.current[ "xesam:title" ] + " from " + b.current[ "xesam:author" ] + " on " + b.current[ "xesam:album" ]; } layout = new LinearLayout( plasmoid ); layout.setAlignment( 2 ); label1 = new Label( ); label1.text = "This is a javascript applet. Just to show off that we can get data from c++ dataengines, here's info on the currently playing track:"; layout.addItem( label1 ); label = new Label(); layout.addItem( label ); label.text = "This is a Javascript Applet"; plasmoid.dataEngine("amarok-current").connectSource( "current", plasmoid );

Further reading ● Qt 4.4 documentation – ● Amarok Scripting HowTo – ● Amarok Scripting API – ● Scripted Services Tutorial – ● Using.ui files –

Questions?

Easy Workshop Tasks ● Small, minimal UI ● GUI to change playlist mode – In Context View or as external app ● Tool to add missing XING headers ● Now Playing Plugin(s) ● Discogs Scripted Applet ●...or whatever comes to your mind