void get_info( file_info & p_info, abort_callback & p_abort ) { YMMUSIC * m_info = ymMusicCreate(); ymMusicLoadMemory(m_info,file_buffer.get_ptr(), file_buffer.get_size()); ymMusicInfo_t info; ymMusicGetInfo(m_info,&info); p_info.info_set( "encoding", "synthesized" ); p_info.info_set( "codec", "YM" ); p_info.info_set_int( "channels", 1 ); p_info.meta_set( "title", pfc::stringcvt::string_utf8_from_ansi( info.pSongName) ); p_info.meta_set( "artist", pfc::stringcvt::string_utf8_from_ansi( info.pSongAuthor) ); p_info.meta_set( "comment", pfc::stringcvt::string_utf8_from_ansi( info.pSongComment) ); p_info.set_length( info.musicTimeInSec ); ymMusicDestroy(m_info); }
void get_info(t_uint32 p_subsong, file_info &p_info, abort_callback &p_abort) { int duration = module_info.durations[p_subsong]; if (duration < 0) duration = 1000 * song_length; if (play_loops && module_info.loops[p_subsong]) duration = 1000 * song_length; if (duration >= 0) p_info.set_length(duration / 1000.0); p_info.info_set_int("channels", module_info.channels); p_info.info_set_int("subsongs", module_info.songs); if (module_info.author[0] != '\0') p_info.meta_set("composer", module_info.author); p_info.meta_set("title", module_info.name); if (module_info.date[0] != '\0') p_info.meta_set("date", module_info.date); }
void get_info( file_info & p_info, abort_callback & p_abort ) { ModPlugFile* m_info = ModPlug_Load(file_buffer.get_ptr(), file_buffer.get_size()); p_info.info_set( "encoding", "synthesized" ); int type_module = ModPlug_GetModuleType(m_info); p_info.info_set( "codec", "Module file" ); p_info.info_set_int( "channels", 2 ); p_info.meta_set( "title", pfc::stringcvt::string_utf8_from_ansi( ModPlug_GetName(m_info) )); int len = ModPlug_GetLength(m_info); len /= 1000; p_info.set_length( len ); if(m_info)ModPlug_Unload(m_info); }
void get_info(file_info & p_info,abort_callback & p_abort) { p_info.set_length( mod->get_duration_seconds() ); p_info.info_set_int( "samplerate", settings.samplerate ); p_info.info_set_int( "channels", settings.channels ); p_info.info_set_int( "bitspersample", 32 ); std::vector<std::string> keys = mod->get_metadata_keys(); for ( std::vector<std::string>::iterator key = keys.begin(); key != keys.end(); ++key ) { if ( *key == "message_raw" ) { continue; } p_info.meta_set( (*key).c_str(), mod->get_metadata( *key ).c_str() ); } }
bool file_info_filter_scale_bpm::apply_filter(metadb_handle_ptr p_track, t_filestats p_stats, file_info & p_info) { const char * str = p_info.meta_get(m_bpm_tag, 0); float bpm = 0.0f; if ((str != NULL) && (sscanf_s(str, "%f", &bpm) == 1)) { bpm = static_cast<float>(bpm * m_scale); p_info.meta_set(m_bpm_tag, format_bpm(bpm)); return true; } else { return false; } }
static void meta_set(file_info &p_info, const char *p_name, const char *p_value) { if (p_value[0] != '\0') p_info.meta_set(p_name, p_value); }