本文整理汇总了C++中ExportContext::beginElement方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportContext::beginElement方法的具体用法?C++ ExportContext::beginElement怎么用?C++ ExportContext::beginElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportContext
的用法示例。
在下文中一共展示了ExportContext::beginElement方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xmlExportBegin
void MediaFormatIO::xmlExportBegin(
ExportContext& context) const {
switch(m_format.type) {
case B_MEDIA_RAW_AUDIO:
context.beginElement(s_raw_audio_tag);
break;
case B_MEDIA_RAW_VIDEO:
context.beginElement(s_raw_video_tag);
break;
case B_MEDIA_MULTISTREAM:
context.beginElement(s_multistream_tag);
break;
case B_MEDIA_ENCODED_AUDIO:
context.beginElement(s_encoded_audio_tag);
break;
case B_MEDIA_ENCODED_VIDEO:
context.beginElement(s_encoded_video_tag);
break;
default:
// +++++ not very polite
context.reportError("MediaFormatIO: type not supported\n");
break;
}
}
示例2: export_multistream_content
void export_multistream_content(
const media_multistream_format& f,
ExportContext& context) {
context.beginContent();
// write flags
context.beginElement(MediaFormatIO::s_multistream_flags_tag);
export_multistream_flags_attr(f.flags, context);
context.endElement();
// write format-specific info
if(f.format == media_multistream_format::B_VID) {
context.beginElement(MediaFormatIO::s_multistream_vid_info_tag);
export_multistream_vid_info_attr(f.u.vid, context);
context.endElement();
}
else if(f.format == media_multistream_format::B_AVI) {
context.beginElement(MediaFormatIO::s_multistream_avi_info_tag);
export_multistream_avi_info_attr(f.u.avi, context);
context.beginContent();
export_multistream_avi_info_content(f.u.avi, context);
context.endElement();
}
}
示例3: export_raw_video_content
void export_raw_video_content(
const media_raw_video_format& f,
ExportContext& context) {
context.beginContent();
context.beginElement(MediaFormatIO::s_video_display_info_tag);
export_video_display_info_attr(f.display, context);
context.endElement();
}
示例4: export_encoded_video_content
void export_encoded_video_content(
const media_encoded_video_format& f,
ExportContext& context) {
context.beginContent();
context.beginElement(MediaFormatIO::s_raw_video_tag);
export_raw_video_attr(f.output, context);
context.endElement();
}
示例5: write_media_type
void write_media_type(
media_type t,
ExportContext& context) {
context.beginElement(MediaFormatIO::s_media_type_tag);
context.beginContent();
switch(t) {
case B_MEDIA_NO_TYPE:
context.writeString("B_MEDIA_NO_TYPE");
break;
case B_MEDIA_UNKNOWN_TYPE:
context.writeString("B_MEDIA_UNKNOWN_TYPE");
break;
case B_MEDIA_RAW_AUDIO:
context.writeString("B_MEDIA_RAW_AUDIO");
break;
case B_MEDIA_RAW_VIDEO:
context.writeString("B_MEDIA_RAW_VIDEO");
break;
case B_MEDIA_VBL:
context.writeString("B_MEDIA_VBL");
break;
case B_MEDIA_TIMECODE:
context.writeString("B_MEDIA_TIMECODE");
break;
case B_MEDIA_MIDI:
context.writeString("B_MEDIA_MIDI");
break;
case B_MEDIA_TEXT:
context.writeString("B_MEDIA_TEXT");
break;
case B_MEDIA_HTML:
context.writeString("B_MEDIA_HTML");
break;
case B_MEDIA_MULTISTREAM:
context.writeString("B_MEDIA_MULTISTREAM");
break;
case B_MEDIA_PARAMETERS:
context.writeString("B_MEDIA_PARAMETERS");
break;
case B_MEDIA_ENCODED_AUDIO:
context.writeString("B_MEDIA_ENCODED_AUDIO");
break;
case B_MEDIA_ENCODED_VIDEO:
context.writeString("B_MEDIA_ENCODED_VIDEO");
break;
default: {
BString val;
val << (uint32)t;
context.writeString(val);
}
}
context.endElement();
}
示例6: xmlExportBegin
// -------------------------------------------------------- //
void ConnectionIO::xmlExportBegin(
ExportContext& context) const {
if(!m_exportValid) {
context.reportError(
"ConnectionIO::xmlExportBegin():\n"
"*** invalid ***\n");
return;
}
context.beginElement(_CONNECTION_ELEMENT);
}
示例7: export_encoded_audio_content
void export_encoded_audio_content(
const media_encoded_audio_format& f,
ExportContext& context) {
context.beginContent();
context.beginElement(MediaFormatIO::s_raw_audio_tag);
export_raw_audio_attr(f.output, context);
#if B_BEOS_VERSION > B_BEOS_VERSION_4_5
export_multi_audio_info_attr(f.multi_info, context);
#endif
context.endElement();
}
示例8: xmlExportBegin
void RouteAppNodeManager::xmlExportBegin(
ExportContext& context) const {
status_t err;
try {
NodeSetIOContext& set = dynamic_cast<NodeSetIOContext&>(context);
context.beginElement(_NODE_SET_ELEMENT);
// validate the node set
for(int n = set.countNodes()-1; n >= 0; --n) {
media_node_id id = set.nodeAt(n);
ASSERT(id != media_node::null.node);
// fetch node
NodeRef* ref;
err = getNodeRef(id, &ref);
if(err < B_OK) {
D_SETTINGS((
"! RVNM::xmlExportBegin(): node %ld doesn't exist\n", id));
set.removeNodeAt(n);
continue;
}
// skip unless internal
if(!ref->isInternal()) {
D_SETTINGS((
"! RVNM::xmlExportBegin(): node %ld not internal; skipping.\n", id));
set.removeNodeAt(n);
continue;
}
}
}
catch(bad_cast& e) {
context.reportError("RouteAppNodeManager: expected a NodeSetIOContext\n");
}
}
示例9: xmlExportContent
void ConnectionIO::xmlExportContent(
ExportContext& context) const {
context.beginContent();
// write output
{
context.beginElement(_OUTPUT_ELEMENT);
context.beginContent();
// describe the node
// LiveNodeIO nodeIO(
// m_manager,
// dynamic_cast<NodeSetIOContext*>(&context),
// m_outputNode);
context.writeObject(m_outputNodeIO);
// context.beginElement(_LIVE_NODE_ELEMENT);
// if(m_outputNodeKey.Length()) {
// context.writeAttr("key", m_outputNodeKey);
// }
// else {
// _write_simple("name", m_outputNodeName.String(), context);
// _write_node_kinds(m_outputNodeKind, context);
// }
// context.endElement(); // _LIVE_NODE_ELEMENT
// describe the output
_write_simple("name", m_outputName.String(), context);
if(m_outputFormat.type > B_MEDIA_UNKNOWN_TYPE) {
MediaFormatIO io(m_outputFormat);
context.writeObject(&io);
}
context.endElement(); // _OUTPUT_ELEMENT
}
// write input
{
context.beginElement(_INPUT_ELEMENT);
context.beginContent();
// describe the node
// LiveNodeIO nodeIO(
// m_manager,
// dynamic_cast<NodeSetIOContext*>(&context),
// m_inputNode);
context.writeObject(m_inputNodeIO);
// context.beginElement(_LIVE_NODE_ELEMENT);
// if(m_inputNodeKey.Length()) {
// context.writeAttr("key", m_inputNodeKey);
// }
// else {
// _write_simple("name", m_inputNodeName.String(), context);
// _write_node_kinds(m_inputNodeKind, context);
// }
// context.endElement(); // _LIVE_NODE_ELEMENT
// describe the input
_write_simple("name", m_inputName.String(), context);
if(m_inputFormat.type > B_MEDIA_UNKNOWN_TYPE) {
MediaFormatIO io(m_inputFormat);
context.writeObject(&io);
}
context.endElement(); // _INPUT_ELEMENT
}
// write requested format
if(m_requestedFormat.type > B_MEDIA_UNKNOWN_TYPE) {
MediaFormatIO io(m_requestedFormat);
BString comment = "\n";
comment << context.indentString();
comment << "<!-- initial requested format -->";
context.writeString(comment);
context.writeObject(&io);
}
}
示例10: xmlExportBegin
void NodeKey::xmlExportBegin(
ExportContext& context) const {
context.beginElement(s_element);
}
示例11: xmlExportBegin
void FlatMessageIO::xmlExportBegin(
ExportContext& context) const {
context.beginElement(s_element);
}
示例12: xmlExportContent
void RouteAppNodeManager::xmlExportContent(
ExportContext& context) const {
status_t err;
try {
NodeSetIOContext& nodeSet = dynamic_cast<NodeSetIOContext&>(context);
context.beginContent();
// write nodes; enumerate connections
typedef map<uint32,Connection> connection_map;
connection_map connections;
int count = nodeSet.countNodes();
for(int n = 0; n < count; ++n) {
media_node_id id = nodeSet.nodeAt(n);
ASSERT(id != media_node::null.node);
// fetch node
NodeRef* ref;
err = getNodeRef(id, &ref);
if(err < B_OK) {
D_SETTINGS((
"! RouteAppNodeManager::xmlExportContent():\n"
" getNodeRef(%ld) failed: '%s'\n",
id, strerror(err)));
continue;
}
// fetch connections
vector<Connection> conSet;
ref->getInputConnections(conSet);
ref->getOutputConnections(conSet);
for(uint32 c = 0; c < conSet.size(); ++c)
// non-unique connections will be rejected:
connections.insert(
connection_map::value_type(conSet[c].id(), conSet[c]));
// create an IO object for the node & write it
DormantNodeIO io(ref, nodeSet.keyAt(n));
if(context.writeObject(&io) < B_OK)
// abort
return;
}
// write connections
for(connection_map::const_iterator it = connections.begin();
it != connections.end(); ++it) {
ConnectionIO io(
&(*it).second,
this,
&nodeSet);
if(context.writeObject(&io) < B_OK)
// abort
return;
}
// +++++ write groups
// write UI state
{
BMessage m;
nodeSet.exportUIState(&m);
context.beginElement(_UI_STATE_ELEMENT);
context.beginContent();
MessageIO io(&m);
context.writeObject(&io);
context.endElement();
}
}
catch(bad_cast& e) {
context.reportError("RouteAppNodeManager: expected a NodeSetIOContext\n");
}
}