Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: meta data for file on disk (Read 2746 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

meta data for file on disk

Ran into a problem when trying to do something in the SDK. Say I have some file on disk, not in a playlist, not in the DB. I want to get meta data for the file. I've tried this:
Code: [Select]
file_info_i New("C:\\music\\song_wtih_meta.mp3", 0);
New.meta_get_count()


But meta_get_count always returns 0. .get_file_path does return the correct filename.

Any ideas how to do this? I assume I'm just not understanding the way everything fits in the SDK. Thanks.

Edited because not matter how many times I proof read I miss an error.

meta data for file on disk

Reply #1
file_info is merely an interface for passing information about files around, file_info_i is an implementation of that interface. It does not trigger loading of this information. Use metadb::handle_create() to acquire a metadb_handle of the track you are interested in, and then query the information from that. See masstagger source code for an example of how to use handle_lock(), handle_query_locked(), and handle_unlock() in conjunction.