本文整理汇总了C++中prop_set函数的典型用法代码示例。如果您正苦于以下问题:C++ prop_set函数的具体用法?C++ prop_set怎么用?C++ prop_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prop_set函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: glw_update_sizes
static void
glw_update_sizes(glw_root_t *gr)
{
int val;
int base_size = gr->gr_height / 35; // 35 is just something
val = GLW_CLAMP(base_size + glw_settings.gs_size, 14, 40);
if(gr->gr_current_size != val) {
gr->gr_current_size = val;
prop_set(gr->gr_prop_ui, "size", PROP_SET_INT, val);
glw_text_flush(gr);
glw_icon_flush(gr);
TRACE(TRACE_DEBUG, "GLW", "UI size scale changed to %d", val);
}
val = GLW_CLAMP(gr->gr_base_underscan_h + glw_settings.gs_underscan_h,
0, 100);
if(gr->gr_underscan_h != val) {
prop_set(gr->gr_prop_ui, "underscan_h", PROP_SET_INT, val);
gr->gr_underscan_h = val;
}
val = GLW_CLAMP(gr->gr_base_underscan_v + glw_settings.gs_underscan_v,
0, 100);
if(gr->gr_underscan_v != val) {
prop_set(gr->gr_prop_ui, "underscan_v", PROP_SET_INT, val);
gr->gr_underscan_v = val;
}
}
开发者ID:dev-life,项目名称:showtime,代码行数:33,代码来源:glw.c
示例2: update_state
static void
update_state(plugin_t *pl)
{
int canInstall = 0;
int canUninstall = 0;
int canUpgrade = 0;
int cantUpgrade = 0;
rstr_t *status = NULL;
int version_dep_ok =
pl->pl_app_min_version == NULL ||
parse_version_int(pl->pl_app_min_version) <=
app_get_version_int();
prop_set(pl->pl_status, "minver", PROP_SET_VOID);
pl->pl_new_version_avail = 0;
if(pl->pl_installed == 0) {
if(!version_dep_ok) {
status = _("Not installable");
prop_set(pl->pl_status, "minver", PROP_SET_STRING,
pl->pl_app_min_version);
} else {
status = _("Not installed");
canInstall = 1;
}
} else if(!strcmp(pl->pl_inst_ver ?: "", pl->pl_repo_ver ?: "")) {
status = _("Up to date");
canUninstall = 1;
} else {
开发者ID:RuralHunter,项目名称:showtime,代码行数:34,代码来源:plugins.c
示例3: device_register
void
device_register(struct device *dev, void *aux)
{
struct device *parent = dev->dv_parent;
if (strcmp(dev->dv_cfdata->cf_name, "com") == 0 &&
strcmp(parent->dv_cfdata->cf_name, "opb") == 0) {
/* Set the frequency of the on-chip UART. */
int freq = COM_FREQ * 6;
if (prop_set(dev_propdb, dev, "frequency",
&freq, sizeof(freq), PROP_INT, 0) != 0)
printf("WARNING: unable to set frequency "
"property for %s\n", dev->dv_xname);
return;
}
if (strcmp(dev->dv_cfdata->cf_name, "emac") == 0 &&
strcmp(parent->dv_cfdata->cf_name, "opb") == 0) {
/* Set the mac-addr of the on-chip Ethernet. */
/* XXX 405GP only has one; what about CPUs with two? */
if (prop_set(dev_propdb, dev, "mac-addr",
&board_data.mac_address_local,
sizeof(board_data.mac_address_local),
PROP_CONST, 0) != 0)
printf("WARNING: unable to set mac-addr "
"property for %s\n", dev->dv_xname);
return;
}
}
开发者ID:MarginC,项目名称:kame,代码行数:30,代码来源:autoconf.c
示例4: connman_init
void
connman_init(void)
{
TAILQ_INIT(&connman_services);
netconf_model = prop_create_root(NULL);
prop_concat_t *pc = prop_concat_create(prop_create(netconf_model, "nodes"));
net_state = prop_create(netconf_model, "status");
prop_set(netconf_model, "type", PROP_SET_STRING, "directory");
prop_t *m = prop_create(netconf_model, "metadata");
prop_set(m, "title", PROP_SET_RSTRING, _("Network connections"));
// service_nodes contains list of items we receive from connman
service_nodes = prop_create_root(NULL);
prop_concat_add_source(pc, service_nodes, NULL);
// settings
connman_settings = prop_create_root(NULL);
prop_t *delim = prop_create_root(NULL);
prop_set_string(prop_create(delim, "type"), "separator");
prop_concat_add_source(pc, prop_create(connman_settings, "nodes"), delim);
settings_add_url(gconf.settings_network,
_p("Network connections"), NULL, NULL, NULL, MYURL,
SETTINGS_FIRST);
hts_thread_create_detached("connman", connman_thread, NULL,
THREAD_PRIO_BGTASK);
}
开发者ID:Ezio-PS,项目名称:movian,代码行数:33,代码来源:connman.c
示例5: create_channel
HRESULT create_channel( WS_CHANNEL_TYPE type, WS_CHANNEL_BINDING binding,
const WS_CHANNEL_PROPERTY *properties, ULONG count, struct channel **ret )
{
struct channel *channel;
ULONG i, msg_size = 65536;
HRESULT hr;
if (!(channel = alloc_channel())) return E_OUTOFMEMORY;
prop_set( channel->prop, channel->prop_count, WS_CHANNEL_PROPERTY_MAX_BUFFERED_MESSAGE_SIZE,
&msg_size, sizeof(msg_size) );
for (i = 0; i < count; i++)
{
hr = prop_set( channel->prop, channel->prop_count, properties[i].id, properties[i].value,
properties[i].valueSize );
if (hr != S_OK)
{
free_channel( channel );
return hr;
}
}
channel->type = type;
channel->binding = binding;
*ret = channel;
return S_OK;
}
开发者ID:AmesianX,项目名称:wine,代码行数:29,代码来源:channel.c
示例6: add_news_locked
static prop_t *
add_news_locked(const char *id, const char *message,
const char *location, const char *caption,
const char *action)
{
prop_t *p, *ret = NULL;
prop_t *root = prop_create(prop_get_global(), "news");
if(dismissed_news_out != NULL) {
if(htsmsg_get_u32_or_default(dismissed_news_in, id, 0)) {
dismis_news(id);
} else {
p = prop_create_root(id);
prop_set(p, "message", PROP_SET_STRING, message);
prop_set(p, "id", PROP_SET_STRING, id);
prop_set(p, "location", PROP_SET_STRING, location);
prop_set(p, "caption", PROP_SET_STRING, caption);
prop_set(p, "action", PROP_SET_STRING, action);
prop_subscribe(PROP_SUB_TRACK_DESTROY,
PROP_TAG_CALLBACK, news_sink, prop_ref_inc(p),
PROP_TAG_ROOT, prop_create(p, "eventSink"),
PROP_TAG_MUTEX, &news_mutex,
NULL);
ret = prop_ref_inc(p);
if(prop_set_parent(p, root))
prop_destroy(p);
}
}
return ret;
}
开发者ID:tajmouati,项目名称:showtime,代码行数:33,代码来源:notifications.c
示例7: init_global_info
/**
* Set some info in the global property tree that might be interesting
*/
static void
init_global_info(void)
{
prop_t *s = prop_create(prop_get_global(), "app");
extern const char *htsversion;
extern const char *htsversion_full;
prop_set(s, "name", PROP_SET_STRING, APPNAMEUSER);
prop_set(s, "version", PROP_SET_STRING, htsversion);
prop_set(s, "fullversion", PROP_SET_STRING, htsversion_full);
prop_set(s, "copyright", PROP_SET_STRING, "© 2006 - 2015 Lonelycoder AB");
}
开发者ID:tajmouati,项目名称:showtime,代码行数:15,代码来源:showtime.c
示例8: file_open_audio
/**
* Try to open the given URL with a playqueue context
*/
static int
file_open_audio(prop_t *page, const char *url)
{
char parent[URL_MAX];
char parent2[URL_MAX];
struct fa_stat fs;
prop_t *model;
if(fa_parent(parent, sizeof(parent), url))
return 1;
if(fa_stat(parent, &fs, NULL, 0))
return 1;
model = prop_create(page, "model");
prop_set_string(prop_create(model, "type"), "directory");
/* Find a meaningful page title (last component of URL) */
rstr_t *title = title_from_url(parent);
prop_set(model, "metadata", "title", NULL, PROP_SET_RSTRING, title);
// Set parent
if(!fa_parent(parent2, sizeof(parent2), parent))
prop_set_string(prop_create(page, "parent"), parent2);
fa_scanner(parent, fs.fs_mtime, model, url, prop_create(page, "directClose"),
title);
rstr_release(title);
return 0;
}
开发者ID:niconico27,项目名称:showtime,代码行数:33,代码来源:fa_backend.c
示例9: mp_reset
void
mp_reset(media_pipe_t *mp)
{
cancellable_reset(mp->mp_cancellable);
prop_set(mp->mp_prop_io, "bitrate", PROP_SET_VOID);
prop_set(mp->mp_prop_io, "bitrateValid", PROP_SET_VOID);
prop_destroy_childs(mp->mp_prop_audio_tracks);
prop_destroy_childs(mp->mp_prop_subtitle_tracks);
prop_set_void(mp->mp_prop_audio_track_current);
mp_add_track_off(mp->mp_prop_subtitle_tracks, "sub:off");
prop_set_string(mp->mp_prop_subtitle_track_current, "sub:off");
}
开发者ID:tajmouati,项目名称:showtime,代码行数:16,代码来源:media.c
示例10: mp_set_duration
void
mp_set_duration(media_pipe_t *mp, int64_t duration)
{
if(duration == AV_NOPTS_VALUE) {
mp->mp_duration = 0;
prop_set(mp->mp_prop_metadata, "duration", PROP_SET_VOID);
return;
}
mp->mp_duration = duration;
float d = mp->mp_duration / 1000000.0;
prop_set(mp->mp_prop_metadata, "duration", PROP_SET_FLOAT, d);
if(duration && mp->mp_prop_metadata_source)
prop_set(mp->mp_prop_metadata_source, "duration", PROP_SET_FLOAT, d);
}
开发者ID:RuralHunter,项目名称:showtime,代码行数:16,代码来源:media.c
示例11: create_proxy
static HRESULT create_proxy( WS_CHANNEL *channel, const WS_PROXY_PROPERTY *properties, ULONG count,
WS_SERVICE_PROXY **handle )
{
struct proxy *proxy;
HRESULT hr;
ULONG i;
if (!(proxy = alloc_proxy())) return E_OUTOFMEMORY;
for (i = 0; i < count; i++)
{
hr = prop_set( proxy->prop, proxy->prop_count, properties[i].id, properties[i].value,
properties[i].valueSize );
if (hr != S_OK)
{
free_proxy( proxy );
return hr;
}
}
proxy->channel = channel;
*handle = (WS_SERVICE_PROXY *)proxy;
return S_OK;
}
开发者ID:AndreRH,项目名称:wine,代码行数:25,代码来源:proxy.c
示例12: audio_setup_spdif_muxer
static void
audio_setup_spdif_muxer(audio_decoder_t *ad, AVCodec *codec,
media_queue_t *mq)
{
AVOutputFormat *ofmt = av_guess_format("spdif", NULL, NULL);
if(ofmt == NULL)
return;
const int mux_buffer_size = 16384;
assert(ad->ad_mux_buffer == NULL);
ad->ad_mux_buffer = malloc(mux_buffer_size);
AVFormatContext *fctx = avformat_alloc_context();
fctx->oformat = ofmt;
fctx->pb = avio_alloc_context(ad->ad_mux_buffer, mux_buffer_size,
1, ad, NULL, spdif_mux_write, NULL);
AVStream *s = avformat_new_stream(fctx, codec);
s->codec->sample_rate = 48000; // ???
if(avcodec_open2(s->codec, codec, NULL)) {
TRACE(TRACE_ERROR, "audio", "Unable to open %s codec for SPDIF",
codec->name);
bad:
av_free(fctx->pb);
free(ad->ad_mux_buffer);
ad->ad_mux_buffer = NULL;
avformat_free_context(fctx);
return;
}
if(avformat_write_header(fctx, NULL)) {
TRACE(TRACE_ERROR, "audio", "Unable to open SPDIF muxer",
codec->name);
goto bad;
}
ad->ad_spdif_muxer = fctx;
TRACE(TRACE_DEBUG, "audio", "SPDIF muxer opened");
const char *name;
switch(codec->id) {
case AV_CODEC_ID_DTS: name = "DTS"; break;
case AV_CODEC_ID_AC3: name = "AC3"; break;
case AV_CODEC_ID_EAC3: name = "EAC3"; break;
default:
name = "";
break;
}
char str[64];
snprintf(str, sizeof(str), "%s%sPass-Through", name, *name ? " " : "");
prop_set_string(mq->mq_prop_codec, str);
ad->ad_in_sample_rate = 0;
ad->ad_in_sample_format = 0;
ad->ad_in_channel_layout = 0;
prop_set(ad->ad_mp->mp_prop_ctrl, "canAdjustVolume", PROP_SET_INT, 0);
}
开发者ID:dreamcat4,项目名称:showtime,代码行数:57,代码来源:audio.c
示例13: js_item_disable
static JSBool
js_item_disable(JSContext *cx, JSObject *obj,
uintN argc, jsval *argv, jsval *rval)
{
js_item_t *ji = JS_GetPrivate(cx, obj);
prop_set(ji->ji_root, "enabled", PROP_SET_INT, 0);
*rval = JSVAL_VOID;
return JS_TRUE;
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:9,代码来源:js_page.c
示例14: WsSetChannelProperty
/**************************************************************************
* WsSetChannelProperty [[email protected]]
*/
HRESULT WINAPI WsSetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID id, const void *value,
ULONG size, WS_ERROR *error )
{
struct channel *channel = (struct channel *)handle;
TRACE( "%p %u %p %u\n", handle, id, value, size );
if (error) FIXME( "ignoring error parameter\n" );
return prop_set( channel->prop, channel->prop_count, id, value, size );
}
开发者ID:AmesianX,项目名称:wine,代码行数:13,代码来源:channel.c
示例15: mp_reset
void
mp_reset(media_pipe_t *mp)
{
mp_unhold(mp, MP_HOLD_PRE_BUFFERING | MP_HOLD_STREAM | MP_HOLD_SYNC);
cancellable_reset(mp->mp_cancellable);
prop_set(mp->mp_prop_io, "bitrate", PROP_SET_VOID);
prop_set(mp->mp_prop_io, "bitrateValid", PROP_SET_VOID);
prop_t *p = prop_create(mp->mp_prop_io, "infoNodes");
prop_destroy_childs(p);
prop_destroy_childs(mp->mp_prop_audio_tracks);
prop_destroy_childs(mp->mp_prop_subtitle_tracks);
prop_set_void(mp->mp_prop_audio_track_current);
mp_add_track_off(mp->mp_prop_subtitle_tracks, "sub:off");
prop_set_string(mp->mp_prop_subtitle_track_current, "sub:off");
}
开发者ID:VIRGINKLM,项目名称:showtime,代码行数:20,代码来源:media.c
示例16: property_set
int property_set(const char *key, const char *value){
static int (*prop_set)(const char *key, const char *value)=0;
if (!prop_set){
void *h = dlopen("libcutils.so",RTLD_LAZY);
if (!h)
return -1;
prop_set = dlsym(h, "property_set");
if (!prop_set)
return -1;
}
return prop_set(key, value);
}
开发者ID:Ivan-du-toit,项目名称:batphone,代码行数:12,代码来源:install.c
示例17: runcontrol_init
void
runcontrol_init(void)
{
prop_t *rc;
rc = prop_create(prop_get_global(), "runcontrol");
prop_set(rc, "canStandby", PROP_SET_INT, !!gconf.can_standby);
prop_set(rc, "canPowerOff", PROP_SET_INT, !!gconf.can_poweroff);
prop_set(rc, "canLogout", PROP_SET_INT, !!gconf.can_logout);
prop_set(rc, "canOpenShell", PROP_SET_INT, !!gconf.can_open_shell);
prop_set(rc, "canRestart", PROP_SET_INT, !!gconf.can_restart);
prop_set(rc, "canExit", PROP_SET_INT, !gconf.can_not_exit);
if(!(gconf.can_standby ||
gconf.can_poweroff ||
gconf.can_logout ||
gconf.can_open_shell ||
gconf.can_restart ||
!gconf.can_not_exit))
return;
settings_create_separator(gconf.settings_general,
_p("Starting and stopping"));
if(gconf.can_standby) {
init_autostandby();
init_sleeptimer(rc);
settings_create_action(gconf.settings_general, _p("Standby"),
do_standby, NULL, 0, NULL);
}
if(gconf.can_poweroff)
settings_create_action(gconf.settings_general, _p("Power off system"),
do_power_off, NULL, 0, NULL);
if(gconf.can_logout)
settings_create_action(gconf.settings_general, _p("Logout"),
do_logout, NULL, 0, NULL);
if(gconf.can_open_shell)
settings_create_action(gconf.settings_general, _p("Open shell"),
do_open_shell, NULL, 0, NULL);
if(!gconf.can_not_exit)
settings_create_action(gconf.settings_general, _p("Quit"),
do_exit, NULL, 0, NULL);
if(gconf.shell_fd > 0) {
settings_create_separator(gconf.settings_network, _p("SSH server"));
setting_create(SETTING_BOOL, gconf.settings_network,SETTINGS_INITIAL_UPDATE,
SETTING_TITLE(_p("Enable SSH server")),
SETTING_VALUE(0),
SETTING_CALLBACK(set_ssh_server, NULL),
SETTING_STORE("runcontrol", "sshserver"),
NULL);
}
}
开发者ID:bguerreiro,项目名称:movian,代码行数:60,代码来源:runcontrol.c
示例18: meminfo_do
static int
meminfo_do(void)
{
int ret = 0;
char data[1000];
uint64_t v1;
char s1[64];
FILE *f;
prop_t *mem = prop_create(p_sys, "mem");
struct mallinfo mi = mallinfo();
prop_set(mem, "arena", PROP_SET_INT, (mi.hblks + mi.arena) / 1024);
prop_set(mem, "unusedChunks", PROP_SET_INT, mi.ordblks);
prop_set(mem, "activeMem", PROP_SET_INT, mi.uordblks / 1024);
prop_set(mem, "inactiveMem", PROP_SET_INT, mi.fordblks / 1024);
f = fopen("/proc/meminfo", "r");
if(f == NULL)
return 0;
while(fgets(data, sizeof(data), f) != NULL) {
if(sscanf(data, "%60s %"PRId64, s1, &v1) != 2)
continue;
if(!strcmp(s1, "MemTotal:"))
prop_set(mem, "systotal", PROP_SET_INT, v1);
else if(!strcmp(s1, "MemFree:"))
prop_set(mem, "sysfree", PROP_SET_INT, v1);
}
fclose(f);
return ret;
}
开发者ID:Cy-4AH,项目名称:showtime,代码行数:34,代码来源:linux_process_monitor.c
示例19: init_sleeptimer
static void
init_sleeptimer(prop_t *rc)
{
const int maxtime = 180;
sleeptime_prop = prop_create(rc, "sleepTime");
prop_set_int(sleeptime_prop, 60);
prop_set_int_clipping_range(sleeptime_prop, 0, maxtime);
prop_set(rc, "sleepTimeMax", PROP_SET_INT, maxtime);
prop_set(rc, "sleepTimeStep", PROP_SET_INT, 5);
sleeptime_sub =
prop_subscribe(0,
PROP_TAG_CALLBACK_INT, update_sleeptime, NULL,
PROP_TAG_ROOT, sleeptime_prop,
NULL);
prop_subscribe(PROP_SUB_NO_INITIAL_UPDATE,
PROP_TAG_NAME("global", "runcontrol", "sleepTimer"),
PROP_TAG_CALLBACK_INT, update_sleeptimer, NULL,
NULL);
}
开发者ID:bguerreiro,项目名称:movian,代码行数:22,代码来源:runcontrol.c
示例20: agent_request_input
/**
* Popup an request to the user on behalf of connman
*/
static GVariant *
agent_request_input(connman_service_t *cs, GVariant *req,
GDBusMethodInvocation *inv)
{
TRACE(TRACE_INFO, "CONNMAN", "Requesting credentials for %s", cs->cs_path);
TRACE(TRACE_DEBUG, "CONNMAN", "RequestInput: %s",
g_variant_print(req, TRUE));
prop_t *p = prop_create_root(NULL);
prop_set(p, "type", PROP_SET_STRING, "auth");
prop_set(p, "id", PROP_SET_STRING, cs->cs_path);
prop_set(p, "source", PROP_SET_STRING, "Network");
GVariant *prev = g_variant_lookup_value(req, "PreviousPassphrase", NULL);
if(prev) {
prop_set(p, "reason", PROP_SET_STRING, "Password incorrect");
} else {
prop_set(p, "reason", PROP_SET_STRING, "Password needed");
}
GVariant *identity = g_variant_lookup_value(req, "Identity", NULL);
cs->cs_input_req_want_identity = identity != NULL;
prop_set(p, "disableUsername", PROP_SET_INT, !cs->cs_input_req_want_identity);
prop_set(p, "disableDomain", PROP_SET_INT, 1);
prop_t *r = prop_create(p, "eventSink");
cs->cs_input_req_sub =
prop_subscribe(0,
PROP_TAG_CALLBACK_EVENT, input_req_event, cs,
PROP_TAG_NAMED_ROOT, r, "popup",
PROP_TAG_COURIER, connman_courier,
NULL);
cs->cs_input_req_prop = p;
/* Will show the popup */
if(prop_set_parent(p, prop_create(prop_get_global(), "popups"))) {
/* popuproot is a zombie, this is an error */
abort();
}
cs->cs_input_req_inv = inv;
g_object_ref(G_OBJECT(inv));
return NULL;
}
开发者ID:Ezio-PS,项目名称:movian,代码行数:56,代码来源:connman.c
注:本文中的prop_set函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论