/********************************************************************** * %FUNCTION: PPPOEInitDevice * %ARGUMENTS: * None * %RETURNS: * * %DESCRIPTION: * Initializes PPPoE device. ***********************************************************************/ static int PPPOEInitDevice(void) { conn = malloc(sizeof(PPPoEConnection)); if (!conn) { fatal("Could not allocate memory for PPPoE session"); } memset(conn, 0, sizeof(PPPoEConnection)); if (acName) { SET_STRING(conn->acName, acName); } if (pppd_pppoe_service) { SET_STRING(conn->serviceName, pppd_pppoe_service); } if (strlen(devnam) > IFNAMSIZ) { fatal("Device name %s is too long - max length %d", devnam, (int) IFNAMSIZ); } SET_STRING(conn->ifName, devnam); conn->discoverySocket = -1; conn->sessionSocket = -1; conn->hostUniq = malloc(17); if (!conn->hostUniq) { fatal("Out of Memory"); } snprintf(conn->hostUniq, 17, "%lx", (unsigned long) getpid()); conn->printACNames = printACNames; conn->discoveryTimeout = PADI_TIMEOUT; return 1; }
static void _parse_root(config_t *config, xmlDocPtr doc, xmlNodePtr node) { do { if (node == NULL) break; if (xmlIsBlankNode(node)) continue; if (strcmp(node->name, "background") == 0) SET_INT(config->background); else if (strcmp(node->name, "logpath") == 0) SET_STRING(config->logpath); else if (strcmp(node->name, "logfile") == 0) SET_STRING(config->logfile); else if (strcmp(node->name, "loglevel") == 0) SET_INT(config->loglevel); else if (strcmp(node->name, "logsize") == 0) SET_INT(config->logsize); else if (strcmp(node->name, "consolelog") == 0) SET_INT(config->log_stderr); else if (strcmp(node->name, "pidfile") == 0) SET_STRING(config->pidfile); else if (strcmp(node->name, "stream") == 0) _parse_stream(config, doc, node->xmlChildrenNode); } while ((node = node->next)); }
static void _parse_input(config_t *config, xmlDocPtr doc, xmlNodePtr node) { module_param_t *param, *p; do { if (node == NULL) break; if (xmlIsBlankNode(node)) continue; if (strcmp(node->name, "module") == 0) SET_STRING(config->playlist_module); else if (strcmp(node->name, "param") == 0) { param = (module_param_t *)calloc(1, sizeof(module_param_t)); SET_PARM_STRING("name", param->name); SET_STRING(param->value); param->next = NULL; if (config->module_params == NULL) { config->module_params = param; } else { p = config->module_params; while (p->next != NULL) p = p->next; p->next = param; } } } while ((node = node->next)); }
void SjTrackInfo::SetValue(long ti, const wxString& value) { long longValue; #define SET_STRING(n) \ (n) = value; return; #define SET_LONG(n) \ if( value.ToLong(&longValue) ) { (n) = longValue; } return; switch( ti ) { case SJ_TI_URL: SET_STRING (m_url); case SJ_TI_TRACKNAME: SET_STRING (m_trackName); case SJ_TI_TRACKNR: SET_LONG (m_trackNr); case SJ_TI_TRACKCOUNT: SET_LONG (m_trackCount); case SJ_TI_DISKNR: SET_LONG (m_diskNr); case SJ_TI_DISKCOUNT: SET_LONG (m_diskCount); case SJ_TI_LEADARTISTNAME: SET_STRING (m_leadArtistName); case SJ_TI_ORGARTISTNAME: SET_STRING (m_orgArtistName); case SJ_TI_COMPOSERNAME: SET_STRING (m_composerName); case SJ_TI_ALBUMNAME: SET_STRING (m_albumName); case SJ_TI_GENRENAME: SET_STRING (m_genreName); case SJ_TI_GROUPNAME: SET_STRING (m_groupName); case SJ_TI_COMMENT: SET_STRING (m_comment); case SJ_TI_BEATSPERMINUTE: SET_LONG (m_beatsPerMinute); case SJ_TI_RATING: SET_LONG (m_rating); case SJ_TI_YEAR: SET_LONG (m_year); case SJ_TI_PLAYTIMEMS: SET_LONG (m_playtimeMs); } wxASSERT( 0 ); }
static void _parse_metadata(instance_t *instance, config_t *config, xmlDocPtr doc, xmlNodePtr node) { do { if (node == NULL) break; if (xmlIsBlankNode(node)) continue; if (strcmp(node->name, "name") == 0) { if(instance) SET_STRING(instance->stream_name); else SET_STRING(config->stream_name); } else if (strcmp(node->name, "genre") == 0) { if(instance) SET_STRING(instance->stream_genre); else SET_STRING(config->stream_genre); } else if (strcmp(node->name, "description") == 0) { if(instance) SET_STRING(instance->stream_description); else SET_STRING(config->stream_description); } else if (strcmp(node->name, "url") == 0) { if(instance) SET_STRING(instance->stream_url); else SET_STRING(config->stream_url); } } while ((node = node->next)); }
void structManual :: v_defaultHeaders (EditorCommand cmd) { Manual me = (Manual) cmd -> d_editor; ManPages manPages = (ManPages) my data; if (my path) { wchar_t string [400]; static const wchar_t *shortMonth [] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" }; ManPage page = (ManPage) manPages -> pages -> item [my path]; long date = page -> date; SET_STRING (L"Right or outside header", page -> title) SET_STRING (L"Left or inside footer", page -> author) if (date) { swprintf (string, 400, L"%ls %ld, %ld", shortMonth [date % 10000 / 100 - 1], date % 100, date / 10000); SET_STRING (L"Left or inside header", string) } }
static void menu_cb_editConstraint (EDITOR_ARGS) { EDITOR_IAM (OTGrammarEditor); EDITOR_FORM (U"Edit constraint", 0) LABEL (U"constraint", U""); REAL (U"Ranking value", U"100.0"); REAL (U"Disharmony", U"100.0"); REAL (U"Plasticity", U"1.0"); EDITOR_OK OTGrammar ot = (OTGrammar) my data; OTGrammarConstraint constraint; if (my selected < 1 || my selected > ot -> numberOfConstraints) Melder_throw (U"Select a constraint first."); constraint = & ot -> constraints [ot -> index [my selected]]; SET_STRING (U"constraint", constraint -> name) SET_REAL (U"Ranking value", constraint -> ranking) SET_REAL (U"Disharmony", constraint -> disharmony) SET_REAL (U"Plasticity", constraint -> plasticity) EDITOR_DO OTGrammar ot = (OTGrammar) my data; OTGrammarConstraint constraint = & ot -> constraints [ot -> index [my selected]]; Editor_save (me, U"Edit constraint"); constraint -> ranking = GET_REAL (U"Ranking value"); constraint -> disharmony = GET_REAL (U"Disharmony"); constraint -> plasticity = GET_REAL (U"Plasticity"); OTGrammar_sort (ot); Graphics_updateWs (my g); Editor_broadcastDataChanged (me); EDITOR_END }
LinphoneContent *linphone_content_copy_from_sal_body(LinphoneContent *obj, const SalBody *ref){ SET_STRING(obj,type,ref->type); SET_STRING(obj,subtype,ref->subtype); SET_STRING(obj,encoding,ref->encoding); if (obj->data) { ms_free(obj->data); obj->data=NULL; } if (ref->data){ obj->data=ms_malloc(ref->size+1); memcpy(obj->data, ref->data, ref->size); ((char*)obj->data)[ref->size]='\0'; } obj->size=ref->size; return obj; }
static void menu_cb_editRanking (EDITOR_ARGS) { EDITOR_IAM (OTMultiEditor); EDITOR_FORM (U"Edit ranking", 0) LABEL (U"constraint", U""); REAL (U"Ranking value", U"100.0"); REAL (U"Disharmony", U"100.0"); EDITOR_OK OTMulti grammar = (OTMulti) my data; OTConstraint constraint; if (my selectedConstraint < 1 || my selectedConstraint > grammar -> numberOfConstraints) Melder_throw (U"Select a constraint first."); constraint = & grammar -> constraints [grammar -> index [my selectedConstraint]]; SET_STRING (U"constraint", constraint -> name) SET_REAL (U"Ranking value", constraint -> ranking) SET_REAL (U"Disharmony", constraint -> disharmony) EDITOR_DO OTMulti grammar = (OTMulti) my data; OTConstraint constraint = & grammar -> constraints [grammar -> index [my selectedConstraint]]; Editor_save (me, U"Edit ranking"); constraint -> ranking = GET_REAL (U"Ranking value"); constraint -> disharmony = GET_REAL (U"Disharmony"); OTMulti_sort (grammar); Graphics_updateWs (my g); Editor_broadcastDataChanged (me); EDITOR_END }
static void menu_cb_addToDynamicMenu (EDITOR_ARGS) { EDITOR_IAM (ScriptEditor); EDITOR_FORM (U"Add to dynamic menu", U"Add to dynamic menu...") WORD (U"Class 1", U"Sound") INTEGER (U"Number 1", U"0") WORD (U"Class 2", U"") INTEGER (U"Number 2", U"0") WORD (U"Class 3", U"") INTEGER (U"Number 3", U"0") SENTENCE (U"Command", U"Do it...") SENTENCE (U"After command", U"") INTEGER (U"Depth", U"0") LABEL (U"", U"Script file:") TEXTFIELD (U"Script", U"") EDITOR_OK if (my name [0]) SET_STRING (U"Script", my name) else SET_STRING (U"Script", U"(please save your script first)") EDITOR_DO praat_addActionScript (GET_STRING (U"Class 1"), GET_INTEGER (U"Number 1"), GET_STRING (U"Class 2"), GET_INTEGER (U"Number 2"), GET_STRING (U"Class 3"), GET_INTEGER (U"Number 3"), GET_STRING (U"Command"), GET_STRING (U"After command"), GET_INTEGER (U"Depth"), GET_STRING (U"Script")); praat_show (); EDITOR_END }
void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal ) { (void)p_obj; input_item_t *p_item = static_cast<input_item_t*>(newVal.p_address); // Update short name char *psz_name = input_item_GetName( p_item ); SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) ); free( psz_name ); // Update local path (if possible) or full uri char *psz_uri = input_item_GetURI( p_item ); char *psz_path = make_path( psz_uri ); char *psz_save = psz_path ? psz_path : psz_uri; SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_save ) ); free( psz_path ); free( psz_uri ); // Update art uri char *psz_art = input_item_GetArtURL( p_item ); SET_STRING( m_cVarStreamArt, string( psz_art ? psz_art : "" ) ); free( psz_art ); // Update playtree getPlaytreeVar().onUpdateCurrent( true ); }
void linphone_content_copy(LinphoneContent *obj, const LinphoneContent *ref){ SET_STRING(obj,type,ref->type); SET_STRING(obj,subtype,ref->subtype); SET_STRING(obj,encoding,ref->encoding); SET_STRING(obj,name,ref->name); if (obj->data) { ms_free(obj->data); obj->data=NULL; } if (ref->data){ obj->data=ms_malloc(ref->size+1); memcpy(obj->data, ref->data, ref->size); ((char*)obj->data)[ref->size]='\0'; } obj->size=ref->size; }
void structManual :: v_defaultHeaders (EditorCommand cmd) { Manual me = (Manual) cmd -> d_editor; ManPages manPages = (ManPages) my data; if (my path) { char32 string [400]; static const char32 *shortMonth [] = { U"Jan", U"Feb", U"Mar", U"Apr", U"May", U"Jun", U"Jul", U"Aug", U"Sep", U"Oct", U"Nov", U"Dec" }; ManPage page = manPages -> pages.at [my path]; long date = page -> date; SET_STRING (U"Right or outside header", page -> title) SET_STRING (U"Left or inside footer", page -> author) if (date) { Melder_sprint (string,400, shortMonth [date % 10000 / 100 - 1], U" ", date % 100, U", ", date / 10000); SET_STRING (U"Left or inside header", string) } }
static void menu_cb_printRange (EDITOR_ARGS) { EDITOR_IAM (Manual); EDITOR_FORM (L"Print range", 0) SENTENCE (L"Left or inside header", L"") SENTENCE (L"Middle header", L"") SENTENCE (L"Right or outside header", L"Manual") SENTENCE (L"Left or inside footer", L"") SENTENCE (L"Middle footer", L"") SENTENCE (L"Right or outside footer", L"") BOOLEAN (L"Mirror even/odd headers", TRUE) LABEL (L"", L"Print all pages whose title starts with:") TEXTFIELD (L"Print pages starting with", L"Intro") INTEGER (L"First page number", L"1") BOOLEAN (L"Suppress \"Links to this page\"", FALSE) EDITOR_OK ManPages manPages = (ManPages) my data; time_t today = time (NULL); char dateA [50]; #ifdef UNIX struct tm *tm = localtime (& today); strftime (dateA, 50, "%B %e, %Y", tm); #else strcpy (dateA, ctime (& today)); #endif wchar_t *date = Melder_peekUtf8ToWcs (dateA), *newline; newline = wcschr (date, '\n'); if (newline) *newline = '\0'; SET_STRING (L"Left or inside header", date) SET_STRING (L"Right or outside header", my name) if (my d_printingPageNumber) SET_INTEGER (L"First page number", my d_printingPageNumber + 1) if (my path >= 1 && my path <= manPages -> pages -> size) { ManPage page = (ManPage) manPages -> pages -> item [my path]; SET_STRING (L"Print pages starting with", page -> title); } EDITOR_DO my insideHeader = GET_STRING (L"Left or inside header"); my middleHeader = GET_STRING (L"Middle header"); my outsideHeader = GET_STRING (L"Right or outside header"); my insideFooter = GET_STRING (L"Left or inside footer"); my middleFooter = GET_STRING (L"Middle footer"); my outsideFooter = GET_STRING (L"Right or outside footer"); my mirror = GET_INTEGER (L"Mirror even/odd headers"); my printPagesStartingWith = GET_STRING (L"Print pages starting with"); my d_printingPageNumber = GET_INTEGER (L"First page number"); my suppressLinksHither = GET_INTEGER (L"Suppress \"Links to this page\""); Printer_print (print, me); EDITOR_END }
static void menu_cb_printRange (Manual me, EDITOR_ARGS_FORM) { EDITOR_FORM (U"Print range", 0) SENTENCE (U"Left or inside header", U"") SENTENCE (U"Middle header", U"") SENTENCE (U"Right or outside header", U"Manual") SENTENCE (U"Left or inside footer", U"") SENTENCE (U"Middle footer", U"") SENTENCE (U"Right or outside footer", U"") BOOLEAN (U"Mirror even/odd headers", true) LABEL (U"", U"Print all pages whose title starts with:") TEXTFIELD (U"Print pages starting with", U"Intro") INTEGER (U"First page number", U"1") BOOLEAN (U"Suppress \"Links to this page\"", false) EDITOR_OK ManPages manPages = (ManPages) my data; time_t today = time (nullptr); char dateA [50]; #ifdef UNIX struct tm *tm = localtime (& today); strftime (dateA, 50, "%B %e, %Y", tm); #else strcpy (dateA, ctime (& today)); #endif char32 *date = Melder_peek8to32 (dateA), *newline; newline = str32chr (date, U'\n'); if (newline) *newline = U'\0'; SET_STRING (U"Left or inside header", date) SET_STRING (U"Right or outside header", my name) if (my d_printingPageNumber) SET_INTEGER (U"First page number", my d_printingPageNumber + 1) if (my path >= 1 && my path <= manPages -> pages.size) { ManPage page = manPages -> pages.at [my path]; SET_STRING (U"Print pages starting with", page -> title); } EDITOR_DO my insideHeader = GET_STRING (U"Left or inside header"); my middleHeader = GET_STRING (U"Middle header"); my outsideHeader = GET_STRING (U"Right or outside header"); my insideFooter = GET_STRING (U"Left or inside footer"); my middleFooter = GET_STRING (U"Middle footer"); my outsideFooter = GET_STRING (U"Right or outside footer"); my mirror = GET_INTEGER (U"Mirror even/odd headers"); my printPagesStartingWith = GET_STRING (U"Print pages starting with"); my d_printingPageNumber = GET_INTEGER (U"First page number"); my suppressLinksHither = GET_INTEGER (U"Suppress \"Links to this page\""); Printer_print (print, me); EDITOR_END }
LispObject Alloc_MakeString(char *str) { LispObject o; struct LispString *s = (struct LispString *)Malloc(sizeof(struct LispString)); s->str = StringAlloc(str); s->len = (int)strlen(str); SET_STRING(o, s); return o; }
LispObject GC_MakeString(char *str) { LispObject o; struct LispString *s = STRING_NEW(); s->str = StringAlloc(str); s->len = (int)strlen(str); SET_STRING(o, s); return o; }
/* Set link style variables */ void set_link_vars(void) { SET_BOOL(link_dashed); SET_BOOL(link_spline); SET_COLOUR(link_colour); SET_COLOUR(link_text_colour); SET_FONT(link_text_font); SET_FONTSIZE(link_text_fontsize); SET_REAL(link_arrow_size); SET_REAL(link_line_width); SET_STRING(link_inout_string); SET_STRING(link_updown_string); }
static void cfg_main_section_save (const char *section) { char *filters; SET_STRING(theme); SET_STRING(engine); SET_STRING(verbosity); SET_STRING(log_file); SET_INT(idle_timeout); SET_INT(fullscreen); SET_INT(slideshow_delay); SET_BOOL(display_mouse); SET_TUPLE(music_filters, "music_ext"); SET_TUPLE(video_filters, "video_ext"); SET_TUPLE(photo_filters, "photo_ext"); }
/********************************************************************** * %FUNCTION: PPPOEInitDevice * %ARGUMENTS: * None * %RETURNS: * * %DESCRIPTION: * Initializes PPPoE device. ***********************************************************************/ static int PPPOEInitDevice(void) { conn = malloc(sizeof(PPPoEConnection)); if (!conn) { fatal("Could not allocate memory for PPPoE session"); } memset(conn, 0, sizeof(PPPoEConnection)); if (acName) { SET_STRING(conn->acName, acName); } if (pppd_pppoe_service) { SET_STRING(conn->serviceName, pppd_pppoe_service); } SET_STRING(conn->ifName, devnam); conn->discoverySocket = -1; conn->sessionSocket = -1; conn->useHostUniq = 1; conn->printACNames = printACNames; return 1; }
static void menu_cb_writeAllToHtmlDir (Manual me, EDITOR_ARGS_FORM) { EDITOR_FORM (U"Save all pages as HTML files", nullptr) LABEL (U"", U"Type a directory name:") TEXTFIELD (U"directory", U"") EDITOR_OK structMelderDir currentDirectory { { 0 } }; Melder_getDefaultDir (& currentDirectory); SET_STRING (U"directory", Melder_dirToPath (& currentDirectory)) EDITOR_DO char32 *directory = GET_STRING (U"directory"); ManPages_writeAllToHtmlDir ((ManPages) my data, directory); EDITOR_END }
static void menu_cb_writeAllToHtmlDir (EDITOR_ARGS) { EDITOR_IAM (Manual); EDITOR_FORM (L"Save all pages as HTML files", 0) LABEL (L"", L"Type a directory name:") TEXTFIELD (L"directory", L"") EDITOR_OK structMelderDir currentDirectory = { { 0 } }; Melder_getDefaultDir (& currentDirectory); SET_STRING (L"directory", Melder_dirToPath (& currentDirectory)) EDITOR_DO wchar *directory = GET_STRING (L"directory"); ManPages_writeAllToHtmlDir ((ManPages) my data, directory); EDITOR_END }
static void string_substr(LVGActionCtx *ctx, ASClass *cls, uint8_t *a, uint32_t nargs) { assert(2 == nargs); ASVal *se_start = &ctx->stack[ctx->stack_ptr]; //ASVal *se_len = se_start + 1; ctx->stack_ptr += 1; ASVal *res = &ctx->stack[ctx->stack_ptr]; uint32_t start = to_int(se_start); //uint32_t len = to_int(se_len); const char *str = (const char *)cls; uint32_t max_len = strlen(str); if (start > max_len) start = max_len; SET_STRING(res, str + start); // TODO: allocate new string and use len }
/* Set map style variables */ void set_map_vars(void) { SET_BOOL(show_page_border); SET_BOOL(show_page_title); SET_BOOL(show_map_border); SET_BOOL(show_map_title); SET_BOOL(show_tags); SET_COLOUR(map_background_colour); SET_COLOUR(map_border_colour); SET_COLOUR(map_title_colour); SET_COLOUR(page_background_colour); SET_COLOUR(page_border_colour); SET_COLOUR(page_title_colour); SET_FONT(map_title_font); SET_FONT(page_title_font); SET_REAL(font_scale); font_scale = V_MAX(font_scale, 0.1); SET_REAL(page_margin); SET_FONTSIZE(map_title_fontsize); SET_FONTSIZE(page_title_fontsize); SET_STRING(page_size); if (!get_papersize(page_size, &page_width, &page_height)) fatal("invalid paper size: %s", page_size); if (VAR_DEF("page_width")) SET_REAL(page_width); if (VAR_DEF("page_height")) SET_REAL(page_height); SET_REAL(room_size); room_size = V_MAX(room_size, 0.1); SET_REAL(room_width); SET_REAL(room_height); }
int Printer_postScriptSettings (void) { static UiForm *dia; if (dia == NULL) { UiForm::UiField *radio; dia = new UiForm (theCurrentPraatApplication -> topShell, L"PostScript settings", DO_Printer_postScriptSettings, NULL, L"PostScript settings...", L"PostScript settings..."); #if defined (_WIN32) || defined (macintosh) BOOLEAN (L"Allow direct PostScript", TRUE); #endif RADIO_ENUM (L"Grey resolution", kGraphicsPostscript_spots, DEFAULT) #if defined (UNIX) RADIO_ENUM (L"Paper size", kGraphicsPostscript_paperSize, DEFAULT); RADIO_ENUM (L"Orientation", kGraphicsPostscript_orientation, DEFAULT); POSITIVE (L"Magnification", L"1.0"); LABEL (L"label", L"Print command:"); #if defined (linux) TEXTFIELD (L"printCommand", L"lpr %s"); #else TEXTFIELD (L"printCommand", L"lp -c %s"); #endif #endif RADIO_ENUM (L"Font choice strategy", kGraphicsPostscript_fontChoiceStrategy, DEFAULT); #if defined (macintosh) BOOLEAN (L"EPS files include preview", TRUE); #endif dia->finish (); } #if defined (_WIN32) || defined (macintosh) SET_INTEGER (L"Allow direct PostScript", thePrinter. allowDirectPostScript); #endif SET_ENUM (L"Grey resolution", kGraphicsPostscript_spots, thePrinter. spots); #if defined (UNIX) SET_ENUM (L"Paper size", kGraphicsPostscript_paperSize, thePrinter. paperSize); SET_ENUM (L"Orientation", kGraphicsPostscript_orientation, thePrinter. orientation); SET_REAL (L"Magnification", thePrinter. magnification); SET_STRING (L"printCommand", Site_getPrintCommand ()); #endif SET_ENUM (L"Font choice strategy", kGraphicsPostscript_fontChoiceStrategy, thePrinter. fontChoiceStrategy); #if defined (macintosh) SET_INTEGER (L"EPS files include preview", thePrinter. epsFilesHavePreview); #endif dia->do_ (false); return 1; }
static void menu_cb_addToMenu (EDITOR_ARGS) { EDITOR_IAM (ScriptEditor); EDITOR_FORM (U"Add to menu", U"Add to fixed menu...") WORD (U"Window", U"?") SENTENCE (U"Menu", U"File") SENTENCE (U"Command", U"Do it...") SENTENCE (U"After command", U"") INTEGER (U"Depth", U"0") LABEL (U"", U"Script file:") TEXTFIELD (U"Script", U"") EDITOR_OK if (my editorClass) SET_STRING (U"Window", my editorClass -> className) if (my name [0]) SET_STRING (U"Script", my name) else SET_STRING (U"Script", U"(please save your script first)") EDITOR_DO praat_addMenuCommandScript (GET_STRING (U"Window"), GET_STRING (U"Menu"), GET_STRING (U"Command"), GET_STRING (U"After command"), GET_INTEGER (U"Depth"), GET_STRING (U"Script")); praat_show (); EDITOR_END }
void VlcProc::update_current_input() { input_thread_t* pInput = getIntf()->p_sys->p_input; if( !pInput ) return; input_item_t *pItem = input_GetItem( pInput ); if( pItem ) { // Update short name (as defined by --input-title-format) char *psz_fmt = var_InheritString( getIntf(), "input-title-format" ); char *psz_name = NULL; if( psz_fmt != NULL ) { psz_name = str_format_meta( pInput, psz_fmt ); free( psz_fmt ); } SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ? psz_name : "" ) ); free( psz_name ); // Update local path (if possible) or full uri char *psz_uri = input_item_GetURI( pItem ); char *psz_path = make_path( psz_uri ); char *psz_save = psz_path ? psz_path : psz_uri; SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_save ) ); free( psz_path ); free( psz_uri ); // Update art uri char *psz_art = input_item_GetArtURL( pItem ); SET_STRING( m_cVarStreamArt, string( psz_art ? psz_art : "" ) ); free( psz_art ); } }
static void menu_cb_addToFixedMenu (EDITOR_ARGS) { EDITOR_IAM (ScriptEditor); EDITOR_FORM (U"Add to fixed menu", U"Add to fixed menu..."); RADIO (U"Window", 1) RADIOBUTTON (U"Objects") RADIOBUTTON (U"Picture") SENTENCE (U"Menu", U"New") SENTENCE (U"Command", U"Do it...") SENTENCE (U"After command", U"") INTEGER (U"Depth", U"0") LABEL (U"", U"Script file:") TEXTFIELD (U"Script", U"") EDITOR_OK if (my name [0]) SET_STRING (U"Script", my name) else SET_STRING (U"Script", U"(please save your script first)") EDITOR_DO praat_addMenuCommandScript (GET_STRING (U"Window"), GET_STRING (U"Menu"), GET_STRING (U"Command"), GET_STRING (U"After command"), GET_INTEGER (U"Depth"), GET_STRING (U"Script")); praat_show (); EDITOR_END }
QString MPEGDescriptor::toString() const { QString str; if (DescriptorID::registration == DescriptorTag()) SET_STRING(RegistrationDescriptor); else if (DescriptorID::iso_639_language == DescriptorTag()) SET_STRING(ISO639LanguageDescriptor); else if (DescriptorID::avc_video == DescriptorTag()) SET_STRING(AVCVideoDescriptor); else if (DescriptorID::ac3_audio_stream == DescriptorTag()) SET_STRING(AudioStreamDescriptor); else if (DescriptorID::caption_service == DescriptorTag()) SET_STRING(CaptionServiceDescriptor); else if (DescriptorID::extended_channel_name == DescriptorTag()) SET_STRING(ExtendedChannelNameDescriptor); else if (DescriptorID::component_name == DescriptorTag()) SET_STRING(ComponentNameDescriptor); else if (DescriptorID::conditional_access == DescriptorTag()) SET_STRING(ConditionalAccessDescriptor); else if (DescriptorID::network_name == DescriptorTag()) SET_STRING(NetworkNameDescriptor); //else if (DescriptorID::linkage == DescriptorTag()) // SET_STRING(LinkageDescriptor); else if (DescriptorID::adaptation_field_data == DescriptorTag()) SET_STRING(AdaptationFieldDataDescriptor); //else if (DescriptorID::ancillary_data == DescriptorTag()) // SET_STRING(AncillaryDataDescriptor); else if (DescriptorID::cable_delivery_system == DescriptorTag()) SET_STRING(CableDeliverySystemDescriptor); else if (DescriptorID::satellite_delivery_system == DescriptorTag()) SET_STRING(SatelliteDeliverySystemDescriptor); else if (DescriptorID::terrestrial_delivery_system == DescriptorTag()) SET_STRING(TerrestrialDeliverySystemDescriptor); else if (DescriptorID::frequency_list == DescriptorTag()) SET_STRING(FrequencyListDescriptor); else if (DescriptorID::service == DescriptorTag()) SET_STRING(ServiceDescriptor); else if (DescriptorID::stream_identifier == DescriptorTag()) SET_STRING(StreamIdentifierDescriptor); else if (DescriptorID::default_authority == DescriptorTag()) SET_STRING(DefaultAuthorityDescriptor); else if (DescriptorID::bouquet_name == DescriptorTag()) SET_STRING(BouquetNameDescriptor); else if (DescriptorID::country_availability == DescriptorTag()) SET_STRING(CountryAvailabilityDescriptor); else if (DescriptorID::service_list == DescriptorTag()) SET_STRING(ServiceListDescriptor); else if (DescriptorID::scte_cue_identifier == DescriptorTag()) SET_STRING(CueIdentifierDescriptor); else if (DescriptorID::scte_revision_detection == DescriptorTag()) SET_STRING(RevisionDetectionDescriptor); else if (DescriptorID::teletext == DescriptorTag()) SET_STRING(TeletextDescriptor); /// POSSIBLY UNSAFE ! -- begin else if (PrivateDescriptorID::dvb_logical_channel_descriptor == DescriptorTag()) SET_STRING(DVBLogicalChannelDescriptor); /// POSSIBLY UNSAFE ! -- end else if (IsValid()) { str = QString("%1 Descriptor (0x%2) length(%3). Dumping\n") .arg(DescriptorTagString()) .arg(DescriptorTag(),2,16,QChar('0')) .arg(DescriptorLength()); //for (uint i=0; i<DescriptorLength(); i++) // str.append(QString(" 0x%1").arg(int(_data[i+2]), 0, 16)); str.append(hexdump()); } else { str = "Invalid Descriptor"; } return str; }
static void _parse_instance(config_t *config, xmlDocPtr doc, xmlNodePtr node) { instance_t *instance, *i; instance = (instance_t *)calloc(1, sizeof(instance_t)); _set_instance_defaults(instance); do { if (node == NULL) break; if (xmlIsBlankNode(node)) continue; if (strcmp(node->name, "hostname") == 0) SET_STRING(instance->hostname); else if (strcmp(node->name, "port") == 0) SET_INT(instance->port); else if (strcmp(node->name, "password") == 0) SET_STRING(instance->password); else if (strcmp(node->name, "username") == 0) SET_STRING(instance->user); else if (strcmp(node->name, "yp") == 0) SET_INT(instance->public_stream); else if (strcmp(node->name, "savefile") == 0) SET_STRING(instance->savefilename); else if (strcmp(node->name, "mount") == 0) SET_STRING(instance->mount); else if(strcmp(node->name, "reconnectdelay") == 0) SET_INT(instance->reconnect_delay); else if(strcmp(node->name, "reconnectattempts") == 0) SET_INT(instance->reconnect_attempts); else if(strcmp(node->name, "retry-initial") == 0) SET_INT(instance->retry_initial_connection); else if(strcmp(node->name, "maxqueuelength") == 0) SET_INT(instance->max_queue_length); else if(strcmp(node->name, "downmix") == 0) SET_INT(instance->downmix); else if(strcmp(node->name, "resample") == 0) _parse_resample(instance, doc, node->xmlChildrenNode); else if (strcmp(node->name, "encode") == 0) _parse_encode(instance, doc, node->xmlChildrenNode); else if (strcmp(node->name, "metadata") == 0) _parse_metadata(instance, config, doc, node->xmlChildrenNode); } while ((node = node->next)); instance->next = NULL; if (_using_default_instance) { _using_default_instance = 0; _free_instances(config->instances); config->instances = NULL; } if (config->instances == NULL) { config->instances = instance; } else { i = config->instances; while (i->next != NULL) i = i->next; i->next = instance; } }