X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Faudio_playlist_importer.cc;h=34d46915f188e6f21feaa9417b804fc709051b82;hb=5b4c3aa226dc95f33dc3ffae6669a24f5e8b8fe0;hp=d97e95195f29255dc993e9b1dc44d572c594aad2;hpb=bb9cc45cd22af67ac275a5e73accbe14fee664d8;p=ardour.git diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc index d97e95195f..34d46915f1 100644 --- a/libs/ardour/audio_playlist_importer.cc +++ b/libs/ardour/audio_playlist_importer.cc @@ -28,8 +28,10 @@ #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; @@ -168,14 +170,20 @@ bool AudioPlaylistImporter::_prepare_move () { // Rename - while (session.playlist_by_name (name) || !handler.check_name (name)) { - std::pair rename_pair = Rename (_("A playlist with this name already exists, please rename it."), name); + while (session.playlists->by_name (name) || !handler.check_name (name)) { + std::pair 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; @@ -251,3 +259,8 @@ AudioPlaylistImporter::populate_region_list () } } +string +UnusedAudioPlaylistImportHandler::get_info () const +{ + return _("Audio Playlists (unused)"); +}