Help - Search - Members - Calendar
Full Version: How to get total file size of all items in playlist
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
mixcherry
Currently I use this code:
CODE
metadb_handle_list items;
pm->playlist_get_all_items(playlist_idx, items);
t_filesize total_filesize = 0;
for (int i=0; i<items.get_count(); i++) {
    total_filesize += items[i]->get_filesize();
    }
items.remove_all();

This works well for normal MP3/OGG/FLAC files, but the total filesize is not reported correctly when e.g. CUE+FLAC is used -- it seems that each song (which is part of CUE) returns the same filesize as the whole original file. Is it possible to show the filesize of part of FLAC (based on CUE info)?

I've noticed that Properties... box always shows only original size of whole flac size, no matter how many tracks from CUE are selected. How to achieve this effect? With my code, I get original_whole_flac_filesize * num_selected_tracks...
foosion
See file_list_helper::file_list_from_metadb_handle_list in the SDK helpers.
mixcherry
Thank you, now it works as intended. I've also realized that getting only file's certain part size is a nonsese.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.