-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add hotcue text labels, position, and right click menu to overview waveform #2238
Merged
Merged
Changes from 64 commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
dc7c7e3
WOverview: render hotcue text labels
Be-ing d9d963f
WOverview: elide long cue labels, but show them on mouse hover
Be-ing bc19ef3
WOverview: let cue labels expand until they reach the next label
Be-ing 2222550
WOverview: sort cues when they are updated, not when drawing
Be-ing 8554b35
use const auto& in for loops
Be-ing dcbd145
WOverview: move tracking of first hovered mark to mouseMoveEvent
Be-ing e2c80bc
WOverview: show position of hotcues on mouse hover
Be-ing 65d2790
merge WaveformMarkProperties into WaveformMark class
Be-ing f9a540f
add right click menu on WOverview to edit hotcue label & color
Be-ing d2971e5
WOverview: jump to hotcue when clicking its label
Be-ing 6e07761
mention hotcue right click menu in overview & hotcue tooltips
Be-ing 5a4abb8
WOverview: draw playhead marker under cue labels
Be-ing d2d6fc3
add named constant for undefined cue point positions
Be-ing acf83fe
WOverview: fix non-hotcue WaveformMarks not rendering
Be-ing 9f4423e
WOverview: hide WaveformMarkRange durations if they overlap cue position
Be-ing ee9e745
WOverview: don't render invisible WaveformMarks
Be-ing e4b0411
WOverview: avoid overlapping cue labels & cue position text
Be-ing 90e6112
WOverview: show cue position & label when hovering line, not just label
Be-ing 2c1dd95
WOverview: make WaveformMarks without text labels hoverable
Be-ing 0079d64
WOverview: only show hotcue right click menu for hotcues
Be-ing 7539a2f
WOverview: always show at least the hotcue number if label elided
Be-ing bb2bc08
WOverview: shift cue labels left if they would exceed width of widget
Be-ing 9a30992
WOverview: shift cue position text left if it would get cut off
Be-ing 35efc63
WOverview: avoid drawing overlapping cue labels
Be-ing 885efe7
WOverview: remove code that is now redundant
Be-ing 0fb3b36
fix typo in comment
Be-ing 462e3bd
WOverview: show time until cue when hovering
Be-ing 31c3814
WOverview: show time position on right click
Be-ing 6403d30
split ColorMenu class from CueMenu
Be-ing 3af842c
ColorMenu: use cue colors specified by skin
Be-ing 4af33c6
WOverview: show cues that are beyond the limits of the track
Be-ing 85b8485
WOverview: prevent showing out-of-bounds times on right click drag
Be-ing a87655d
factor out redundant code to new WaveformMarkLabel class
Be-ing b3a55e9
mention right clicking to show time in overview tooltip
Be-ing 4f9a5da
WOverview: draw background for non-hotcue cue marks
Be-ing 2378a88
elaborate in comments
Be-ing 0903d1e
WOverview: calculate label background color only once
Be-ing c038eed
WOverview: draw translucent backgrounds for WaveformMarkRange label
Be-ing 0cdfbc5
WOverview: show time till end of track when hovering cues
Be-ing 2fcf8fc
WOverview: fix cue position text getting drawn under other cues
Be-ing e65f56a
WOverview: fix regression with hovered cue labels not getting drawn
Be-ing 05ed063
WOverview: don't draw overlapping labels when hovered label is shifte…
Be-ing cb5cecf
WOverview: make vertical alignment of labels more consistent
Be-ing 8af156d
ColorMenu: set parent of QActions
Be-ing a654ebf
WaveformMarkLabel: skip code when it won't do anything
Be-ing 38feaf6
ColorMenu: remove useColorSet call from constructor
Be-ing 27047e2
WOverview: explain magic number
Be-ing e8d3de8
WOverview: use qreal and remove superfluous explicit casts
Be-ing 7056bc3
double indent for long `if` conditions
Be-ing 5d3159f
remove commented code
Be-ing 641250d
WaveformMarkRender: remove unnecessary check for null text
Be-ing 106e1a6
ColorMenu: refactor to avoid deleting/creating new QActions
Be-ing 2331bf3
Merge remote-tracking branch 'upstream/master' into hotcue_labels
Be-ing 7cd7d49
WOverview: seek on left mouse button press
Be-ing 52f520e
WOverview: show negative times for cue/right click behind playhead
Be-ing 9e53801
WOverview: update at least once per second
Be-ing b81d737
WOverview: increasing padding width for hovering cue lines
Be-ing 65dab6b
WOverview: only update >= once per second if that is actually required
Be-ing 3717577
WOverview: clamp dragged mouse position when moved left of widget
Be-ing 6afd934
Deere: let hotcue labels show lowercase letters
Be-ing 94604cd
Deere: increase default font size to 12px
Be-ing e6f012e
WaveformMarkLabel: elide text that is wider than widget
Be-ing 52968ff
WaveformMarkLabel: rename textPoint -> textBottomLeft
Be-ing f520693
fix indentation
Be-ing f187737
fix build issues with old Qt versions
Be-ing 529be48
LateNight: don't capitalize cue labels on overview waveform
Be-ing 058f0d4
remove unused code
Be-ing 4439406
WOverview: let skins specify label background, text color, and font size
Be-ing 25a653e
Shade: specify overview label colors and font size
Be-ing ed45d45
WOverview: only consider labels at same height for eliding width
Be-ing 2e1e11a
WOverview: show MarkRange and cue labels at consistent height
Be-ing ef72609
WOverview: don't draw MarkRange labels when they should be hidden
Be-ing cbb7bff
Revert "WaveformMarkRender: remove unnecessary check for null text"
Be-ing 367eb1d
WOverview: don't overlap right-aligned cue labels and cue lines
Be-ing d3b6b4e
WOverview: avoid overlapping labels with cue lines
Be-ing ba03e61
WOverview: keep hotcue label showing when right click menu is shown
Be-ing 10e2114
WaveformMark: sort marks without hotcues before those with hotcues
Be-ing 6f85553
add line break to overview waveform tooltip
Be-ing 48f3080
edit overview waveform tooltip
Be-ing 5c5705c
CueMenu: "Cue label" -> "New cue label"
Be-ing 6c3ce9a
WOverview: show CueMenu for hotcue when it is drawn over a non-hotcue
Be-ing a26999e
Fix building on Xenial
daschuer 7c320fa
Remove border of cue labels and increase font size
daschuer 7c304d1
Shade: set a overview bg color to alter the cue label background with…
daschuer c32960d
Shade: remove useless <Style> nodes
ronso0 5a237f4
Deere: regular case for New Label label
ronso0 90efc3e
LateNight: regular case for hotcue label dialog
ronso0 bbe393b
Tango: darker bg for hotcue labels
ronso0 e2407e5
Merge pull request #27 from ronso0/hotcue-label-fixes
Be-ing 02f7874
Merge remote-tracking branch 'upstream/master' into hotcue_labels
Be-ing 1e947ab
Use "Ubuntu" font for WOverview
daschuer 02eb82a
Revert the default font size to 10px, to not trigger a bug that lets …
daschuer 71aca86
Merge pull request #26 from daschuer/hotcue_labels
Be-ing cd46192
Merge branch 'hotcue_labels' of github.com:Be-ing/mixxx into hotcue_l…
Be-ing 0b65f26
Merge remote-tracking branch 'upstream/master' into hotcue_labels
Be-ing 3a3b66b
WOverview: add option for skins to not show cue times on mouse hover
Be-ing d47789f
Skins: don't show times for cues on mouse hover in preview decks
Be-ing 8250e1f
Deere: increase height of mini decks so all text fits on overviews
Be-ing 8c18135
LateNight: increase height of mini decks so all text fits on overviews
Be-ing a254e62
Merge remote-tracking branch 'mixxx/master' into hotcue-confilcts-Lat…
ronso0 602afd6
expand overview in Shade mini decks
ronso0 c1ba627
Merge pull request #29 from ronso0/hotcue-confilcts-LateNight-Shade-fix
Be-ing 05d4464
Skins: don't show cue times on mouse hover for samplers
Be-ing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,105 @@ | ||
#include <QtDebug> | ||
|
||
#include "skin/skincontext.h" | ||
#include "waveform/renderers/waveformmarkproperties.h" | ||
#include "waveform/renderers/waveformsignalcolors.h" | ||
#include "widget/wskincolor.h" | ||
|
||
#include "waveformmark.h" | ||
|
||
WaveformMark::WaveformMark(const QString& group, | ||
const QDomNode& node, | ||
const SkinContext& context, | ||
const WaveformSignalColors& signalColors) | ||
: m_iHotCue(kNoHotCue) { | ||
QString item = context.selectString(node, "Control"); | ||
if (!item.isEmpty()) { | ||
m_pPointCos = std::make_unique<ControlProxy>(group, item); | ||
if (item.startsWith("hotcue_") && item.endsWith("_position")) { | ||
m_iHotCue = item.midRef(7, item.count() - 16).toInt() - 1; | ||
namespace { | ||
Qt::Alignment decodeAlignmentFlags(QString alignString, Qt::Alignment defaultFlags) { | ||
QStringList stringFlags = alignString.toLower() | ||
.split("|", QString::SkipEmptyParts); | ||
|
||
Qt::Alignment hflags = 0L; | ||
Qt::Alignment vflags = 0L; | ||
|
||
for (auto stringFlag : stringFlags) { | ||
if (stringFlag == "center") { | ||
hflags |= Qt::AlignHCenter; | ||
vflags |= Qt::AlignVCenter; | ||
} else if (stringFlag == "left") { | ||
hflags |= Qt::AlignLeft; | ||
} else if (stringFlag == "hcenter") { | ||
hflags |= Qt::AlignHCenter; | ||
} else if (stringFlag == "right") { | ||
hflags |= Qt::AlignRight; | ||
} else if (stringFlag == "top") { | ||
vflags |= Qt::AlignTop; | ||
} else if (stringFlag == "vcenter") { | ||
vflags |= Qt::AlignVCenter; | ||
} else if (stringFlag == "bottom") { | ||
vflags |= Qt::AlignBottom; | ||
} | ||
} | ||
QString visibilityControl = context.selectString(node, "VisibilityControl"); | ||
if (!visibilityControl.isEmpty()) { | ||
ConfigKey key = ConfigKey::parseCommaSeparated(visibilityControl); | ||
m_pVisibleCos = std::make_unique<ControlProxy>(key); | ||
|
||
if (hflags != Qt::AlignLeft && hflags != Qt::AlignHCenter && hflags != Qt::AlignRight) { | ||
hflags = defaultFlags & Qt::AlignHorizontal_Mask; | ||
} | ||
|
||
if (vflags != Qt::AlignTop && vflags != Qt::AlignVCenter && vflags != Qt::AlignBottom) { | ||
vflags = defaultFlags & Qt::AlignVertical_Mask; | ||
} | ||
m_properties = WaveformMarkProperties(node, context, signalColors, m_iHotCue); | ||
|
||
return hflags | vflags; | ||
} | ||
} // anonymous namespace | ||
|
||
WaveformMark::WaveformMark(const QString& group, | ||
const QDomNode& node, | ||
const SkinContext& context, | ||
const WaveformSignalColors& signalColors, | ||
int hotCue) | ||
: m_iHotCue(hotCue) { | ||
if (hotCue >= 0) { | ||
QString item = "hotcue_" + QString::number(hotCue + 1) + "_position"; | ||
m_pPointCos = std::make_unique<ControlProxy>(group, item); | ||
QString control; | ||
if (hotCue != kNoHotCue) { | ||
control = "hotcue_" + QString::number(hotCue + 1) + "_position"; | ||
} else { | ||
control = context.selectString(node, "Control"); | ||
} | ||
if (!control.isEmpty()) { | ||
m_pPointCos = std::make_unique<ControlProxy>(group, control); | ||
} | ||
|
||
QString visibilityControl = context.selectString(node, "VisibilityControl"); | ||
if (!visibilityControl.isEmpty()) { | ||
ConfigKey key = ConfigKey::parseCommaSeparated(visibilityControl); | ||
m_pVisibleCos = std::make_unique<ControlProxy>(key); | ||
} | ||
|
||
QColor color(context.selectString(node, "Color")); | ||
if (!color.isValid()) { | ||
// As a fallback, grab the color from the parent's AxesColor | ||
color = signalColors.getAxesColor(); | ||
qDebug() << "Didn't get mark <Color>, using parent's <AxesColor>:" << color; | ||
} else { | ||
color = WSkinColor::getCorrectColor(color); | ||
} | ||
setBaseColor(color); | ||
|
||
m_textColor = context.selectString(node, "TextColor"); | ||
if (!m_textColor.isValid()) { | ||
// Read the text color, otherwise use the parent's BgColor. | ||
m_textColor = signalColors.getBgColor(); | ||
qDebug() << "Didn't get mark <TextColor>, using parent's <BgColor>:" << m_textColor; | ||
} | ||
|
||
QString markAlign = context.selectString(node, "Align"); | ||
m_align = decodeAlignmentFlags(markAlign, Qt::AlignBottom | Qt::AlignHCenter); | ||
|
||
// Hotcue text is set by the cue's label in the database, not by the skin. | ||
if (hotCue == WaveformMark::kNoHotCue) { | ||
daschuer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
m_text = context.selectString(node, "Text"); | ||
} | ||
|
||
m_pixmapPath = context.selectString(node, "Pixmap"); | ||
if (!m_pixmapPath.isEmpty()) { | ||
m_pixmapPath = context.makeSkinPath(m_pixmapPath); | ||
} | ||
m_properties = WaveformMarkProperties(node, context, signalColors, hotCue); | ||
} | ||
|
||
void WaveformMark::setBaseColor(QColor baseColor) { | ||
m_fillColor = baseColor; | ||
m_borderColor = Color::chooseContrastColor(baseColor); | ||
m_labelColor = Color::chooseColorByBrightness(baseColor, QColor(255,255,255,255), QColor(0,0,0,255)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand what you meant to say here.