[vlc-devel] Fwd: Improved AppleScript support in VLC (code)
hartman at videolan.org
Sat Aug 27 22:55:24 CEST 2005
Forwarding to developer mailinglist.
Anyone feels up to this?
Whatever you do, beware of vlc's multithreaded nature. Best get and
set these value's directly on the controls. Come to think of it, you
might be able to create MPSlider and ITSlider instead of
VLCApplication pairs, to directly interact with the volume and
Begin forwarded message:
> From: Jonas Salling
> Date: 25 augustus 2005 10:08:11 GMT+02:00
> To: hartman at videolan.org
> Cc: thedj at users.sourceforge.net
> Subject: Improved AppleScript support in VLC (code)
> Let me introduce myself. I'm Jonas Salling, the author of Salling
> Clicker, a rather popular remote control tool for Mac OS X (and
> soon also Windows).
> Many of my users use Clicker in conjunction with VLC. Clicker can
> interact with Mac OS X applications both with synthetic HID events
> and AppleScript. I'm writing you now, as I feel the experience for
> Clicker/VLC users could be much improved had there been a more
> robust support for AppleScript in VLC.
> I understand this sort of stuff is probably not something you're
> prioritizing at this point (I've seen some comments in trac to that
> effect), so I grabbed the source code from your SVN repository
> thinking I could help out a bit; at least adding some of the things
> I'd like to see, such as adding a scriptable application object
> with properties for "player state", "audio volume", etc.
> I'm under great pressure to finish other work, so I wasn't able to
> get very far in doing what I had set out to do (primarily, VLC
> seems to have dependencies to libraries I don't have on my
> machine). But I figured I should share with you how I think you
> could easily improve the scripting aspects of VLC for OS X. If
> you'd prefer for me to keep tinkering with this and send you the
> results, let me know if there are any configure flags I can use to
> compile and run at least the UI parts of the app on a stock 10.4.2
> Now, here's what I think you can do to get a scriptable application
> object with some properties:
> Define the "application" class with the properties you want. Insert
> the following before "Commands":
> Make the corresponding changes:
> <string>audio volume</string>
> <string>The VLC application</string>
> Add a category on the VLCApplication class for the properties
> (CocoaScripting will use key-value-coding to interact with
> VLCApplication; the setter and getter methods correspond to the
> names in scriptSuite, but with the getter-method starting always in
> @implementation VLCApplication (Scripting)
> - (NSNumber *)volume
> // do your thing here...
> return [NSNumber numberWithInt:42];
> - (void)setVolume:(NSNumber *)value
> // do your thing here [value intValue]...
> Ok. This should be about all you have to do. I'm not sure how much
> experience you have with AppleScript support implementations, so
> please forgive me if you knew this already. Otherwise, I hope this
> example gives you a better understanding of how easy it might be to
> improve on VLC.
> Let me know if you have any questions or comments once you
> (hopefully) get to this.
> Jonas Salling
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel