diff osx/svitunes.mm @ 370:ca9f27734349 macness

svitunes: retrieve the genre metadata, as well as the path
author Dan Stowell <dan.stowell@eecs.qmul.ac.uk>
date Fri, 15 Oct 2010 11:07:11 +0100
parents d0c6a13ae6d2
children fad5611ef9db
line wrap: on
line diff
--- a/osx/svitunes.mm	Tue Oct 12 16:02:02 2010 +0100
+++ b/osx/svitunes.mm	Fri Oct 15 11:07:11 2010 +0100
@@ -32,7 +32,7 @@
     return result;
 }
 
-QString iTunesNowPlayingPath(){
+QStringList iTunesNowPlaying(){
     NSDictionary *errorDict;
     NSAppleScript *scriptObject = [[NSAppleScript alloc]    initWithSource:@" \
 tell application \"System Events\" to set iTunesIsRunning to (name of processes) contains \"iTunes\" \n\
@@ -50,7 +50,7 @@
         end if \n\
     end if \n\
     \
-    return the POSIX path of (location of aTrack as text) \n\
+    return the POSIX path of (location of aTrack as text) & \"\n\" & (genre of aTrack) \n\
 end tell \n\
 "
     ];
@@ -73,5 +73,5 @@
     QString resultString = qt_mac_NSStringToQString(nsResultString);
     
     [scriptObject release];
-    return resultString;
+    return resultString.split(QChar('\n'));
 }