comparison document/SVFileReader.cpp @ 127:fbd09fcda469

* doc updates
author Chris Cannam
date Fri, 30 Mar 2007 17:16:48 +0000
parents b4110b17bca8
children 006c90387f40
comparison
equal deleted inserted replaced
126:8d31c8e9c820 127:fbd09fcda469
38 #include <QString> 38 #include <QString>
39 #include <QMessageBox> 39 #include <QMessageBox>
40 #include <QFileDialog> 40 #include <QFileDialog>
41 41
42 #include <iostream> 42 #include <iostream>
43
44 /*
45 Some notes about the SV XML format. We're very lazy with our XML:
46 there's no schema or DTD, and we depend heavily on elements being
47 in a particular order.
48
49 <sv>
50
51 <data>
52
53 <!-- The data section contains definitions of both models and
54 visual layers. Layers are considered data in the document;
55 the structure of views that displays the layers is not. -->
56
57 <!-- id numbers are unique within the data type (i.e. no two
58 models can have the same id, but a model can have the same
59 id as a layer, etc). SV generates its id numbers just for
60 the purpose of cross-referencing within the current file;
61 they don't necessarily have any meaning once the file has
62 been loaded. -->
63
64 <model id="0" name="..." type="..." ... />
65 <model id="1" name="..." type="..." ... />
66
67 <!-- Models that have data associated with them store it
68 in a neighbouring dataset element. The dataset must follow
69 the model and precede any derivation or layer elements that
70 refer to the model. -->
71
72 <model id="2" name="..." type="..." dataset="0" ... />
73
74 <dataset id="0" type="...">
75 <point frame="..." value="..." ... />
76 </dataset>
77
78 <!-- Where one model is derived from another via a transform,
79 it has an associated derivation element. This must follow
80 both the source and target model elements. The source and
81 model attributes give the source model id and target model
82 id respectively. A model can have both dataset and
83 derivation elements; if it does, dataset must appear first.
84 If the model's data are not stored, but instead the model
85 is to be regenerated completely from the transform when
86 the session is reloaded, then the model should have _only_
87 a derivation element, and no model element should appear
88 for it at all. -->
89
90 <derivation source="0" model="2" transform="..." ...>
91 <plugin id="..." ... />
92 </derivation>
93
94 <!-- The playparameters element lists playback settings for
95 a model. -->
96
97 <playparameters mute="false" pan="0" gain="1" model="1" ... />
98
99 <!-- Layer elements. The models must have already been defined.
100 The same model may appear in more than one layer (of more
101 than one type). -->
102
103 <layer id="1" type="..." name="..." model="0" ... />
104 <layer id="2" type="..." name="..." model="1" ... />
105
106 </data>
107
108
109 <display>
110
111 <!-- The display element contains visual structure for the
112 layers. It's simpler than the data section. -->
113
114 <!-- Overall preferred window size for this session. -->
115
116 <window width="..." height="..."/>
117
118 <!-- List of view elements to stack up. Each one contains
119 a list of layers in stacking order, back to front. -->
120
121 <view type="pane" ...>
122 <layer id="1"/>
123 <layer id="2"/>
124 </view>
125
126 <!-- The layer elements just refer to layers defined in the
127 data section, so they don't have to have any attributes
128 other than the id. For sort-of-historical reasons SV
129 actually does repeat the other attributes here, but
130 it doesn't need to. -->
131
132 <view type="pane" ...>
133 <layer id="2"/>
134 <view>
135
136 </display>
137
138
139 <!-- List of selected regions by audio frame extents. -->
140
141 <selections>
142 <selection start="..." end="..."/>
143 </selections>
144
145
146 </sv>
147
148 */
149
150 43
151 SVFileReader::SVFileReader(Document *document, 44 SVFileReader::SVFileReader(Document *document,
152 SVFileReaderPaneCallback &callback, 45 SVFileReaderPaneCallback &callback,
153 QString location) : 46 QString location) :
154 m_document(document), 47 m_document(document),