本文整理汇总了C++中set_position函数的典型用法代码示例。如果您正苦于以下问题:C++ set_position函数的具体用法?C++ set_position怎么用?C++ set_position使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_position函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: position_changed
static gboolean position_changed(DBusConnection *connection, DBusMessage *msg,
void *user_data)
{
struct media_player *mp = user_data;
DBusMessageIter iter;
DBG("sender=%s path=%s", mp->sender, mp->path);
dbus_message_iter_init(msg, &iter);
set_position(mp, &iter);
return TRUE;
}
示例2: xmp_next_position
int xmp_next_position(xmp_context opaque)
{
struct context_data *ctx = (struct context_data *)opaque;
struct player_data *p = &ctx->p;
struct module_data *m = &ctx->m;
if (ctx->state < XMP_STATE_PLAYING)
return -XMP_ERROR_STATE;
if (p->pos < m->mod.len)
set_position(ctx, p->pos + 1, 1);
return p->pos;
}
示例3: tta_seek_sample
static int
tta_seek_sample (DB_fileinfo_t *_info, int sample) {
tta_info_t *info = (tta_info_t *)_info;
info->samples_to_skip = set_position (&info->tta, sample + info->startsample);
if (info->samples_to_skip < 0) {
fprintf (stderr, "tta: seek failed\n");
return -1;
}
info->currentsample = sample + info->startsample;
info->remaining = 0;
_info->readpos = sample / _info->fmt.samplerate;
return 0;
}
示例4: font_id
/**
* @brief Creates a text to display with the specified alignment properties.
* @param x x position of the text on the destination surface
* @param y y position of the text on the destination surface
* @param horizontal_alignment horizontal alignment of the text: ALIGN_LEFT,
* ALIGN_CENTER or ALIGN_RIGHT
* @param vertical_alignment vertical alignment of the text: ALIGN_TOP,
* ALIGN_MIDDLE or ALIGN_BOTTOM
*/
TextSurface::TextSurface(int x, int y,
TextSurface::HorizontalAlignment horizontal_alignment,
TextSurface::VerticalAlignment vertical_alignment):
font_id(default_font_id),
horizontal_alignment(horizontal_alignment),
vertical_alignment(vertical_alignment),
rendering_mode(TEXT_SOLID),
surface(NULL) {
text = "";
set_text_color(Color::get_white());
set_background_color(Color::get_black());
set_position(x, y);
}
示例5: set_position
int YARPMEIDeviceDriver::definePosition (void *cmd)
{
long rc = 0;
SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
double *pos = (double *)(tmp->parameters);
rc = set_position(tmp->axis, *pos);
/// this is to reset the encoder ref value.
/// LATER: need to verify whether summing pos is the right thing to do.
_position_zero[tmp->axis] = double(dsp_encoder (tmp->axis)) + *pos;
_winding[tmp->axis] = 0;
return rc;
}
示例6: set_position
MarqueeView::MarqueeView()
{
style = 0;
set_position( 0, 0, 0, 0 );
Visible = FALSE;
text_size = 14.0;
font_height = 2*text_size;
font = &SerifTypeface;
calc_margins( 0.1 );
text_color = 0xFF9f9f0f;
border_color = 0xFFffffff;
background_color = 0xFf202020;
strcpy (class_name, "MarqueeView");
}
示例7: dig
void dig(int **puz, int x, int y, int emp_lim, int rc_lim){
/*randomly empties positions of a completed sudoku to generate a new puzzle, according to the limits passed*/
int g = 0, v, s;
srand(time(NULL));
while(g <= emp_lim){
if(puz[x][y]){
if((v = check_row(puz, x, rc_lim)) && (s = check_col(puz, y, rc_lim))){
g++;
puz[x][y] = EMPTY;
}
}
set_position(&x, &y);
}
return;
}
示例8: score
score(const sf::Vector2f& position)
: m_text_size(m_mult*(position.x + position.y)), m_font(), m_text()
{
assert(m_score_name != "");
assert(m_score == 0);
set_font();
set_text_font();
set_text_size();
set_color();
textify_score();
set_origin();
set_position(position);
}
示例9: xmp_set_position
int xmp_set_position(xmp_context opaque, int pos)
{
struct context_data *ctx = (struct context_data *)opaque;
struct player_data *p = &ctx->p;
struct module_data *m = &ctx->m;
if (ctx->state < XMP_STATE_PLAYING)
return -XMP_ERROR_STATE;
if (pos >= m->mod.len)
return -XMP_ERROR_INVALID;
set_position(ctx, pos, 0);
return p->pos;
}
示例10: uci
void uci(void) {
/* printf("Entering UCI mode. Type in commands here (quit to quit, help for a list of commands)\n\n"); */
// Default state
isWhitesMove=1;
//set_position_startpos();
FILE *fp;
fp=fopen("chess.log", "a");
fprintf(fp, "---- CHESS v0.0 ------------\n");
int keep_going = 1;
char string[256];
while (keep_going == 1) {
//printf( "Command: " );
fflush (stdout);
int x = scanf ("%79s",string);
fprintf(fp, "Received command: %s\n", string);
if (strcmp(string, "quit")==0) {
keep_going = 0;
} else if (strcmp(string, "uci")==0) {
show_uci_info();
} else if (strcmp(string, "isready")==0) {
is_ready();
} else if (strcmp(string, "position")==0) {
set_position();
} else if (strcmp(string, "go")==0) {
go();
} else if (strcmp(string, "stop")==0) {
stop();
} else if (strcmp(string, "draw")==0) {
draw();
} else if (strcmp(string, "move")==0) {
uci_make_move();
} else if (strcmp(string, "dumpmoves")==0) {
dump_moves();
} else if (strcmp(string, "info")==0) {
info();
} else if (strcmp(string, "test")==0) {
run_tests();
} else {
printf( "Unknown command: %s\n", string );
}
}
fclose(fp);
}
示例11: set_position
ui::menu::menu()
{
set_position(window::center.x,window::center.y);
fill_color=default_fillcolor;
border_color=default_bordercolor;
set_texture(default_texture);
set_mask(default_mask);
set_title("menu");
title.set_font("helvetica",18);
subtitle.set_font("helvetica",12);
subtitle.hide();
layout=default_layout;
spacing=default_spacing;
margin=default_margin;
bordered=true;
std::clog<<"object#"<<number<<"(menu)"<<" created.\n";
}
示例12: main
int main(void)
{
int player_x,player_y;
player_x = player_y = 0;
printf("player_x = %d\n",player_x);
printf("player_y = %d\n",player_y);
printf("°ÜÆ°\n");
set_position(&player_x,&player_y);
printf("player_x = %d\n",player_x);
printf("player_y = %d\n",player_y);
return 0;
}
示例13: home_all
void home_all(void)
{
if (homing_state[pivot] != homed)
set_position(gripper, 10, 0.3, -0.3);
home(pivot);
if (homing_state[pivot] == homed)
home(gripper);
if (homing_state[gripper] == homed)
home(elevator);
// !!
if (homing_state[elevator] == homed)
home(mini);
}
示例14: sniper
void sniper()
{
init_all();
// set voltage reference to 5V
clear(ADMUX, REFS1);
set(ADMUX, REFS0);
m_disableJTAG();//allowing gpio of F pins
//setting ADC prescaler
set(ADCSRA,ADPS2);
set(ADCSRA,ADPS1);
set(ADCSRA,ADPS0);
//setting pins to turn off digital circuitry
set(DIDR0,ADC1D);//setting F1
set(DIDR0,ADC4D);//setting F4
set(DIDR0,ADC5D);//setting F5
set(DIDR0,ADC6D);//setting F6
set(DIDR0,ADC7D);//setting F7
set(ADCSRA, ADEN);
play_state = 1;
set_position(1024/2, 768/2);
first = true;
//state_before_game();
//state_play();
m_usb_init();
/* while(!m_usb_isconnected());
m_green(ON);
*/
set_left(30);
set_right(100);
while(1)
{
adc();
// m_usb_tx_string("left: ");
//m_usb_tx_int(a_left);
wait(1);
}
}
示例15: set_default_size
ViewLogFileWindow::ViewLogFileWindow(const std::string& PathToLogFile)
{
set_default_size(500, 350);
set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
set_title(_("Install log"));
m_CloseButton.set_label(_("Close"));
m_RefLogTextBuffer = Gtk::TextBuffer::create();
m_RefLogTextBuffer->set_text("");
m_LogTextView.set_editable(false);
m_LogTextView.set_buffer(m_RefLogTextBuffer);
m_LogTextView.set_wrap_mode(Gtk::WRAP_WORD);
m_LogSWindow.add(m_LogTextView);
m_LogSWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_VBox.set_border_width(12);
m_VBox.pack_start(m_LogSWindow,Gtk::PACK_EXPAND_WIDGET,12);
m_VBox.pack_start(m_CloseButton,Gtk::PACK_SHRINK,12);
add(m_VBox);
m_CloseButton.signal_clicked().connect(
sigc::mem_fun(*this, &ViewLogFileWindow::onCloseClicked)
);
std::ifstream LogFile(PathToLogFile.c_str());
std::string Line, FullContent;
while(getline(LogFile,Line))
{
FullContent += Line + "\n";
}
LogFile.close();
m_RefLogTextBuffer->set_text(FullContent);
show_all_children();
set_modal(true);
}