BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / cortex / RouteApp / route_app_io.h
blob303981b435f2ae8e3af4014a0ddd18227e987186
1 /*
2 * Copyright (c) 1999-2000, Eric Moon.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
32 // route_app_io.h
33 // * PURPOSE
34 // Central definitions of constants used to import/export
35 // XML-formatted data in Cortex.
37 // * HISTORY
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"
45 #include "XML.h"
47 #include <MediaDefs.h>
48 #include <String.h>
50 #include "cortex_defs.h"
51 __BEGIN_CORTEX_NAMESPACE
53 class NodeManager;
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;
87 // helper functions
89 void _write_simple(
90 const char* element,
91 const char* value,
92 ExportContext& context);
94 void _write_node_kinds(
95 int64 kinds,
96 ExportContext& context);
98 void _read_node_kind(
99 int64& ioKind,
100 const char* data,
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,
110 media_node_id node,
111 BString& outKey,
112 BString& outName,
113 int64& outKind);
115 // given a name and kind, looks for a matching node
117 status_t _match_node_signature(
118 const char* name,
119 int64 kind,
120 media_node_id* outNode);
122 // given a key, looks for a system-default node
124 status_t _match_system_node_key(
125 const char* 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__*/