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


C++ setInt函数代码示例

本文整理汇总了C++中setInt函数的典型用法代码示例。如果您正苦于以下问题:C++ setInt函数的具体用法?C++ setInt怎么用?C++ setInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: read_track_info_internal

jobjectArray read_track_info_internal(JNIEnv *env, jobject thiz, libvlc_media_t* p_m)
{
    /* get java class */
    jclass cls = (*env)->FindClass( env, "org/videolan/libvlc/TrackInfo" );
    if ( !cls )
    {
        LOGE("Failed to load class (org/videolan/libvlc/TrackInfo)" );
        return NULL;
    }

    /* get java class contructor */
    jmethodID clsCtor = (*env)->GetMethodID( env, cls, "<init>", "()V" );
    if ( !clsCtor )
    {
        LOGE("Failed to find class constructor (org/videolan/libvlc/TrackInfo)" );
        return NULL;
    }

    /* Get the tracks information of the media. */
    libvlc_media_track_t **p_tracks;

    int i_nbTracks = libvlc_media_tracks_get(p_m, &p_tracks);
    jobjectArray array = (*env)->NewObjectArray(env, i_nbTracks + 1, cls, NULL);

    unsigned i;
    if (array != NULL)
    {
        for (i = 0; i <= i_nbTracks; ++i)
        {
            jobject item = (*env)->NewObject(env, cls, clsCtor);
            if (item == NULL)
                continue;
            (*env)->SetObjectArrayElement(env, array, i, item);

            // use last track for metadata
            if (i == i_nbTracks)
            {
                setInt(env, item, "Type", 3 /* TYPE_META */);
                setLong(env, item, "Length", libvlc_media_get_duration(p_m));
                setString(env, item, "Title", libvlc_media_get_meta(p_m, libvlc_meta_Title));
                setString(env, item, "Artist", libvlc_media_get_meta(p_m, libvlc_meta_Artist));
                setString(env, item, "Album", libvlc_media_get_meta(p_m, libvlc_meta_Album));
                setString(env, item, "Genre", libvlc_media_get_meta(p_m, libvlc_meta_Genre));
                setString(env, item, "ArtworkURL", libvlc_media_get_meta(p_m, libvlc_meta_ArtworkURL));
                setString(env, item, "NowPlaying", libvlc_media_get_meta(p_m, libvlc_meta_NowPlaying));
                setString(env, item, "TrackNumber", libvlc_media_get_meta(p_m, libvlc_meta_TrackNumber));
                continue;
            }

            setInt(env, item, "Id", p_tracks[i]->i_id);
            setInt(env, item, "Type", p_tracks[i]->i_type);
            setString(env, item, "Codec", (const char*)vlc_fourcc_GetDescription(0,p_tracks[i]->i_codec));
            setString(env, item, "Language", p_tracks[i]->psz_language);
            setInt(env, item, "Bitrate", p_tracks[i]->i_bitrate);

            if (p_tracks[i]->i_type == libvlc_track_video)
            {
                setInt(env, item, "Height", p_tracks[i]->video->i_height);
                setInt(env, item, "Width", p_tracks[i]->video->i_width);
                setFloat(env, item, "Framerate", (float)p_tracks[i]->video->i_frame_rate_num / p_tracks[i]->video->i_frame_rate_den);
            }
            if (p_tracks[i]->i_type == libvlc_track_audio)
            {
                setInt(env, item, "Channels", p_tracks[i]->audio->i_channels);
                setInt(env, item, "Samplerate", p_tracks[i]->audio->i_rate);
            }
        }
    }

    libvlc_media_tracks_release(p_tracks, i_nbTracks);
    return array;
}
开发者ID:wuwenvogue,项目名称:vlc-android-1,代码行数:72,代码来源:libvlcjni-track.c

示例2: setInt

 bool ShadowCalculation_Impl::setMaximumFiguresInShadowOverlapCalculations(int maximumFiguresInShadowOverlapCalculations) {
   bool result = setInt(OS_ShadowCalculationFields::MaximumFiguresinShadowOverlapCalculations, maximumFiguresInShadowOverlapCalculations);
   return result;
 }
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:4,代码来源:ShadowCalculation.cpp

示例3: setInt

 void RunPeriod_Impl::setEndMonth(int month)
 {
   setInt(OS_RunPeriodFields::EndMonth,month);
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:4,代码来源:RunPeriod.cpp

示例4: setInt

void ValueParameterDescriptor::useHostOverlayHandle(bool v) {
  setInt(kOfxParamPropUseHostOverlayHandle, 0, (v ? 1 : 0));
}
开发者ID:gatgui,项目名称:ofxpp,代码行数:3,代码来源:parameter.cpp

示例5: saveRegisters

/*
 * Save the values of the virtual registers to the
 * current thread structure.
 */
void saveRegisters() {
    setInt(frame, FRAME_PC, pc);
    int sp = (char*) stack - (char*) frame;
    setInt(frame, FRAME_SP, sp);
}
开发者ID:ahua,项目名称:java,代码行数:9,代码来源:interpreter.c

示例6: UNREFERENCED_PARAMETER

void Reader::IoSmartCardGetAttribute(IWDFIoRequest* pRequest,SIZE_T inBufSize,SIZE_T outBufSize) {
	UNREFERENCED_PARAMETER(inBufSize);

	wchar_t log[300]=L"";
	char temp[300];

	DWORD code=getInt(pRequest);
	swprintf(log,L"[BixVReader][GATT]  - code %0X",code);
	OutputDebugString(log);

	switch(code) {
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA009):
			// custom attribute; RPC_TYPE
			OutputDebugString(L"[BixVReader][GATT]RPC_TYPE");
			setInt(device,pRequest,rpcType);
			return;
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA00a):
			// custom attribute; PipeName
			if (rpcType==0) {
				PipeReader *pipe=(PipeReader *)this;
				OutputDebugString(L"[BixVReader][GATT]PIPE_NAME");
				sprintf(temp,"%S",pipe->pipeName);
				setString(device,pRequest,(char*)temp,(int)outBufSize);
			}
			else {
				SectionLocker lock(device->m_RequestLock);
				pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
			}
			return;
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA00b):
			// custom attribute; EventPipeName
			if (rpcType==0) {
				PipeReader *pipe=(PipeReader *)this;
				OutputDebugString(L"[BixVReader][GATT]EVENT_PIPE_NAME");
				sprintf(temp,"%S",pipe->pipeEventName);
				setString(device,pRequest,(char*)temp,(int)outBufSize);
			}
			else {
				SectionLocker lock(device->m_RequestLock);
				pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
			}
			return;
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA00c):
			// custom attribute; TCP port
			if (rpcType==1) {
				TcpIpReader *tcpIp=(TcpIpReader *)this;
				OutputDebugString(L"[BixVReader][GATT]PORT");
				setInt(device,pRequest,tcpIp->port);
			}
			else {
				SectionLocker lock(device->m_RequestLock);
				pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
			}
			return;
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA00d):
			// custom attribute; TCP event port
			if (rpcType==1) {
				TcpIpReader *tcpIp=(TcpIpReader *)this;
				OutputDebugString(L"[BixVReader][GATT]EVENT_PORT");
				setInt(device,pRequest,tcpIp->eventPort);
			}
			else {
				SectionLocker lock(device->m_RequestLock);
				pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
			}
			return;
		case SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA00e):
			// custom attribute; TCP base port
			if (rpcType==1) {
				TcpIpReader *tcpIp=(TcpIpReader *)this;
				OutputDebugString(L"[BixVReader][GATT]BASE_PORT");
				setInt(device,pRequest,tcpIp->portBase);
				tcpIp;
			}
			else {
				SectionLocker lock(device->m_RequestLock);
				pRequest->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), 0);
			}
			return;
		case SCARD_ATTR_CHARACTERISTICS:
			// 0x00000000 No special characteristics
			OutputDebugString(L"[BixVReader][GATT]SCARD_ATTR_CHARACTERISTICS");
			setInt(device,pRequest,0);
			return;
		case SCARD_ATTR_VENDOR_NAME:
			OutputDebugString(L"[BixVReader][GATT]SCARD_ATTR_VENDOR_NAME");
			setString(device,pRequest,vendorName,(int)outBufSize);
			return;
		case SCARD_ATTR_VENDOR_IFD_TYPE:
			OutputDebugString(L"[BixVReader][GATT]SCARD_ATTR_VENDOR_IFD_TYPE");
			setString(device,pRequest,vendorIfdType,(int)outBufSize);
			return;
		case SCARD_ATTR_DEVICE_UNIT:
			OutputDebugString(L"[BixVReader][GATT]SCARD_ATTR_DEVICE_UNIT");
			setInt(device,pRequest,deviceUnit);
			return;
		case SCARD_ATTR_ATR_STRING:
			OutputDebugString(L"[BixVReader][GATT]SCARD_ATTR_ATR_STRING");
			BYTE ATR[100];
			DWORD ATRsize;
//.........这里部分代码省略.........
开发者ID:frankmorgner,项目名称:vsmartcard,代码行数:101,代码来源:Reader.cpp

示例7: setInt

BOOL RegistryInt::store()
    {
     return setInt(id, value, root);
    }
开发者ID:AnkurSheel,项目名称:Engine,代码行数:4,代码来源:RegVars.cpp

示例8: setInt

 bool Timestep_Impl::setNumberOfTimestepsPerHour(int numberOfTimestepsPerHour) {
   bool result = setInt(OS_TimestepFields::NumberofTimestepsperHour, numberOfTimestepsPerHour);
   return result;
 }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:4,代码来源:Timestep.cpp

示例9: setInt

 void RunPeriod_Impl::setNumTimePeriodRepeats(int numRepeats)
 {
   setInt(OS_RunPeriodFields::NumberofTimesRunperiodtobeRepeated,numRepeats);
 }
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:4,代码来源:RunPeriod.cpp

示例10: setInt

 bool ScheduleVariableInterval_Impl::setStartDay(int startDay, bool driverMethod) {
   bool result = setInt(OS_Schedule_VariableIntervalFields::StartDay, startDay, driverMethod);
   return result;
 }
开发者ID:urbanengr,项目名称:OpenStudio,代码行数:4,代码来源:ScheduleVariableInterval.cpp

示例11: setInt

void PvObject::setInt(int value)
{
    std::string key = PyPvDataUtility::getValueOrSingleFieldName(pvStructurePtr);
    setInt(key, value);
}
开发者ID:dchabot,项目名称:pvaPy,代码行数:5,代码来源:PvObject.cpp

示例12: setInt

void Sound::setOffsetBytes(int offset)
{
  setInt(offset, AL_BYTE_OFFSET);
}
开发者ID:sumanvyj,项目名称:phosbot,代码行数:4,代码来源:Sound.cpp

示例13: setInt

bool RegistrySettingsManager::setBoolean(const TCHAR *name, bool value)
{
  return setInt(name, value ? 1 : 0);
}
开发者ID:sim0629,项目名称:tightvnc,代码行数:4,代码来源:RegistrySettingsManager.cpp

示例14: ValueFromString

void DIALOG_PLOT::applyPlotSettings()
{
    REPORTER&   reporter = m_messagesPanel->Reporter();

    PCB_PLOT_PARAMS tempOptions;

    tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
    tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
    tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
    tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() );
    tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
    tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
    tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
    tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
    tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
    tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>
                                   ( m_drillShapeOpt->GetSelection() ) );
    tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
    tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
    tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );

    // Update settings from text fields. Rewrite values back to the fields,
    // since the values may have been constrained by the setters.

    // read HPLG pen size (this param is stored in mils)
    wxString    msg = m_HPGLPenSizeOpt->GetValue();
    int         tmp = ValueFromString( g_UserUnit, msg ) / IU_PER_MILS;

    if( !tempOptions.SetHPGLPenDiameter( tmp ) )
    {
        msg = StringFromValue( g_UserUnit, tempOptions.GetHPGLPenDiameter() * IU_PER_MILS );
        m_HPGLPenSizeOpt->SetValue( msg );
        msg.Printf( _( "HPGL pen size constrained." ) );
        reporter.Report( msg, REPORTER::RPT_INFO );
    }

    // Read HPGL pen overlay (this param is stored in mils)
    msg = m_HPGLPenOverlayOpt->GetValue();
    tmp = ValueFromString( g_UserUnit, msg ) / IU_PER_MILS;

    if( !tempOptions.SetHPGLPenOverlay( tmp ) )
    {
        msg = StringFromValue( g_UserUnit,
                                     tempOptions.GetHPGLPenOverlay() * IU_PER_MILS );
        m_HPGLPenOverlayOpt->SetValue( msg );
        msg.Printf( _( "HPGL pen overlay constrained." ) );
        reporter.Report( msg, REPORTER::RPT_INFO );
    }

    // Default linewidth
    msg = m_linesWidth->GetValue();
    tmp = ValueFromString( g_UserUnit, msg );

    if( !tempOptions.SetLineWidth( tmp ) )
    {
        msg = StringFromValue( g_UserUnit, tempOptions.GetLineWidth() );
        m_linesWidth->SetValue( msg );
        msg.Printf( _( "Default line width constrained." ) );
        reporter.Report( msg, REPORTER::RPT_INFO );
    }

    // X scale
    double tmpDouble;
    msg = m_fineAdjustXscaleOpt->GetValue();
    msg.ToDouble( &tmpDouble );

    if( !setDouble( &m_XScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
    {
        msg.Printf( wxT( "%f" ), m_XScaleAdjust );
        m_fineAdjustXscaleOpt->SetValue( msg );
        msg.Printf( _( "X scale constrained." ) );
        reporter.Report( msg, REPORTER::RPT_INFO );
    }

    ConfigBaseWriteDouble( m_config, OPTKEY_PLOT_X_FINESCALE_ADJ, m_XScaleAdjust );

    // Y scale
    msg = m_fineAdjustYscaleOpt->GetValue();
    msg.ToDouble( &tmpDouble );

    if( !setDouble( &m_YScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
    {
        msg.Printf( wxT( "%f" ), m_YScaleAdjust );
        m_fineAdjustYscaleOpt->SetValue( msg );
        msg.Printf( _( "Y scale constrained." ) );
        reporter.Report( msg, REPORTER::RPT_INFO );
    }

    ConfigBaseWriteDouble( m_config, OPTKEY_PLOT_Y_FINESCALE_ADJ, m_YScaleAdjust );

    // PS Width correction
    msg = m_PSFineAdjustWidthOpt->GetValue();
    int itmp = ValueFromString( g_UserUnit, msg );

    if( !setInt( &m_PSWidthAdjust, itmp, m_widthAdjustMinValue, m_widthAdjustMaxValue ) )
    {
        msg = StringFromValue( g_UserUnit, m_PSWidthAdjust );
        m_PSFineAdjustWidthOpt->SetValue( msg );
        msg.Printf( _( "Width correction constrained. "
                       "The reasonable width correction value must be in a range of "
//.........这里部分代码省略.........
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:101,代码来源:dialog_plot.cpp

示例15: setInt

void IntParameterDescriptor::displayMax(int v) {
  setInt(kOfxParamPropDisplayMax, 0, v);
}
开发者ID:gatgui,项目名称:ofxpp,代码行数:3,代码来源:intparameter.cpp


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