~ubuntu-branches/ubuntu/trusty/muse/trusty

« back to all changes in this revision

Viewing changes to doc/html/split/developer_docs/node4.html

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-08-28 16:25:57 UTC
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: package-import@ubuntu.com-20130828162557-knls3ip7j262eepx
Tags: upstream-2.1.2
ImportĀ upstreamĀ versionĀ 2.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
 
 
3
<!--Converted with LaTeX2HTML 2008 (1.71)
 
4
original version by:  Nikos Drakos, CBLU, University of Leeds
 
5
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
 
6
* with significant contributions from:
 
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
 
8
<HTML>
 
9
<HEAD>
 
10
<TITLE>Configuration</TITLE>
 
11
<META NAME="description" CONTENT="Configuration">
 
12
<META NAME="keywords" CONTENT="developer_docs">
 
13
<META NAME="resource-type" CONTENT="document">
 
14
<META NAME="distribution" CONTENT="global">
 
15
 
 
16
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
 
17
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
 
18
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
 
19
 
 
20
<LINK REL="STYLESHEET" HREF="developer_docs.css">
 
21
 
 
22
<LINK REL="next" HREF="node5.html">
 
23
<LINK REL="previous" HREF="node3.html">
 
24
<LINK REL="up" HREF="node2.html">
 
25
<LINK REL="next" HREF="node5.html">
 
26
</HEAD>
 
27
 
 
28
<BODY >
 
29
 
 
30
<DIV CLASS="navigation"><!--Navigation Panel-->
 
31
<A NAME="tex2html102"
 
32
  HREF="node5.html">
 
33
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 
34
 SRC="/usr/share/latex2html/icons/next.png"></A> 
 
35
<A NAME="tex2html98"
 
36
  HREF="node2.html">
 
37
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 
38
 SRC="/usr/share/latex2html/icons/up.png"></A> 
 
39
<A NAME="tex2html92"
 
40
  HREF="node3.html">
 
41
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 
42
 SRC="/usr/share/latex2html/icons/prev.png"></A> 
 
43
<A NAME="tex2html100"
 
44
  HREF="node1.html">
 
45
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 
46
 SRC="/usr/share/latex2html/icons/contents.png"></A>  
 
47
<BR>
 
48
<B> Next:</B> <A NAME="tex2html103"
 
49
  HREF="node5.html">User controls and automation</A>
 
50
<B> Up:</B> <A NAME="tex2html99"
 
51
  HREF="node2.html">Internals - how it</A>
 
52
<B> Previous:</B> <A NAME="tex2html93"
 
53
  HREF="node3.html">User interface programming</A>
 
54
 &nbsp; <B>  <A NAME="tex2html101"
 
55
  HREF="node1.html">Contents</A></B> 
 
56
<BR>
 
57
<BR></DIV>
 
58
<!--End of Navigation Panel-->
 
59
<!--Table of Child-Links-->
 
60
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
 
61
 
 
62
<UL CLASS="ChildLinks">
 
63
<LI><UL>
 
64
<LI><UL>
 
65
<LI><A NAME="tex2html104"
 
66
  HREF="node4.html#SECTION00220010000000000000">Reading configuration</A>
 
67
<LI><A NAME="tex2html105"
 
68
  HREF="node4.html#SECTION00220020000000000000">Writing configuration</A>
 
69
<LI><A NAME="tex2html106"
 
70
  HREF="node4.html#SECTION00220030000000000000">Song state</A>
 
71
<LI><A NAME="tex2html107"
 
72
  HREF="node4.html#SECTION00220040000000000000">How to add new items</A>
 
73
</UL></UL></UL>
 
74
<!--End of Table of Child-Links-->
 
75
<HR>
 
76
 
 
77
<H1><A NAME="SECTION00220000000000000000"></A> <A NAME="portconfig_sucks"></A>
 
78
<BR>
 
79
Configuration
 
80
</H1>
 
81
Configuration is a bit pesky in MusE in its current state. If you get
 
82
confused by reading this chapter, that's a sign of a sane mind.
 
83
 
 
84
<P>
 
85
There are three kinds of configuration items:
 
86
 
 
87
<UL>
 
88
<LI>(1) Global configuration, like coloring schemes, plugin categories, MDI-ness settings
 
89
</LI>
 
90
<LI>(2) Per-Song configuration, like whether to show or hide certain track types in the arranger
 
91
</LI>
 
92
<LI>(3) Something in between, like MIDI port settings etc. They obviously actually are
 
93
      global configuration issues (or ought to be), but also obviously must be stored
 
94
      in the song file for portability. (This problem could possibly be solved by
 
95
      the feature proposal in <A HREF="node15.html#symbolic_ports">3.7</A>.
 
96
</LI>
 
97
</UL>
 
98
 
 
99
<P>
 
100
 
 
101
<H4><A NAME="SECTION00220010000000000000">
 
102
Reading configuration</A>
 
103
</H4>
 
104
<TT>fterfirstv`v=95 _ `v=58 : 
 
105
      `v&gt;64
 
106
        `v&lt;91 vvv
 
107
 
 
108
                            <`<=95 _ `<=58 : 
 
109
      `<&gt;64
 
110
        `<&lt;91 <<<
 
111
 
 
112
                            c@amelhyph<269>>oid MusECore::readConfiguration(Xml&amp;, bool, bool)</TT> in
 
113
<TT>fterfirstc`c=95 _ `c=58 : 
 
114
      `c&gt;64
 
115
        `c&lt;91 ccc
 
116
 
 
117
                            <`<=95 _ `<=58 : 
 
118
      `<&gt;64
 
119
        `<&lt;91 <<<
 
120
 
 
121
                            c@amelhyph<269>>onf.cpp</TT> is the central point
 
122
of reading configuration. It is called when MusE is started first
 
123
(by <TT>fterfirstb`b=95 _ `b=58 : 
 
124
      `b&gt;64
 
125
        `b&lt;91 bbb
 
126
 
 
127
                            <`<=95 _ `<=58 : 
 
128
      `<&gt;64
 
129
        `<&lt;91 <<<
 
130
 
 
131
                            c@amelhyph<269>>ool MusECore::readConfiguration()</TT>), and also when a
 
132
song is loaded. 
 
133
<BR>It can be instructed whether to read MIDI ports (3), global configuration
 
134
and MIDI ports (1+3). Per-Song configuration is always read (2).
 
135
 
 
136
<P>
 
137
When adding new configuration items and thus altering <TT>fterfirstr`r=95 _ `r=58 : 
 
138
      `r&gt;64
 
139
        `r&lt;91 rrr
 
140
 
 
141
                            <`<=95 _ `<=58 : 
 
142
      `<&gt;64
 
143
        `<&lt;91 <<<
 
144
 
 
145
                            c@amelhyph<269>>eadConfiguration()</TT>,
 
146
you must take care to place your item into the correct section. The code is
 
147
divided into the following sections:
 
148
 
 
149
<UL>
 
150
<LI>Global and/or per-song configuration (3)
 
151
</LI>
 
152
<LI>Global configuration (1)
 
153
</LI>
 
154
<LI>Code for skipping obsolete entries
 
155
</LI>
 
156
</UL>
 
157
 
 
158
<P>
 
159
The sections are divided by comments (they contain <TT>--</TT>, so just
 
160
search for them). Please do not just remove code for reading obsolete entries,
 
161
but always add an appropriate entry to the 'skipping' section in order to
 
162
prevent error messages when reading old configs.
 
163
 
 
164
<P>
 
165
 
 
166
<H4><A NAME="SECTION00220020000000000000">
 
167
Writing configuration</A>
 
168
</H4>
 
169
Global configuration is written using the
 
170
<TT>fterfirstM`M=95 _ `M=58 : 
 
171
      `M&gt;64
 
172
        `M&lt;91 MMM
 
173
 
 
174
                            <`<=95 _ `<=58 : 
 
175
      `<&gt;64
 
176
        `<&lt;91 <<<
 
177
 
 
178
                            c@amelhyph<269>>usEGui::MusE::writeGlobalConfiguration()</TT> functions, while
 
179
per-song-config is written by <TT>fterfirstM`M=95 _ `M=58 : 
 
180
      `M&gt;64
 
181
        `M&lt;91 MMM
 
182
 
 
183
                            <`<=95 _ `<=58 : 
 
184
      `<&gt;64
 
185
        `<&lt;91 <<<
 
186
 
 
187
                            c@amelhyph<269>>usEGui::MusE::writeConfiguration()</TT>
 
188
(notice the missing <TT>fterfirstG`G=95 _ `G=58 : 
 
189
      `G&gt;64
 
190
        `G&lt;91 GGG
 
191
 
 
192
                            <`<=95 _ `<=58 : 
 
193
      `<&gt;64
 
194
        `<&lt;91 <<<
 
195
 
 
196
                            c@amelhyph<269>>lobal</TT>; both implemented in <TT>fterfirstc`c=95 _ `c=58 : 
 
197
      `c&gt;64
 
198
        `c&lt;91 ccc
 
199
 
 
200
                            <`<=95 _ `<=58 : 
 
201
      `<&gt;64
 
202
        `<&lt;91 <<<
 
203
 
 
204
                            c@amelhyph<269>>onf.cpp</TT>).
 
205
 
 
206
<P>
 
207
<TT>fterfirstw`w=95 _ `w=58 : 
 
208
      `w&gt;64
 
209
        `w&lt;91 www
 
210
 
 
211
                            <`<=95 _ `<=58 : 
 
212
      `<&gt;64
 
213
        `<&lt;91 <<<
 
214
 
 
215
                            c@amelhyph<269>>riteConfiguration</TT> is actually just a subset of the code in
 
216
<TT>fterfirstw`w=95 _ `w=58 : 
 
217
      `w&gt;64
 
218
        `w&lt;91 www
 
219
 
 
220
                            <`<=95 _ `<=58 : 
 
221
      `<&gt;64
 
222
        `<&lt;91 <<<
 
223
 
 
224
                            c@amelhyph<269>>riteGlobalConfiguration</TT>. <SPAN  CLASS="textbf">Duplicate code!</SPAN>                  
 
225
<P>
 
226
 
 
227
<H4><A NAME="SECTION00220030000000000000">
 
228
Song state</A>
 
229
</H4>
 
230
Additionally to per-song configuration, there is the song's state.
 
231
This contains "the song", that is all tracks, parts and note events,
 
232
together with information about the currently opened windows, their
 
233
position, size, settings and so on. Adding new items here is actually
 
234
pretty painless: Configuration is read and written using
 
235
<TT>fterfirstM`M=95 _ `M=58 : 
 
236
      `M&gt;64
 
237
        `M&lt;91 MMM
 
238
 
 
239
                            <`<=95 _ `<=58 : 
 
240
      `<&gt;64
 
241
        `<&lt;91 <<<
 
242
 
 
243
                            c@amelhyph<269>>usECore::Song::read</TT> and <TT>fterfirst:`:=95 _ `:=58 : 
 
244
      `:&gt;64
 
245
        `:&lt;91 :::
 
246
 
 
247
                            <`<=95 _ `<=58 : 
 
248
      `<&gt;64
 
249
        `<&lt;91 <<<
 
250
 
 
251
                            c@amelhyph<269>>:write</TT>, both implemented in
 
252
<TT>fterfirsts`s=95 _ `s=58 : 
 
253
      `s&gt;64
 
254
        `s&lt;91 sss
 
255
 
 
256
                            <`<=95 _ `<=58 : 
 
257
      `<&gt;64
 
258
        `<&lt;91 <<<
 
259
 
 
260
                            c@amelhyph<269>>ongfile.cpp</TT>. There are no caveats.
 
261
 
 
262
<P>
 
263
 
 
264
<H4><A NAME="SECTION00220040000000000000">
 
265
How to add new items</A>
 
266
</H4>
 
267
When adding global configuration items, then add them into the second
 
268
block ("global configuration") in <TT>fterfirstr`r=95 _ `r=58 : 
 
269
      `r&gt;64
 
270
        `r&lt;91 rrr
 
271
 
 
272
                            <`<=95 _ `<=58 : 
 
273
      `<&gt;64
 
274
        `<&lt;91 <<<
 
275
 
 
276
                            c@amelhyph<269>>eadConfiguration</TT> and into
 
277
<TT>fterfirstw`w=95 _ `w=58 : 
 
278
      `w&gt;64
 
279
        `w&lt;91 www
 
280
 
 
281
                            <`<=95 _ `<=58 : 
 
282
      `<&gt;64
 
283
        `<&lt;91 <<<
 
284
 
 
285
                            c@amelhyph<269>>riteGlobalConfiguration</TT>.
 
286
 
 
287
<P>
 
288
When adding just-per-song items, better don't bother to touch the
 
289
"configuration" code and just add it to the song's state (there might
 
290
be rare exceptions).
 
291
 
 
292
<P>
 
293
When adding global configuration items, make sure you add them into the
 
294
correct section of <TT>fterfirstr`r=95 _ `r=58 : 
 
295
      `r&gt;64
 
296
        `r&lt;91 rrr
 
297
 
 
298
                            <`<=95 _ `<=58 : 
 
299
      `<&gt;64
 
300
        `<&lt;91 <<<
 
301
 
 
302
                            c@amelhyph<269>>eadConfiguration</TT>, and into <TT>fterfirstw`w=95 _ `w=58 : 
 
303
      `w&gt;64
 
304
        `w&lt;91 www
 
305
 
 
306
                            <`<=95 _ `<=58 : 
 
307
      `<&gt;64
 
308
        `<&lt;91 <<<
 
309
 
 
310
                            c@amelhyph<269>>riteGlobalConfiguration</TT>.
 
311
 
 
312
<P>
 
313
 
 
314
<DIV CLASS="navigation"><HR>
 
315
<!--Navigation Panel-->
 
316
<A NAME="tex2html102"
 
317
  HREF="node5.html">
 
318
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 
319
 SRC="/usr/share/latex2html/icons/next.png"></A> 
 
320
<A NAME="tex2html98"
 
321
  HREF="node2.html">
 
322
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 
323
 SRC="/usr/share/latex2html/icons/up.png"></A> 
 
324
<A NAME="tex2html92"
 
325
  HREF="node3.html">
 
326
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 
327
 SRC="/usr/share/latex2html/icons/prev.png"></A> 
 
328
<A NAME="tex2html100"
 
329
  HREF="node1.html">
 
330
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 
331
 SRC="/usr/share/latex2html/icons/contents.png"></A>  
 
332
<BR>
 
333
<B> Next:</B> <A NAME="tex2html103"
 
334
  HREF="node5.html">User controls and automation</A>
 
335
<B> Up:</B> <A NAME="tex2html99"
 
336
  HREF="node2.html">Internals - how it</A>
 
337
<B> Previous:</B> <A NAME="tex2html93"
 
338
  HREF="node3.html">User interface programming</A>
 
339
 &nbsp; <B>  <A NAME="tex2html101"
 
340
  HREF="node1.html">Contents</A></B> </DIV>
 
341
<!--End of Navigation Panel-->
 
342
 
 
343
</BODY>
 
344
</HTML>