PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Guru Evi   DCOP calls for PHP   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: DCOP calls for PHP
Execute actions of KDE applications using DCOP
Author: By
Last change:
Date: 17 years ago
Size: 1,175 bytes


Class file image Download

$dcop = new dcop;

$dcop->application("juk","guruevi"); //1st argument is necessary, 2nd and 3rd are either specified in your class
                         //or the defaults will be used

$dcop->app_function("Player","playingString"); //call juk's player function and get playingstring as an argument
$playingstring = implode(" ",$dcop->call()); //This should return what's currently playing on juk

$dcop->app_function("Player","trackProperty","Album"); //gimme the album
$playingalbum = implode(" ",$dcop->call());

$dcop->app_function("Player","totalTime"); //how much is the total time (in seconds)
$playing_tot_time = implode(" ",$dcop->call());

$dcop->app_function("Player","currentTime"); //how much is the current time (in seconds)
$playing_cur_time = implode(" ",$dcop->call());

"Currently playing in JuK: " . $playingstring . " from the album: " . $playingalbum . "\n";
"Currently " . $playing_cur_time . " seconds far in the " . $playing_tot_time . " seconds long song\n\n";
"This is just an example of what DCOP for you can do - submit bugs in the PHP scripts to\n";
"License: GPL\n";