Browse Source

initial chord arranger

carla_vst
Alexandros Theodotou 4 years ago
parent
commit
c9cd4d27a8
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 2
      AUTHORS
  2. 3
      THANKS
  3. 2
      data/meson.build
  4. 78
      data/org.zrythm.Zrythm.gschema.xml
  5. 18
      inc/audio/chord_object.h
  6. 7
      inc/gui/backend/chord_editor.h
  7. 8
      inc/gui/widgets/audio_editor_space.h
  8. 84
      inc/gui/widgets/automation_editor_space.h
  9. 6
      inc/gui/widgets/chord_arranger.h
  10. 105
      inc/gui/widgets/chord_editor_space.h
  11. 59
      inc/gui/widgets/chord_key.h
  12. 5
      inc/gui/widgets/chord_selector_window.h
  13. 38
      inc/gui/widgets/clip_editor_inner.h
  14. 8
      inc/gui/widgets/midi_editor_space.h
  15. 10
      inc/gui/widgets/piano_roll_key.h
  16. 1
      inc/settings/settings.h
  17. 2
      inc/utils/resources.h
  18. 1
      po/meson.build
  19. 2
      resources/gen-gtk-gresources-xml.py
  20. 203
      resources/ui/automation_editor_space.ui
  21. 211
      resources/ui/chord_editor_space.ui
  22. 20
      resources/ui/clip_editor_inner.ui
  23. 33
      src/actions/actions.c
  24. 36
      src/actions/edit_chord_action.c
  25. 23
      src/audio/chord_object.c
  26. 20
      src/gui/backend/chord_editor.c
  27. 2
      src/gui/backend/clip_editor.c
  28. 68
      src/gui/backend/events.c
  29. 14
      src/gui/widgets/audio_editor_space.c
  30. 126
      src/gui/widgets/automation_editor_space.c
  31. 10
      src/gui/widgets/chord_arranger.c
  32. 57
      src/gui/widgets/chord_arranger_bg.c
  33. 144
      src/gui/widgets/chord_editor_space.c
  34. 145
      src/gui/widgets/chord_key.c
  35. 8
      src/gui/widgets/chord_object.c
  36. 32
      src/gui/widgets/chord_selector_window.c
  37. 84
      src/gui/widgets/clip_editor_inner.c
  38. 2
      src/gui/widgets/editor_ruler.c
  39. 3
      src/gui/widgets/meson.build
  40. 21
      src/gui/widgets/midi_editor_space.c
  41. 3
      src/gui/widgets/midi_note.c
  42. 4
      src/gui/widgets/piano_roll_key.c
  43. 3
      src/gui/widgets/piano_roll_key_label.c
  44. 20
      src/gui/widgets/splash.c
  45. 3
      src/gui/widgets/velocity.c
  46. 11
      src/settings/settings.c
  47. 2
      src/utils/localization.c
  48. 4
      src/zrythm.c

2
AUTHORS

@ -4,8 +4,6 @@ Contributors: @@ -4,8 +4,6 @@ Contributors:
* Main developer
Sascha Bast <sash@mischkonsum.org>
* Piano roll auto-scroll
Robin Gareus <robin@gareus.org>
* Routing algorithm
Georg Krause
* Forward and backward button callbacks

3
THANKS

@ -12,6 +12,9 @@ Thanks: @@ -12,6 +12,9 @@ Thanks:
* Coming up with the Zrythm tagline
Yuri
* FreeBSD packager
Robin Gareus <robin@gareus.org>
* Help and advice
* Routing algorithm
----

2
data/meson.build

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
install_data (
'org.zrythm.gschema.xml',
'org.zrythm.Zrythm.gschema.xml',
install_dir: schemasdir)
install_data (
'zrythm.desktop',

78
data/org.zrythm.gschema.xml → data/org.zrythm.Zrythm.gschema.xml

@ -22,22 +22,22 @@ @@ -22,22 +22,22 @@
<schemalist>
<schema id="org.zrythm"
path="/org/zrythm/">
<schema id="org.zrythm.Zrythm"
path="/org/zrythm/Zrythm/">
</schema>
<enum id="org.zrythm.preferences.audio-backend-enum">
<enum id="org.zrythm.Zrythm.preferences.audio-backend-enum">
<value nick="none" value="0"/>
<value nick="alsa" value="1"/>
<value nick="jack" value="2"/>
<value nick="port-audio" value="3"/>
</enum>
<enum id="org.zrythm.preferences.midi-backend-enum">
<enum id="org.zrythm.Zrythm.preferences.midi-backend-enum">
<value nick="none" value="0"/>
<value nick="alsa" value="1"/>
<value nick="jack" value="2"/>
</enum>
<enum id="org.zrythm.preferences.language-enum">
<enum id="org.zrythm.Zrythm.preferences.language-enum">
<value nick="english" value="0"/>
<value nick="german" value="1"/>
<value nick="french" value="2"/>
@ -49,64 +49,64 @@ @@ -49,64 +49,64 @@
<value nick="russian" value="8"/>
<value nick="chinese" value="9"/>
</enum>
<enum id="org.zrythm.preferences.export-time-range-enum">
<enum id="org.zrythm.Zrythm.preferences.export-time-range-enum">
<value nick="song" value="0"/>
<value nick="loop" value="1"/>
<value nick="custom" value="2"/>
</enum>
<enum id="org.zrythm.preferences.export-format-enum">
<enum id="org.zrythm.Zrythm.preferences.export-format-enum">
<value nick="FLAC" value="0"/>
<value nick="OGG" value="1"/>
<value nick="WAV" value="2"/>
<value nick="MP3" value="3"/>
</enum>
<enum id="org.zrythm.preferences.export-bit-depth-enum">
<enum id="org.zrythm.Zrythm.preferences.export-bit-depth-enum">
<value nick="16" value="0"/>
<value nick="24" value="1"/>
<value nick="23" value="2"/>
</enum>
<enum id="org.zrythm.ui.notenotation">
<enum id="org.zrythm.Zrythm.ui.notenotation">
<value nick="notes" value="0"/>
<value nick="numbers" value="1"/>
</enum>
<enum id="org.zrythm.ui.plugin-browser-tab">
<enum id="org.zrythm.Zrythm.ui.plugin-browser-tab">
<value nick="collection" value="0"/>
<value nick="category" value="1"/>
<value nick="protocol" value="2"/>
</enum>
<enum id="org.zrythm.ui.plugin-browser-filter">
<enum id="org.zrythm.Zrythm.ui.plugin-browser-filter">
<value nick="none" value="0"/>
<value nick="instrument" value="1"/>
<value nick="effect" value="2"/>
<value nick="modulator" value="3"/>
<value nick="midi-effect" value="4"/>
</enum>
<enum id="org.zrythm.ui.piano-roll-highlight-enum">
<enum id="org.zrythm.Zrythm.ui.piano-roll-highlight-enum">
<value nick="none" value="0"/>
<value nick="chord" value="1"/>
<value nick="scale" value="2"/>
<value nick="both" value="3"/>
</enum>
<enum id="org.zrythm.ui.piano-roll-midi-modifier-enum">
<enum id="org.zrythm.Zrythm.ui.piano-roll-midi-modifier-enum">
<value nick="velocity" value="0"/>
<value nick="pitch-wheel" value="1"/>
<value nick="mod-wheel" value="2"/>
<value nick="aftertouch" value="3"/>
</enum>
<enum id="org.zrythm.preferences.pan-law-enum">
<enum id="org.zrythm.Zrythm.preferences.pan-law-enum">
<value nick="zero-db" value="0"/>
<value nick="minus-three-db" value="1"/>
<value nick="minus-six-db" value="2"/>
</enum>
<enum id="org.zrythm.preferences.pan-algo-enum">
<enum id="org.zrythm.Zrythm.preferences.pan-algo-enum">
<value nick="linear" value="0"/>
<value nick="sqrt" value="1"/>
<value nick="sine" value="2"/>
</enum>
<!-- GENERAL schema -->
<schema id="org.zrythm.general"
path="/org/zrythm/general/">
<schema id="org.zrythm.Zrythm.general"
path="/org/zrythm/Zrythm/general/">
<key name="recent-projects" type="as">
<default>[]</default>
@ -138,11 +138,12 @@ @@ -138,11 +138,12 @@
</schema>
<!-- PREFERENCES schema -->
<schema id="org.zrythm.preferences"
path="/org/zrythm/preferences/">
<schema id="org.zrythm.Zrythm.preferences"
path="/org/zrythm/Zrythm/preferences/">
<!-- KEY: audio-backend -->
<key name="audio-backend" enum="org.zrythm.preferences.audio-backend-enum">
<key name="audio-backend"
enum="org.zrythm.Zrythm.preferences.audio-backend-enum">
<default>"jack"</default>
<summary>Audio Backend</summary>
<description>
@ -152,7 +153,7 @@ @@ -152,7 +153,7 @@
<!-- KEY: pan-algorithm -->
<key name="pan-algo"
enum="org.zrythm.preferences.pan-algo-enum">
enum="org.zrythm.Zrythm.preferences.pan-algo-enum">
<default>"sine"</default>
<summary>The panning algorithm</summary>
<description>
@ -163,7 +164,7 @@ @@ -163,7 +164,7 @@
<!-- KEY: pan-law -->
<key name="pan-law"
enum="org.zrythm.preferences.pan-law-enum">
enum="org.zrythm.Zrythm.preferences.pan-law-enum">
<default>"minus-three-db"</default>
<summary>The Pan Law</summary>
<description>
@ -173,7 +174,8 @@ @@ -173,7 +174,8 @@
</key>
<!-- KEY: midi-backend -->
<key name="midi-backend" enum="org.zrythm.preferences.midi-backend-enum">
<key name="midi-backend"
enum="org.zrythm.Zrythm.preferences.midi-backend-enum">
<default>"jack"</default>
<summary>MIDI Backend</summary>
<description>
@ -193,7 +195,7 @@ @@ -193,7 +195,7 @@
<!-- Selected language -->
<key name="language"
enum="org.zrythm.preferences.language-enum">
enum="org.zrythm.Zrythm.preferences.language-enum">
<default>"english"</default>
<summary>UI interface language</summary>
<description>
@ -239,7 +241,8 @@ @@ -239,7 +241,8 @@
</key>
<!-- KEY: export time range -->
<key name="export-time-range" enum="org.zrythm.preferences.export-time-range-enum">
<key name="export-time-range"
enum="org.zrythm.Zrythm.preferences.export-time-range-enum">
<default>"song"</default>
<summary>Time range to use when exporting</summary>
<description>
@ -248,7 +251,8 @@ @@ -248,7 +251,8 @@
</key>
<!-- KEY: export format -->
<key name="export-format" enum="org.zrythm.preferences.export-format-enum">
<key name="export-format"
enum="org.zrythm.Zrythm.preferences.export-format-enum">
<default>"FLAC"</default>
<summary>Format to use when exporting</summary>
<description>
@ -266,7 +270,8 @@ @@ -266,7 +270,8 @@
</key>
<!-- KEY: export bit depth -->
<key name="export-bit-depth" enum="org.zrythm.preferences.export-bit-depth-enum">
<key name="export-bit-depth"
enum="org.zrythm.Zrythm.preferences.export-bit-depth-enum">
<default>"24"</default>
<summary>Bit depth to use when exporting</summary>
<description>
@ -276,10 +281,11 @@ @@ -276,10 +281,11 @@
</schema>
<!-- UI schema -->
<schema id="org.zrythm.ui"
path="/org/zrythm/ui/">
<schema id="org.zrythm.Zrythm.ui"
path="/org/zrythm/Zrythm/ui/">
<!-- KEY: note notation -->
<key name="note-notation" enum="org.zrythm.ui.notenotation">
<key name="note-notation"
enum="org.zrythm.Zrythm.ui.notenotation">
<default>"notes"</default>
<summary>Note Notation</summary>
<description>
@ -288,7 +294,8 @@ @@ -288,7 +294,8 @@
</key>
<!-- KEY: piano roll highlighting -->
<key name="piano-roll-highlight" enum="org.zrythm.ui.piano-roll-highlight-enum">
<key name="piano-roll-highlight"
enum="org.zrythm.Zrythm.ui.piano-roll-highlight-enum">
<default>"none"</default>
<summary>Piano Roll Highlight</summary>
<description>
@ -298,7 +305,8 @@ @@ -298,7 +305,8 @@
</key>
<!-- KEY: piano roll midi modifier -->
<key name="piano-roll-midi-modifier" enum="org.zrythm.ui.piano-roll-midi-modifier-enum">
<key name="piano-roll-midi-modifier"
enum="org.zrythm.Zrythm.ui.piano-roll-midi-modifier-enum">
<default>"velocity"</default>
<summary>Piano Roll MIDI Modifier</summary>
<description>
@ -318,7 +326,8 @@ @@ -318,7 +326,8 @@
</key>
<!-- KEY: plugin browser tab -->
<key name="plugin-browser-tab" enum="org.zrythm.ui.plugin-browser-tab">
<key name="plugin-browser-tab"
enum="org.zrythm.Zrythm.ui.plugin-browser-tab">
<default>"category"</default>
<summary>Plugin Browser tab</summary>
<description>
@ -327,7 +336,8 @@ @@ -327,7 +336,8 @@
</key>
<!-- KEY: plugin browser filter -->
<key name="plugin-browser-filter" enum="org.zrythm.ui.plugin-browser-filter">
<key name="plugin-browser-filter"
enum="org.zrythm.Zrythm.ui.plugin-browser-filter">
<default>"none"</default>
<summary>Plugin Browser filter</summary>
<description>

18
inc/audio/chord_object.h

@ -78,7 +78,9 @@ typedef struct ChordObject @@ -78,7 +78,9 @@ typedef struct ChordObject
/** Cache, used in runtime operations. */
Position cache_pos;
ChordDescriptor * descr;
/** The index of the chord it belongs to
* (0 topmost). */
int index;
/** Pointer back to parent. */
Region * region;
@ -124,8 +126,8 @@ chord_object_init_loaded ( @@ -124,8 +126,8 @@ chord_object_init_loaded (
*/
ChordObject *
chord_object_new (
ChordDescriptor * descr,
int is_main);
int index,
int is_main);
static inline int
chord_object_is_equal (
@ -134,7 +136,7 @@ chord_object_is_equal ( @@ -134,7 +136,7 @@ chord_object_is_equal (
{
return
!position_compare(&a->pos, &b->pos) &&
chord_descriptor_is_equal (a->descr, b->descr);
a->index == b->index;
}
/**
@ -145,6 +147,14 @@ chord_object_set_region ( @@ -145,6 +147,14 @@ chord_object_set_region (
ChordObject * self,
Region * region);
/**
* Returns the ChordDescriptor associated with this
* ChordObject.
*/
ChordDescriptor *
chord_object_get_chord_descriptor (
ChordObject * self);
/**
* Finds the ChordObject in the project
* corresponding to the given one.

7
inc/gui/backend/chord_editor.h

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
#include <cyaml/cyaml.h>
typedef struct ChordDescriptor ChordDescriptor;
/**
* @addtogroup gui_backend
*
@ -37,13 +39,14 @@ @@ -37,13 +39,14 @@
#define CHORD_EDITOR \
(&CLIP_EDITOR->chord_editor)
typedef struct Region Region;
/**
* Backend for the chord editor.
*/
typedef struct ChordEditor
{
/** The chords to show on the left. */
ChordDescriptor * chords[128];
int num_chords;
} ChordEditor;
static const cyaml_schema_field_t

8
inc/gui/widgets/audio_editor_space.h

@ -65,6 +65,14 @@ void @@ -65,6 +65,14 @@ void
audio_editor_space_widget_setup (
AudioEditorSpaceWidget * self);
/**
* See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
*/
void
audio_editor_space_widget_update_size_group (
AudioEditorSpaceWidget * self,
int visible);
void
audio_editor_space_widget_refresh (
AudioEditorSpaceWidget * self);

84
inc/gui/widgets/automation_editor_space.h

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
/*
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file
*
* Automation editor space.
*/
#ifndef __GUI_WIDGETS_AUTOMATION_EDITOR_SPACE_H__
#define __GUI_WIDGETS_AUTOMATION_EDITOR_SPACE_H__
#include <gtk/gtk.h>
#define AUTOMATION_EDITOR_SPACE_WIDGET_TYPE \
(automation_editor_space_widget_get_type ())
G_DECLARE_FINAL_TYPE (
AutomationEditorSpaceWidget,
automation_editor_space_widget,
Z, AUTOMATION_EDITOR_SPACE_WIDGET,
GtkBox)
typedef struct _AutomationArrangerWidget
AutomationArrangerWidget;
/**
* @addtogroup widgets
*
* @{
*/
#define MW_AUTOMATION_EDITOR_SPACE \
MW_CLIP_EDITOR_INNER->automation_editor_space
/**
* The piano roll widget is the whole space inside
* the clip editor tab when a AUTOMATION region is selected.
*/
typedef struct _AutomationEditorSpaceWidget
{
GtkBox parent_instance;
GtkScrolledWindow * arranger_scroll;
GtkViewport * arranger_viewport;
AutomationArrangerWidget * arranger;
} AutomationEditorSpaceWidget;
void
automation_editor_space_widget_setup (
AutomationEditorSpaceWidget * self);
/**
* See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
*/
void
automation_editor_space_widget_update_size_group (
AutomationEditorSpaceWidget * self,
int visible);
void
automation_editor_space_widget_refresh (
AutomationEditorSpaceWidget * self);
/**
* @}
*/
#endif

6
inc/gui/widgets/chord_arranger.h

@ -35,7 +35,8 @@ G_DECLARE_FINAL_TYPE ( @@ -35,7 +35,8 @@ G_DECLARE_FINAL_TYPE (
Z, CHORD_ARRANGER_WIDGET,
ArrangerWidget)
#define CHORD_ARRANGER MW_PIANO_ROLL->arranger
#define CHORD_ARRANGER \
MW_CHORD_EDITOR_SPACE->arranger
typedef struct _ArrangerBgWidget ArrangerBgWidget;
typedef struct ChordObject ChordObject;
@ -55,6 +56,9 @@ typedef struct _ChordArrangerWidget @@ -55,6 +56,9 @@ typedef struct _ChordArrangerWidget
* there could be more selected.
*/
ChordObject * start_chord_object;
/** Index of the chord being hovered on. */
int hovered_index;
} ChordArrangerWidget;
ARRANGER_W_DECLARE_FUNCS (

105
inc/gui/widgets/chord_editor_space.h

@ -0,0 +1,105 @@ @@ -0,0 +1,105 @@
/*
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file
*
* Chord editor space.
*/
#ifndef __GUI_WIDGETS_CHORD_EDITOR_SPACE_H__
#define __GUI_WIDGETS_CHORD_EDITOR_SPACE_H__
#include <gtk/gtk.h>
#define CHORD_EDITOR_SPACE_WIDGET_TYPE \
(chord_editor_space_widget_get_type ())
G_DECLARE_FINAL_TYPE (
ChordEditorSpaceWidget,
chord_editor_space_widget,
Z, CHORD_EDITOR_SPACE_WIDGET,
GtkBox)
typedef struct _ChordArrangerWidget
ChordArrangerWidget;
typedef struct _ChordKeyWidget ChordKeyWidget;
/**
* @addtogroup widgets
*
* @{
*/
#define MW_CHORD_EDITOR_SPACE \
MW_CLIP_EDITOR_INNER->chord_editor_space
/**
* The piano roll widget is the whole space inside
* the clip editor tab when a CHORD region is selected.
*/
typedef struct _ChordEditorSpaceWidget
{
GtkBox parent_instance;
/** The main vertical paned. */
GtkPaned * main_top_bot_paned;
/** The box dividing the chord keys and the
* arranger. */
GtkBox * chord_keys_slash_arranger_box;
/** The box on the left of the arranger containing
* the chord keys. */
GtkBox * left_box;
/** The box wrapped inside a scroll that will host
* the ChordKeyWidget's. */
GtkBox * chord_keys_box;
/** The chord keys (see ChordEditor). */
ChordKeyWidget * chord_keys[128];
/** The arranger. */
ChordArrangerWidget * arranger;
GtkScrolledWindow * arranger_scroll;
GtkViewport * arranger_viewport;
} ChordEditorSpaceWidget;
void
chord_editor_space_widget_setup (
ChordEditorSpaceWidget * self);
/**
* See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
*/
void
chord_editor_space_widget_update_size_group (
ChordEditorSpaceWidget * self,
int visible);
void
chord_editor_space_widget_refresh (
ChordEditorSpaceWidget * self);
/**
* @}
*/
#endif

59
inc/gui/widgets/chord_key.h

@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
/*
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file
*/
#ifndef __GUI_WIDGETS_CHORD_KEY_H__
#define __GUI_WIDGETS_CHORD_KEY_H__
#include <gtk/gtk.h>
#define CHORD_KEY_WIDGET_TYPE \
(chord_key_widget_get_type ())
G_DECLARE_FINAL_TYPE (
ChordKeyWidget,
chord_key_widget,
Z, CHORD_KEY_WIDGET,
GtkDrawingArea)
/**
* Piano roll note widget to be shown on the left
* side of the piano roll (128 of these).
*/
typedef struct _ChordKeyWidget
{
GtkDrawingArea parent_instance;
/** The chord this widget is for. */
ChordDescriptor * descr;
GtkGestureMultiPress * multipress;
} ChordKeyWidget;
/**
* Creates a ChordKeyWidget for the given
* MIDI note descriptor.
*/
ChordKeyWidget *
chord_key_widget_new (
ChordDescriptor * descr);
#endif

5
inc/gui/widgets/chord_selector_window.h

@ -132,9 +132,6 @@ typedef struct _ChordSelectorWindowWidget @@ -132,9 +132,6 @@ typedef struct _ChordSelectorWindowWidget
GtkRadioButton * creator_visibility_all;
GtkRadioButton * creator_visibility_in_scale;
/** The owner ChordObjectWidget. */
ChordObjectWidget * chord;
/** ScaleObject at the chord's position. */
ScaleObject * scale;
@ -149,7 +146,7 @@ typedef struct _ChordSelectorWindowWidget @@ -149,7 +146,7 @@ typedef struct _ChordSelectorWindowWidget
*/
ChordSelectorWindowWidget *
chord_selector_window_widget_new (
ChordObjectWidget * owner);
ChordDescriptor * descr);
/**
* @}

38
inc/gui/widgets/clip_editor_inner.h

@ -42,6 +42,10 @@ typedef struct _MidiEditorSpaceWidget @@ -42,6 +42,10 @@ typedef struct _MidiEditorSpaceWidget
MidiEditorSpaceWidget;
typedef struct _AudioEditorSpaceWidget
AudioEditorSpaceWidget;
typedef struct _ChordEditorSpaceWidget
ChordEditorSpaceWidget;
typedef struct _AutomationEditorSpaceWidget
AutomationEditorSpaceWidget;
/**
* @addtogroup widgets
@ -49,7 +53,33 @@ typedef struct _AudioEditorSpaceWidget @@ -49,7 +53,33 @@ typedef struct _AudioEditorSpaceWidget
* @{
*/
#define MW_CLIP_EDITOR_INNER MW_CLIP_EDITOR->clip_editor_inner
#define MW_CLIP_EDITOR_INNER \
MW_CLIP_EDITOR->clip_editor_inner
/**
* Adds or removes widgets from the
* left_of_ruler_size_group depending on if the
* current editor space is visible or not.
*
* To be used by each editor space.
*
* @note Assumes that a boolean called visible
* exists.
*
* @param wname The name of the widget.
*/
#define CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP( \
wname) \
if (visible) \
gtk_size_group_add_widget ( \
MW_CLIP_EDITOR_INNER-> \
left_of_ruler_size_group, \
GTK_WIDGET (self->wname)); \
else \
gtk_size_group_remove_widget ( \
MW_CLIP_EDITOR_INNER-> \
left_of_ruler_size_group, \
GTK_WIDGET (self->wname))
/**
* The piano roll widget is the whole space inside
@ -80,10 +110,16 @@ typedef struct _ClipEditorInnerWidget @@ -80,10 +110,16 @@ typedef struct _ClipEditorInnerWidget
/* ==== Automation Editor ==== */
AutomationEditorSpaceWidget *
automation_editor_space;
/* ==== End Automation Editor ==== */
/* ==== Chord Editor ==== */
ChordEditorSpaceWidget *
chord_editor_space;
/* ==== End Chord Editor ==== */
/* ==== Audio Editor ==== */

8
inc/gui/widgets/midi_editor_space.h

@ -121,6 +121,14 @@ void @@ -121,6 +121,14 @@ void
midi_editor_space_widget_setup (
MidiEditorSpaceWidget * self);
/**
* See CLIP_EDITOR_INNER_WIDGET_ADD_TO_SIZEGROUP.
*/
void
midi_editor_space_widget_update_size_group (
MidiEditorSpaceWidget * self,
int visible);
/**
* Refresh the labels only (for highlighting).
*

10
inc/gui/widgets/piano_roll_key.h

@ -28,11 +28,11 @@ @@ -28,11 +28,11 @@
#define PIANO_ROLL_KEY_WIDGET_TYPE \
(piano_roll_key_widget_get_type ())
G_DECLARE_FINAL_TYPE (PianoRollKeyWidget,
piano_roll_key_widget,
Z,
PIANO_ROLL_KEY_WIDGET,
GtkDrawingArea)
G_DECLARE_FINAL_TYPE (
PianoRollKeyWidget,
piano_roll_key_widget,
Z, PIANO_ROLL_KEY_WIDGET,
GtkDrawingArea)
/**
* Piano roll note widget to be shown on the left

1
inc/settings/settings.h

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <gtk/gtk.h>
#define GSETTINGS_ZRYTHM_PREFIX "org.zrythm.Zrythm"
#define SETTINGS (&ZRYTHM->settings)
#define S_PREFERENCES SETTINGS->preferences
#define S_UI SETTINGS->ui

2
inc/utils/resources.h

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
* icons.
*/
#define RESOURCE_PATH "/org/zrythm/app/"
#define RESOURCE_PATH "/org/zrythm/Zrythm/app/"
#define TEMPLATE_PATH "ui/"
#define ICON_PATH "icons/"

1
po/meson.build

@ -27,5 +27,6 @@ i18n.gettext ( @@ -27,5 +27,6 @@ i18n.gettext (
args: [
'--directory=' + meson.source_root(),
'--msgid-bugs-address=https://git.zrythm.org/zrythm/zrythm/issues',
'--add-comments'
],
)

2
resources/gen-gtk-gresources-xml.py

@ -66,7 +66,7 @@ for f in get_files('theme/Matcha-dark-sea/assets', '.svg'): @@ -66,7 +66,7 @@ for f in get_files('theme/Matcha-dark-sea/assets', '.svg'):
xml += '''
</gresource>
<gresource prefix='/org/zrythm/app'>
<gresource prefix='/org/zrythm/Zrythm/app'>
'''
xml += '\n'

203
resources/ui/automation_editor_space.ui

@ -0,0 +1,203 @@ @@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!--
Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
This file is part of Zrythm
Zrythm is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zrythm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
-->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="AutomationEditorSpaceWidget" parent="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkPaned" id="midi_arranger_velocity_paned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="midi_notes_arranger_box">
<property name="height_request">120</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<child>
<object class="GtkBox" id="midi_notes_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="piano_roll_keys_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">external</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="piano_roll_keys_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="piano_roll_keys_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="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="midi_arranger_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow" id="arranger_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">always</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="arranger_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="MidiArrangerWidget" id="arranger">
<property name="visible">1</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="midi_vel_label_editor_box">
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="midi_vel_chooser_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBoxText" id="midi_modifier_chooser">
<property name="visible">1</property>
<items>
<item translatable="yes" id="midi_velocity">Velocity</item>
<item translatable="yes" id="midi_pitch_wheel">Pitch Wheel</item>
<item translatable="yes" id="midi_mod_wheel">Mod Wheel</item>
<item translatable="yes" id="midi_aftertouch">Aftertouch</item>
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="modifier_arranger_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">external</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="modifier_arranger_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="MidiModifierArrangerWidget" id="modifier_arranger">
<property name="visible">True</property>
<property name="can_focus">1</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</template>
</interface>

211
resources/ui/chord_editor_space.ui

@ -0,0 +1,211 @@ @@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!--
Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
This file is part of Zrythm
Zrythm is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zrythm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
-->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="ChordEditorSpaceWidget" parent="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkPaned" id="main_top_bot_paned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox"
id="chord_keys_slash_arranger_box">
<property name="height_request">120</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<child>
<object class="GtkBox"
id="left_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow"
id="chord_roll_keys_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">external</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport"
id="chord_keys_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox"
id="chord_keys_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="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox"
id="arranger_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow"
id="arranger_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">always</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport"
id="arranger_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="ChordArrangerWidget" id="arranger">
<property name="visible">1</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="midi_vel_label_editor_box">
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="midi_vel_chooser_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBoxText" id="midi_modifier_chooser">
<property name="visible">1</property>
<items>
<item translatable="yes" id="midi_velocity">Velocity</item>
<item translatable="yes" id="midi_pitch_wheel">Pitch Wheel</item>
<item translatable="yes" id="midi_mod_wheel">Mod Wheel</item>
<item translatable="yes" id="midi_aftertouch">Aftertouch</item>
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="modifier_arranger_scroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">external</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="modifier_arranger_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="MidiModifierArrangerWidget" id="modifier_arranger">
<property name="visible">True</property>
<property name="can_focus">1</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</template>
</interface>

20
resources/ui/clip_editor_inner.ui

@ -141,21 +141,21 @@ @@ -141,21 +141,21 @@
<property name="visible">1</property>
</object>
</child>
<!--<child>-->
<!--<object class="ChordEditorSpaceWidget" id="chord_editor_space">-->
<!--<property name="visible">1</property>-->
<!--</object>-->
<!--</child>-->
<child>
<object class="ChordEditorSpaceWidget" id="chord_editor_space">
<property name="visible">1</property>
</object>
</child>
<child>
<object class="AudioEditorSpaceWidget" id="audio_editor_space">
<property name="visible">1</property>
</object>
</child>
<!--<child>-->
<!--<object class="AutomationEditorSpaceWidget" id="automation_editor_space">-->
<!--<property name="visible">1</property>-->
<!--</object>-->
<!--</child>-->
<child>
<object class="AutomationEditorSpaceWidget" id="automation_editor_space">
<property name="visible">1</property>
</object>
</child>
</object>
</child>
</object>

33
src/actions/actions.c

@ -223,16 +223,45 @@ activate_about (GSimpleAction *action, @@ -223,16 +223,45 @@ activate_about (GSimpleAction *action,
GTK_IMAGE (
resources_get_icon (ICON_TYPE_ZRYTHM,
"z-splash.svg"));
char * artists[] =
{
"Alexandros Theodotou <alex@zrythm.org>",
NULL
};
char * authors[] =
{
"Alexandros Theodotou <alex@zrythm.org>",
"Sascha Bast <sash@mischkonsum.org>",
"Georg Krause",
NULL
};
char * documenters[] =
{
"Alexandros Theodotou <alex@zrythm.org>",
NULL
};
char * translators =
"Alexandros Theodotou <alex@zrythm.org>\n"
"Nicolas Faure <sub26nico@laposte.net>\n"
"Waui <wau-wau@tutanota.de>\n"
"Allan Nordhøy <epost@anotheragency.no>\n"
"WaldiS <admin@sto.ugu.pl>";
gtk_show_about_dialog (
GTK_WINDOW (MAIN_WINDOW),
"artists", artists,
"authors", authors,
"copyright", "Copyright (C) 2018-2019 Alexandros Theodotou",
"documenters", documenters,
/*"logo-icon-name", "z",*/
"logo", gtk_image_get_pixbuf (img),
"program-name", "Zrythm",
"comments", "An highly automated, intuitive, Digital Audio Workstation (DAW)",
"license-type", GTK_LICENSE_GPL_3_0,
"license-type", GTK_LICENSE_AGPL_3_0,
"translator-credits", translators,
"website", "https://www.zrythm.org",
"website-label", "Official Website",
"website-label", "Home Page",
"version", "v" PACKAGE_VERSION,
NULL);
gtk_widget_destroy (GTK_WIDGET (img));

36
src/actions/edit_chord_action.c

@ -39,7 +39,7 @@ edit_chord_action_new ( @@ -39,7 +39,7 @@ edit_chord_action_new (
self->chord =
chord_object_clone (
chord, CHORD_OBJECT_CLONE_COPY_MAIN);
self->descr = chord_descriptor_clone (descr);
/*self->descr = chord_descriptor_clone (descr);*/
return ua;
}
@ -49,16 +49,16 @@ edit_chord_action_do ( @@ -49,16 +49,16 @@ edit_chord_action_do (
EditChordAction * self)
{
/* get the actual chord */
ChordObject * chord =
chord_object_find (self->chord);
/*ChordObject * chord =*/
/*chord_object_find (self->chord);*/
/* set the new descriptor */
ChordDescriptor * old = chord->descr;
chord->descr =
chord_descriptor_clone (self->descr);
chord_descriptor_free (old);
/*ChordDescriptor * old = chord->descr;*/
/*chord->descr =*/
/*chord_descriptor_clone (self->descr);*/
/*chord_descriptor_free (old);*/
EVENTS_PUSH (ET_CHORD_OBJECT_CHANGED, chord);
/*EVENTS_PUSH (ET_CHORD_OBJECT_CHANGED, chord);*/
return 0;
}
@ -68,19 +68,19 @@ edit_chord_action_undo ( @@ -68,19 +68,19 @@ edit_chord_action_undo (
EditChordAction * self)
{
/* get the actual chord */
ChordDescriptor * prev = self->chord->descr;
self->chord->descr = self->descr;
ChordObject * chord =
chord_object_find (self->chord);
self->chord->descr = prev;
/*ChordDescriptor * prev = self->chord->descr;*/
/*self->chord->descr = self->descr;*/
/*ChordObject * chord =*/
/*chord_object_find (self->chord);*/
/*self->chord->descr = prev;*/
/* set the old descriptor */
prev = chord->descr;
chord->descr =
chord_descriptor_clone (self->chord->descr);
chord_descriptor_free (prev);
/*prev = chord->descr;*/
/*chord->descr =*/
/*chord_descriptor_clone (self->chord->descr);*/
/*chord_descriptor_free (prev);*/
EVENTS_PUSH (ET_CHORD_OBJECT_CHANGED, chord);
/*EVENTS_PUSH (ET_CHORD_OBJECT_CHANGED, chord);*/
return 0;
}

23
src/audio/chord_object.c

@ -52,13 +52,13 @@ chord_object_init_loaded ( @@ -52,13 +52,13 @@ chord_object_init_loaded (
*/
ChordObject *
chord_object_new (
ChordDescriptor * descr,
int is_main)
int index,
int is_main)
{
ChordObject * self =
calloc (1, sizeof (ChordObject));
self->descr = descr;
self->index = index;
if (is_main)
{
@ -112,6 +112,17 @@ chord_object_find ( @@ -112,6 +112,17 @@ chord_object_find (
return NULL;
}
/**
* Returns the ChordDescriptor associated with this
* ChordObject.
*/
ChordDescriptor *
chord_object_get_chord_descriptor (
ChordObject * self)
{
return CHORD_EDITOR->chords[self->index];
}
/**
* Finds the ChordObject in the project
* corresponding to the given one's position.
@ -149,10 +160,8 @@ chord_object_clone ( @@ -149,10 +160,8 @@ chord_object_clone (
if (flag == CHORD_OBJECT_CLONE_COPY_MAIN)
is_main = 1;
ChordDescriptor * descr =
chord_descriptor_clone (src->descr);
ChordObject * chord =
chord_object_new (descr, is_main);
chord_object_new (src->index, is_main);
position_set_to_pos (
&chord->pos, &src->pos);
@ -201,8 +210,6 @@ chord_object_free ( @@ -201,8 +210,6 @@ chord_object_free (
GTK_WIDGET (self->widget));
}
chord_descriptor_free (self->descr);
if (self->region_name)
g_free (self->region_name);

20
src/gui/backend/chord_editor.c

@ -28,14 +28,30 @@ @@ -28,14 +28,30 @@
#include <stdlib.h>
#include "audio/chord_descriptor.h"
#include "gui/backend/chord_editor.h"
/*#include "gui/widgets/chord_editor.h"*/
#include "project.h"
void
chord_editor_init (
ChordEditor * self)
{
/* TODO */
self->chords[0] =
chord_descriptor_new (
NOTE_A, 1, NOTE_A, CHORD_TYPE_MIN,
CHORD_ACC_7, 0);
self->chords[1] =
chord_descriptor_new (
NOTE_B, 1, NOTE_B, CHORD_TYPE_MIN,
CHORD_ACC_7, 0);
self->chords[2] =
chord_descriptor_new (
NOTE_B, 1, NOTE_B, CHORD_TYPE_MIN,
CHORD_ACC_7, 0);