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 a user-instantiated
35 // media node description.
38 // e.moon 8dec99 Begun
40 #ifndef __ConnectionIO_H__
41 #define __ConnectionIO_H__
44 #include "Connection.h"
50 #include <MediaDefs.h>
52 class dormant_node_info
;
54 #include "cortex_defs.h"
55 __BEGIN_CORTEX_NAMESPACE
58 class NodeSetIOContext
;
64 public: // *** ctor/dtor
65 virtual ~ConnectionIO();
70 const Connection
* con
,
71 const NodeManager
* manager
,
72 const NodeSetIOContext
* context
);
74 bool exportValid() const { return m_exportValid
; }
76 public: // *** operations
78 // call when object imported to create the described
82 const NodeSetIOContext
* context
,
85 public: // *** document-type setup
87 XML::DocumentType
* docType
);
89 public: // *** IPersistent
94 ExportContext
& context
) const;
96 void xmlExportAttributes(
97 ExportContext
& context
) const;
99 void xmlExportContent(
100 ExportContext
& context
) const;
103 ExportContext
& context
) const;
107 virtual void xmlImportBegin(
108 ImportContext
& context
);
110 virtual void xmlImportAttribute(
113 ImportContext
& context
);
115 virtual void xmlImportContent(
118 ImportContext
& context
);
120 virtual void xmlImportChild(
122 ImportContext
& context
);
124 virtual void xmlImportComplete(
125 ImportContext
& context
);
128 virtual void xmlImportChildBegin(
130 ImportContext
& context
);
132 virtual void xmlImportChildComplete(
134 ImportContext
& context
);
136 private: // *** implementation
138 LiveNodeIO
* m_inputNodeIO
;
140 BString m_outputName
; // original name if available
141 media_format m_outputFormat
;
143 LiveNodeIO
* m_outputNodeIO
;
145 BString m_inputName
; // original name if available
146 media_format m_inputFormat
;
148 media_format m_requestedFormat
;
155 enum import_state_t
{
160 import_state_t m_importState
;
163 __END_CORTEX_NAMESPACE
164 #endif /*__ConnectionIO_H__*/