2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // Central definitions of constants used to import/export
35 // XML-formatted data in Cortex.
38 // e.moon 8dec99 Begun
40 #ifndef __route_app_io_h__
41 #define __route_app_io_h__
43 #include "ImportContext.h"
44 #include "ExportContext.h"
47 #include <MediaDefs.h>
50 #include "cortex_defs.h"
51 __BEGIN_CORTEX_NAMESPACE
54 class NodeSetIOContext
;
56 // IPersistent elements
57 extern const char* const _DORMANT_NODE_ELEMENT
;
58 extern const char* const _LIVE_NODE_ELEMENT
;
59 extern const char* const _CONNECTION_ELEMENT
;
61 extern const char* const _NODE_GROUP_ELEMENT
;
63 // simple string-content elements
64 extern const char* const _NAME_ELEMENT
;
65 extern const char* const _FLAG_ELEMENT
;
66 extern const char* const _KIND_ELEMENT
;
67 extern const char* const _FLAVOR_ID_ELEMENT
;
68 extern const char* const _CYCLE_ELEMENT
;
69 extern const char* const _RUN_MODE_ELEMENT
;
70 extern const char* const _TIME_SOURCE_ELEMENT
;
71 extern const char* const _RECORDING_DELAY_ELEMENT
;
72 extern const char* const _REF_ELEMENT
;
74 // intermediate elements
75 extern const char* const _OUTPUT_ELEMENT
;
76 extern const char* const _INPUT_ELEMENT
;
77 extern const char* const _NODE_SET_ELEMENT
;
78 extern const char* const _UI_STATE_ELEMENT
;
80 // system-defined node keys
81 extern const char* const _AUDIO_INPUT_KEY
;
82 extern const char* const _AUDIO_OUTPUT_KEY
;
83 extern const char* const _AUDIO_MIXER_KEY
;
84 extern const char* const _VIDEO_INPUT_KEY
;
85 extern const char* const _VIDEO_OUTPUT_KEY
;
92 ExportContext
& context
);
94 void _write_node_kinds(
96 ExportContext
& context
);
101 ImportContext
& context
);
103 // fills in either key or outName/kind for the provided
104 // node. If the given node is one of the default system nodes,
105 // an appropriate 'preset' key value will be returned.
107 status_t
_get_node_signature(
108 const NodeManager
* manager
,
109 const NodeSetIOContext
* context
,
115 // given a name and kind, looks for a matching node
117 status_t
_match_node_signature(
120 media_node_id
* outNode
);
122 // given a key, looks for a system-default node
124 status_t
_match_system_node_key(
126 const NodeManager
* manager
,
127 media_node_id
* outNode
);
129 // adds mappings for the simple string-content elements to the
130 // given document type
132 void _add_string_elements(
133 XML::DocumentType
* docType
);
135 __END_CORTEX_NAMESPACE
136 #endif /*__route_app_io_h__*/