[vlc-devel] [PATCH] OS X AppleScript: added new features

Felix Paul Kühne fkuehne.videolan at googlemail.com
Thu Sep 15 18:12:00 CEST 2011


Hi Jan,

On 13.09.2011, at 23:51, Jan Winter wrote:

> Hi Felix,
> 
> thanks for your comments.
> 
>> - for - (NSString*) nameOfCurrentItem, lastComponent isn't the way to go. instead, you should do something like this:
> 
> Did you mean this:
> 
> that function in VLCCoreInteraction can stay as it is
> 
> - (NSString*)pathOfCurrentPlaylistItem
That's okay for me, although it might be nicer to return a NSURL instead of a NSString.

> that function should be added to VLCCoreInteraction ???
> 
> - (NSString*)nameOfCurrentPlaylistItem
yeah, good idea!

> 
>> Additionally, setAudioVolume will need to be re-written, since the core's volume scale was changed to be cubic with a maximum of 200 % as far as I remember. However, this change wasn't reflected in the OS X UI so far.
> 
> Does that mean that [[VLCCoreInteraction sharedInstance] setVolume:i_parameter] stays the same, I have to adjust the function in applescript.m? Is it enough to limit the scale to 200% or do you mean with cubic a non-linear scale?
The new scale is non-linear, yes. Since the OS X interface needs an update here anyway, let's just keep this code and I'll fix it afterwards when updating the other parts.

> Do you've got a hint for me how to use one of the functions like libvlc_audio_get_track_count in libvlc_media_player.h ?
You can't use libvlc functions within the OSX module (or any VLC module). This is VLC's external interface in contrast to libvlccore. The nomenclature is a bit confusing if you aren't used to it..

You'll want to have a look at the "audio-es" variable. For details how to access its data, have a look at the respective header files or at "-(void)setupVarMenu: forMenuItem: target: var: selector:" to see it in action. Basically, you'll want to export val_list.p_list->i_count. From this variable, you can also extract the track names and of course you can use it to set the track of your choice.


Best regards,

Felix




More information about the vlc-devel mailing list