diff options
author | Robert Jonsson <spamatica@gmail.com> | 2013-03-10 19:08:05 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2013-03-10 19:08:05 +0000 |
commit | 8f0772bf78d72dd02d2f9b57696e2b9e5f9ce978 (patch) | |
tree | 98ae75e1d5f6ce8dda550ba13dc08c6ddaf1fe0b /muse2/muse | |
parent | 0cbda2ef8898f4e6333407c64e662d6e087878fa (diff) |
added more colors
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/appearance.cpp | 23 | ||||
-rw-r--r-- | muse2/muse/arranger/pcanvas.cpp | 29 | ||||
-rw-r--r-- | muse2/muse/conf.cpp | 34 | ||||
-rw-r--r-- | muse2/muse/gconfig.cpp | 11 | ||||
-rw-r--r-- | muse2/muse/gconfig.h | 13 | ||||
-rw-r--r-- | muse2/muse/waveedit/wavecanvas.cpp | 10 |
6 files changed, 100 insertions, 20 deletions
diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 057e12de..0db8b173 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -181,6 +181,11 @@ Appearance::Appearance(Arranger* a, QWidget* parent) new IdListViewItem(0x41f, aid, "Ruler background"); new IdListViewItem(0x420, aid, "Ruler text"); new IdListViewItem(0x424, aid, "Ruler current marker space"); + new IdListViewItem(0x425, aid, "part wave peak"); + new IdListViewItem(0x426, aid, "part wave rms"); + new IdListViewItem(0x427, aid, "part midi event for light part color"); + new IdListViewItem(0x428, aid, "part midi event for dark part color"); + id = new IdListViewItem(0, aid, "Track List"); new IdListViewItem(0x411, id, "background"); new IdListViewItem(0x412, id, "midi background"); @@ -207,7 +212,13 @@ Appearance::Appearance(Arranger* a, QWidget* parent) new IdListViewItem(0x422, id, "drum list"); id = new IdListViewItem(0, itemList, "Wave Editor"); - new IdListViewItem(0x300, id, "background"); + new IdListViewItem(0x300, id, "Background"); + new IdListViewItem(0x301, id, "Wave peak color"); + new IdListViewItem(0x302, id, "Wave rms color"); + new IdListViewItem(0x303, id, "Wave peak color selected"); + new IdListViewItem(0x304, id, "Wave rms color selected"); + new IdListViewItem(0x305, id, "Wave nonselected part"); + id = new IdListViewItem(0, itemList, "Mixer"); new IdListViewItem(0x500, id, "background"); new IdListViewItem(0x501, id, "midi label"); @@ -759,6 +770,12 @@ void Appearance::colorItemSelectionChanged() case 0x101: color = &config->bigTimeForegroundColor; break; case 0x200: color = &config->transportHandleColor; break; case 0x300: color = &config->waveEditBackgroundColor; break; + case 0x301: color = &config->wavePeakColor; break; + case 0x302: color = &config->waveRmsColor; break; + case 0x303: color = &config->wavePeakColorSelected; break; + case 0x304: color = &config->waveRmsColorSelected; break; + case 0x305: color = &config->waveNonselectedPart; break; + case 0x411: color = &config->trackBg; break; case 0x412: color = &config->midiTrackBg; break; case 0x413: color = &config->drumTrackBg; break; @@ -782,6 +799,10 @@ void Appearance::colorItemSelectionChanged() case 0x422: color = &config->drumListBg; break; case 0x423: color = &config->midiControllerViewBg; break; case 0x424: color = &config->rulerCurrent; break; + case 0x425: color = &config->partWaveColorPeak; break; + case 0x426: color = &config->partWaveColorRms; break; + case 0x427: color = &config->partMidiDarkEventColor; break; + case 0x428: color = &config->partMidiLightEventColor; break; case 0x500: color = &config->mixerBg; break; case 0x501: color = &config->midiTrackLabelBg; break; diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 72c03263..bcbb3e58 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -2315,26 +2315,29 @@ void PartCanvas::drawMoving(QPainter& p, const CItem* item, const QRect&) void PartCanvas::drawMidiPart(QPainter& p, const QRect&, MusECore::EventList* events, MusECore::MidiTrack *mt, MusECore::MidiPart *pt, const QRect& r, int pTick, int from, int to) { int color_brightness; + QColor eventColor; if(pt) { int part_r, part_g, part_b, brightness; MusEGlobal::config.partColors[pt->colorIndex()].getRgb(&part_r, &part_g, &part_b); brightness = part_r*29 + part_g*59 + part_b*12; - //if ((brightness < 12000 || pt->selected()) && !pt->mute()) DELETETHIS 4 - // color_brightness=192; // too dark: use lighter color - //else - // color_brightness=64; // otherwise use dark color - if (brightness >= 12000 && !pt->selected()) + if (brightness >= 12000 && !pt->selected()) { + eventColor=MusEGlobal::config.partMidiDarkEventColor; color_brightness=54; // 96; // too bright: use dark color - else + } + else { + eventColor=MusEGlobal::config.partMidiLightEventColor; color_brightness=200; //160; // too dark: use lighter color + } } - else + else { + eventColor=QColor(80,80,80); color_brightness=80; + } if (MusEGlobal::config.canvasShowPartType & 2) { // show events - p.setPen(QColor(color_brightness,color_brightness,color_brightness)); + p.setPen(eventColor); // Do not allow this, causes segfault. if(from <= to) { @@ -2510,7 +2513,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, MusECore::EventList* ev if (MusEGlobal::heavyDebugMsg) printf("DEBUG: arranger: cakewalk enabled, y-stretch disabled\n"); } - p.setPen(QColor(color_brightness,color_brightness,color_brightness)); + p.setPen(eventColor); for (MusECore::iEvent i = events->begin(); i != ito; ++i) { int t = i->first + pTick; int te = t + i->second.lenTick(); @@ -2618,9 +2621,9 @@ void PartCanvas::drawWavePart(QPainter& p, rms /= channels; peak = (peak * (hh-2)) >> 9; rms = (rms * (hh-2)) >> 9; - p.setPen(QColor(Qt::darkGray)); + p.setPen(MusEGlobal::config.partWaveColorPeak); p.drawLine(i, y - peak - cc, i, y + peak); - p.setPen(QColor(Qt::darkGray).darker()); + p.setPen(MusEGlobal::config.partWaveColorRms); p.drawLine(i, y - rms - cc, i, y + rms); } } @@ -2638,9 +2641,9 @@ void PartCanvas::drawWavePart(QPainter& p, for (unsigned k = 0; k < channels; ++k) { int peak = (sa[k].peak * (hm - 1)) >> 8; int rms = (sa[k].rms * (hm - 1)) >> 8; - p.setPen(QColor(Qt::darkGray)); + p.setPen(MusEGlobal::config.partWaveColorPeak); p.drawLine(i, y - peak - cc, i, y + peak); - p.setPen(QColor(Qt::darkGray).darker()); + p.setPen(MusEGlobal::config.partWaveColorRms); p.drawLine(i, y - rms - cc, i, y + rms); y += 2 * hm; diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 73a234d9..3e7927bd 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -677,6 +677,7 @@ void readConfiguration(Xml& xml, bool doReadMidiPortConfig, bool doReadGlobalCon MusEGlobal::config.palette[15] = readColor(xml); else if (tag == "palette16") MusEGlobal::config.palette[16] = readColor(xml); + else if (tag == "partColor0") MusEGlobal::config.partColors[0] = readColor(xml); else if (tag == "partColor1") @@ -865,6 +866,27 @@ void readConfiguration(Xml& xml, bool doReadMidiPortConfig, bool doReadGlobalCon MusEGlobal::config.rulerFg = readColor(xml); else if (tag == "rulerCurrentColor") MusEGlobal::config.rulerCurrent = readColor(xml); + + else if (tag == "waveNonselectedPart") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "wavePeakColor") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "waveRmsColor") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "wavePeakColorSelected") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "waveRmsColorSelected") + MusEGlobal::config.rulerCurrent = readColor(xml); + + else if (tag == "partWaveColorPeak") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "partWaveColorRms") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "partMidiDarkEventColor") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "partMidiLightEventColor") + MusEGlobal::config.rulerCurrent = readColor(xml); + else if (tag == "midiCanvasBackgroundColor") MusEGlobal::config.midiCanvasBg = readColor(xml); else if (tag == "midiControllerViewBackgroundColor") @@ -1425,6 +1447,18 @@ void MusE::writeGlobalConfiguration(int level, MusECore::Xml& xml) const xml.colorTag(level, "rulerBackgroundColor", MusEGlobal::config.rulerBg); xml.colorTag(level, "rulerForegroundColor", MusEGlobal::config.rulerFg); xml.colorTag(level, "rulerCurrentColor", MusEGlobal::config.rulerCurrent); + + xml.colorTag(level, "waveNonselectedPart", MusEGlobal::config.waveNonselectedPart); + xml.colorTag(level, "wavePeakColor", MusEGlobal::config.wavePeakColor); + xml.colorTag(level, "waveRmsColor", MusEGlobal::config.waveRmsColor); + xml.colorTag(level, "wavePeakColorSelected", MusEGlobal::config.wavePeakColorSelected); + xml.colorTag(level, "waveRmsColorSelected", MusEGlobal::config.waveRmsColorSelected); + + xml.colorTag(level, "partWaveColorPeak", MusEGlobal::config.partWaveColorPeak); + xml.colorTag(level, "partWaveColorRms", MusEGlobal::config.partWaveColorRms); + xml.colorTag(level, "partMidiDarkEventColor", MusEGlobal::config.partMidiDarkEventColor); + xml.colorTag(level, "partMidiLightEventColor", MusEGlobal::config.partMidiLightEventColor); + xml.colorTag(level, "midiCanvasBackgroundColor", MusEGlobal::config.midiCanvasBg); xml.colorTag(level, "midiControllerViewBackgroundColor", MusEGlobal::config.midiControllerViewBg); xml.colorTag(level, "drumListBackgroundColor", MusEGlobal::config.drumListBg); diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index 15938f1c..07c32561 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -132,6 +132,17 @@ GlobalConfigValues config = { QColor(255, 255, 255), // drumListBg QColor(255, 255, 255), // rulerCurrent + Qt::lightGray, // waveNonselectedPart + Qt::darkGray, // wavePeakColor + Qt::black, // waveRmsColor + Qt::lightGray, // wavePeakColorSelected + Qt::white, // waveRmsColorSelected + + Qt::darkGray, // partWaveColorPeak + QColor(20,20,20), // partWaveColorRms + QColor(54,54,54), // partMidiDarkEventColor + QColor(200,200,200), // partMidiLightEventColor + 384, // division; 1024, // rtcTicks true, // midiSendInit Send instrument initialization sequences diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index 93052427..08990f03 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -24,7 +24,7 @@ #ifndef __CONFIG_H__ #define __CONFIG_H__ -#define NUM_PARTCOLORS 19 +#define NUM_PARTCOLORS 18 #define NUM_FONTS 7 #include <QColor> @@ -141,6 +141,17 @@ struct GlobalConfigValues { QColor drumListBg; QColor rulerCurrent; + QColor waveNonselectedPart; + QColor wavePeakColor; + QColor waveRmsColor; + QColor wavePeakColorSelected; + QColor waveRmsColorSelected; + + QColor partWaveColorPeak; + QColor partWaveColorRms; + QColor partMidiDarkEventColor; + QColor partMidiLightEventColor; + int division; int rtcTicks; bool midiSendInit; // Send instrument initialization sequences diff --git a/muse2/muse/waveedit/wavecanvas.cpp b/muse2/muse/waveedit/wavecanvas.cpp index c27f6cef..95ecd250 100644 --- a/muse2/muse/waveedit/wavecanvas.cpp +++ b/muse2/muse/waveedit/wavecanvas.cpp @@ -739,7 +739,7 @@ void WaveCanvas::drawParts(QPainter& p, const QRect& r, bool do_cur_part) { //int cidx = wp->colorIndex(); //QColor c(MusEGlobal::config.partColors[cidx]); - QColor c(Qt::darkGray); + QColor c(MusEGlobal::config.waveNonselectedPart); c.setAlpha(MusEGlobal::config.globalAlphaBlend); QBrush part_bg_brush(MusECore::gGradientFromQColor(c, mwpr.topLeft(), mwpr.bottomLeft())); p.fillRect(mpbgr, part_bg_brush); @@ -1127,12 +1127,12 @@ void WaveCanvas::drawItem(QPainter& p, const MusEGui::CItem* item, const QRect& peak = h; if (rms > h) rms = h; - QColor peak_color = QColor(Qt::darkGray); - QColor rms_color = QColor(Qt::black); + QColor peak_color = MusEGlobal::config.wavePeakColor; + QColor rms_color = MusEGlobal::config.waveRmsColor; if (pos > selectionStartPos && pos < selectionStopPos) { - peak_color = QColor(Qt::lightGray); - rms_color = QColor(Qt::white); + peak_color = MusEGlobal::config.wavePeakColorSelected; + rms_color = MusEGlobal::config.waveRmsColorSelected; QLine l_inv = clipQLine(i, y - h + cc, i, y + h - cc, mr); if(!l_inv.isNull()) { |