- Auto *current = 0;
- double unit_position = mwindow->edl->local_session->get_selectionstart(1);
- unit_position = mwindow->edl->align_to_frame(unit_position, 0);
- unit_position = patch->atrack->to_units(unit_position, 0);
-
- FloatAutos *ptr = (FloatAutos*)patch->atrack->automation->autos[AUTOMATION_FADE];
- return (FloatAuto*)ptr->get_prev_auto(
- (long)unit_position,
- PLAY_FORWARD,
- current);
+ this->mwindow = mwindow;
+ this->patch = patch;
+}
+
+void AKeyFadePatch::create_objects()
+{
+ akey_fade_value = new AKeyFadeValue(this);
+ add_subwindow(akey_fade_value);
+ akey_fade_value->activate();
+ show_window();
+}
+
+AKeyFadeValue::AKeyFadeValue(AKeyFadePatch *akey_fade_patch)
+ : AFadePatch(akey_fade_patch->mwindow, akey_fade_patch->patch,
+ 0,0, akey_fade_patch->get_w())
+{
+ this->akey_fade_patch = akey_fade_patch;
+}
+
+int AKeyFadeValue::button_release_event()
+{
+ AFadePatch::button_release_event();
+ return 0;
+}
+
+int AKeyFadeValue::handle_event()
+{
+ APatchGUI *patch = akey_fade_patch->patch;
+ int ret = AFadePatch::handle_event();
+ AFadePatch *fade = patch->fade;
+ if( fade )
+ fade->update(get_value());
+ return ret;