XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Aug 18日 08:20

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2016年 Dec 7日 12:48 
Online
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 536
We are limited to the controls that the developer Tony provides. He codes the interface to certain windows core APIs and then the Xwidget designers have to use the APIs/cores that Tony provides. If they are good then the Xwidget designers have an easy time as all the heavy-lifting is done by the 'core'. The code is built-in as it were.

However, this is only useful for the few cores that Tony has designed. Some of those cores are out-of-date and some aren't very good (the mediaplayer core), some are completely missing. If you want a core to allow automated and easy access to VLC player or Open Hardware Monitor then that core does not exist. You are stuck with having to write your own code.

We have access to very little documentation but there exists documentation and methodology from other sources that allows us to create our own methods but that is sparse and not directly related to xwidget. However, if you search for jscript, COM and activeXobject the internet will provide some examples on how to integrate Active X objects into your own code.

As an example, it is relatively straightforward to extend the Xwidget engine's javascript to allow it to interface via COM to Windows object control extensions (ocx). In this manner you can extend javascript functionality to allow access to other Windows components such as Windows Media Player's API without requiring a 'core' at all. You do it all in code instead.

eg.
// creating a new instance of the windows media player
var WMPlayer = new ActiveXObject("WMPlayer.OCX.7");

// commands that cause the WMP do this or that
WMPlayer.settings.setMode("loop", false);
WMPlayer.settings.autoStart = false;
WMPlayer.settings.mute = false;

// dialog box to open an audio media file for playing
fileName = OpenFileDialog("");

// use WMPlayer to play the file
WMPlayer.URL = fileName;
WMPlayer.currentPlaylist.count;
WMPlayer.controls.play();

We no longer have to make do with Tony's (slightly rubbish) media player core and can manipulate the audio tracks as we require.

I have a fully working Yahoo widget with all the necessary javascript code already created to interface /control Windows media player and as Xwidget has full ActiveX COM integration and javascript, all that logic is transferable and I so am able to migrate the code to Xwidget to allow a widget to control the Windows Media Player via activeX within Xwidget too. That conversion for this is actually underway.

Downside: As we have created our own new instance of the WMPlayer object you have to disassociate (unbind) all your controls that are currently bound to Tony's media player core. Using Tony's media player core in your widget has creates its own instance of the WMPlayer object which will play/control another track of its choosing simultaneously. You won't be able to interact with it manually with code using the above methods, it would be like having two media players within one widget!

Basically, you have to use your own code or Tony's core exclusively but that is no problem as Tony's media player core is a little bit rubbish.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group