1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
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 -->
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">
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">
20
<LINK REL="STYLESHEET" HREF="developer_docs.css">
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">
30
<DIV CLASS="navigation"><!--Navigation Panel-->
33
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
34
SRC="/usr/share/latex2html/icons/next.png"></A>
37
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
38
SRC="/usr/share/latex2html/icons/up.png"></A>
41
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
42
SRC="/usr/share/latex2html/icons/prev.png"></A>
45
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
46
SRC="/usr/share/latex2html/icons/contents.png"></A>
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
<B> <A NAME="tex2html101"
55
HREF="node1.html">Contents</A></B>
58
<!--End of Navigation Panel-->
59
<!--Table of Child-Links-->
60
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
62
<UL CLASS="ChildLinks">
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>
74
<!--End of Table of Child-Links-->
77
<H1><A NAME="SECTION00220000000000000000"></A> <A NAME="portconfig_sucks"></A>
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.
85
There are three kinds of configuration items:
88
<LI>(1) Global configuration, like coloring schemes, plugin categories, MDI-ness settings
90
<LI>(2) Per-Song configuration, like whether to show or hide certain track types in the arranger
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>.
101
<H4><A NAME="SECTION00220010000000000000">
102
Reading configuration</A>
104
<TT>fterfirstv`v=95 _ `v=58 :
112
c@amelhyph<269>>oid MusECore::readConfiguration(Xml&, bool, bool)</TT> in
113
<TT>fterfirstc`c=95 _ `c=58 :
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 :
131
c@amelhyph<269>>ool MusECore::readConfiguration()</TT>), and also when a
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).
137
When adding new configuration items and thus altering <TT>fterfirstr`r=95 _ `r=58 :
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:
150
<LI>Global and/or per-song configuration (3)
152
<LI>Global configuration (1)
154
<LI>Code for skipping obsolete entries
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.
166
<H4><A NAME="SECTION00220020000000000000">
167
Writing configuration</A>
169
Global configuration is written using the
170
<TT>fterfirstM`M=95 _ `M=58 :
178
c@amelhyph<269>>usEGui::MusE::writeGlobalConfiguration()</TT> functions, while
179
per-song-config is written by <TT>fterfirstM`M=95 _ `M=58 :
187
c@amelhyph<269>>usEGui::MusE::writeConfiguration()</TT>
188
(notice the missing <TT>fterfirstG`G=95 _ `G=58 :
196
c@amelhyph<269>>lobal</TT>; both implemented in <TT>fterfirstc`c=95 _ `c=58 :
204
c@amelhyph<269>>onf.cpp</TT>).
207
<TT>fterfirstw`w=95 _ `w=58 :
215
c@amelhyph<269>>riteConfiguration</TT> is actually just a subset of the code in
216
<TT>fterfirstw`w=95 _ `w=58 :
224
c@amelhyph<269>>riteGlobalConfiguration</TT>. <SPAN CLASS="textbf">Duplicate code!</SPAN>
227
<H4><A NAME="SECTION00220030000000000000">
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 :
243
c@amelhyph<269>>usECore::Song::read</TT> and <TT>fterfirst:`:=95 _ `:=58 :
251
c@amelhyph<269>>:write</TT>, both implemented in
252
<TT>fterfirsts`s=95 _ `s=58 :
260
c@amelhyph<269>>ongfile.cpp</TT>. There are no caveats.
264
<H4><A NAME="SECTION00220040000000000000">
265
How to add new items</A>
267
When adding global configuration items, then add them into the second
268
block ("global configuration") in <TT>fterfirstr`r=95 _ `r=58 :
276
c@amelhyph<269>>eadConfiguration</TT> and into
277
<TT>fterfirstw`w=95 _ `w=58 :
285
c@amelhyph<269>>riteGlobalConfiguration</TT>.
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
293
When adding global configuration items, make sure you add them into the
294
correct section of <TT>fterfirstr`r=95 _ `r=58 :
302
c@amelhyph<269>>eadConfiguration</TT>, and into <TT>fterfirstw`w=95 _ `w=58 :
310
c@amelhyph<269>>riteGlobalConfiguration</TT>.
314
<DIV CLASS="navigation"><HR>
315
<!--Navigation Panel-->
316
<A NAME="tex2html102"
318
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
319
SRC="/usr/share/latex2html/icons/next.png"></A>
322
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
323
SRC="/usr/share/latex2html/icons/up.png"></A>
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"
330
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
331
SRC="/usr/share/latex2html/icons/contents.png"></A>
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
<B> <A NAME="tex2html101"
340
HREF="node1.html">Contents</A></B> </DIV>
341
<!--End of Navigation Panel-->