~alextee/zrythm

5414551bd6f0ed1bf8ff3861feb5d862d2cf3970 — Alexandros Theodotou 1 year, 3 months ago 57011fd custom_arranger_scrolling
clean up
M inc/gui/widgets/arranger.h => inc/gui/widgets/arranger.h +1 -2
@@ 126,7 126,6 @@ typedef struct _ArrangerWidget

  /** Whether there is an offset from a user scroll that should
   * be added to the offset while dragging. */
  bool   have_offset_from_scroll;
  double offset_x_from_scroll;
  double offset_y_from_scroll;



@@ 667,7 666,7 @@ arranger_widget_scroll_until_obj (
  int              horizontal,
  int              up,
  int              left,
  double           padding);
  int              padding);

/**
 * Toggles the mute status of the selection, based

M inc/gui/widgets/audio_editor_space.h => inc/gui/widgets/audio_editor_space.h +1 -3
@@ 40,9 40,7 @@ typedef struct _AudioEditorSpaceWidget
{
  GtkBox parent_instance;

  GtkBox * left_box;
  //GtkScrolledWindow * arranger_scroll;
  //GtkViewport *       arranger_viewport;
  GtkBox *         left_box;
  ArrangerWidget * arranger;
} AudioEditorSpaceWidget;


M inc/gui/widgets/chord_editor_space.h => inc/gui/widgets/chord_editor_space.h +0 -2
@@ 70,8 70,6 @@ typedef struct _ChordEditorSpaceWidget

  /** The arranger. */
  ArrangerWidget * arranger;
  //GtkScrolledWindow * arranger_scroll;
  //GtkViewport *       arranger_viewport;
} ChordEditorSpaceWidget;

int

M inc/gui/widgets/clip_editor_inner.h => inc/gui/widgets/clip_editor_inner.h +3 -5
@@ 60,11 60,9 @@ typedef struct _ClipEditorInnerWidget
  GtkBox *          bot_of_arranger_toolbar;
  GtkLabel *        track_name_lbl;
  GtkBox *          left_of_ruler_box;
  //GtkScrolledWindow * ruler_scroll;
  //GtkViewport *       ruler_viewport;
  RulerWidget *  ruler;
  GtkStack *     editor_stack;
  GtkSizeGroup * left_of_ruler_size_group;
  RulerWidget *     ruler;
  GtkStack *        editor_stack;
  GtkSizeGroup *    left_of_ruler_size_group;

  /* ==== Piano Roll (Midi Editor) ==== */


M inc/gui/widgets/ruler.h => inc/gui/widgets/ruler.h +0 -1
@@ 129,7 129,6 @@ typedef struct _RulerWidget
  double last_offset_x;

  double hover_x;
  double hover_y;

  GtkGestureDrag *  drag;
  GtkGestureClick * click;

M inc/gui/widgets/timeline_panel.h => inc/gui/widgets/timeline_panel.h +0 -12
@@ 52,12 52,6 @@ typedef struct _TimelinePanelWidget
  /** Box for the timelines and the ruler. */
  GtkBox * timelines_plus_ruler;

  /** Scroll for ruler holding the viewport. */
  //GtkScrolledWindow * ruler_scroll;

  /** Viewport for ruler holding the ruler. */
  //GtkViewport * ruler_viewport;

  /** Ruler. */
  RulerWidget * ruler;



@@ 65,17 59,11 @@ typedef struct _TimelinePanelWidget
   * timelines. */
  GtkBox * timeline_divider_box;

  //GtkScrolledWindow * timeline_scroll;
  //GtkViewport *       timeline_viewport;

  /** The main timeline. */
  ArrangerWidget * timeline;

  TimelineToolbarWidget * timeline_toolbar;

  //GtkScrolledWindow * pinned_timeline_scroll;
  //GtkViewport *       pinned_timeline_viewport;

  /** The pinned timeline above the main one. */
  ArrangerWidget * pinned_timeline;


M src/gui/backend/event_manager.c => src/gui/backend/event_manager.c +0 -2
@@ 717,8 717,6 @@ event_manager_process_event (EventManager * self, ZEvent * ev)
      {
#if 0
        RulerWidget * ruler = Z_RULER_WIDGET (ev->arg);
        gtk_widget_set_size_request (
          GTK_WIDGET (ruler), (int) ruler->total_px, -1);
#endif
      }
      break;

M src/gui/widgets/arranger.c => src/gui/widgets/arranger.c +30 -39
@@ 85,7 85,7 @@ G_DEFINE_TYPE (ArrangerWidget, arranger_widget, GTK_TYPE_WIDGET)

#define TYPE_IS(x) (self->type == TYPE (x))

#define SCROLL_PADDING 8.0
#define SCROLL_PADDING 8

/**
 * Returns if the arranger can scroll vertically.


@@ 976,7 976,7 @@ move_items_x (ArrangerWidget * self, const double ticks_diff)
    arranger_widget_get_selections (self);
  g_return_if_fail (sel);

  EVENTS_PUSH (ET_ARRANGER_SELECTIONS_IN_TRANSIT, sel);
  EVENTS_PUSH_NOW (ET_ARRANGER_SELECTIONS_IN_TRANSIT, sel);

  arranger_selections_add_ticks (sel, ticks_diff);
  g_debug ("adding %f ticks to selections", ticks_diff);


@@ 6137,28 6137,19 @@ arranger_widget_scroll_until_obj (
  int              horizontal,
  int              up,
  int              left,
  double           padding)
  int              padding)
{
#if 0
  GtkScrolledWindow * scroll =
    arranger_widget_get_scrolled_window (self);
  int scroll_width =
    gtk_widget_get_allocated_width (GTK_WIDGET (scroll));
  int scroll_height =
    gtk_widget_get_allocated_height (GTK_WIDGET (scroll));
  GtkAdjustment * hadj = gtk_scrolled_window_get_hadjustment (
    GTK_SCROLLED_WINDOW (scroll));
  GtkAdjustment * vadj = gtk_scrolled_window_get_vadjustment (
    GTK_SCROLLED_WINDOW (scroll));
  double adj_x = gtk_adjustment_get_value (hadj);
  double adj_y = gtk_adjustment_get_value (vadj);
  GtkAllocation allocation;
  gtk_widget_get_allocation (GTK_WIDGET (self), &allocation);
  EditorSettings * settings =
    arranger_widget_get_editor_settings (self);

  if (horizontal)
    {
      double start_px = (double) arranger_widget_pos_to_px (
        self, &obj->pos, 1);
      double end_px = (double) arranger_widget_pos_to_px (
        self, &obj->end_pos, 1);
      int start_px =
        arranger_widget_pos_to_px (self, &obj->pos, 1);
      int end_px =
        arranger_widget_pos_to_px (self, &obj->end_pos, 1);

      /* adjust px for objects with non-global
       * positions */


@@ 6167,52 6158,52 @@ arranger_widget_scroll_until_obj (
          ArrangerObject * r_obj = (ArrangerObject *)
            clip_editor_get_region (CLIP_EDITOR);
          g_return_if_fail (r_obj);
          double tmp_px = (double) arranger_widget_pos_to_px (
            self, &r_obj->pos, 1);
          int tmp_px =
            arranger_widget_pos_to_px (self, &r_obj->pos, 1);
          start_px += tmp_px;
          end_px += tmp_px;
        }

      if (
        start_px <= adj_x
        || end_px >= adj_x + (double) scroll_width)
        start_px <= settings->scroll_start_x
        || end_px >= settings->scroll_start_x + allocation.width)
        {
          if (left)
            {
              gtk_adjustment_set_value (
                hadj, start_px - padding);
              editor_settings_set_scroll_start_x (
                settings, start_px - padding, F_NO_VALIDATE);
            }
          else
            {
              double tmp =
                (end_px + padding) - (double) scroll_width;
              gtk_adjustment_set_value (hadj, tmp);
              int tmp = (end_px + padding) - allocation.width;
              editor_settings_set_scroll_start_x (
                settings, tmp, F_NO_VALIDATE);
            }
        }
    }
  else
    {
      arranger_object_set_full_rectangle (obj, self);
      double start_px = obj->full_rect.y;
      double end_px = obj->full_rect.y + obj->full_rect.height;
      int start_px = obj->full_rect.y;
      int end_px = obj->full_rect.y + obj->full_rect.height;
      if (
        start_px <= adj_y
        || end_px >= adj_y + (double) scroll_height)
        start_px <= settings->scroll_start_y
        || end_px
             >= settings->scroll_start_y + allocation.height)
        {
          if (up)
            {
              gtk_adjustment_set_value (
                vadj, start_px - padding);
              editor_settings_set_scroll_start_y (
                settings, start_px - padding, F_NO_VALIDATE);
            }
          else
            {
              double tmp =
                (end_px + padding) - (double) scroll_height;
              gtk_adjustment_set_value (vadj, tmp);
              int tmp = (end_px + padding) - allocation.height;
              editor_settings_set_scroll_start_y (
                settings, tmp, F_NO_VALIDATE);
            }
        }
    }
#endif
}

/**

M src/gui/widgets/audio_editor_space.c => src/gui/widgets/audio_editor_space.c +0 -21
@@ 27,27 27,6 @@ G_DEFINE_TYPE (
  audio_editor_space_widget,
  GTK_TYPE_BOX)

#if 0
/**
 * Links scroll windows after all widgets have been
 * initialized.
 */
static void
link_scrolls (AudioEditorSpaceWidget * self)
{
  /* link ruler h scroll to arranger h scroll */
  if (MW_CLIP_EDITOR_INNER->ruler_scroll)
    {
      g_return_if_fail (
        GTK_IS_WIDGET (MW_CLIP_EDITOR_INNER->ruler_scroll));
      gtk_scrolled_window_set_hadjustment (
        MW_CLIP_EDITOR_INNER->ruler_scroll,
        gtk_scrolled_window_get_hadjustment (
          GTK_SCROLLED_WINDOW (self->arranger_scroll)));
    }
}
#endif

/**
 * See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
 */

M src/gui/widgets/automation_editor_space.c => src/gui/widgets/automation_editor_space.c +0 -21
@@ 27,25 27,6 @@ G_DEFINE_TYPE (
  automation_editor_space_widget,
  GTK_TYPE_BOX)

#if 0
/**
 * Links scroll windows after all widgets have been
 * initialized.
 */
static void
link_scrolls (AutomationEditorSpaceWidget * self)
{
  /* link ruler h scroll to arranger h scroll */
  if (MW_CLIP_EDITOR_INNER->ruler_scroll)
    {
      gtk_scrolled_window_set_hadjustment (
        MW_CLIP_EDITOR_INNER->ruler_scroll,
        gtk_scrolled_window_get_hadjustment (
          self->arranger_scroll));
    }
}
#endif

/**
 * See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
 */


@@ 111,8 92,6 @@ automation_editor_space_widget_class_init (
  gtk_widget_class_bind_template_child ( \
    klass, AutomationEditorSpaceWidget, x)

  /*BIND_CHILD (arranger_scroll);*/
  /*BIND_CHILD (arranger_viewport);*/
  BIND_CHILD (arranger);
  BIND_CHILD (left_box);
  /*BIND_CHILD (legend);*/

M src/gui/widgets/chord_editor_space.c => src/gui/widgets/chord_editor_space.c +0 -30
@@ 32,34 32,6 @@ G_DEFINE_TYPE (

#define DEFAULT_PX_PER_KEY 12

#if 0
/**
 * Links scroll windows after all widgets have been
 * initialized.
 */
static void
link_scrolls (ChordEditorSpaceWidget * self)
{
  /* link note keys v scroll to arranger v scroll */
  if (self->chord_keys_scroll)
    {
      gtk_scrolled_window_set_vadjustment (
        self->chord_keys_scroll,
        gtk_scrolled_window_get_vadjustment (
          GTK_SCROLLED_WINDOW (self->arranger_scroll)));
    }

  /* link ruler h scroll to arranger h scroll */
  if (MW_CLIP_EDITOR_INNER->ruler_scroll)
    {
      gtk_scrolled_window_set_hadjustment (
        MW_CLIP_EDITOR_INNER->ruler_scroll,
        gtk_scrolled_window_get_hadjustment (
          self->arranger_scroll));
    }
}
#endif

/**
 * See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
 */


@@ 194,8 166,6 @@ chord_editor_space_widget_class_init (
  gtk_widget_class_bind_template_child ( \
    klass, ChordEditorSpaceWidget, x)

  /*BIND_CHILD (arranger_scroll);*/
  /*BIND_CHILD (arranger_viewport);*/
  BIND_CHILD (arranger);
  BIND_CHILD (left_box);
  BIND_CHILD (chord_keys_box);

M src/gui/widgets/clip_editor_inner.c => src/gui/widgets/clip_editor_inner.c +0 -2
@@ 301,8 301,6 @@ clip_editor_inner_widget_class_init (
  BIND_CHILD (bot_of_arranger_toolbar);
  BIND_CHILD (track_name_lbl);
  BIND_CHILD (left_of_ruler_box);
  /*BIND_CHILD (ruler_scroll);*/
  /*BIND_CHILD (ruler_viewport);*/
  BIND_CHILD (ruler);
  BIND_CHILD (toggle_notation);
  BIND_CHILD (toggle_listen_notes);

M src/gui/widgets/midi_arranger.c => src/gui/widgets/midi_arranger.c +9 -13
@@ 496,19 496,16 @@ midi_arranger_handle_vertical_zoom_scroll (
  if (!(state & GDK_CONTROL_MASK && state & GDK_SHIFT_MASK))
    return;

#if 0
  GtkScrolledWindow * scroll =
    arranger_widget_get_scrolled_window (self);

  double y = self->hover_y;
  double delta_y = dy;

  /* get current adjustment so we can get the
   * difference from the cursor */
  GtkAdjustment * adj =
    gtk_scrolled_window_get_vadjustment (scroll);
  double adj_val = gtk_adjustment_get_value (adj);
  double size_before = gtk_adjustment_get_upper (adj);
  EditorSettings * settings =
    arranger_widget_get_editor_settings (self);
  double adj_val = settings->scroll_start_y;
  double size_before = gtk_widget_get_allocated_height (
    GTK_WIDGET (MW_PIANO_ROLL_KEYS));
  double adj_perc = y / size_before;

  /* get px diff so we can calculate the new


@@ 535,9 532,8 @@ midi_arranger_handle_vertical_zoom_scroll (
  /* refresh relevant widgets */
  midi_editor_space_widget_refresh (MW_MIDI_EDITOR_SPACE);

  /* get updated adjustment and set its value
   at the same offset as before */
  adj = gtk_scrolled_window_get_vadjustment (scroll);
  gtk_adjustment_set_value (adj, adj_perc * size_after - diff);
#endif
  /* set value at the same offset as before */
  editor_settings_set_scroll_start_y (
    settings, (int) (adj_perc * size_after - diff),
    F_NO_VALIDATE);
}

M src/gui/widgets/midi_editor_space.c => src/gui/widgets/midi_editor_space.c +0 -91
@@ 43,54 43,6 @@ on_midi_modifier_changed (
    PIANO_ROLL, gtk_combo_box_get_active (widget));
}

#if 0
/**
 * Links scroll windows after all widgets have been
 * initialized.
 */
static void
link_scrolls (MidiEditorSpaceWidget * self)
{
  /* link note keys v scroll to arranger v scroll */
  if (self->piano_roll_keys_scroll)
    {
      gtk_scrolled_window_set_vadjustment (
        self->piano_roll_keys_scroll,
        gtk_scrolled_window_get_vadjustment (
          GTK_SCROLLED_WINDOW (self->arranger_scroll)));
    }

  /* link ruler h scroll to arranger h scroll */
  if (MW_CLIP_EDITOR_INNER->ruler_scroll)
    {
      gtk_scrolled_window_set_hadjustment (
        self->arranger_scroll,
        gtk_scrolled_window_get_hadjustment (
          MW_CLIP_EDITOR_INNER->ruler_scroll));
    }

  /* link modifier arranger h scroll to arranger h
   * scroll */
  if (self->modifier_arranger_scroll)
    {
      gtk_scrolled_window_set_hadjustment (
        self->modifier_arranger_scroll,
        gtk_scrolled_window_get_hadjustment (
          MW_CLIP_EDITOR_INNER->ruler_scroll));
    }

  /* set scrollbar adjustments */
  gtk_scrollbar_set_adjustment (
    self->arranger_hscrollbar,
    gtk_scrolled_window_get_hadjustment (
      MW_CLIP_EDITOR_INNER->ruler_scroll));
  gtk_scrollbar_set_adjustment (
    self->arranger_vscrollbar,
    gtk_scrolled_window_get_vadjustment (
      GTK_SCROLLED_WINDOW (self->arranger_scroll)));
}
#endif

static int
on_scroll (
  GtkEventControllerScroll * scroll_controller,


@@ 111,46 63,11 @@ on_scroll (
  return TRUE;
}

#if 0
/**
 * Source function that keeps trying to scroll to the
 * mid note until successful.
 */
static gboolean
midi_editor_space_tick_cb (
  GtkWidget *     widget,
  GdkFrameClock * frame_clock,
  gpointer        user_data)
{
  MidiEditorSpaceWidget * self =
    Z_MIDI_EDITOR_SPACE_WIDGET (user_data);
  GtkAdjustment * adj = gtk_scrolled_window_get_vadjustment (
    self->arranger_scroll);
  double lower = gtk_adjustment_get_lower (adj);
  double upper = gtk_adjustment_get_upper (adj);

  /* keep trying until the scrolled window has
   * a proper size */
  if (upper > 0)
    {
      gtk_adjustment_set_value (
        adj, lower + (upper - lower) / 2.0);

      return G_SOURCE_REMOVE;
    }

  return G_SOURCE_CONTINUE;
}
#endif

void
midi_editor_space_widget_refresh (MidiEditorSpaceWidget * self)
{
  piano_roll_keys_widget_refresh (self->piano_roll_keys);

  /* relink scrolls (why?) */
  /*link_scrolls (self);*/

  /* setup combo box */
  gtk_combo_box_set_active (
    GTK_COMBO_BOX (self->midi_modifier_chooser),


@@ 243,11 160,6 @@ midi_editor_space_widget_init (MidiEditorSpaceWidget * self)

  gtk_widget_init_template (GTK_WIDGET (self));

  /* make hscrollbar invisible until GTK bug
   * 4478 is fixed */
  /*gtk_widget_set_visible (*/
  /*GTK_WIDGET (self->arranger_hscrollbar), false);*/

  gtk_paned_set_resize_start_child (
    self->midi_arranger_velocity_paned, true);
  gtk_paned_set_resize_end_child (


@@ 298,9 210,6 @@ midi_editor_space_widget_init (MidiEditorSpaceWidget * self)
  gtk_widget_add_controller (
    GTK_WIDGET (self),
    GTK_EVENT_CONTROLLER (scroll_controller));

  /*gtk_widget_add_tick_callback (*/
  /*GTK_WIDGET (self), midi_editor_space_tick_cb, self, NULL);*/
}

static void

M src/gui/widgets/ruler.c => src/gui/widgets/ruler.c +7 -3
@@ 1418,6 1418,7 @@ drag_begin (
{
  EditorSettings * settings =
    ruler_widget_get_editor_settings (self);
  g_return_if_fail (settings);
  start_x += settings->scroll_start_x;
  self->start_x = start_x;
  self->start_y = start_y;


@@ 1546,9 1547,9 @@ on_motion (

  EditorSettings * settings =
    ruler_widget_get_editor_settings (self);
  g_return_if_fail (settings);
  x += settings->scroll_start_x;
  self->hover_x = x;
  self->hover_y = y;

  /* drag-update didn't work so do the drag-update
   * here */


@@ 1707,6 1708,7 @@ ruler_widget_get_visible_rect (
  gtk_widget_get_allocation (GTK_WIDGET (self), rect);
  const EditorSettings * settings =
    ruler_widget_get_editor_settings (self);
  g_return_if_fail (settings);
  rect->x = settings->scroll_start_x;
  rect->y = 0;
}


@@ 1801,7 1803,6 @@ on_scroll (
  RulerWidget * self = Z_RULER_WIDGET (user_data);

  double x = self->hover_x;
  /*double y = self->hover_y;*/

  GdkModifierType modifier_type =
    gtk_event_controller_get_current_event_state (


@@ 1811,12 1812,12 @@ on_scroll (
  bool shift_held = modifier_type & GDK_SHIFT_MASK;
  if (ctrl_held)
    {
      g_debug ("ctrl held");

      if (!shift_held)
        {
          EditorSettings * settings =
            ruler_widget_get_editor_settings (self);
          g_return_val_if_fail (settings, false);
          double adj_val = (double) settings->scroll_start_x;

          /* get position of cursor */


@@ 1855,6 1856,9 @@ on_scroll (
              timeline_minimap_widget_refresh (
                MW_TIMELINE_MINIMAP);
            }

          /* also update hover x since we're using it here */
          self->hover_x = new_x;
        }
    }
  else /* else if not ctrl held */

M src/gui/widgets/timeline_panel.c => src/gui/widgets/timeline_panel.c +0 -50
@@ 30,19 30,6 @@ G_DEFINE_TYPE (
  timeline_panel_widget,
  GTK_TYPE_BOX)

#if 0
static void
on_hadj_value_changed (GtkAdjustment * adj, gpointer user_data)
{
#  if 0
  g_debug (
    "horizontal adjustment value changed to %f",
    gtk_adjustment_get_value (adj));
#  endif
  EVENTS_PUSH (ET_RULER_VIEWPORT_CHANGED, MW_RULER);
}
#endif

void
timeline_panel_widget_setup (TimelinePanelWidget * self)
{


@@ 60,21 47,6 @@ timeline_panel_widget_setup (TimelinePanelWidget * self)
    GTK_WIDGET (self->ruler), -1, RW_HEIGHT);
  tracklist_header_widget_setup (self->tracklist_header);

  /* setup ruler */
#if 0
  gtk_scrolled_window_set_hadjustment (
    self->ruler_scroll,
    gtk_scrolled_window_get_hadjustment (
      self->timeline_scroll));

  /* set pinned timeline to follow main timeline's
   * hscroll */
  gtk_scrolled_window_set_hadjustment (
    self->pinned_timeline_scroll,
    gtk_scrolled_window_get_hadjustment (
      self->timeline_scroll));
#endif

  ruler_widget_refresh (Z_RULER_WIDGET (MW_RULER));
  ruler_widget_refresh (Z_RULER_WIDGET (EDITOR_RULER));



@@ 95,22 67,6 @@ timeline_panel_widget_setup (TimelinePanelWidget * self)
    Z_ARRANGER_WIDGET (self->pinned_timeline),
    ARRANGER_WIDGET_TYPE_TIMELINE, SNAP_GRID_TIMELINE);

#if 0
  /* link vertical scroll of timeline to
   * tracklist */
  gtk_scrolled_window_set_vadjustment (
    self->timeline_scroll,
    gtk_scrolled_window_get_vadjustment (
      self->tracklist->unpinned_scroll));

  GtkAdjustment * adj = gtk_scrollable_get_hadjustment (
    GTK_SCROLLABLE (self->ruler_viewport));

  g_signal_connect (
    G_OBJECT (adj), "value-changed",
    G_CALLBACK (on_hadj_value_changed), self);
#endif

  timeline_toolbar_widget_setup (self->timeline_toolbar);
}



@@ 194,15 150,9 @@ timeline_panel_widget_class_init (
  BIND_CHILD (tracklist_top);
  BIND_CHILD (tracklist_header);
  BIND_CHILD (tracklist);
  /*BIND_CHILD (ruler_scroll);*/
  /*BIND_CHILD (ruler_viewport);*/
  /*BIND_CHILD (timeline_scroll);*/
  /*BIND_CHILD (timeline_viewport);*/
  BIND_CHILD (timeline);
  BIND_CHILD (ruler);
  BIND_CHILD (timeline_divider_box);
  /*BIND_CHILD (pinned_timeline_scroll);*/
  /*BIND_CHILD (pinned_timeline_viewport);*/
  BIND_CHILD (pinned_timeline);
  BIND_CHILD (timeline_toolbar);
  BIND_CHILD (timelines_plus_ruler);

M src/project.c => src/project.c +0 -79
@@ 1775,85 1775,6 @@ project_save (
  audio_pool_remove_unused (AUDIO_POOL, is_backup);
  audio_pool_write_to_disk (AUDIO_POOL, is_backup);

  /* save UI positions */
  if (ZRYTHM_HAVE_UI)
    {
      if (MW_TIMELINE)
        {
#if 0
          GtkScrolledWindow * scroll =
            arranger_widget_get_scrolled_window (MW_TIMELINE);
          GtkAdjustment * adj =
            gtk_scrolled_window_get_hadjustment (scroll);
          PRJ_TIMELINE->editor_settings.scroll_start_x =
            (int) gtk_adjustment_get_value (adj);
          adj = gtk_scrolled_window_get_vadjustment (scroll);
          PRJ_TIMELINE->editor_settings.scroll_start_y =
            (int) gtk_adjustment_get_value (adj);
#endif
        }
      if (MW_MIDI_ARRANGER)
        {
#if 0
          GtkScrolledWindow * scroll =
            arranger_widget_get_scrolled_window (
              MW_MIDI_ARRANGER);
          GtkAdjustment * adj =
            gtk_scrolled_window_get_hadjustment (scroll);
          PIANO_ROLL->editor_settings.scroll_start_x =
            (int) gtk_adjustment_get_value (adj);
          adj = gtk_scrolled_window_get_vadjustment (scroll);
          PIANO_ROLL->editor_settings.scroll_start_y =
            (int) gtk_adjustment_get_value (adj);
#endif
        }
      if (MW_AUTOMATION_ARRANGER)
        {
#if 0
          GtkScrolledWindow * scroll =
            arranger_widget_get_scrolled_window (
              MW_AUTOMATION_ARRANGER);
          GtkAdjustment * adj =
            gtk_scrolled_window_get_hadjustment (scroll);
          AUTOMATION_EDITOR->editor_settings.scroll_start_x =
            (int) gtk_adjustment_get_value (adj);
          adj = gtk_scrolled_window_get_vadjustment (scroll);
          AUTOMATION_EDITOR->editor_settings.scroll_start_y =
            (int) gtk_adjustment_get_value (adj);
#endif
        }
      if (MW_AUDIO_ARRANGER)
        {
#if 0
          GtkScrolledWindow * scroll =
            arranger_widget_get_scrolled_window (
              MW_AUDIO_ARRANGER);
          GtkAdjustment * adj =
            gtk_scrolled_window_get_hadjustment (scroll);
          AUDIO_CLIP_EDITOR->editor_settings.scroll_start_x =
            (int) gtk_adjustment_get_value (adj);
          adj = gtk_scrolled_window_get_vadjustment (scroll);
          AUDIO_CLIP_EDITOR->editor_settings.scroll_start_y =
            (int) gtk_adjustment_get_value (adj);
#endif
        }
      if (MW_CHORD_ARRANGER)
        {
#if 0
          GtkScrolledWindow * scroll =
            arranger_widget_get_scrolled_window (
              MW_CHORD_ARRANGER);
          GtkAdjustment * adj =
            gtk_scrolled_window_get_hadjustment (scroll);
          CHORD_EDITOR->editor_settings.scroll_start_x =
            (int) gtk_adjustment_get_value (adj);
          adj = gtk_scrolled_window_get_vadjustment (scroll);
          CHORD_EDITOR->editor_settings.scroll_start_y =
            (int) gtk_adjustment_get_value (adj);
#endif
        }
    }

  ProjectSaveData * data = object_new (ProjectSaveData);
  data->project_file_path = project_get_path (
    self, PROJECT_PATH_PROJECT_FILE, is_backup);