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 // Manage the import and export of an 'existing node'
35 // descriptor -- which refers to a system node
36 // (video input, audio mixer, etc.,) a dormant node
37 // described in the same document, or some other external
40 // In the first two cases, the node is described by a key
41 // string; the following preset key strings correspond to
52 // There's no way to describe a particular live node instance
53 // in a persistent fashion (an instance of the same node created
54 // in the future will have a different node ID.) At the moment,
55 // LiveNodeIO describes such nodes via two pieces of information:
57 // - the node's 'kind' bitmask
60 // e.moon 20dec99 begun
62 #ifndef __LiveNodeIO_H__
63 #define __LiveNodeIO_H__
71 #include "cortex_defs.h"
72 __BEGIN_CORTEX_NAMESPACE
75 class NodeSetIOContext
;
80 public: // *** ctor/dtor
81 virtual ~LiveNodeIO();
85 const NodeManager
* manager
,
86 const NodeSetIOContext
* context
,
89 bool exportValid() const { return m_exportValid
; }
91 // if true, call key() to fetch the key string; otherwise,
93 bool hasKey() const { return m_key
.Length() > 0; }
95 const char* key() const { return m_key
.String(); }
97 const char* name() const { return m_name
.String(); }
98 int64
kind() const { return m_kind
; }
100 public: // *** import operations
102 // locate the referenced live node
104 const NodeManager
* manager
,
105 const NodeSetIOContext
* context
,
106 media_node_id
* outNode
) const;
108 public: // *** document-type setup
110 XML::DocumentType
* docType
);
112 public: // *** IPersistent
117 ExportContext
& context
) const;
119 void xmlExportAttributes(
120 ExportContext
& context
) const;
122 void xmlExportContent(
123 ExportContext
& context
) const;
126 ExportContext
& context
) const;
131 ImportContext
& context
);
133 void xmlImportAttribute(
136 ImportContext
& context
);
138 void xmlImportContent(
141 ImportContext
& context
);
145 ImportContext
& context
);
147 void xmlImportComplete(
148 ImportContext
& context
);
150 private: // *** implementation
159 __END_CORTEX_NAMESPACE
160 #endif /*__LiveNodeIO_H__*/