Mercurial > hg > sonic-visualiser
comparison 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 |
comparison
equal
deleted
inserted
replaced
369:8b3038e55d50 | 370:ca9f27734349 |
---|---|
2163 | 2163 |
2164 #ifdef Q_WS_MAC | 2164 #ifdef Q_WS_MAC |
2165 void | 2165 void |
2166 MainWindow::importITunesAudio() | 2166 MainWindow::importITunesAudio() |
2167 { | 2167 { |
2168 QString path = iTunesNowPlayingPath(); | 2168 QStringList nowPlaying = iTunesNowPlaying(); |
2169 QString path = nowPlaying.at(0); | |
2170 QString genre = (nowPlaying.size() > 1) ? nowPlaying.at(1) : ""; | |
2171 std::cerr << "MainWindow::importITunesAudio(): genre is " << genre.toStdString() << std::endl; | |
2169 | 2172 |
2170 if (path != "") { | 2173 if (path != "") { |
2171 if (openAudio(path, ReplaceMainModel) == FileOpenFailed) { | 2174 if (openAudio(path, ReplaceMainModel) == FileOpenFailed) { |
2172 emit hideSplash(); | 2175 emit hideSplash(); |
2173 QMessageBox::critical(this, tr("Failed to open file"), | 2176 QMessageBox::critical(this, tr("Failed to open file"), |
2174 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path)); | 2177 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path)); |
2175 } | 2178 } |
2176 } | 2179 } |
2177 } | 2180 } |
2178 #endif | 2181 #endif |
2179 | 2182 |
2180 void | 2183 void |