1 // ConnectionIO.h 2 // * PURPOSE 3 // Manage the import and export of a user-instantiated 4 // media node description. 5 // 6 // * HISTORY 7 // e.moon 8dec99 Begun 8 9 #ifndef __ConnectionIO_H__ 10 #define __ConnectionIO_H__ 11 12 #include "NodeRef.h" 13 #include "Connection.h" 14 #include "XML.h" 15 16 #include <String.h> 17 #include <Entry.h> 18 19 #include <MediaDefs.h> 20 21 class dormant_node_info; 22 23 #include "cortex_defs.h" 24 __BEGIN_CORTEX_NAMESPACE 25 26 class NodeManager; 27 class NodeSetIOContext; 28 class LiveNodeIO; 29 30 class ConnectionIO : 31 public IPersistent { 32 33 public: // *** ctor/dtor 34 virtual ~ConnectionIO(); 35 36 ConnectionIO(); 37 38 ConnectionIO( 39 const Connection* con, 40 const NodeManager* manager, 41 const NodeSetIOContext* context); 42 43 bool exportValid() const { return m_exportValid; } 44 45 public: // *** operations 46 47 // call when object imported to create the described 48 // connection 49 status_t instantiate( 50 NodeManager* manager, 51 const NodeSetIOContext* context, 52 Connection* outCon); 53 54 public: // *** document-type setup 55 static void AddTo( 56 XML::DocumentType* docType); 57 58 public: // *** IPersistent 59 60 // EXPORT: 61 62 void xmlExportBegin( 63 ExportContext& context) const; 64 65 void xmlExportAttributes( 66 ExportContext& context) const; 67 68 void xmlExportContent( 69 ExportContext& context) const; 70 71 void xmlExportEnd( 72 ExportContext& context) const; 73 74 // IMPORT: 75 76 virtual void xmlImportBegin( 77 ImportContext& context); 78 79 virtual void xmlImportAttribute( 80 const char* key, 81 const char* value, 82 ImportContext& context); 83 84 virtual void xmlImportContent( 85 const char* data, 86 uint32 length, 87 ImportContext& context); 88 89 virtual void xmlImportChild( 90 IPersistent* child, 91 ImportContext& context); 92 93 virtual void xmlImportComplete( 94 ImportContext& context); 95 96 97 virtual void xmlImportChildBegin( 98 const char* name, 99 ImportContext& context); 100 101 virtual void xmlImportChildComplete( 102 const char* name, 103 ImportContext& context); 104 105 private: // *** implementation 106 107 LiveNodeIO* m_inputNodeIO; 108 109 BString m_outputName; // original name if available 110 media_format m_outputFormat; 111 112 LiveNodeIO* m_outputNodeIO; 113 114 BString m_inputName; // original name if available 115 media_format m_inputFormat; 116 117 media_format m_requestedFormat; 118 119 uint32 m_flags; 120 121 bool m_exportValid; 122 123 // import state 124 enum import_state_t { 125 IMPORT_NONE, 126 IMPORT_OUTPUT, 127 IMPORT_INPUT 128 }; 129 import_state_t m_importState; 130 }; 131 132 __END_CORTEX_NAMESPACE 133 #endif /*__ConnectionIO_H__*/