y += 5;
add_subwindow(new BC_Title(x, y, _("Operation:"), LARGEFONT,
resources->text_default));
- y += 35;
int y1 = y;
+ y += 15;
+
AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y);
add_subwindow(android_remote);
y += android_remote->get_h() + 10;
add_subwindow(title = new BC_Title(x2, y, _("PIN:")));
AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y);
add_subwindow(android_pin);
- y += title->get_h() + 30;
+ y += title->get_h() + 20;
ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y);
add_subwindow(shbtn_prefs);
- y += shbtn_prefs->get_h() + 30;
+ y += shbtn_prefs->get_h() + 20;
+
+ add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x2, y));
+ y += reload_plugins->get_h() + 10;
add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
y += title->get_h() + 10;
y += 30;
y2 = y;
- x = x0; y = y1;
+ x = x0; y = y1 + 35;
add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y));
y += 30;
return 1;
}
+PrefsReloadPlugins::PrefsReloadPlugins(PreferencesWindow *pwindow,
+ InterfacePrefs *iface_prefs, int x, int y)
+ : BC_GenericButton(x, y, _("Reload plugin index"))
+{
+ this->pwindow = pwindow;
+ this->iface_prefs = iface_prefs;
+}
+
+int PrefsReloadPlugins::handle_event()
+{
+ pwindow->thread->reload_plugins = 1;
+ text_color(get_resources()->button_highlighted);
+ draw_face(1);
+ return 1;
+}
+
PrefsLV2PathText::PrefsLV2PathText(PreferencesWindow *pwindow,
InterfacePrefs *subwindow, int x, int y, int w)
: BC_TextBox(x, y, w, 1, pwindow->thread->preferences->lv2_path)
if (buttonpress != 3)
{
if(i == AUTOMATION_FADE || i == AUTOMATION_SPEED)
- synchronize_autos(0,
- track,
- (FloatAuto*)mwindow->session->drag_auto,
- 1);
+ fill_ganged_autos(get_double_click(), 0, track,
+ (FloatAuto*)mwindow->session->drag_auto);
mwindow->session->current_operation = pre_auto_operations[i];
update_drag_caption();
rerender = 1;
}
-void TrackCanvas::synchronize_autos(float change,
- Track *skip, FloatAuto *fauto, int fill_gangs)
+void TrackCanvas::fill_ganged_autos(int all, float change, Track *skip, FloatAuto *fauto)
{
+ if( !skip->gang ) return;
// Handles the special case of modifying a fadeauto
// when there are ganged faders on several tracks
-// (skip and fauto may be NULL if fill_gangs==-1)
-
- if( fill_gangs > 0 && skip->gang ) {
- double position = skip->from_units(fauto->position);
- int autoidx = fauto->autos->autoidx;
-
- for(Track *current = mwindow->edl->tracks->first; current; current = NEXT) {
- if( (current->data_type == skip->data_type || get_double_click()) &&
- current->gang && current->record && current != skip ) {
- int64_t current_position = current->to_units(position, 1);
- FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[autoidx];
- float auto_min = mwindow->edl->local_session->automation_mins[fade_autos->autogrouptype];
- float auto_max = mwindow->edl->local_session->automation_maxs[fade_autos->autogrouptype];
- FloatAuto *previous = 0, *next = 0;
- FloatAuto *keyframe = (FloatAuto*)fade_autos->get_auto_at_position(current_position);
- if( !keyframe ) {
-// create keyframe on neighbouring track at the point in time given by fauto
- float init_value = fade_autos->get_value(current_position, PLAY_FORWARD, previous, next);
- float new_value = init_value + change;
- CLAMP(new_value, auto_min, auto_max);
- keyframe = (FloatAuto*)fade_autos->insert_auto(current_position);
- keyframe->set_value(new_value);
- }
- else {
+ double position = skip->from_units(fauto->position);
+ int autoidx = fauto->autos->autoidx;
+
+ for(Track *current = mwindow->edl->tracks->first; current; current = NEXT) {
+ if( (all || current->data_type == skip->data_type) &&
+ current->gang && current->record && current != skip ) {
+ FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[autoidx];
+ float auto_min = mwindow->edl->local_session->automation_mins[fade_autos->autogrouptype];
+ float auto_max = mwindow->edl->local_session->automation_maxs[fade_autos->autogrouptype];
+ int64_t current_position = current->to_units(position, 1);
+ FloatAuto *keyframe = (FloatAuto*)fade_autos->get_auto_at_position(position);
+ if( keyframe ) {
// keyframe exists, just change it
- float new_value = keyframe->get_value() + change;
- CLAMP(new_value, auto_min, auto_max);
- keyframe->adjust_to_new_coordinates(current_position, new_value);
-// need to (re)set the position, as the existing node could be on a "equivalent" position (within half a frame)
- }
-
- mwindow->session->drag_auto_gang->append((Auto *)keyframe);
+ float value = keyframe->get_value();
+ float new_value = value + change;
+ CLAMP(new_value, auto_min, auto_max);
+ keyframe->adjust_to_new_coordinates(current_position, new_value);
}
+ else if( mwindow->edl->session->auto_keyframes ) {
+// create keyframe on neighbouring track at the point in time given by fauto
+ FloatAuto *previous = 0, *next = 0;
+ float value = fade_autos->get_value(current_position, PLAY_FORWARD, previous, next);
+ float new_value = value + change;
+ CLAMP(new_value, auto_min, auto_max);
+ keyframe = (FloatAuto*)fade_autos->insert_auto(current_position);
+ keyframe->set_value(new_value);
+ }
+ else
+ continue;
+ mwindow->session->drag_auto_gang->append((Auto *)keyframe);
}
}
- else if( !fill_gangs ) {
- double position = skip->from_units(fauto->position);
-// Move the gangs
- for (int i = 0; i < mwindow->session->drag_auto_gang->total; i++) {
- FloatAuto *keyframe = (FloatAuto *)mwindow->session->drag_auto_gang->values[i];
- int64_t keyframe_position = keyframe->autos->track->to_units(position, 1);
- float new_value = keyframe->get_value() + change;
- CLAMP(new_value,
- mwindow->edl->local_session->automation_mins[keyframe->autos->autogrouptype],
- mwindow->edl->local_session->automation_maxs[keyframe->autos->autogrouptype]);
- keyframe->adjust_to_new_coordinates(keyframe_position, new_value);
- }
+}
+void TrackCanvas::update_ganged_autos(float change, Track *skip, FloatAuto *fauto)
+{
+ double position = skip->from_units(fauto->position);
+// Move the gangs
+ for (int i = 0; i < mwindow->session->drag_auto_gang->total; i++) {
+ FloatAuto *keyframe = (FloatAuto *)mwindow->session->drag_auto_gang->values[i];
+ int64_t keyframe_position = keyframe->autos->track->to_units(position, 1);
+ float new_value = keyframe->get_value() + change;
+ CLAMP(new_value,
+ mwindow->edl->local_session->automation_mins[keyframe->autos->autogrouptype],
+ mwindow->edl->local_session->automation_maxs[keyframe->autos->autogrouptype]);
+ keyframe->adjust_to_new_coordinates(keyframe_position, new_value);
}
- else {
+}
+
+void TrackCanvas::clear_ganged_autos()
+{
// remove the gangs
- for (int i = 0; i < mwindow->session->drag_auto_gang->total; i++) {
- FloatAuto *keyframe = (FloatAuto *)mwindow->session->drag_auto_gang->values[i];
- keyframe->autos->remove_nonsequential(
- keyframe);
- }
- mwindow->session->drag_auto_gang->remove_all();
+ for (int i = 0; i < mwindow->session->drag_auto_gang->total; i++) {
+ FloatAuto *keyframe = (FloatAuto *)mwindow->session->drag_auto_gang->values[i];
+ keyframe->autos->remove_nonsequential(keyframe);
}
+ mwindow->session->drag_auto_gang->remove_all();
}
result = 1;
float change = value - old_value;
current->adjust_to_new_coordinates(position, value);
- synchronize_autos(change, current->autos->track, current, 0);
+ update_ganged_autos(change, current->autos->track, current);
show_message(current, 1,", %.2f", current->get_value());
}
break;
current->set_control_in_value(
value * levered_position(position - current->position,
current->get_control_in_position()));
- synchronize_autos(0, current->autos->track, current, 0);
+ update_ganged_autos(0, current->autos->track, current);
show_message(current, 1,", %.2f", current->get_control_in_value());
}
break; }
current->set_control_out_value(
value * levered_position(position - current->position,
current->get_control_out_position()));
- synchronize_autos(0, current->autos->track, current, 0);
+ update_ganged_autos(0, current->autos->track, current);
show_message(current, 1,", %.2f", current->get_control_out_value());
}
break; }
load_flags |= LOAD_EDITS;
case DRAG_FADE:
// delete the drag_auto_gang first and remove out of order keys
- synchronize_autos(0, 0, 0, -1);
+ clear_ganged_autos();
case DRAG_CZOOM:
case DRAG_PZOOM:
case DRAG_PLAY: