parent
ca73e5748a
commit
82ab8e140e
@ -275,10 +275,11 @@ bool Editor_keyDown(int key, int modifiers)
|
|||||||
|
|
||||||
if ((key >= '1' && key <= '9') && ((modifiers & EDITOR_KEY_CTRL) || (modifiers & EDITOR_KEY_ALT)))
|
if ((key >= '1' && key <= '9') && ((modifiers & EDITOR_KEY_CTRL) || (modifiers & EDITOR_KEY_ALT)))
|
||||||
{
|
{
|
||||||
struct sync_track* track = tracks[active_track];
|
struct sync_track** tracks;
|
||||||
int row = viewInfo->rowPos;
|
int track, row;
|
||||||
|
|
||||||
float bias_value = 0.0f;
|
float bias_value = 0.0f;
|
||||||
|
tracks = getTracks();
|
||||||
|
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
@ -293,19 +294,32 @@ bool Editor_keyDown(int key, int modifiers)
|
|||||||
|
|
||||||
bias_value = modifiers & EDITOR_KEY_ALT ? -bias_value : bias_value;
|
bias_value = modifiers & EDITOR_KEY_ALT ? -bias_value : bias_value;
|
||||||
|
|
||||||
int idx = key_idx_floor(track, row);
|
int selectLeft = mini(viewInfo->selectStartTrack, viewInfo->selectStopTrack);
|
||||||
if (idx < 0)
|
int selectRight = maxi(viewInfo->selectStartTrack, viewInfo->selectStopTrack);
|
||||||
return false;
|
int selectTop = mini(viewInfo->selectStartRow, viewInfo->selectStopRow);
|
||||||
|
int selectBottom = maxi(viewInfo->selectStartRow, viewInfo->selectStopRow);
|
||||||
|
|
||||||
// copy and modify
|
for (track = selectLeft; track <= selectRight; ++track)
|
||||||
struct track_key newKey = track->keys[idx];
|
{
|
||||||
|
struct sync_track* t = tracks[track];
|
||||||
|
|
||||||
|
for (row = selectTop; row <= selectBottom; ++row)
|
||||||
|
{
|
||||||
|
int idx = sync_find_key(t, row);
|
||||||
|
if (idx < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
struct track_key newKey = t->keys[idx];
|
||||||
newKey.value += bias_value;
|
newKey.value += bias_value;
|
||||||
|
|
||||||
sync_set_key(track, &newKey);
|
sync_set_key(t, &newKey);
|
||||||
|
|
||||||
RemoteConnection_sendSetKeyCommand(track->name, &newKey);
|
RemoteConnection_sendSetKeyCommand(t->name, &newKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Editor_update();
|
Editor_update();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user