当前位置: 首页>>代码示例>>C++>>正文


C++ file_info::meta_get方法代码示例

本文整理汇总了C++中file_info::meta_get方法的典型用法代码示例。如果您正苦于以下问题:C++ file_info::meta_get方法的具体用法?C++ file_info::meta_get怎么用?C++ file_info::meta_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在file_info的用法示例。


在下文中一共展示了file_info::meta_get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: retag_set_info

	void retag_set_info(t_uint32 p_subsong, const file_info &p_info, abort_callback &p_abort)
	{
		ASAPInfo *info = const_cast<ASAPInfo *>(ASAP_GetInfo(asap));
		ASAPInfo_SetAuthor(info, empty_if_null(p_info.meta_get("composer", 0)));
		ASAPInfo_SetTitle(info, empty_if_null(p_info.meta_get("title", 0)));
		ASAPInfo_SetDate(info, empty_if_null(p_info.meta_get("date", 0)));
	}
开发者ID:hudokkow,项目名称:audiodecoder.asap,代码行数:7,代码来源:foo_asap.cpp

示例2: instantiate

	virtual bool instantiate( const file_info & info, decode_postprocessor_instance::ptr & out )
	{
		if (info.info_get_int("samplerate") != 44100) return false;

		const char* enabled = info.meta_get("pre_emphasis", 0);
		if (enabled == NULL) enabled = info.meta_get("pre-emphasis", 0);
		if (enabled == NULL)
		{
			return false;
		}

		if (pfc::stricmp_ascii(enabled, "1") == 0 || pfc::stricmp_ascii(enabled, "on") == 0 || pfc::stricmp_ascii(enabled, "yes") == 0)
		{
			console::print("Pre-emphasis detected and enabled in track. Running filter");
			out = new service_impl_t<deemph_postprocessor_instance>;
			return true;
		}
	}
开发者ID:Crazybond,项目名称:foobar2000,代码行数:18,代码来源:postprocess_deemph.cpp

示例3: info_meta_add

static void info_meta_add(file_info & info, const char * tag, pfc::ptr_list_t< const char > const& values)
{
	t_size count = info.meta_get_count_by_name( tag );
	if ( count )
	{
		// append as another line
		pfc::string8 final = info.meta_get(tag, count - 1);
		final += "\r\n";
		final += values[0];
开发者ID:soneek,项目名称:foo_input_ncsf,代码行数:9,代码来源:psf.cpp

示例4: copy_info

static void copy_info(char *dest, const file_info &p_info, const char *p_name)
{
	const char *src;
	int i = 0;
	src = p_info.meta_get(p_name, 0);
	if (src != NULL)
		for (; i < 127 && src[i] != '\0'; i++)
			dest[i] = src[i];
	dest[i] = '\0';
}
开发者ID:070499,项目名称:xbmc,代码行数:10,代码来源:foo_asap.cpp

示例5: apply_filter

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;
	}
}
开发者ID:stengerh,项目名称:foo_bpm,代码行数:18,代码来源:file_info_filter_scale_bpm.cpp

示例6: strtoul

	write_xid6( service_ptr_t<file> & p_file, const file_info & p_info, abort_callback & p_abort )
		: m_file( p_file ), m_abort( p_abort )
	{
		pfc::stringcvt::string_ansi_from_utf8 converter;
		t_filesize offset_tag_start;
		const char * value;
		t_uint32 int32 = 0;

		p_file->seek_ex( 0, file::seek_from_eof, p_abort );

		p_file->write_object( xid6_signature, 4, p_abort );
		p_file->write_object_t( int32, p_abort );

		offset_tag_start = p_file->get_position( p_abort );

		value = p_info.meta_get( "title", 0 );
		if ( value )
		{
			converter.convert( value );
			if ( strlen( converter ) > 32 ) write_string( XID_SONG, converter );
		}

		value = p_info.meta_get( "album", 0 );
		if ( value )
		{
			converter.convert( value );
			if ( strlen( converter ) > 32 ) write_string( XID_GAME, converter );
		}

		value = p_info.meta_get( "artist", 0 );
		if ( value )
		{
			converter.convert( value );
			if ( strlen( converter ) > 32 ) write_string( XID_ARTIST, converter );
		}

		value = p_info.meta_get( "dumper", 0 );
		if ( value )
		{
			converter.convert( value );
			if ( strlen( converter ) > 16 ) write_string( XID_DUMPER, converter );
		}

		value = p_info.meta_get( "comment", 0 );
		if ( value )
		{
			converter.convert( value );
			if ( strlen( converter ) > 32 ) write_string( XID_CMNTS, converter );
		}

		value = p_info.meta_get( "OST", 0 );
		if ( value )
		{
			converter.convert( value );
			write_string( XID_OST, converter );
		}

		value = p_info.meta_get( "discnumber", 0 );
		if ( value )
		{
			char * end;
			unsigned disc = strtoul( value, &end, 10 );
			if ( !*end && disc > 0 && disc <= 9 )
				write_data( XID_DISC, disc );
		}

		value = p_info.meta_get( "tracknumber", 0 );
		if ( value )
		{
			char * end;
			unsigned track = strtoul( value, &end, 10 );
			if ( track > 0 && track < 100 )
				write_data( XID_TRACK, track * 0x100 + *end );
		}

		value = p_info.meta_get( "copyright", 0 );
		if ( value )
		{
			char * end;
			unsigned copyright_year = strtoul( value, &end, 10 );
			if ( copyright_year > 0 && copyright_year < 65536 )
				write_data( XID_COPY, copyright_year );

			while ( *end && *end == ' ' ) end++;
			if ( *end )
			{
				converter.convert( end );
				write_string( XID_PUB, converter );
			}
		}

		value = p_info.info_get( field_length );
		if ( value )
		{
			char * end;
			unsigned length = strtoul( value, &end, 10 );
			if ( !*end && length > 0 && ( length % 1000 || length > 999000 ) )
				write_int( XID_INTRO, length * 64 );
		}

//.........这里部分代码省略.........
开发者ID:xomniversex,项目名称:foo_gep,代码行数:101,代码来源:spc.cpp

示例7: offsetof

static void write_id666( service_ptr_t<file> & p_file, const file_info & p_info, abort_callback & p_abort )
{
	char buffer[32];
	const char * value;
	pfc::stringcvt::string_ansi_from_utf8 converter;

	p_file->seek( 0x23, p_abort );
	buffer [0] = 26;
	p_file->write_object( buffer, 1, p_abort );

	p_file->seek( offsetof( Spc_Emu::header_t, song ), p_abort );

	memset( buffer, 0, sizeof( buffer ) );
	value = p_info.meta_get( "title", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 32 );
	}
	p_file->write_object( buffer, 32, p_abort );

	memset( buffer, 0, sizeof( buffer ) );
	value = p_info.meta_get( "album", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 32 );
	}
	p_file->write_object( buffer, 32, p_abort );

	memset( buffer, 0, 16 );
	value = p_info.meta_get( "dumper", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 16 );
	}
	p_file->write_object( buffer, 16, p_abort );

	memset( buffer, 0, sizeof( buffer ) );
	value = p_info.meta_get( "comment", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 32 );
	}
	p_file->write_object( buffer, 32, p_abort );

	memset( buffer, 0, 11 );
	value = p_info.meta_get( "date", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 11 );
	}
	p_file->write_object( buffer, 11, p_abort );

	memset( buffer, 0, 3 );
	value = p_info.info_get( field_length );
	if ( value )
	{
		size_t length = strlen( value );
		if ( length > 3 )
		{
			length -= 3;
			strncpy( buffer, value, min( 3, length ) );
		}
	}
	p_file->write_object( buffer, 3, p_abort );

	memset( buffer, 0, 5 );
	value = p_info.info_get( field_fade );
	if ( value ) strncpy( buffer, value, 5 );
	p_file->write_object( buffer, 5, p_abort );

	memset( buffer, 0, sizeof( buffer ) );
	value = p_info.meta_get( "artist", 0 );
	if ( value )
	{
		converter.convert( value );
		strncpy( buffer, converter, 32 );
	}
	p_file->write_object( buffer, 32, p_abort );
}
开发者ID:xomniversex,项目名称:foo_gep,代码行数:84,代码来源:spc.cpp

示例8: set_tag

void embeddedcue_metadata_manager::set_tag(file_info const & p_info) {
	m_content.remove_all();
	
	{
		track_record & track0 = m_content.find_or_add((unsigned)0);
		track0.m_info.from_info(p_info);
		track0.m_info.m_info.set("cue_embedded","no");
	}
	
	

	const char * cuesheet = p_info.meta_get("cuesheet",0);
	if (cuesheet == NULL) {
		return;
	}

	//processing order
	//1. cuesheet content
	//2. overwrite with global metadata from the tag
	//2. overwrite with local metadata from the tag

	{
		cue_creator::t_entry_list entries;
		try {
			cue_parser::parse_full(cuesheet,entries);
		} catch(exception_io_data const & e) {
			console::print(e.what());
			return;
		}

		for(cue_creator::t_entry_list::const_iterator iter = entries.first(); iter.is_valid(); ) {
			cue_creator::t_entry_list::const_iterator next = iter;
			++next;
			track_record & entry = m_content.find_or_add(iter->m_track_number);
			entry.m_file = iter->m_file;
			entry.m_flags = iter->m_flags;
			entry.m_index_list = iter->m_index_list;
			entry.m_info.from_info(iter->m_infos);
			entry.m_info.from_info_overwrite_info(p_info);
			entry.m_info.m_info.set("cue_embedded","yes");
			double begin = entry.m_index_list.start(), end = next.is_valid() ? next->m_index_list.start() : p_info.get_length();
			if (end <= begin) throw exception_io_data();
			entry.m_info.set_length(end - begin);
			iter = next;
		}
	}
	
	for(t_size metawalk = 0, metacount = p_info.meta_get_count(); metawalk < metacount; ++metawalk) {
		const char * name = p_info.meta_enum_name(metawalk);
		const t_size valuecount = p_info.meta_enum_value_count(metawalk);
		if (valuecount > 0 && !is_reserved_meta_entry(name) && is_global_meta_entry(name)) {
			__set_tag_global_field_relay relay(p_info,metawalk);
			m_content.enumerate(relay);
		}
	}

	{
		pfc::string8_fastalloc namebuffer;
		for(t_size metawalk = 0, metacount = p_info.meta_get_count(); metawalk < metacount; ++metawalk) {
			const char * name = p_info.meta_enum_name(metawalk);
			const t_size valuecount = p_info.meta_enum_value_count(metawalk);
			unsigned trackno;
			if (valuecount > 0 && !is_reserved_meta_entry(name) && resolve_cue_meta_name(name,namebuffer,trackno)) {
				track_record * rec = m_content.query_ptr(trackno);
				if (rec != NULL) {
					rec->m_info.transfer_meta_entry(namebuffer,p_info,metawalk);
				}
			}
		}
	}
}
开发者ID:9060,项目名称:columns_ui,代码行数:71,代码来源:cue_parser_embedding.cpp


注:本文中的file_info::meta_get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。