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