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

Felix Paul Kühne fkuehne.videolan at googlemail.com
Tue Sep 13 16:14:07 CEST 2011


Hi Jan,

On 12.09.2011, at 22:38, Jan Winter wrote:

> I added some new AppleScript features. You can see and test the new features with the attached AppleScript (just comment each line out for testing). Everything worked fine on my machine. Feedback or suggestions how to make my code better are appreciated.
Thanks for the nice patch!

2 remarks:
- instead of tabs, we expect 4 spaces for any code within VLC. Additionally, there shouldn't be neither on empty lines.
- for - (NSString*) nameOfCurrentItem, lastComponent isn't the way to go. instead, you should do something like this:

NSString *aString;
char *format = var_InheritString( VLCIntf, "input-title-format" );
char *formated = str_format_meta( p_input, format );
free( format );
aString = [NSString stringWithUTF8String:formated];
free( formated );

char *uri = input_item_GetURI( input_GetItem( p_input ) );

NSURL * o_url = [NSURL URLWithString: [NSString stringWithUTF8String: uri]];
free( uri );

if ([aString isEqualToString:@""])
{
    if ([o_url isFileURL])
        aString = [[NSFileManager defaultManager] displayNameAtPath: [o_url path]];
    else
        aString = [o_url absoluteString];
}
return aString;

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.


Best regards,

Felix




More information about the vlc-devel mailing list