Example #1
0
 void get_info(file_info & p_info, abort_callback & p_abort)
 {
     p_info.info_set_int("bitrate", (t_int64)m_decoder->avg_bitrate / 1000);
     p_info.info_set_int("samplerate", m_decoder->sample_rate);
     p_info.info_set_int("bitspersample", get_bps_for_format(config.format));
     p_info.info_set_int("channels", config.speakers);
     p_info.info_set("codec", m_decoder->format);
     p_info.set_length( (double) m_decoder->length);
 }
Example #2
0
	void get_info(t_uint32 p_subsong, file_info &p_info, abort_callback &p_abort)
	{
		int duration = get_song_duration(p_subsong, false);
		if (duration >= 0)
			p_info.set_length(duration / 1000.0);
		const ASAPInfo *info = ASAP_GetInfo(asap);
		p_info.info_set_int("channels", ASAPInfo_GetChannels(info));
		p_info.info_set_int("subsongs", ASAPInfo_GetSongs(info));
		meta_set(p_info, "composer", ASAPInfo_GetAuthor(info));
		meta_set(p_info, "title", ASAPInfo_GetTitle(info));
		meta_set(p_info, "date", ASAPInfo_GetDate(info));
	}
Example #3
0
	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);
	}
Example #4
0
	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() );
		}
	}
Example #5
0
	void get_info(file_info & p_info,abort_callback & p_abort) {
		t_filesize size = m_file->get_size(p_abort);
		if (size != filesize_invalid) {
			//file size is known, let's set length
			p_info.set_length(audio_math::samples_to_time( size / raw_total_sample_width, raw_sample_rate));
		}
		//note that the values below should be based on contents of the file itself, NOT on user-configurable variables for an example. To report info that changes independently from file contents, use get_dynamic_info/get_dynamic_info_track instead.
		p_info.info_set_int("samplerate",raw_sample_rate);
		p_info.info_set_int("channels",raw_channels);
		p_info.info_set_int("bitspersample",raw_bits_per_sample);
		p_info.info_set("encoding","lossless");
		p_info.info_set_bitrate((raw_bits_per_sample * raw_channels * raw_sample_rate + 500 /* rounding for bps to kbps*/ ) / 1000 /* bps to kbps */);
		
	}
Example #6
0
 void get_info(file_info &info, abort_callback &abort)
 {
     m_demuxer->get_metadata(info);
     auto asbd = m_demuxer->format().asbd;
     info.set_length(m_demuxer->duration() / asbd.mSampleRate);
     info.info_set_bitrate(m_demuxer->bitrate());
     info.info_set_int("samplerate", asbd.mSampleRate);
     uint32_t channel_mask = m_demuxer->format().channel_mask;
     std::string channels;
     if (channel_mask) {
         channels = Helpers::describe_channels(channel_mask);
         info.info_set("channels", channels.c_str());
     } else {
         info.info_set_int("channels", asbd.mChannelsPerFrame);
     }
     m_decoder->get_info(info);
 }
Example #7
0
	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);
	}
Example #8
0
	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);
	}
Example #9
0
	virtual void get_info(t_uint32 subsong, file_info & p_info,abort_callback & p_abort) {
		t_uint32 sample_rate = get_sample_rate();
		m_head.input->get_info(subsong, p_info, p_abort);
		pfc::string8 name;
		name << get_info_prefix();
		t_size prefixlen = name.get_length();
		name << "head_length";
		p_info.info_set(name, format_samples_ex(m_head.samples, sample_rate));
		name.truncate(prefixlen);
		name << "body_length";
		p_info.info_set(name, format_samples_ex(m_body.samples, sample_rate));
		p_info.set_length(audio_math::samples_to_time(m_head.samples + m_body.samples, sample_rate));
		if (m_autoprobe) {
			name.truncate(prefixlen);
			name << "autoprobe";
			pfc::string8 value;
			value << "type=" << g_get_short_name() << " head-suffix=" << m_head.suffix << " body-suffix=" << m_body.suffix;
			p_info.info_set(name, value);
		}
	}