// Only used for audio files, so we don't bother with compression. const char *DISK_file_to_base64(const wchar_t *wfilename){ disk_t *disk = DISK_open_binary_for_reading(wfilename); if (disk==NULL) return NULL; QByteArray data = disk->file()->readAll(); DISK_close_and_delete(disk); return talloc_strdup(data.toBase64().constData()); }
static void set_wav_loop_points(Sample *sample, const wchar_t *filename, bool set_loop_on_off){ disk_t *file = DISK_open_binary_for_reading(filename); if(file==NULL){ GFX_Message(NULL, "Could not open file \"%s\". libsndfile could open the file though. Something might be wrong with your disk.",filename); return; } if(set_wav_loop_points_using_smpl_chunk(sample,file, set_loop_on_off)==false) set_wav_loop_points_using_cues(sample,file, set_loop_on_off); DISK_close_and_delete(file); }