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


C++ MediaInfo::Count_Get方法代码示例

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


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

示例1: main

int main (int argc, char *argv[])
{
    //Information about MediaInfo
    MediaInfo MI;
    ZenLib::Ztring To_Display=MI.Option(__T("Info_Version"), __T("0.7.0.0;MediaInfoDLL_Example_MSVC;0.7.0.0")).c_str();

    To_Display += __T("\r\n\r\nInfo_Parameters\r\n");
    To_Display += MI.Option(__T("Info_Parameters")).c_str();

    To_Display += __T("\r\n\r\nInfo_Capacities\r\n");
    To_Display += MI.Option(__T("Info_Capacities")).c_str();

    To_Display += __T("\r\n\r\nInfo_Codecs\r\n");
    To_Display += MI.Option(__T("Info_Codecs")).c_str();

    //An example of how to use the library
    To_Display += __T("\r\n\r\nOpen\r\n");
    MI.Open(__T("Example.ogg"));

    To_Display += __T("\r\n\r\nInform with Complete=false\r\n");
    MI.Option(__T("Complete"));
    To_Display += MI.Inform().c_str();

    To_Display += __T("\r\n\r\nInform with Complete=true\r\n");
    MI.Option(__T("Complete"), __T("1"));
    To_Display += MI.Inform().c_str();

    To_Display += __T("\r\n\r\nCustom Inform\r\n");
    MI.Option(__T("Inform"), __T("General;Example : FileSize=%FileSize%"));
    To_Display += MI.Inform().c_str();

    To_Display += __T("\r\n\r\nGet with Stream=General and Parameter=\"FileSize\"\r\n");
    To_Display += MI.Get(Stream_General, 0, __T("FileSize"), Info_Text, Info_Name).c_str();

    To_Display += __T("\r\n\r\nGetI with Stream=General and Parameter=46\r\n");
    To_Display += MI.Get(Stream_General, 0, 46, Info_Text).c_str();

    To_Display += __T("\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n");
    To_Display += ZenLib::Ztring::ToZtring(MI.Count_Get(Stream_Audio, -1)); //Warning : this is an integer

    To_Display += __T("\r\n\r\nGet with Stream=General and Parameter=\"AudioCount\"\r\n");
    To_Display += MI.Get(Stream_General, 0, __T("AudioCount"), Info_Text, Info_Name).c_str();

    To_Display += __T("\r\n\r\nGet with Stream=Audio and Parameter=\"StreamCount\"\r\n");
    To_Display += MI.Get(Stream_Audio, 0, __T("StreamCount"), Info_Text, Info_Name).c_str();

    To_Display += __T("\r\n\r\nClose\r\n");
    MI.Close();

    std::cout<<To_Display.To_Local().c_str()<<std::endl;

    return 0;
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:53,代码来源:HowToUse.cpp

示例2: main

int main (int argc, MediaInfoLib::Char *argv[])
{
    //Information about MediaInfo
    MediaInfo MI;
    String To_Display=MI.Option(_T("Info_Version"), _T("0.7.0.0;MediaInfoDLL_Example_MSVC;0.7.0.0")).c_str();

    To_Display += _T("\r\n\r\nInfo_Parameters\r\n");
    To_Display += MI.Option(_T("Info_Parameters")).c_str();

    To_Display += _T("\r\n\r\nInfo_Capacities\r\n");
    To_Display += MI.Option(_T("Info_Capacities")).c_str();

    To_Display += _T("\r\n\r\nInfo_Codecs\r\n");
    To_Display += MI.Option(_T("Info_Codecs")).c_str();

    //An example of how to use the library
    To_Display += _T("\r\n\r\nOpen\r\n");
    MI.Open(_T("Example.ogg"));

    To_Display += _T("\r\n\r\nInform with Complete=false\r\n");
    MI.Option(_T("Complete"));
    To_Display += MI.Inform().c_str();

    To_Display += _T("\r\n\r\nInform with Complete=true\r\n");
    MI.Option(_T("Complete"), _T("1"));
    To_Display += MI.Inform().c_str();

    To_Display += _T("\r\n\r\nCustom Inform\r\n");
    MI.Option(_T("Inform"), _T("General;Example : FileSize=%FileSize%"));
    To_Display += MI.Inform().c_str();

    To_Display += _T("\r\n\r\nGet with Stream=General and Parameter=\"FileSize\"\r\n");
    To_Display += MI.Get(Stream_General, 0, _T("FileSize"), Info_Text, Info_Name).c_str();

    To_Display += _T("\r\n\r\nGetI with Stream=General and Parameter=46\r\n");
    To_Display += MI.Get(Stream_General, 0, 46, Info_Text).c_str();

    To_Display += _T("\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n");
    #ifdef __MINGW32__
        Char* C1=new Char[33];
        _itot (MI.Count_Get(Stream_Audio), C1, 10);
        To_Display +=C1;
        delete[] C1;
    #else
        toStringStream SS;
        SS << std::setbase(10) << MI.Count_Get(Stream_Audio);
        To_Display += SS.str();
    #endif

    To_Display += _T("\r\n\r\nGet with Stream=General and Parameter=\"AudioCount\"\r\n");
    To_Display += MI.Get(Stream_General, 0, _T("AudioCount"), Info_Text, Info_Name).c_str();

    To_Display += _T("\r\n\r\nGet with Stream=Audio and Parameter=\"StreamCount\"\r\n");
    To_Display += MI.Get(Stream_Audio, 0, _T("StreamCount"), Info_Text, Info_Name).c_str();

    To_Display += _T("\r\n\r\nClose\r\n");
    MI.Close();

    #ifdef _UNICODE
        std::wcout << To_Display;
    #else
        std::cout  << To_Display;
    #endif

    return 1;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:66,代码来源:HowToUse_Dll.cpp

示例3: setupModel

void NBMediaInfoModel::setupModel() {

	MediaInfo MI;
	MI.Open( FromQString( mFileName ) );

	QStringList keys;
	for( int s = (int)Stream_General; s < (int)Stream_Max; s++ ) {
		size_t streamNumMax = MI.Count_Get( (stream_t)s );
		if ( not streamNumMax )
			continue;

		for( size_t j = 0; j < streamNumMax; j++ ) {
			QString streamKindName = FromZString( MI.Get( (stream_t)s, j, ZString( "StreamKind/String" ), Info_Text ) );
			if ( streamNumMax > 1 )
				streamKindName += QString( " %1" ).arg( j );

			size_t infoCount = MI.Count_Get( (stream_t)s, j );

			if ( not infoCount )
				continue;

			NBMediaInfoNode *streamNode = new NBMediaInfoNode( streamKindName, QString(), rootNode );

			keys.clear();
			for( size_t i = 0; i < infoCount; i++ ) {
				QString name = FromZString( MI.Get( (stream_t)s, j, i, Info_Name_Text ) );
				QString value = FromZString( MI.Get( (stream_t)s, j, i, Info_Text ) );

				if ( name.contains( "Count", Qt::CaseInsensitive ) )
					continue;

				else if ( name.contains( "name", Qt::CaseInsensitive ) and not name.contains( "track", Qt::CaseInsensitive ) )
					continue;

				else if ( name.startsWith( "Kind of", Qt::CaseInsensitive ) )
					continue;

				else if ( name == "File size" )
					continue;

				else if ( name.contains( "last modification", Qt::CaseInsensitive ) )
					continue;

				else if ( name.contains( "Extensions usually", Qt::CaseInsensitive ) )
					continue;

				if ( value.size() )
					 value += FromZString( MI.Get( (stream_t)s, 0, i, Info_Measure_Text ) );

				if ( not name.size() or not value.size() )
					continue;

				if ( not keys.contains( name ) ) {
					keys << name;
					streamNode->addChild( new NBMediaInfoNode( name, value, streamNode ) );
				}
			}

			rootNode->addChild( streamNode );
		}
	}

	mQuickInfo = FromZString( MI.Inform() );
};
开发者ID:marcusbritanicus,项目名称:NewBreeze,代码行数:64,代码来源:NBMediaInfo.cpp


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