Beispiel #1
0
EXPORT void audgui_export_playlist (void)
{
    int list = aud_playlist_get_active ();
    int id = aud_playlist_get_unique_id (list);

    char * def = aud_playlist_get_filename (list);
    char * filename = select_file (TRUE, def);
    str_unref (def);

    if (! filename || (vfs_file_test (filename, G_FILE_TEST_EXISTS) &&
     ! confirm_overwrite (filename)))
        return;

    if ((list = aud_playlist_by_unique_id (id)) < 0)
        return;

    aud_playlist_save (list, filename);
    g_free (filename);
}
Beispiel #2
0
static void finish_job (void * data)
{
    ImportExportJob * job = data;
    int list = aud_playlist_by_unique_id (job->list_id);

    if (list >= 0)
    {
        aud_playlist_set_filename (list, job->filename);

        if (job->save)
            aud_playlist_save (list, job->filename);
        else
        {
            aud_playlist_entry_delete (list, 0, aud_playlist_entry_count (list));
            aud_playlist_entry_insert (list, 0, job->filename, NULL, FALSE);
        }
    }

    gtk_widget_destroy (job->selector);
}