Hi,
Attached is a prepatch (not intended for being applied) of the Segment
Colouring work. The basic idea works and there are no crashes (that
I've been able to cause) however there are several things still to do.
I'm sending this to get comments on style / coding etc. Can anyone who
is interested please review it and tell me what I'll need to change to
eventually get it into the tree.
It applies cleanly and compiles against the latest anonymous CVS.
OK, here's the list of TODO things and known problems:
=================================SNIP
Known issues:
=============
Ones which need solving before the merge (IMO):
-----------------------------------------------
1) The Segments aren't automatically redrawn when you update their
colour; you have to deselect them see the change.
2) The same applies when you update the colours in the
Edit Doc Prop|Colours dialog; the segments won't take their new colour
until they're selected or deselected. In this case it'd probably be
easiest to force the SegmentCanvas to do a full repaint as we don't
know how many of the Segments will be affected (possibly lots of them
if you change the Default Colour).
3) When two segments are overlaid you don't get a combination of their
colours; this is because I can't find a way to get the colour of the
second (and other) overlapping Segments; we only have them as QCanvasItems.
I'm trying to find a way around this (see gui/segmentcanvas.cpp:526)
4) The dialog which contains the table of Colours and Names isn't very nice.
(i.e. I want to remove the numbers on the left [I'm looking into it]).
5) It'd be nice to be able to move Colours up and down the list.
(But this can be added later if necessary)
6) Undo isn't implemented yet
(But this can be added later if necessary)
7) The code may need tidying up in places (hence why I'm posting this pre-patch)
8) The code needs to be documented
Ones I'm not sure whether to solve or not
-----------------------------------------
9) If you create a Segment Colour which is too dark:
a) It becomes difficult to read the font
b) It becomes difficult to see when you have it selected
10) If you create a Segment Colour which is too light:
You'll end up with the repeats being white and having no
tint of their original colour at all.
11) If you create a Segment Colour name which is too long, you can't see it
in the drop down box.
There are two schools of thought here:
A) If the user does this they're being daft and it isn't our problem
B) We should deal with the daftness
I tend towards B) for all but issue number 11) where I don't think it's
desirable to fix the problem (c.f. with the Segment Label display).
=====================================SNIP
Thanks for looking at the patch,
Mark
--
Mark Hymers <markh at linuxfromscratch dot org>
"But Yossarian *still* didn't understand either how Milo could buy eggs
in Malta for seven cents apiece and sell them at a profit in Pianosa
for five cents."
Catch 22, Joseph Heller
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/base/ColourMap.C
rosegarden-tmp/base/ColourMap.C
--- rosegarden-pristine2/base/ColourMap.C 2003-07-06 18:15:32.000000000 +0100
+++ rosegarden-tmp/base/ColourMap.C 2003-05-22 21:45:40.000000000 +0100
@@ -183,6 +183,15 @@
return false;
}
+void
+ColourMap::replace(ColourMap &input)
+{
+ if (this != &input)
+ m_map = input.m_map;
+
+ return;
+}
+
RCMap::const_iterator
ColourMap::begin()
{
@@ -197,4 +206,19 @@
return ret;
}
+ColourMap&
+ColourMap::operator=(const ColourMap& input)
+{
+ if (this != &input)
+ m_map = input.m_map;
+
+ return *this;
+}
+
+int
+ColourMap::size() const
+{
+ return m_map.size();
+}
+
}
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/base/ColourMap.h
rosegarden-tmp/base/ColourMap.h
--- rosegarden-pristine2/base/ColourMap.h 2003-07-06 18:15:32.000000000 +0100
+++ rosegarden-tmp/base/ColourMap.h 2003-07-16 15:09:15.000000000 +0100
@@ -31,10 +31,10 @@
#ifndef _BASE_COLOURMAP_H_
#define _BASE_COLOURMAP_H_
-// These is the default default colour
-#define COLOUR_DEF_R 230
-#define COLOUR_DEF_B 230
-#define COLOUR_DEF_G 230
+// These are the default, default colour
+#define COLOUR_DEF_R 197
+#define COLOUR_DEF_B 125
+#define COLOUR_DEF_G 211
namespace Rosegarden
{
@@ -105,6 +105,8 @@
*/
bool swapItems(unsigned int item_1, unsigned int item_2);
+ void replace(ColourMap &input);
+
/**
* This returns a const iterator pointing to m_map.begin()
*/
@@ -115,6 +117,10 @@
*/
RCMap::const_iterator end();
+ ColourMap& operator=(const ColourMap& input);
+
+ int size() const;
+
private:
RCMap m_map;
};
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/base/Composition.h
rosegarden-tmp/base/Composition.h
--- rosegarden-pristine2/base/Composition.h 2003-07-15 20:58:44.000000000 +0100
+++ rosegarden-tmp/base/Composition.h 2003-07-16 18:47:14.000000000 +0100
@@ -568,6 +568,8 @@
static const std::string TempoEventType;
static const PropertyName TempoProperty; // stored in beats per hour
+ // Colour stuff
+ ColourMap& getSegmentColourMap() { return m_segmentColourMap; }
//////
//
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/base/Segment.C
rosegarden-tmp/base/Segment.C
--- rosegarden-pristine2/base/Segment.C 2003-07-06 15:23:25.000000000 +0100
+++ rosegarden-tmp/base/Segment.C 2003-07-16 23:30:18.000000000 +0100
@@ -913,6 +913,12 @@
}
+void
+Segment::setColourIndex(const unsigned int input)
+{
+ m_colourIndex = input;
+}
+
SegmentHelper::~SegmentHelper() { }
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/base/test/colour.output
rosegarden-tmp/base/test/colour.output
--- rosegarden-pristine2/base/test/colour.output 1970-01-01 01:00:00.000000000
+0100
+++ rosegarden-tmp/base/test/colour.output 2003-05-15 23:02:11.000000000 +0100
@@ -0,0 +1,68 @@
+TEST: Colour.C
+
+Can we create an Colour with the right default values?
+red: 0 green: 0 blue: 0
+Can we set values; green here is invalid - it should be set to 0 instead
+Testing the copy constructor
+red: 210 green: 0 blue: 100
+Check operator= works
+red: 210 green: 0 blue: 100
+Check the setColour routine
+red: 1 green: 2 blue: 3
+Check the getColour routine
+red: 1 green: 2 blue: 3
+
+TEST: ColourMap.C
+
+Can we create a ColourMap with the right default Colour + String
+Can we get the default colour back out of it?
+name: red: 230 green: 230 blue: 230
+Can we create a ColourMap with a specified default Colour?
+Can we get the information back out of it?
+name: red: 210 green: 0 blue: 100
+Can we add a Colour
+Can we get the info back out?
+name: TEST1 red: 100 green: 101 blue: 102
+Add a couple more colours
+index: 0 name: red: 210 green: 0 blue: 100
+index: 1 name: TEST1 red: 100 green: 101 blue: 102
+index: 2 name: TEST2 red: 101 green: 102 blue: 103
+index: 3 name: TEST3 red: 102 green: 103 blue: 104
+index: 4 name: TEST4 red: 103 green: 104 blue: 105
+Now try deleting the third item
+index: 0 name: red: 210 green: 0 blue: 100
+index: 1 name: TEST1 red: 100 green: 101 blue: 102
+index: 2 name: TEST2 red: 101 green: 102 blue: 103
+index: 4 name: TEST4 red: 103 green: 104 blue: 105
+Make sure we get false when we try and modify item number 3
+Check we can modify a colour which *is* there
+index: 0 name: red: 210 green: 0 blue: 100
+index: 1 name: TEST1 red: 100 green: 101 blue: 102
+index: 2 name: TEST2 red: 101 green: 102 blue: 103
+index: 4 name: YES red: 233 green: 233 blue: 233
+Now try adding another item - it should take the place of the one we removed.
+index: 0 name: red: 210 green: 0 blue: 100
+index: 1 name: TEST1 red: 100 green: 101 blue: 102
+index: 2 name: TEST2 red: 101 green: 102 blue: 103
+index: 3 name: NEW red: 211 green: 212 blue: 213
+index: 4 name: YES red: 233 green: 233 blue: 233
+Try swapping two items:
+index: 0 name: red: 210 green: 0 blue: 100
+index: 1 name: TEST1 red: 100 green: 101 blue: 102
+index: 2 name: TEST2 red: 101 green: 102 blue: 103
+index: 3 name: YES red: 233 green: 233 blue: 233
+index: 4 name: NEW red: 211 green: 212 blue: 213
+
+TEST: Generic Colour routines
+
+Try getting a contrasting colour:
+Original colour:
+red: 210 green: 0 blue: 100
+Contrast colour:
+red: 45 green: 255 blue: 155
+Try getting a combination colour:
+Original colours:
+red: 45 green: 255 blue: 155
+red: 100 green: 101 blue: 102
+Combination colour:
+red: 72 green: 178 blue: 128
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/Makefile.am
rosegarden-tmp/gui/Makefile.am
--- rosegarden-pristine2/gui/Makefile.am 2003-07-06 15:25:19.000000000 +0100
+++ rosegarden-tmp/gui/Makefile.am 2003-07-15 20:29:53.000000000 +0100
@@ -11,6 +11,7 @@
basiccommand.cpp \
chordnameruler.cpp \
colours.cpp \
+ colourwidgets.cpp \
constants.cpp \
controleditor.cpp \
controlruler.cpp \
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/colours.cpp
rosegarden-tmp/gui/colours.cpp
--- rosegarden-pristine2/gui/colours.cpp 2003-05-18 18:17:19.000000000 +0100
+++ rosegarden-tmp/gui/colours.cpp 2003-07-16 21:12:43.000000000 +0100
@@ -28,14 +28,10 @@
const QColor ActiveRecordTrack = Qt::red;
const QColor SegmentCanvas = QColor(230, 230, 230);
- const QColor SegmentBlock = QColor(197, 211, 125);
const QColor SegmentBorder = Qt::black;
- const QColor SegmentHighlightBlock = QColor(98, 102, 78);
- const QColor SegmentIntersectBlock = SegmentBlock.dark(150);
const QColor RecordingSegmentBlock = QColor(255, 182, 193);
const QColor RecordingSegmentBorder = Qt::black;
- const QColor RepeatSegmentBlock = QColor(238, 238, 205);
const QColor RepeatSegmentBorder = QColor(130, 133, 170);
const QColor SegmentAudioPreview = QColor(39, 71, 22);
@@ -49,7 +45,9 @@
const QColor LoopRulerBackground = QColor(120, 120, 120);
const QColor LoopRulerForeground = Qt::white;
const QColor LoopHighlight = Qt::white;
-
+
+ const QColor TempoBase = QColor(197, 211, 125);
+
//const QColor TextRulerBackground = QColor(60, 205, 230, QColor::Hsv);
// const QColor TextRulerBackground = QColor(120, 90, 238, QColor::Hsv);
// const QColor TextRulerBackground = QColor(210, 220, 140);
@@ -108,7 +106,7 @@
const QColor RotaryPlugin = QColor(185, 255, 248);
Rosegarden::Colour
-convertColour (const QColor& input)
+convertColour (const QColor &input)
{
int r,g,b;
input.rgb(&r, &g, &b);
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/colours.h
rosegarden-tmp/gui/colours.h
--- rosegarden-pristine2/gui/colours.h 2003-05-18 18:17:19.000000000 +0100
+++ rosegarden-tmp/gui/colours.h 2003-07-16 21:12:55.000000000 +0100
@@ -39,14 +39,10 @@
extern const QColor SegmentCanvas;
extern const QColor SegmentBorder;
- extern const QColor SegmentBlock;
- extern const QColor SegmentHighlightBlock;
- extern const QColor SegmentIntersectBlock;
extern const QColor RecordingSegmentBlock;
extern const QColor RecordingSegmentBorder;
- extern const QColor RepeatSegmentBlock;
extern const QColor RepeatSegmentBorder;
extern const QColor SegmentAudioPreview;
@@ -61,6 +57,8 @@
extern const QColor LoopRulerForeground;
extern const QColor LoopHighlight;
+ extern const QColor TempoBase;
+
extern const QColor TextRulerBackground;
extern const QColor TextRulerForeground;
@@ -113,8 +111,8 @@
extern const QColor RotaryPlugin;
- Rosegarden::Colour convertColour(QColor input);
- QColor convertColour(Rosegarden::Colour input);
+ Rosegarden::Colour convertColour(const QColor &input);
+ QColor convertColour(const Rosegarden::Colour &input);
}
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/colourwidgets.cpp
rosegarden-tmp/gui/colourwidgets.cpp
--- rosegarden-pristine2/gui/colourwidgets.cpp 1970-01-01 01:00:00.000000000 +0100
+++ rosegarden-tmp/gui/colourwidgets.cpp 2003-07-16 22:57:23.000000000 +0100
@@ -0,0 +1,144 @@
+
+// -*- c-basic-offset: 4 -*-
+
+/*
+ Rosegarden-4
+ A sequencer and musical notation editor.
+
+ This program is Copyright 2000-2003
+ Guillaume Laurent <[EMAIL PROTECTED]>,
+ Chris Cannam <[EMAIL PROTECTED]>,
+ Richard Bown <[EMAIL PROTECTED]>
+
+ Portions of this file Copyright 2003
+ Mark Hymers <[EMAIL PROTECTED]>
+
+ The moral right of the authors to claim authorship of this work
+ has been asserted.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+*/
+
+#include <qtable.h>
+#include <qinputdialog.h>
+
+#include <kcolordialog.h>
+#include <klocale.h>
+
+#include "colours.h"
+#include "colourwidgets.h"
+
+/*
+ * RosegardenColourTable
+ * To be documented.
+ */
+RosegardenColourTable::RosegardenColourTable
+ (QWidget *parent, Rosegarden::ColourMap &input, ColourList &list)
+ : QTable(1, 2, parent, "RColourTable")
+{
+ setSorting(FALSE);
+ setSelectionMode(QTable::SingleRow);
+ horizontalHeader()->setLabel(0, i18n("Name"));
+ horizontalHeader()->setLabel(1, i18n("Colour"));
+ populate_table(input, list);
+ connect(this, SIGNAL(doubleClicked(int, int, int, const QPoint&)),
+ SLOT(slotEditEntry(int, int)));
+
+}
+
+void
+RosegardenColourTable::slotEditEntry(int row, int col)
+{
+
+ switch(col)
+ {
+ case 0:
+ {
+ if (row == 0) return;
+ bool ok = false;
+ QString newName = QInputDialog::getText(i18n("Modify Colour Name"),
i18n("Enter new name"),
+ QLineEdit::Normal, item(row,
col)->text(), &ok);
+
+ if ((ok == true) && (!newName.isEmpty()))
+ {
+ emit entryTextChanged(row, newName);
+ return;
+ }
+ }
+ break;
+ case 1:
+ {
+ QColor temp = m_colours[row];
+ KColorDialog box(this, "", true);
+
+ int result = box.getColor(temp);
+
+ if (result == KColorDialog::Accepted)
+ {
+ emit entryColourChanged(row, temp);
+ return;
+ }
+ }
+ break;
+ default: // Should never happen
+ break;
+ }
+
+}
+
+void
+RosegardenColourTable::populate_table(Rosegarden::ColourMap &input, ColourList &list)
+{
+ m_colours.reserve(input.size());
+ setNumRows(input.size());
+
+ unsigned int i=0;
+
+ for (Rosegarden::RCMap::const_iterator it=input.begin(); it!=input.end(); ++it)
+ {
+ if (it->second.second == std::string(""))
+ {
+ QTableItem *text = new QTableItem(this, QTableItem::Never, i18n("Default
Colour"));
+ setItem(i, 0, text);
+ }
+ else
+ {
+ QTableItem *text = new QTableItem(this, QTableItem::OnTyping,
it->second.second);
+ setItem(i, 0, text);
+ }
+
+ list[i] = it->first;
+ m_colours[i] = RosegardenGUIColours::convertColour(it->second.first);
+
+ RosegardenColourTableItem *temp = new RosegardenColourTableItem(this,
m_colours[i]);
+ setItem(i, 1, temp);
+
+ verticalHeader()->setLabel(i, QString::number(it->first));
+
+ ++i;
+ }
+
+}
+
+/*
+ * RosegardenColourTableItem
+ * To be documented.
+ */
+void
+RosegardenColourTableItem::setColor(QColor &input)
+{
+ currentColour = input;
+}
+
+void
+RosegardenColourTableItem::paint(QPainter *p, const QColorGroup &cg, const QRect &cr,
bool selected)
+{
+ QColorGroup g(cg);
+ g.setColor(QColorGroup::Base, currentColour);
+ selected = false;
+ QTableItem::paint(p, g, cr, selected);
+}
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/colourwidgets.h
rosegarden-tmp/gui/colourwidgets.h
--- rosegarden-pristine2/gui/colourwidgets.h 1970-01-01 01:00:00.000000000 +0100
+++ rosegarden-tmp/gui/colourwidgets.h 2003-07-16 22:56:48.000000000 +0100
@@ -0,0 +1,74 @@
+
+// -*- c-basic-offset: 4 -*-
+
+/*
+ Rosegarden-4
+ A sequencer and musical notation editor.
+
+ This program is Copyright 2000-2003
+ Guillaume Laurent <[EMAIL PROTECTED]>,
+ Chris Cannam <[EMAIL PROTECTED]>,
+ Richard Bown <[EMAIL PROTECTED]>
+
+ Portions of this file Copyright 2003
+ Mark Hymers <[EMAIL PROTECTED]>
+
+ The moral right of the authors to claim authorship of this work
+ has been asserted.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+*/
+
+#ifndef _COLOURWIDGETS_H_
+#define _COLOURWIDGETS_H_
+
+#include <vector>
+
+#include <qtable.h>
+#include <qsignalmapper.h>
+#include <qcolor.h>
+
+#include "ColourMap.h"
+
+
+class RosegardenColourTable : public QTable
+{
+ Q_OBJECT
+
+public:
+ typedef std::map<unsigned int, unsigned int, std::less<unsigned int> > ColourList;
+ RosegardenColourTable(QWidget *parent, Rosegarden::ColourMap &input, ColourList
&list);
+ void populate_table(Rosegarden::ColourMap &input, ColourList &list);
+
+
+signals:
+ void entryTextChanged(unsigned int, QString);
+ void entryColourChanged(unsigned int, QColor);
+
+public slots:
+ void slotEditEntry (int, int);
+
+protected:
+ std::vector<QColor> m_colours;
+
+};
+
+class RosegardenColourTableItem : public QTableItem
+{
+public:
+ RosegardenColourTableItem(QTable *t, const QColor &input)
+ : QTableItem(t, QTableItem::Never, ""),
+ currentColour(input) {}
+ void setColor(QColor &input);
+ void paint(QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected);
+
+protected:
+ QColor currentColour;
+};
+
+
+#endif // _COLOURWIDGETS_H_
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour
rosegarden-pristine2/gui/rosegardenconfigurationpage.h
rosegarden-tmp/gui/rosegardenconfigurationpage.h
--- rosegarden-pristine2/gui/rosegardenconfigurationpage.h 2003-07-06
15:27:34.000000000 +0100
+++ rosegarden-tmp/gui/rosegardenconfigurationpage.h 2003-07-16 23:00:17.000000000
+0100
@@ -22,6 +22,10 @@
#ifndef _ROSEGARDENCONFIGUREPAGE_H_
#define _ROSEGARDENCONFIGUREPAGE_H_
+#include <map>
+#include <utility>
+#include <vector>
+
#include <qspinbox.h>
#include <qcombobox.h>
#include <qcheckbox.h>
@@ -29,11 +33,16 @@
#include <qlineedit.h>
#include <klocale.h>
+#include <kcolordialog.h>
+#include <kcolorbutton.h>
#include <string>
+#include "ColourMap.h"
#include "Device.h"
#include "config.h"
+#include "widgets.h"
+#include "colourwidgets.h"
class RosegardenGUIDoc;
class QTabWidget;
@@ -42,8 +51,9 @@
class QRadioButton;
class QLabel;
class QCheckBox;
-class KListView;
class RosegardenQuantizeParameters;
+class KListView;
+class QTable;
namespace Rosegarden
{
@@ -390,6 +400,41 @@
};
/**
+ * Colour Configuration Page
+ *
+ * (document-wide settings)
+ */
+class ColourConfigurationPage : public TabbedConfigurationPage
+{
+ Q_OBJECT
+public:
+ ColourConfigurationPage(RosegardenGUIDoc *doc,
+ QWidget *parent=0, const char *name=0);
+ virtual void apply();
+
+ void populate_table();
+
+ static QString iconLabel() { return i18n("Colour"); }
+ static QString title() { return i18n("Colour Settings"); }
+
+protected slots:
+ void slotAddNew();
+ void slotDelete();
+ void slotTextChanged(unsigned int, QString);
+ void slotColourChanged(unsigned int, QColor);
+
+signals:
+ void docColoursChanged();
+
+protected:
+ RosegardenColourTable *m_colourtable;
+
+ ColourMap m_map;
+ RosegardenColourTable::ColourList m_listmap;
+
+};
+
+/**
* Metronome Configuration page
*
* (document-wide settings)
@@ -415,7 +460,6 @@
};
-
// ----------- SequencerConfigurationage -----------------
//
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour
rosegarden-pristine2/gui/rosegardenconfiguredialog.cpp
rosegarden-tmp/gui/rosegardenconfiguredialog.cpp
--- rosegarden-pristine2/gui/rosegardenconfiguredialog.cpp 2003-07-06
15:27:40.000000000 +0100
+++ rosegarden-tmp/gui/rosegardenconfiguredialog.cpp 2003-07-16 23:32:06.000000000
+0100
@@ -45,6 +45,8 @@
#include <qtooltip.h>
#include <qvbox.h>
#include <qstringlist.h>
+#include <qtable.h>
+#include <qheader.h>
#include <kcombobox.h>
#include <klistview.h>
@@ -52,8 +54,10 @@
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kprocess.h>
+#include <kcolordialog.h>
#include "constants.h"
+#include "colours.h"
#include "rosestrings.h"
#include "rosegardenconfiguredialog.h"
#include "rosegardenconfigurationpage.h"
@@ -72,6 +76,7 @@
#include "editcommands.h"
#include "studiocontrol.h"
#include "widgets.h"
+#include "colourwidgets.h"
#include "audiopluginmanager.h"
#include "diskspace.h"
@@ -909,6 +914,7 @@
}
+
// ------------------- SequencerConfigurationPage ---------------------
//
@@ -1689,6 +1695,101 @@
}
}
+ColourConfigurationPage::ColourConfigurationPage(RosegardenGUIDoc *doc,
+ QWidget *parent,
+ const char *name)
+ : TabbedConfigurationPage(doc, parent, name)
+{
+ QFrame *frame = new QFrame(m_tabWidget);
+ QGridLayout *layout = new QGridLayout(frame, 2, 2,
+ 10, 5);
+
+ m_map = m_doc->getComposition().getSegmentColourMap();
+
+ m_colourtable = new RosegardenColourTable(frame, m_map, m_listmap);
+
+ layout->addMultiCellWidget(m_colourtable, 0, 0, 0, 1);
+
+ QPushButton* addColourButton = new QPushButton(i18n("Add New Colour"),
+ frame);
+ layout->addWidget(addColourButton, 1, 0, Qt::AlignHCenter);
+
+ QPushButton* deleteColourButton = new QPushButton(i18n("Delete Colour"),
+ frame);
+ layout->addWidget(deleteColourButton, 1, 1, Qt::AlignHCenter);
+
+ connect(addColourButton, SIGNAL(clicked()),
+ this, SLOT(slotAddNew()));
+
+ connect(deleteColourButton, SIGNAL(clicked()),
+ this, SLOT(slotDelete()));
+
+ connect(this, SIGNAL(docColoursChanged()),
+ m_doc, SLOT(slotDocColoursChanged()));
+
+ connect(m_colourtable, SIGNAL(entryTextChanged(unsigned int, QString)),
+ this, SLOT(slotTextChanged(unsigned int, QString)));
+
+ connect(m_colourtable, SIGNAL(entryColourChanged(unsigned int, QColor)),
+ this, SLOT(slotColourChanged(unsigned int, QColor)));
+
+ addTab(frame, i18n("Colour Map"));
+
+}
+
+void
+ColourConfigurationPage::slotTextChanged(unsigned int index, QString string)
+{
+ m_map.modifyNameByIndex(m_listmap[index], string.ascii());
+ m_colourtable->populate_table(m_map, m_listmap);
+}
+
+void
+ColourConfigurationPage::slotColourChanged(unsigned int index, QColor color)
+{
+ m_map.modifyColourByIndex(m_listmap[index],
RosegardenGUIColours::convertColour(color));
+ m_colourtable->populate_table(m_map, m_listmap);
+}
+
+void
+ColourConfigurationPage::apply()
+{
+ m_doc->getComposition().getSegmentColourMap().replace(m_map);
+ emit docColoursChanged();
+}
+
+void
+ColourConfigurationPage::slotAddNew()
+{
+ QColor temp;
+
+ KColorDialog box(this, "", true);
+
+ int result = box.getColor( temp );
+
+ if (result == KColorDialog::Accepted)
+ {
+ Rosegarden::Colour temp2 = RosegardenGUIColours::convertColour(temp);
+ m_map.addItem(temp2, i18n("New").ascii());
+ m_colourtable->populate_table(m_map, m_listmap);
+ }
+
+}
+
+void
+ColourConfigurationPage::slotDelete()
+{
+ QTableSelection temp = m_colourtable->selection(0);
+
+ if ((!temp.isActive()) || (temp.topRow()==0))
+ return;
+
+ unsigned int toDel = temp.topRow();
+
+ m_map.deleteItemByIndex(m_listmap[toDel]);
+ m_colourtable->populate_table(m_map, m_listmap);
+
+}
//------------------------------------------------------------
@@ -1837,6 +1938,17 @@
page->setPageIndex(pageIndex(pageWidget));
m_configurationPages.push_back(page);
+ // Colour Page
+ pageWidget = addPage(ColourConfigurationPage::iconLabel(),
+ ColourConfigurationPage::title(),
+ loadIcon(ColourConfigurationPage::iconName()));
+
+ vlay = new QVBoxLayout(pageWidget, 0, spacingHint());
+ page = new ColourConfigurationPage(doc, pageWidget);
+ vlay->addWidget(page);
+ page->setPageIndex(pageIndex(pageWidget));
+ m_configurationPages.push_back(page);
+
// Metronome Page
//
pageWidget = addPage(MetronomeConfigurationPage::iconLabel(),
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/rosegardenguidoc.cpp
rosegarden-tmp/gui/rosegardenguidoc.cpp
--- rosegarden-pristine2/gui/rosegardenguidoc.cpp 2003-07-15 21:01:21.000000000
+0100
+++ rosegarden-tmp/gui/rosegardenguidoc.cpp 2003-07-15 23:27:58.000000000 +0100
@@ -2106,4 +2106,10 @@
return app->getClipboard();
}
+void RosegardenGUIDoc::slotDocColoursChanged()
+{
+ RG_DEBUG << "RosegardenGUIDoc::slotDocColoursChanged()\n";
+ emit docColoursChanged();
+}
+
const unsigned int RosegardenGUIDoc::MinNbOfTracks = 64;
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/rosegardenguidoc.h
rosegarden-tmp/gui/rosegardenguidoc.h
--- rosegarden-pristine2/gui/rosegardenguidoc.h 2003-07-15 21:01:22.000000000 +0100
+++ rosegarden-tmp/gui/rosegardenguidoc.h 2003-07-15 23:12:30.000000000 +0100
@@ -419,6 +419,8 @@
//
void slotNewRecordButton();
+ void slotDocColoursChanged();
+
signals:
/**
* Emitted when document is modified or saved
@@ -428,6 +430,7 @@
void pointerPositionChanged(Rosegarden::timeT);
void playPositionChanged(Rosegarden::timeT);
void loopChanged(Rosegarden::timeT, Rosegarden::timeT);
+ void docColoursChanged();
protected:
/**
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/segmentcanvas.cpp
rosegarden-tmp/gui/segmentcanvas.cpp
--- rosegarden-pristine2/gui/segmentcanvas.cpp 2003-07-06 15:27:59.000000000 +0100
+++ rosegarden-tmp/gui/segmentcanvas.cpp 2003-07-16 22:42:24.000000000 +0100
@@ -33,6 +33,8 @@
#include <kapp.h>
#include <kconfig.h>
+#include "Colour.h"
+#include "ColourMap.h"
#include "Composition.h"
#include "NotationTypes.h"
#include "BaseProperties.h"
@@ -54,13 +56,17 @@
using Rosegarden::SnapGrid;
using Rosegarden::TrackId;
using Rosegarden::timeT;
+using Rosegarden::Colour;
+using Rosegarden::ColourMap;
+using Rosegarden::getCombinationColour;
class SegmentRepeatRectangle : public QCanvasRectangle
{
public:
SegmentRepeatRectangle(QCanvas *,
Rosegarden::Segment *,
- SnapGrid *);
+ SnapGrid *,
+ RosegardenGUIDoc *);
void setRepeatInterval(unsigned int i) { m_repeatInterval = i; }
@@ -75,17 +81,20 @@
Rosegarden::Segment *m_segment;
unsigned int m_repeatInterval;
SnapGrid *m_snapGrid;
+ RosegardenGUIDoc *m_doc;
};
SegmentRepeatRectangle::SegmentRepeatRectangle(QCanvas *canvas,
Rosegarden::Segment *segment,
- SnapGrid *snapGrid)
+ SnapGrid *snapGrid,
+ RosegardenGUIDoc *doc)
: QCanvasRectangle(canvas),
m_segment(segment),
m_repeatInterval(0),
- m_snapGrid(snapGrid)
+ m_snapGrid(snapGrid),
+ m_doc(doc)
{
- setBrush(RosegardenGUIColours::RepeatSegmentBlock);
+
setBrush(RosegardenGUIColours::convertColour(m_doc->getComposition().getSegmentColourMap().getColourByIndex(m_segment->getColourIndex())).light(150));
setPen(RosegardenGUIColours::RepeatSegmentBorder);
}
@@ -113,7 +122,7 @@
int rWidth = int(m_snapGrid->getRulerScale()->
getXForTime(m_repeatInterval));
- painter.setBrush(RosegardenGUIColours::RepeatSegmentBlock);
+
setBrush(RosegardenGUIColours::convertColour(m_doc->getComposition().getSegmentColourMap().getColourByIndex(m_segment->getColourIndex())).light(150));
painter.setPen(RosegardenGUIColours::RepeatSegmentBorder);
while (pos < width + rWidth)
@@ -513,8 +522,11 @@
QCanvasItemList items = canvas()->allItems();
painter.save();
- painter.setBrush(RosegardenGUIColours::SegmentIntersectBlock);
-
+
+ // XXX: At the moment we only use the colour of the segment which is on top
+ // Reason: I can't find a way to get the colours of the overlapping segment
+ // as all we have is the QCanvasItem, not a pointer to the Segment
+
for (QCanvasItemList::Iterator it=items.begin(); it!=items.end(); ++it) {
if ((*it) == this) continue; // skip ourselves
@@ -592,7 +604,7 @@
if (!m_repeatRectangle)
m_repeatRectangle = new SegmentRepeatRectangle(canvas(),
getSegment(),
- m_snapGrid);
+ m_snapGrid, m_doc);
timeT repeatStart = m_endTime;
timeT repeatEnd = m_segment->getRepeatEndTime();
@@ -758,8 +770,6 @@
m_currentItem(0),
m_recordingSegment(0),
m_splitLine(0),
- m_brush(RosegardenGUIColours::SegmentBlock),
- m_highlightBrush(RosegardenGUIColours::SegmentHighlightBlock),
m_pen(RosegardenGUIColours::SegmentBorder),
m_fineGrain(false),
m_showPreviews(true),
@@ -1051,7 +1061,7 @@
(track, startTime, endTime, m_showPreviews, &m_grid, canvas(), m_doc);
newItem->setPen(m_pen);
- newItem->setBrush(m_brush);
+
newItem->setBrush(RosegardenGUIColours::convertColour(m_doc->getComposition().getSegmentColourMap().getColourByIndex(0)));
newItem->setVisible(true);
newItem->setZ(1); // Segment at Z=1, Pointer at Z=10 [rwb]
@@ -1065,7 +1075,7 @@
(segment, m_showPreviews, &m_grid, canvas(), m_doc);
newItem->setPen(m_pen);
- newItem->setBrush(m_brush);
+
newItem->setBrush(RosegardenGUIColours::convertColour(m_doc->getComposition().getSegmentColourMap().getColourByIndex(segment->getColourIndex())));
newItem->setVisible(true);
newItem->setZ(1); // Segment at Z=1, Pointer at Z=10 [rwb]
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/segmentcanvas.h
rosegarden-tmp/gui/segmentcanvas.h
--- rosegarden-pristine2/gui/segmentcanvas.h 2003-05-31 19:38:44.000000000 +0100
+++ rosegarden-tmp/gui/segmentcanvas.h 2003-07-16 20:45:23.000000000 +0100
@@ -213,9 +213,6 @@
Rosegarden::SnapGrid &grid() { return m_grid; }
- /// Return the brush used by all SegmentItem objects (normally, solid blue)
- const QBrush& brush() const { return m_brush; }
-
/// Return the pen used by all SegmentItem objects
const QPen& pen() const { return m_pen; }
@@ -253,16 +250,6 @@
SegmentRepeatRectangle* findRepeatClickedOn(QPoint);
- /**
- * get the highlight brush from the canvas
- */
- QBrush getHighlightBrush() const { return m_highlightBrush; }
-
- /**
- * Get the normal segment brush
- */
- QBrush getSegmentBrush() const { return m_brush; }
-
SegmentToolBox* getToolBox() { return m_toolBox; }
/**
@@ -378,8 +365,8 @@
SegmentSplitLine *m_splitLine;
- QBrush m_brush;
- QBrush m_highlightBrush;
+// QBrush m_brush;
+// QBrush m_highlightBrush;
QPen m_pen;
bool m_fineGrain;
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/segmentparameterbox.cpp
rosegarden-tmp/gui/segmentparameterbox.cpp
--- rosegarden-pristine2/gui/segmentparameterbox.cpp 2003-07-06 15:28:08.000000000
+0100
+++ rosegarden-tmp/gui/segmentparameterbox.cpp 2003-07-16 23:24:51.000000000 +0100
@@ -31,6 +31,7 @@
#include "Quantizer.h"
#include "NotationTypes.h"
+#include "colours.h"
#include "notepixmapfactory.h"
#include "segmentcommands.h"
#include "rosestrings.h"
@@ -60,6 +61,7 @@
delete m_quantizeValue;
delete m_transposeValue;
delete m_delayValue;
+ delete m_colourValue;
}
void
@@ -71,13 +73,14 @@
// magic numbers: 13 is the height of the menu pixmaps, 10 is just 10
int comboHeight = std::max(fontMetrics.height(), 13) + 10;
- QGridLayout *gridLayout = new QGridLayout(this, 5, 2, 8, 1);
+ QGridLayout *gridLayout = new QGridLayout(this, 6, 2, 8, 1);
QLabel *label = new QLabel(i18n("Label"), this);
QLabel *repeatLabel = new QLabel(i18n("Repeat"), this);
QLabel *quantizeLabel = new QLabel(i18n("Quantize"), this);
QLabel *transposeLabel = new QLabel(i18n("Transpose"), this);
QLabel *delayLabel = new QLabel(i18n("Delay"), this);
+ QLabel *colourLabel = new QLabel(i18n("Colour"), this);
// HBox for label
//
@@ -138,11 +141,27 @@
connect(m_delayValue, SIGNAL(textChanged(const QString&)),
SLOT(slotDelayTextChanged(const QString &)));
+ // set up combo box for colours
+ m_colourValue = new KComboBox(false, this);
+ m_colourValue->setFont(font);
+ m_colourValue->setFixedHeight(comboHeight);
+
+ // Detect when the document colours are updated
+ connect (m_view->getDocument(), SIGNAL(docColoursChanged()),
+ this, SLOT(slotDocColoursChanged()));
+
+ // handle colour combo changes
+ connect(m_colourValue, SIGNAL(activated(int)),
+ SLOT(slotColourSelected(int)));
+
+
+
label->setFont(font);
repeatLabel->setFont(font);
quantizeLabel->setFont(font);
transposeLabel->setFont(font);
delayLabel->setFont(font);
+ colourLabel->setFont(font);
gridLayout->addRowSpacing(0, 8);
@@ -161,6 +180,9 @@
gridLayout->addWidget(delayLabel, 5, 0, AlignLeft);
gridLayout->addWidget(m_delayValue, 5, 1);
+ gridLayout->addWidget(colourLabel, 6, 0, AlignLeft);
+ gridLayout->addWidget(m_colourValue, 6, 1);
+
// populate the quantize combo
//
NotePixmapFactory npf;
@@ -220,6 +242,9 @@
// set delay blank initially
m_delayValue->setCurrentItem(-1);
+ // populate m_colourValue
+ slotDocColoursChanged();
+
}
void
@@ -241,6 +266,31 @@
populateBoxFromSegments();
}
+void
+SegmentParameterBox::slotDocColoursChanged()
+{
+ m_colourValue->clear();
+ m_colourList.clear();
+ // Populate it from composition.m_segmentColourMap
+ Rosegarden::ColourMap temp =
m_view->getDocument()->getComposition().getSegmentColourMap();
+
+ unsigned int i=0;
+
+ for (Rosegarden::RCMap::const_iterator it=temp.begin(); it != temp.end(); ++it)
+ {
+ QPixmap colour(15,15);
+ colour.fill(RosegardenGUIColours::convertColour(it->second.first));
+ if (it->second.second == std::string(""))
+ m_colourValue->insertItem(colour, i18n("Default Colour"), i);
+ else
+ m_colourValue->insertItem(colour, (QString)it->second.second, i);
+ m_colourList[it->first] = i;
+ ++i;
+ }
+
+ m_colourValue->setCurrentItem(0);
+}
+
void SegmentParameterBox::update()
{
RG_DEBUG << "SegmentParameterBox::update()\n";
@@ -261,6 +311,8 @@
Tristate quantized = NotApplicable;
Tristate transposed = NotApplicable;
Tristate delayed = NotApplicable;
+ Tristate diffcolours = NotApplicable;
+ unsigned int myCol = 0;
Rosegarden::timeT qntzLevel = 0;
// At the moment we have no negative delay, so we use negative
@@ -280,6 +332,7 @@
if (quantized == NotApplicable) quantized = None;
if (transposed == NotApplicable) transposed = None;
if (delayed == NotApplicable) delayed = None;
+ if (diffcolours == NotApplicable) diffcolours = None;
// Set label to "*" when multiple labels don't match
//
@@ -381,6 +434,18 @@
delayed = Some;
}
+ // Colour
+
+ if (it == m_segments.begin())
+ {
+ myCol = (*it)->getColourIndex();
+ }
+ else
+ {
+ if (myCol != (*it)->getColourIndex());
+ diffcolours = All;
+ }
+
}
switch(repeated)
@@ -493,6 +558,27 @@
m_delayValue->setEnabled(delayed != NotApplicable);
m_delayValue->blockSignals(false);
+
+ switch(diffcolours)
+ {
+ case None:
+ if (m_colourList.find(myCol) != m_colourList.end())
+ m_colourValue->setCurrentItem(m_colourList[myCol]);
+ else
+ m_colourValue->setCurrentItem(0);
+ break;
+
+
+ case All:
+ case NotApplicable:
+ default:
+ m_colourValue->setCurrentItem(0);
+ break;
+
+ }
+
+ m_colourValue->setEnabled(diffcolours != NotApplicable);
+
}
void SegmentParameterBox::slotRepeatPressed()
@@ -627,6 +713,26 @@
}
}
+void
+SegmentParameterBox::slotColourSelected(int value)
+{
+ unsigned int temp;
+
+ RosegardenColourTable::ColourList::const_iterator pos = m_colourList.find(value);
+
+ if (pos != m_colourList.end())
+ temp = pos->first;
+ else // Somehow we are trying to set a colour which doesn't exist
+ temp = 0;
+
+ std::vector<Rosegarden::Segment*>::iterator it;
+
+ for (it = m_segments.begin(); it != m_segments.end(); ++it)
+ (*it)->setColourIndex(temp);
+
+ // XXX: Now we need to trigger the canvas to update
+}
+
MultiViewCommandHistory*
SegmentParameterBox::getCommandHistory()
{
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/segmentparameterbox.h
rosegarden-tmp/gui/segmentparameterbox.h
--- rosegarden-pristine2/gui/segmentparameterbox.h 2003-07-06 15:28:10.000000000
+0100
+++ rosegarden-tmp/gui/segmentparameterbox.h 2003-07-16 22:59:15.000000000 +0100
@@ -31,6 +31,7 @@
#include "Quantizer.h"
#include "Selection.h"
+#include "colourwidgets.h"
#include "widgets.h"
@@ -87,10 +88,14 @@
void slotEditSegmentLabel();
+ void slotColourSelected(int);
+ void slotDocColoursChanged();
+
virtual void update();
signals:
void documentModified();
+ void canvasModified();
protected:
void initBox();
@@ -102,11 +107,13 @@
KComboBox *m_quantizeValue;
RosegardenComboBox *m_transposeValue;
RosegardenComboBox *m_delayValue;
+ KComboBox *m_colourValue;
std::vector<Rosegarden::Segment*> m_segments;
std::vector<Rosegarden::timeT> m_standardQuantizations;
std::vector<Rosegarden::timeT> m_delays;
std::vector<int> m_realTimeDelays;
+ RosegardenColourTable::ColourList m_colourList;
RosegardenGUIView *m_view;
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/segmenttool.cpp
rosegarden-tmp/gui/segmenttool.cpp
--- rosegarden-pristine2/gui/segmenttool.cpp 2003-07-06 15:28:11.000000000 +0100
+++ rosegarden-tmp/gui/segmenttool.cpp 2003-07-16 23:26:20.000000000 +0100
@@ -26,6 +26,7 @@
#include "segmenttool.h"
+#include "Colour.h"
#include "SnapGrid.h"
#include "NotationTypes.h"
@@ -41,6 +42,7 @@
using Rosegarden::SnapGrid;
using Rosegarden::Note;
using Rosegarden::SegmentSelection;
+using RosegardenGUIColours::convertColour;
//////////////////////////////////////////////////////////////////////
// Segment Tools
@@ -656,7 +658,9 @@
it++)
{
it->second->disconnect(this);
- it->second->setSelected(false, m_canvas->getSegmentBrush());
+ it->second->setSelected(false,
+ convertColour(m_doc->getComposition().getSegmentColourMap()
+
.getColourByIndex(it->second->getSegment()->getColourIndex())));
}
// now clear the selection
@@ -787,7 +791,9 @@
// If we're selecting a Segment through this method
// then don't set the m_currentItem
//
- selectedItem->setSelected(true, m_canvas->getHighlightBrush());
+ selectedItem->setSelected(true,
+ convertColour(m_doc->getComposition().getSegmentColourMap()
+ .getColourByIndex(selectedItem->getSegment()->getColourIndex())).dark(200));
addToSelection(selectedItem);
m_canvas->canvas()->update();
}
@@ -967,7 +973,10 @@
{
removeFromSelection(*oIt);
m_canvas->getSegmentItem(*oIt)->
- setSelected(false, m_canvas->getSegmentBrush());
+ setSelected(false, convertColour(
+ m_doc->getComposition().getSegmentColourMap().
+ getColourByIndex(m_canvas->getSegmentItem(*oIt)
+ ->getSegment()->getColourIndex())));
}
}
diff -Naur --exclude=CVS --exclude=autom4te.cache --exclude='.#*' --exclude=.deps
--exclude=.libs --exclude-from=rosegarden/.cvsignore --exclude=base/test/colour
--exclude='*.lo' --exclude=colour rosegarden-pristine2/gui/tempocolour.cpp
rosegarden-tmp/gui/tempocolour.cpp
--- rosegarden-pristine2/gui/tempocolour.cpp 2003-04-22 16:15:24.000000000 +0100
+++ rosegarden-tmp/gui/tempocolour.cpp 2003-07-16 21:11:58.000000000 +0100
@@ -27,7 +27,7 @@
TempoColour::getColour(double tempo)
{
int h, s, v;
- RosegardenGUIColours::SegmentBlock.hsv(&h, &s, &v);
+ RosegardenGUIColours::TempoBase.hsv(&h, &s, &v);
v += 20;
if (v > 255) v = 255;