Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mouse Control Enhancements
  • Loading branch information
tecknixia committed Oct 17, 2019
commit 05dbcb7ba24e5b7a2dd64009ff6db333d6226adc
23 changes: 11 additions & 12 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,10 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent )
{
// and check whether the user clicked on an
// existing value
if( pos_ticks >= it.key() &&
( it+1==time_map.end() ||
pos_ticks <= (it+1).key() ) &&
( pos_ticks<= it.key() + MidiTime::ticksPerTact() *4 / m_ppt ) &&
( level == it.value() || mouseEvent->button() == Qt::RightButton ) )
if(pos_ticks >= it.key()
&& (it+1==time_map.end() || pos_ticks <= (it+1).key())
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() * 12 / m_ppt)
&& (level == it.value() || mouseEvent->button() == Qt::RightButton))
{
break;
}
Expand Down Expand Up @@ -957,9 +956,9 @@ void AutomationEditor::mouseMoveEvent(QMouseEvent * mouseEvent)
{
// and check whether the cursor is over an
// existing value
if (pos_ticks >= it.key() - MidiTime::ticksPerTact() *4 / m_ppt
if (pos_ticks >= it.key() - MidiTime::ticksPerTact() * 12 / m_ppt
&& (it+1==time_map.end() || pos_ticks <= (it+1).key())
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() *4 / m_ppt)
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() * 12 / m_ppt)
&& (mouseLevel > it.value() - maxLvlFraction)
&& (mouseLevel < it.value() + maxLvlFraction))
{
Expand Down Expand Up @@ -1105,9 +1104,9 @@ void AutomationEditor::mouseDoubleClickEvent(QMouseEvent * mouseEvent)
{
// and check whether the cursor is over an
// existing value
if (pos_ticks >= it.key() - MidiTime::ticksPerTact() *4 / m_ppt
if (pos_ticks >= it.key() - MidiTime::ticksPerTact() * 12 / m_ppt
&& (it+1==time_map.end() || pos_ticks <= (it+1).key())
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() *4 / m_ppt)
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() * 12 / m_ppt)
&& (mouseLevel > it.value() - maxLvlFraction)
&& (mouseLevel < it.value() + maxLvlFraction))
{
Expand All @@ -1118,7 +1117,7 @@ void AutomationEditor::mouseDoubleClickEvent(QMouseEvent * mouseEvent)

bool ok;
double d = QInputDialog::getDouble(this, tr("Edit Point"),
tr("Enter Y Coordinate:"), m_pointYLevel, 0, m_pattern->firstObject()->maxValue<float>(), 3, &ok);
tr("New Y Value:"), m_pointYLevel, 0, m_pattern->firstObject()->maxValue<float>(), 3, &ok);

if (ok)
{
Expand Down Expand Up @@ -1222,9 +1221,9 @@ void AutomationEditor::wheelEvent(QWheelEvent * we)
{
pos_ticks = (pos_ticks < 0) ? 0 : pos_ticks;

if (pos_ticks >= it.key() - MidiTime::ticksPerTact() *4 / m_ppt
if (pos_ticks >= it.key() - MidiTime::ticksPerTact() * 12 / m_ppt
&& (it+1==time_map.end() || pos_ticks <= (it+1).key())
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() *4 / m_ppt)
&& (pos_ticks<= it.key() + MidiTime::ticksPerTact() * 12 / m_ppt)
&& (level > it.value() - maxLvlFraction)
&& (level < it.value() + maxLvlFraction))
{
Expand Down