diff main/MainWindow.cpp @ 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 8b3038e55d50
children 11f804c7582a 909cf273bed1
line wrap: on
line diff
--- a/main/MainWindow.cpp	Tue Oct 12 16:02:02 2010 +0100
+++ b/main/MainWindow.cpp	Fri Oct 15 11:07:11 2010 +0100
@@ -2165,14 +2165,17 @@
 void
 MainWindow::importITunesAudio()
 {
-    QString path = iTunesNowPlayingPath();
+    QStringList nowPlaying = iTunesNowPlaying();
+    QString path = nowPlaying.at(0);
+    QString genre = (nowPlaying.size() > 1) ? nowPlaying.at(1) : "";
+    std::cerr << "MainWindow::importITunesAudio(): genre is " << genre.toStdString() << std::endl;
 
     if (path != "") {
-	if (openAudio(path, ReplaceMainModel) == FileOpenFailed) {
+    if (openAudio(path, ReplaceMainModel) == FileOpenFailed) {
             emit hideSplash();
-	    QMessageBox::critical(this, tr("Failed to open file"),
-				  tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path));
-	}
+        QMessageBox::critical(this, tr("Failed to open file"),
+                  tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path));
+    }
     }
 }
 #endif