refactor MIDISceneChange color property addition by moving it into SceneChange to...
[ardour.git] / libs / ardour / audio_playlist_importer.cc
index cb6bbed907d3f5fc13eefd0e9d80975830d0a0f0..34d46915f188e6f21feaa9417b804fc709051b82 100644 (file)
 
 #include "ardour/audio_region_importer.h"
 #include "ardour/session.h"
-#include "ardour/playlist.h"
 #include "ardour/playlist_factory.h"
 #include "ardour/session_playlists.h"
 
+#include "i18n.h"
+
 using namespace std;
 using namespace PBD;
 using namespace ARDOUR;
@@ -170,13 +171,19 @@ AudioPlaylistImporter::_prepare_move ()
 {
        // Rename
        while (session.playlists->by_name (name) || !handler.check_name (name)) {
-               std::pair<bool, string> rename_pair = Rename (_("A playlist with this name already exists, please rename it."), name);
+               std::pair<bool, string> rename_pair = *Rename (_("A playlist with this name already exists, please rename it."), name);
                if (!rename_pair.first) {
                        return false;
                }
                name = rename_pair.second;
        }
-       xml_playlist.property ("name")->set_value (name);
+       
+       XMLProperty* p = xml_playlist.property ("name");
+       if (!p) {
+               error << _("badly-formed XML in imported playlist") << endmsg;
+       }
+
+       p->set_value (name);
        handler.add_name (name);
 
        return true;
@@ -252,3 +259,8 @@ AudioPlaylistImporter::populate_region_list ()
        }
 }
 
+string
+UnusedAudioPlaylistImportHandler::get_info () const
+{
+       return _("Audio Playlists (unused)");
+}