本文整理汇总了C++中Mode函数的典型用法代码示例。如果您正苦于以下问题:C++ Mode函数的具体用法?C++ Mode怎么用?C++ Mode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Mode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Mode
void VideoDataSource::updateVideoModeList( void )
{
qboolean qwideScreen;
char resolution[64];
int i, width, height;
// lists must be clear before
modesList.clear();
// native desktop resolution
modesList.push_back( Mode( toString( -2 ), "desktop" ) );
for( i = 0; trap::VID_GetModeInfo( &width, &height, &qwideScreen, i ); i++ ) ;
for( i = 0; trap::VID_GetModeInfo( &width, &height, &qwideScreen, i ); i++ )
{
Q_snprintfz( resolution, sizeof( resolution ), "%s%i x %i", ( qwideScreen ? "W " : "" ), width, height );
// save resolution and index
Mode m( toString( i ), resolution );
modesList.push_back( m );
}
// custom resolution
modesList.push_back( Mode( toString( -1 ), "custom" ) );
// notify updates
int size = modesList.size();
for( int i = 0; i < size; i++ )
NotifyRowAdd( TABLE_NAME, i, 1 );
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:30,代码来源:ui_video_datasource.cpp
示例2: strlen
/*
* go to the next header
*/
bool FileIO::GotoHeader(char* header)
{
//check for errors
if ((this->mFileHandle == NULL) || (!header))
return false;
bool found = false;
long headerSize = strlen(header);
char* currentHeader = new char[headerSize];
for(;;)
{
//go to a byte
if (Mode() == RECORD_MODE)
{
//goto next unit
if (!GotoNext())
break; //if there is no further unit
}
//reset current header
memset(currentHeader, 0, headerSize);
//there is a byte, find the correct bytes (header)
for(;;)
{
//continue search if in BYTE_MODE and there is something to read
if ((Mode() == RECORD_MODE) ||
(EndOfFile()))
break;
//append one byte to the back of the current header
for (int c=0; c<headerSize - 1; c++)
currentHeader[c] = currentHeader[c+1];
currentHeader[headerSize - 1] = PopByte();
//continue search if the current header is not full or
// it's full but doesn't match the right header
if (!currentHeader[0] || memcmp(currentHeader, header, headerSize))
continue;
else
{
found = true;
break;
}
}
//called break above -> check if found or finished by EOF
if (found || EndOfFile())
break;
}
//clean up memory
if (currentHeader)
delete currentHeader;
//found header?
return found;
}
开发者ID:BackupTheBerlios,项目名称:stunts2005,代码行数:62,代码来源:FileIO.cpp
示例3: GlobalSceneGraph
/* greebo: This calculates and constructs the pivot point of the selection.
* It cycles through all selected objects and creates its AABB. The origin point of the AABB
* is basically the pivot point. Pivot2World is therefore a translation from (0,0,0) to the calculated origin.
*
* The pivot point is also snapped to the grid.
*/
void RadiantSelectionSystem::ConstructPivot() const {
if (!_pivotChanged || _pivotMoving)
return;
_pivotChanged = false;
Vector3 objectPivot;
if (!nothingSelected()) {
{
// Create a local variable where the aabb information is stored
AABB bounds;
// Traverse through the selection and update the <bounds> variable
if (Mode() == eComponent) {
GlobalSceneGraph().traverse(BoundsSelectedComponent(bounds));
}
else {
GlobalSceneGraph().traverse(BoundsSelected(bounds));
}
// the <bounds> variable now contains the AABB of the selection, retrieve the origin
objectPivot = bounds.origin;
}
// Snap the pivot point to the grid
vector3_snap(objectPivot, GlobalGrid().getGridSize());
// The pivot2world matrix is just a translation from the world origin (0,0,0) to the object pivot
_pivot2world = Matrix4::getTranslation(objectPivot);
// Only rotation and scaling need further calculations
switch (_manipulatorMode) {
case eTranslate:
break;
case eRotate:
if (Mode() == eComponent) {
matrix4_assign_rotation_for_pivot(_pivot2world, _componentSelection.back());
}
else {
matrix4_assign_rotation_for_pivot(_pivot2world, _selection.back());
}
break;
case eScale:
if (Mode() == eComponent) {
matrix4_assign_rotation_for_pivot(_pivot2world, _componentSelection.back());
}
else {
matrix4_assign_rotation_for_pivot(_pivot2world, _selection.back());
}
break;
default:
break;
} // switch
}
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:61,代码来源:RadiantSelectionSystem.cpp
示例4: Mode
const Mode Modes::getDefault(const QString &remote) const
{
// if(theDefaults[remote] == QString())
// return Mode(remote, "");
if(contains(remote))
if(operator[](remote).contains(theDefaults[remote]))
return operator[](remote)[theDefaults[remote]];
else return Mode(remote, "");
else return Mode(remote, "");
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:11,代码来源:modes.cpp
示例5: Mode
// returns all modes
QList<Mode> ModeManager::modes()
{
QList<Mode> modesList;
modesList << Mode(ID_WELCOME, tr("Welcome"));
modesList << Mode(ID_KMAP, tr("Karnaugh Map"));
#if CUBE3D
modesList << Mode(ID_CUBE, tr("Boolean n-Cube"));
#endif
modesList << Mode(ID_QM_WEBKIT, tr("QM Webkit"));
// modesList << Mode(ID_QM, tr("Quine-McCluskey"));
return modesList;
}
开发者ID:Abby3017,项目名称:bmin,代码行数:13,代码来源:modemanager.cpp
示例6: D_OPERATION
void
CTool::SetValue(
int32 value)
{
D_OPERATION(("CTool::SetValue(%ld)\n", value));
if (value != m_value)
{
if (Mode() == TRIGGER_MODE)
{
// trigger tools don't change their value
return;
}
if ((Mode() == RADIO_MODE) && (Flags() & FORCE_SELECTION)
&& (Value() == B_CONTROL_ON))
{
// radio mode with the force-selection flag set does not
// allow 'turning off' the tool directly
return;
}
m_value = value;
if ((Mode() == RADIO_MODE) && (Value() == B_CONTROL_ON))
{
// turn off other tools in radio group
CTool *tool;
tool = PreviousTool();
while (tool)
{
if (tool->m_value == B_CONTROL_ON)
{
tool->m_value = B_CONTROL_OFF;
tool->ValueChanged();
}
tool = tool->PreviousTool();
}
tool = NextTool();
while (tool)
{
if (tool->m_value == B_CONTROL_ON)
{
tool->m_value = B_CONTROL_OFF;
tool->ValueChanged();
}
tool = tool->NextTool();
}
}
ValueChanged();
}
}
开发者ID:HaikuArchives,项目名称:MeV,代码行数:52,代码来源:Tool.cpp
示例7: switch
int * Plan_File::Path (int *num_path)
{
int offset = 0;
*num_path = 0;
//---- mode specific adjustments ----
switch (Mode ()) {
case AUTO_MODE: //---- auto ----
if (Driver_Flag ()) { //---- driver ----
offset = 2;
//*num_path = Tokens () - offset - plan->data [1];
*num_path = Tokens () - offset;
}
break;
case TRANSIT_MODE: //---- transit ----
if (Driver_Flag ()) { //---- driver ----
offset = 3;
*num_path = Tokens () - offset - 2 * plan->data [0];
}
break;
case BIKE_MODE: //---- bike ----
case WALK_MODE: //---- walk ----
*num_path = Tokens ();
break;
default: //---- other ----
offset = 1;
*num_path = Tokens () - offset;
break;
}
return (plan->data + offset);
}
开发者ID:kravitz,项目名称:transims4,代码行数:32,代码来源:Plan_File.cpp
示例8: Trip_File
File_Group::File_Group (void)
{
Trip_File (NULL);
Time_File (NULL);
Trip_Factor (NULL);
Script_File (NULL);
Purpose (0);
Mode (0);
Method (0);
Duration (0);
Type (0);
SubType (0);
Org_Wt (0);
Des_Wt (0);
Dist_Wt (true);
Speed (0);
Time_Field (0);
Scaling_Factor (1.0);
period = NULL;
time_equiv = NULL;
program = NULL;
header = NULL;
}
开发者ID:kravitz,项目名称:transims4,代码行数:25,代码来源:File_Group.cpp
示例9: gsl_vector_complex_free
void MAIAllocator::Finish() {
gsl_vector_complex_free(Hchan);
gsl_matrix_complex_free(Hmat);
gsl_matrix_complex_free(huu);
gsl_matrix_uint_free(Hperm);
gsl_permutation_free(p);
gsl_vector_free(huserabs);
gsl_vector_uint_free(nextcarr);
gsl_vector_uint_free( usedcarr);
gsl_vector_uint_free( errs );
gsl_matrix_free(habs);
gsl_matrix_uint_free(signature_frequencies);
gsl_matrix_uint_free(signature_frequencies_init);
gsl_matrix_free(signature_powers);
gsl_rng_free(ran);
gsl_matrix_complex_free(transform_mat);
switch (Mode()) {
case 4:
// destroy the Kernel
pKernel->Shutdown() ;
delete pKernel;
break;
}
}
开发者ID:rongals,项目名称:CRAI,代码行数:33,代码来源:maiallocator.cpp
示例10: DIA_getLameSettings
int DIA_getLameSettings(ADM_audioEncoderDescriptor *descriptor)
{
int ret=0;
char string[400];
uint32_t mmode,ppreset;
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry )
#define PX(x) &(lameParam->x)
LAME_encoderParam *lameParam;
ADM_assert(sizeof(LAME_encoderParam)==descriptor->paramSize);
lameParam=(LAME_encoderParam*)descriptor->param;
mmode=lameParam->mode;
ppreset=lameParam->preset;
diaMenuEntry channelMode[]={
{ADM_STEREO, QT_TR_NOOP("Stereo"),NULL},
{ADM_JSTEREO, QT_TR_NOOP("Joint stereo"),NULL},
{ADM_MONO, QT_TR_NOOP("Mono"),NULL}};
diaElemMenu menuMode(&mmode, QT_TR_NOOP("C_hannel mode:"), SZT(channelMode),channelMode);
diaMenuEntry encodingMode[]={
{ADM_LAME_PRESET_CBR, QT_TR_NOOP("CBR"),NULL},
{ADM_LAME_PRESET_ABR, QT_TR_NOOP("ABR"),NULL},
#if 0
{ADM_LAME_PRESET_EXTREME, QT_TR_NOOP("Extreme"),NULL}
#endif
};
diaElemMenu Mode(&ppreset, QT_TR_NOOP("Bit_rate mode:"), SZT(encodingMode),encodingMode);
#define BITRATE(x) {x,QT_TR_NOOP(#x)}
diaMenuEntry bitrateM[]={
BITRATE(56),
BITRATE(64),
BITRATE(80),
BITRATE(96),
BITRATE(112),
BITRATE(128),
BITRATE(160),
BITRATE(192),
BITRATE(224)
};
diaElemMenu bitrate(&(descriptor->bitrate), QT_TR_NOOP("_Bitrate:"), SZT(bitrateM),bitrateM);
diaElemUInteger quality(PX(quality),QT_TR_NOOP("_Quality:"),0,9);
diaElemToggle reservoir(PX(disableReservoir),QT_TR_NOOP("_Disable reservoir:"));
diaElem *elems[]={&menuMode,&Mode,&quality,&bitrate,&reservoir};
if( diaFactoryRun(QT_TR_NOOP("LAME Configuration"),5,elems))
{
lameParam->mode=(ADM_mode)mmode;
lameParam->preset=(ADM_LAME_PRESET)ppreset;
return 1;
}
return 0;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:60,代码来源:audioencoder_lame.cpp
示例11: if
void Modes::generateNulls(const QStringList &theRemotes)
{
for(QStringList::const_iterator i = theRemotes.begin(); i != theRemotes.end(); ++i)
{ if(!contains(*i) || !operator[](*i).contains("")) operator[](*i)[""] = Mode(*i, "");
if(!theDefaults.contains(*i)) theDefaults[*i].isEmpty();
}
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:7,代码来源:modes.cpp
示例12: Node_traverseSubgraph
void RadiantSelectionSystem::cancelMove() {
// Unselect any currently selected manipulators to be sure
_manipulator->setSelected(false);
// Tell all the scene objects to revert their transformations
RevertTransformForSelected walker;
Node_traverseSubgraph(GlobalSceneGraph().root(), walker);
_pivotMoving = false;
pivotChanged();
// greebo: Deselect all faces if we are in brush and drag mode
if (Mode() == ePrimitive && ManipulatorMode() == eDrag)
{
SelectAllComponentWalker faceSelector(false, SelectionSystem::eFace);
Node_traverseSubgraph(GlobalSceneGraph().root(), faceSelector);
}
if (_undoBegun) {
// Cancel the undo operation, if one has been begun
GlobalUndoSystem().cancel();
_undoBegun = false;
}
// Update the views
SceneChangeNotify();
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:28,代码来源:RadiantSelectionSystem.cpp
示例13: setSpan
void SweepSettings::setSpan(Frequency f)
{
if(f < device_traits::min_span()) {
f = device_traits::min_span();
}
if(Mode() == MODE_REAL_TIME) {
bb_lib::clamp(f, Frequency(device_traits::min_real_time_span()),
Frequency(device_traits::max_real_time_span()));
}
// Fit new span to device freq range
if((center - f / 2.0) < device_traits::min_frequency()) {
start = device_traits::min_frequency();
stop = bb_lib::min2((start + f).Val(), device_traits::max_frequency());
} else if((center + f / 2.0) > device_traits::max_frequency()) {
stop = device_traits::max_frequency();
start = bb_lib::max2((stop - f).Val(), device_traits::min_frequency());
} else {
start = center - f / 2.0;
stop = center + f / 2.0;
}
center = (start + stop) / 2.0;
span = stop - start;
AutoBandwidthAdjust(false);
UpdateProgram();
}
开发者ID:hendorog,项目名称:BBApp,代码行数:29,代码来源:sweep_settings.cpp
示例14: Load
// Preset Load
bool SweepSettings::Load(QSettings &s)
{
mode = (OperationalMode)(s.value("Mode", (int)Mode()).toInt());
start = s.value("Sweep/Start", Start().Val()).toDouble();
stop = s.value("Sweep/Stop", Stop().Val()).toDouble();
center = s.value("Sweep/Center", Center().Val()).toDouble();
span = s.value("Sweep/Span", Span().Val()).toDouble();
step = s.value("Sweep/Step", Step().Val()).toDouble();
rbw = s.value("Sweep/RBW", RBW().Val()).toDouble();
vbw = s.value("Sweep/VBW", VBW().Val()).toDouble();
auto_rbw = s.value("Sweep/AutoRBW", AutoRBW()).toBool();
auto_vbw = s.value("Sweep/AutoVBW", AutoVBW()).toBool();
native_rbw = s.value("Sweep/NativeRBW", NativeRBW()).toBool();
refLevel.Load(s, "Sweep/RefLevel");
div = s.value("Sweep/Division", Div()).toDouble();
attenuation = s.value("Sweep/Attenuation", Atten()).toInt();
gain = s.value("Sweep/Gain", Gain()).toInt();
preamp = s.value("Sweep/Preamp", Preamp()).toInt();
sweepTime = s.value("Sweep/SweepTime", SweepTime().Val()).toDouble();
processingUnits = s.value("Sweep/ProcessingUnits", ProcessingUnits()).toInt();
detector = s.value("Sweep/Detector", Detector()).toInt();
rejection = s.value("Sweep/Rejection", Rejection()).toBool();
tgSweepSize = s.value("Sweep/TgSweepSize", tgSweepSize).toInt();
tgHighRangeSweep = s.value("Sweep/TgHighRangeSweep", tgHighRangeSweep).toBool();
tgPassiveDevice = s.value("Sweep/TgPassiveDevice", tgPassiveDevice).toBool();
UpdateProgram();
return true;
}
开发者ID:hendorog,项目名称:BBApp,代码行数:35,代码来源:sweep_settings.cpp
示例15: AutoBandwidthAdjust
void SweepSettings::AutoBandwidthAdjust(bool force)
{
if(Mode() == BB_REAL_TIME) {
native_rbw = device_traits::has_native_bandwidths();
}
if(auto_rbw || force) {
rbw = device_traits::get_best_rbw(this);
} else {
rbw = device_traits::adjust_rbw_on_span(this);
}
if(auto_vbw || vbw > rbw || mode == BB_REAL_TIME) {
vbw = rbw;
}
vbw = device_traits::adjust_vbw(this);
// VBW should not be over 1000 times less than RBW
if(rbw > vbw * 1000.0) {
vbw = rbw / 1000.0;
}
if(mode == BB_REAL_TIME) {
double clamped = rbw;
bb_lib::clamp(clamped, device_traits::min_real_time_rbw(),
device_traits::max_real_time_rbw());
rbw = clamped;
vbw = rbw;
}
}
开发者ID:hendorog,项目名称:BBApp,代码行数:30,代码来源:sweep_settings.cpp
示例16: main
void main(void)
{
DisableInterrupts;
PLL_Init_64M();
UART_Init();
Init_Port();
Init_AD();
Init_PWM();
// LCD_init();
// LCD_clear();
// RST = 1;
PAT_Init();
// PWMDTY23 =6300 ;
// DDRA_DDRA7 = 1;
EnableInterrupts;
for(;;)
{
Mode();
// uart_putchar('a');
/* OutData[0] = (int16)(roadflag[2]);
OutData[1] = (int16)(roadflag[3]);
OutData[2] = (int16)(Steer);
OutData[3] = (int16)(roadflag[1]);
OutPut_Data(); */
// Ramp_Detection();
GetExpectSpeed();
Steer_PID();
stop_car();
//Motor(1800);
}
}
开发者ID:thddaniel,项目名称:Electromagnetic-Smart-Car,代码行数:33,代码来源:main.c
示例17: freezeTransforms
// End the move, this freezes the current transforms
void RadiantSelectionSystem::endMove() {
freezeTransforms();
// greebo: Deselect all faces if we are in brush and drag mode
if ((Mode() == ePrimitive || Mode() == eGroupPart) &&
ManipulatorMode() == eDrag)
{
SelectAllComponentWalker faceSelector(false, SelectionSystem::eFace);
Node_traverseSubgraph(GlobalSceneGraph().root(), faceSelector);
}
// Remove all degenerated brushes from the scene graph (should emit a warning)
foreachSelected(RemoveDegenerateBrushWalker());
_pivotMoving = false;
pivotChanged();
// Update the views
SceneChangeNotify();
// If we started an undoable operation, end it now and tell the console what happened
if (_undoBegun)
{
std::ostringstream command;
if (ManipulatorMode() == eTranslate) {
command << "translateTool";
outputTranslation(command);
}
else if (ManipulatorMode() == eRotate) {
command << "rotateTool";
outputRotation(command);
}
else if (ManipulatorMode() == eScale) {
command << "scaleTool";
outputScale(command);
}
else if (ManipulatorMode() == eDrag) {
command << "dragTool";
}
_undoBegun = false;
// Finish the undo move
GlobalUndoSystem().finish(command.str());
}
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:48,代码来源:RadiantSelectionSystem.cpp
示例18: configure
bool configure (CONFcouple **setup)
{
int ret = 0;
char string[400];
uint32_t mmode, ppreset;
#define SZT(x) sizeof(x)/sizeof(diaMenuEntry )
#define PX(x) &(config.x)
lame_encoder config=defaultConfig;
if(*setup)
{
ADM_paramLoad(*setup,lame_encoder_param,&config);
}
ppreset = config.preset;
diaMenuEntry encodingMode[] = {
{ADM_LAME_PRESET_CBR, QT_TRANSLATE_NOOP("lame","CBR"), NULL},
{ADM_LAME_PRESET_ABR, QT_TRANSLATE_NOOP("lame","ABR"), NULL},
};
diaElemMenu Mode (&ppreset, QT_TRANSLATE_NOOP("lame","Bit_rate mode:"), SZT (encodingMode), encodingMode);
#define BITRATE(x) {x,QT_TRANSLATE_NOOP("lame",#x)}
diaMenuEntry bitrateM[] = {
BITRATE (56),//56
BITRATE (64),
BITRATE (80),
BITRATE (96),
BITRATE (112),
BITRATE (128),
BITRATE (160),
BITRATE (192),
BITRATE (224),
BITRATE (256),
BITRATE (320)
};
//***
diaElemMenu bitrate (&(config.bitrate), QT_TRANSLATE_NOOP("lame","_Bitrate:"), SZT (bitrateM),
bitrateM);
diaElemUInteger quality (PX (quality), QT_TRANSLATE_NOOP("lame","_Quality:"), 0, 9);
bool reservoir32=config.disableBitReservoir;
diaElemToggle reservoir (&reservoir32,
QT_TRANSLATE_NOOP("lame","_Disable reservoir:"));
diaElem *elems[] = { &Mode, &bitrate,&quality, &reservoir };
if (diaFactoryRun (QT_TRANSLATE_NOOP("lame","LAME Configuration"), 4, elems))
{
config.preset=(ADM_LAME_PRESET)ppreset;
config.disableBitReservoir=reservoir32;
if(*setup) delete *setup;
*setup=NULL;
ADM_paramSave(setup,lame_encoder_param,&config);
defaultConfig=config;
return 1;
}
return 0;
}
开发者ID:AlexanderStohr,项目名称:avidemux2,代码行数:59,代码来源:audioencoder_lame.cpp
示例19: glfwGetMonitorName
Monitor::Monitor(GLFWmonitor *monitor) {
if(0 != monitor) {
const char *nm = glfwGetMonitorName(monitor);
name = nm;
int width;
int height;
glfwGetMonitorPhysicalSize(monitor, &width, &height);
size = glm::vec2(width, height);
current = Mode(glfwGetVideoMode(monitor));
int modeCount;
const GLFWvidmode *vidmods = glfwGetVideoModes(monitor, &modeCount);
for(int i = 0; i < modeCount; ++i) {
modes.push_back(Mode(vidmods + i));
}
}
descriptor = monitor;
}
开发者ID:SomeRandomGameDev,项目名称:DumbFramework,代码行数:17,代码来源:adviser.cpp
示例20: deselectAll
// Hub function for "deselect all", this passes the deselect call to the according functions
void RadiantSelectionSystem::deselectAll() {
if (Mode() == eComponent) {
setSelectedAllComponents(false);
}
else {
setSelectedAll(false);
}
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:9,代码来源:RadiantSelectionSystem.cpp
注:本文中的Mode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论