Commit 85dfd9b0 authored by alextee's avatar alextee

compiles but runs with huge lags and problems

parent 9ad66cd3
......@@ -121,7 +121,8 @@ CFLAGS = -Wall \
$(PANGOFT2_CFLAGS) \
$(SNDFILE_CFLAGS) \
$(DEFAULT_CFLAGS) \
$(EXTRA_LD_FLAGS)
$(EXTRA_LD_FLAGS) \
-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
LDFLAGS = $(GTK_LIBS) \
......
......@@ -44,7 +44,7 @@ AC_PROG_CC([gcc])
AC_PREFIX_DEFAULT([/usr])
#Checks for libraries.
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.20])
PKG_CHECK_MODULES([GTK], [gtk+-4.0 >= 3.94])
PKG_CHECK_MODULES([JACK], [jack >= 1.8.17])
PKG_CHECK_MODULES([LILV], [lilv-0 >= 0.24.2])
PKG_CHECK_MODULES([SUIL], [suil-0 >= 0.10.0])
......
......@@ -30,11 +30,9 @@
typedef struct _MainWindowWidget MainWindowWidget;
/** FIXME delete wm */
typedef struct Widget_Manager
{
//GHashTable * widgets;
GtkTargetEntry entries[10]; ///< dnd entries
int num_entries; ///< count
MainWindowWidget * main_window; ///< main window
} Widget_Manager;
......
......@@ -85,6 +85,7 @@ typedef struct ArrangerWidget
GtkGestureDrag * drag;
GtkGestureMultiPress * multipress;
GtkGestureMultiPress * right_mouse_mp;
GtkEventControllerKey * key_controller;
double last_offset_x; ///< for dragging regions, selections
double last_offset_y; ///< for selections
ArrangerWidgetAction action;
......
......@@ -52,6 +52,7 @@ typedef struct AudioUnitLabelWidget
Port * port; ///< the port it corresponds to
AULType type;
int hover; ///< hovered or not
GtkEventControllerMotion * motion;
} AudioUnitLabelWidget;
typedef struct AudioUnitLabelWidgetClass
......
......@@ -33,7 +33,8 @@
typedef enum ACW_CursorState
{
ACW_STATE_NONE,
ACW_STATE_DEFAULT,
ACW_STATE_GRABBING,
} ACW_CursorState;
typedef struct AutomationCurve AutomationCurve;
......@@ -49,7 +50,7 @@ typedef struct AutomationCurveWidget
GtkGestureDrag * drag;
double last_x;
double last_y;
GtkEventControllerMotion * motion;
ACW_CursorState cursor_state;
} AutomationCurveWidget;
......
......@@ -38,18 +38,20 @@
#define AP_WIDGET_CURVE_W 8
#define AP_WIDGET_PADDING 1
typedef enum AutomationPointWidgetState
typedef enum APW_CursorState
{
APW_STATE_NONE,
APW_STATE_SELECTED,
APW_STATE_HOVER
} AutomationPointWidgetState;
APW_CSTATE_DEFAULT,
APW_CSTATE_GRABBING
} APW_CursorState;
typedef struct AutomationPointWidget
{
GtkBox parent_instance;
AutomationPoint * ap; ///< the automation_point associated with this
AutomationPointWidgetState state;
GtkEventControllerMotion * motion;
int hover;
int selected;
APW_CursorState cursor_state;
} AutomationPointWidget;
......@@ -64,12 +66,9 @@ typedef struct AutomationPointWidgetClass
AutomationPointWidget *
automation_point_widget_new (AutomationPoint * automation_point);
/**
* Sets hover state and queues draw.
*/
void
automation_point_widget_set_state_and_queue_draw (AutomationPointWidget * self,
AutomationPointWidgetState state);
automation_point_widget_set_cursor (AutomationPointWidget * self,
APW_CursorState state);
GType automation_point_widget_get_type(void);
......
......@@ -42,6 +42,7 @@ typedef struct ChannelSlotWidget
GtkDrawingArea parent_instance;
Channel * channel; ///< the channel this belongs to
int slot_index; ///< the channel slot index
GtkGestureMultiPress * multipress;
} ChannelSlotWidget;
typedef struct ChannelSlotWidgetClass
......
......@@ -73,6 +73,7 @@ typedef struct DigitalMeterWidget
SnapGrid * snap_grid;
int update_dens; ///< flag to update density
int start_dens; ///< start density
GtkGestureMultiPress * multipress;
} DigitalMeterWidget;
typedef struct DigitalMeterWidgetClass
......
......@@ -77,6 +77,7 @@ typedef struct FaderWidget
int hover;
GdkRGBA start_color;
GdkRGBA end_color;
GtkEventControllerMotion * motion;
} FaderWidget;
typedef struct FaderWidgetClass
......
......@@ -53,6 +53,7 @@ typedef struct KnobWidget
GtkGestureDrag *drag; ///< used for drag gesture
double last_x; ///< used in gesture drag
double last_y; ///< used in gesture drag
GtkEventControllerMotion * motion;
} KnobWidget;
typedef struct KnobWidgetClass
......
......@@ -56,16 +56,16 @@ typedef struct _MainWindowWidget
GtkBox * top_bar;
GtkBox * top_menubar;
GtkMenuItem * file;
GtkImageMenuItem * file_new;
GtkImageMenuItem * file_open;
GtkImageMenuItem * file_save;
GtkImageMenuItem * file_save_as;
GtkImageMenuItem * file_export;
GtkImageMenuItem * file_quit;
GtkMenuItem * file_new;
GtkMenuItem * file_open;
GtkMenuItem * file_save;
GtkMenuItem * file_save_as;
GtkMenuItem * file_export;
GtkMenuItem * file_quit;
GtkMenuItem * edit;
GtkMenuItem * view;
GtkMenuItem * help;
GtkImageMenuItem * help_about;
GtkMenuItem * help_about;
GtkBox * window_buttons;
GtkButton * minimize;
GtkButton * maximize;
......
......@@ -49,6 +49,7 @@ typedef struct MeterWidget
int hover; ///< hovered or not
GdkRGBA start_color;
GdkRGBA end_color;
GtkEventControllerMotion * motion;
} MeterWidget;
typedef struct MeterWidgetClass
......
......@@ -33,20 +33,22 @@
#define IS_MIDI_NOTE_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDI_NOTE_WIDGET_TYPE))
#define MIDI_NOTE_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDI_NOTE_WIDGET_TYPE, MidiNoteWidgetClass))
typedef enum MidiNoteWidgetState
typedef enum MNW_CursorState
{
MNW_STATE_NONE,
MNW_STATE_SELECTED,
MNW_STATE_RESIZE_L,
MNW_STATE_RESIZE_R,
MNW_STATE_HOVER
} MidiNoteWidgetState;
MNW_CSTATE_DEFAULT,
MNW_CSTATE_RESIZE_L,
MNW_CSTATE_RESIZE_R,
MNW_CSTATE_GRABBING
} MNW_CursorState;
typedef struct MidiNoteWidget
{
GtkBox parent_instance;
MidiNote * midi_note; ///< the midi_note associated with this
MidiNoteWidgetState state;
MNW_CursorState cursor_state;
GtkEventControllerMotion * motion;
int hover;
int selected;
} MidiNoteWidget;
typedef struct MidiNoteWidgetClass
......@@ -60,15 +62,11 @@ typedef struct MidiNoteWidgetClass
MidiNoteWidget *
midi_note_widget_new (MidiNote * midi_note);
/**
* Sets hover state and queues draw.
*/
void
midi_note_widget_set_state_and_queue_draw (MidiNoteWidget * self,
MidiNoteWidgetState state);
midi_note_widget_set_cursor (MidiNoteWidget * self,
MNW_CursorState state);
GType midi_note_widget_get_type(void);
#endif
......@@ -46,6 +46,7 @@ typedef struct PanWidget
int hover; ///< hovered or not
GdkRGBA start_color;
GdkRGBA end_color;
GtkEventControllerMotion * motion;
} PanWidget;
typedef struct PanWidgetClass
......@@ -64,4 +65,3 @@ pan_widget_new (float (*getter)(void *), ///< getter function
#endif
......@@ -37,7 +37,8 @@ typedef enum RWCursorState
{
RWS_CURSOR_DEFAULT,
RWS_CURSOR_RESIZE_L,
RWS_CURSOR_RESIZE_R
RWS_CURSOR_RESIZE_R,
RWS_CURSOR_GRABBING
} RWCursorState;
typedef struct RegionWidget
......@@ -47,6 +48,7 @@ typedef struct RegionWidget
int hover;
int selected;
RWCursorState cursor_state;
GtkEventControllerMotion * motion;
} RegionWidget;
typedef struct RegionWidgetClass
......@@ -64,6 +66,10 @@ void
region_widget_select (RegionWidget * self,
int select);
void
region_widget_set_cursor (RegionWidget *self,
RWCursorState state);
GType region_widget_get_type(void);
#endif
......
......@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
#define RULER_WIDGET_TYPE (ruler_widget_get_type ())
#define RULER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RULER_WIDGET_TYPE, Ruler))
#define RULER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RULER_WIDGET_TYPE, RulerWidget))
#define RULER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RULER_WIDGET, RulerWidgetClass))
#define IS_RULER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RULER_WIDGET_TYPE))
#define IS_RULER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RULER_WIDGET_TYPE))
......
......@@ -48,6 +48,7 @@ typedef struct TracklistWidget
GtkGestureDrag * drag;
GtkGestureMultiPress * multipress;
GtkGestureMultiPress * right_mouse_mp; ///< right mouse multipress
GtkEventControllerKey * key_controller;
TrackWidget * master_tw; ///< master track widget
TrackWidget * track_widgets[100]; ///< track paneds, in the order they appear.
///< invisible tracks do not get stored here,
......
......@@ -29,7 +29,7 @@
/**
* Gets system file separator. MUST be freed.
*/
char *
const char *
io_get_separator (); ///< string to write to
/**
......
......@@ -31,5 +31,11 @@ void
ui_show_error_message (GtkWindow * parent_window,
const char * message);
/**
* Creates and returns DND formats for internal objects.
*/
GdkContentFormats *
ui_get_object_dnd_formats ();
#endif
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.94"/>
<template class="AudioUnitWidget" parent="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_homogeneous">True</property>
<property name="column_homogeneous">True</property>
<property name="can-focus">False</property>
<property name="row-homogeneous">True</property>
<property name="column-homogeneous">True</property>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Audio Unit</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="r_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="l_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
</template>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.94"/>
<template class="AutomationTrackWidget" parent="GtkPaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="at_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="selector">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="hexpand">1</property>
<signal name="changed" handler="on_at_selector_changed" object="AutomationTrackWidget" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="mute_toggle">
<property name="label" translatable="yes">M</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="value_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="add_lane">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="use-stock">True</property>
<signal name="clicked" handler="on_add_lane_clicked" object="AutomationTrackWidget" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
</object>
......@@ -68,8 +57,5 @@
<property name="shrink">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</template>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.94"/>
<template class="AutomatorWidget" parent="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<child>
<object class="GtkLabel" id="name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LFO 1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="can-focus">1</property>
<property name="hscrollbar-policy">never</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport" id="controls_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkBox" id="controls_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="automate">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<placeholder/>
</child>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="power">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<placeholder/>
</child>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</template>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.94"/>
<template class="BrowserWidget" parent="GtkPaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<property name="position">220</property>
<property name="position_set">True</property>
<property name="wide_handle">True</property>
<property name="position-set">True</property>
<property name="wide-handle">True</property>
<child>
<object class="GtkGrid" id="browser_top">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="vexpand">1</property>
<child>
<object class="GtkSearchEntry" id="browser_search">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
<property name="can-focus">1</property>
<property name="hexpand">1</property>
<property name="primary-icon-name">edit-find-symbolic</property>
<property name="primary-icon-activatable">0</property>
<property name="primary-icon-sensitive">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="collections_exp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="label_fill">True</property>
<child>
<placeholder/>
</child>
<property name="can-focus">1</property>
<property name="hexpand">1</property>
<child type="label">
<object class="GtkLabel" id="glabel-collections">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="hexpand">1</property>
<property name="label" translatable="yes">Collection</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">2</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="types_exp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="label_fill">True</property>
<child>
<placeholder/>
</child>
<property name="can-focus">1</property>
<property name="hexpand">1</property>
<child type="label">
<object class="GtkLabel" id="glabel-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Type</property>
<property name="justify">fill</property>
<property name="wrap">True</property>
<property name="wrap">1</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="cat_exp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_fill">True</property>
<child>