general: Initial port to GTK4
Requires some work on events and icons.
Christopher Davis authored 3 years ago
Christopher Davis committed 2 years ago
4 | 4 | <property name="modal">1</property> |
5 | 5 | <child> |
6 | 6 | <object class="GtkShortcutsSection"> |
7 | <property name="visible">1</property> | |
8 | 7 | <property name="section-name">shortcuts</property> |
9 | 8 | <property name="max-height">10</property> |
10 | 9 | <child> |
11 | 10 | |
12 | 11 | <object class="GtkShortcutsGroup"> |
13 | <property name="visible">1</property> | |
14 | 12 | <property name="title" translatable="yes" context="shortcut window">General</property> |
15 | 13 | <child> |
16 | 14 | <object class="GtkShortcutsShortcut"> |
21 | 19 | </child> |
22 | 20 | <child> |
23 | 21 | <object class="GtkShortcutsShortcut"> |
24 | <property name="visible">1</property> | |
25 | 22 | <property name="accelerator">S</property> |
26 | 23 | <property name="title" translatable="yes" context="shortcut window">Stop Recording</property> |
27 | 24 | </object> |
28 | 25 | </child> |
29 | 26 | <child> |
30 | 27 | <object class="GtkShortcutsShortcut"> |
31 | <property name="visible">1</property> | |
32 | 28 | <property name="accelerator">space</property> |
33 | 29 | <property name="title" translatable="yes" context="shortcut window">Play / Pause / Resume</property> |
34 | 30 | </object> |
36 | 32 | |
37 | 33 | <child> |
38 | 34 | <object class="GtkShortcutsShortcut"> |
39 | <property name="visible">1</property> | |
40 | 35 | <property name="accelerator">Delete</property> |
41 | 36 | <property name="title" translatable="yes" context="shortcut window">Delete</property> |
42 | 37 | </object> |
43 | 38 | </child> |
44 | 39 | <child> |
45 | 40 | <object class="GtkShortcutsShortcut"> |
46 | <property name="visible">1</property> | |
47 | 41 | <property name="accelerator">F10</property> |
48 | 42 | <property name="title" translatable="yes" context="shortcut window">Open menu</property> |
49 | 43 | </object> |
50 | 44 | </child> |
51 | 45 | <child> |
52 | 46 | <object class="GtkShortcutsShortcut"> |
53 | <property name="visible">1</property> | |
54 | 47 | <property name="accelerator"><ctrl>question</property> |
55 | 48 | <property name="title" translatable="yes" context="shortcut window">Keyboard shortcuts</property> |
56 | 49 | </object> |
57 | 50 | </child> |
58 | 51 | <child> |
59 | 52 | <object class="GtkShortcutsShortcut"> |
60 | <property name="visible">1</property> | |
61 | 53 | <property name="accelerator"><ctrl>Q</property> |
62 | 54 | <property name="title" translatable="yes" context="shortcut window">Quit</property> |
63 | 55 | </object> |
66 | 58 | </child> |
67 | 59 | <child> |
68 | 60 | <object class="GtkShortcutsGroup"> |
69 | <property name="visible">1</property> | |
70 | 61 | <property name="title" translatable="yes" context="shortcut window">Recording</property> |
71 | 62 | <child> |
72 | 63 | <object class="GtkShortcutsShortcut"> |
73 | <property name="visible">1</property> | |
74 | 64 | <property name="accelerator">B</property> |
75 | 65 | <property name="title" translatable="yes" context="shortcut window">Seek Backward</property> |
76 | 66 | </object> |
77 | 67 | </child> |
78 | 68 | <child> |
79 | 69 | <object class="GtkShortcutsShortcut"> |
80 | <property name="visible">1</property> | |
81 | 70 | <property name="accelerator">N</property> |
82 | 71 | <property name="title" translatable="yes" context="shortcut window">Seek Forward</property> |
83 | 72 | </object> |
84 | 73 | </child> |
85 | 74 | <child> |
86 | 75 | <object class="GtkShortcutsShortcut"> |
87 | <property name="visible">1</property> | |
88 | 76 | <property name="accelerator">F2</property> |
89 | 77 | <property name="title" translatable="yes" context="shortcut window">Rename</property> |
90 | 78 | </object> |
91 | 79 | </child> |
92 | 80 | <child> |
93 | 81 | <object class="GtkShortcutsShortcut"> |
94 | <property name="visible">1</property> | |
95 | 82 | <property name="accelerator"><ctrl>s</property> |
96 | 83 | <property name="title" translatable="yes" context="shortcut window">Export</property> |
97 | 84 | </object> |
2 | 2 | <interface> |
3 | 3 | <requires lib="gtk+" version="3.22"/> |
4 | 4 | <requires lib="libhandy" version="1.0"/> |
5 | <template class="Gjs_RecorderWidget" parent="GtkBin"> | |
6 | <property name="visible">True</property> | |
7 | <property name="can_focus">False</property> | |
5 | <template class="Gjs_RecorderWidget" parent="GtkBox"> | |
8 | 6 | <child> |
9 | <object class="HdyWindowHandle"> | |
10 | <property name="visible">True</property> | |
11 | <property name="can_focus">False</property> | |
7 | <object class="GtkWindowHandle"> | |
8 | <property name="hexpand">True</property> | |
12 | 9 | <child> |
13 | 10 | <object class="GtkBox"> |
14 | <property name="visible">True</property> | |
15 | <property name="can_focus">False</property> | |
16 | 11 | <property name="margin_top">24</property> |
17 | 12 | <property name="margin_bottom">24</property> |
18 | 13 | <property name="orientation">vertical</property> |
19 | 14 | <child> |
20 | 15 | <object class="GtkBox" id="recorderBox"> |
21 | 16 | <property name="height_request">230</property> |
22 | <property name="visible">True</property> | |
23 | <property name="can_focus">False</property> | |
24 | 17 | <property name="valign">center</property> |
25 | 18 | <property name="orientation">vertical</property> |
26 | 19 | <child> |
27 | 20 | <object class="GtkLabel" id="recorderTime"> |
28 | <property name="visible">True</property> | |
29 | <property name="can_focus">False</property> | |
30 | 21 | <property name="margin_top">18</property> |
31 | 22 | <property name="use_markup">True</property> |
32 | 23 | <attributes> |
37 | 28 | <class name="recorder-time-label"/> |
38 | 29 | </style> |
39 | 30 | </object> |
40 | <packing> | |
41 | <property name="expand">False</property> | |
42 | <property name="fill">True</property> | |
43 | <property name="pack_type">end</property> | |
44 | <property name="position">0</property> | |
45 | </packing> | |
46 | 31 | </child> |
47 | 32 | </object> |
48 | <packing> | |
49 | <property name="expand">False</property> | |
50 | <property name="fill">True</property> | |
51 | <property name="position">0</property> | |
52 | </packing> | |
53 | 33 | </child> |
54 | 34 | <child> |
55 | 35 | <object class="GtkBox"> |
56 | <property name="visible">True</property> | |
57 | <property name="can_focus">False</property> | |
58 | 36 | <property name="halign">center</property> |
59 | 37 | <property name="valign">center</property> |
60 | 38 | <property name="margin_top">8</property> |
61 | 39 | <property name="spacing">18</property> |
62 | 40 | <child> |
63 | 41 | <object class="GtkStack" id="playbackStack"> |
64 | <property name="visible">True</property> | |
65 | <property name="can_focus">False</property> | |
66 | 42 | <child> |
67 | <object class="GtkButton" id="resumeBtn"> | |
68 | <property name="visible">True</property> | |
69 | <property name="can_focus">True</property> | |
70 | <property name="receives_default">True</property> | |
71 | <property name="tooltip_text" translatable="yes">Resume Recording</property> | |
72 | <property name="halign">center</property> | |
73 | <property name="valign">center</property> | |
74 | <property name="action_name">recorder.resume</property> | |
75 | <child> | |
76 | <object class="GtkImage"> | |
77 | <property name="visible">True</property> | |
78 | <property name="can_focus">False</property> | |
43 | <object class="GtkStackPage"> | |
44 | <property name="name">recorder-start</property> | |
45 | <property name="child"> | |
46 | <object class="GtkButton" id="resumeBtn"> | |
47 | <property name="receives_default">True</property> | |
48 | <property name="tooltip_text" translatable="yes">Resume Recording</property> | |
49 | <property name="halign">center</property> | |
50 | <property name="valign">center</property> | |
51 | <property name="action_name">recorder.resume</property> | |
79 | 52 | <property name="icon_name">media-playback-start-symbolic</property> |
53 | <style> | |
54 | <class name="rounded-button"/> | |
55 | </style> | |
80 | 56 | </object> |
81 | </child> | |
82 | <style> | |
83 | <class name="rounded-button"/> | |
84 | </style> | |
57 | </property> | |
85 | 58 | </object> |
86 | <packing> | |
87 | <property name="name">recorder-start</property> | |
88 | </packing> | |
89 | 59 | </child> |
90 | 60 | <child> |
91 | <object class="GtkButton" id="pauseBtn"> | |
92 | <property name="visible">True</property> | |
93 | <property name="can_focus">True</property> | |
94 | <property name="receives_default">True</property> | |
95 | <property name="tooltip_text" translatable="yes">Pause Recording</property> | |
96 | <property name="halign">center</property> | |
97 | <property name="valign">center</property> | |
98 | <property name="action_name">recorder.pause</property> | |
99 | <child> | |
100 | <object class="GtkImage"> | |
101 | <property name="visible">True</property> | |
102 | <property name="can_focus">False</property> | |
61 | <object class="GtkStackPage"> | |
62 | <property name="name">recorder-pause</property> | |
63 | <property name="child"> | |
64 | <object class="GtkButton" id="pauseBtn"> | |
65 | <property name="receives_default">True</property> | |
66 | <property name="tooltip_text" translatable="yes">Pause Recording</property> | |
67 | <property name="halign">center</property> | |
68 | <property name="valign">center</property> | |
69 | <property name="action_name">recorder.pause</property> | |
103 | 70 | <property name="icon_name">media-playback-pause-symbolic</property> |
71 | <style> | |
72 | <class name="rounded-button"/> | |
73 | </style> | |
104 | 74 | </object> |
105 | </child> | |
106 | <style> | |
107 | <class name="rounded-button"/> | |
108 | </style> | |
75 | </property> | |
109 | 76 | </object> |
110 | <packing> | |
111 | <property name="name">recorder-pause</property> | |
112 | <property name="position">1</property> | |
113 | </packing> | |
114 | 77 | </child> |
115 | 78 | </object> |
116 | <packing> | |
117 | <property name="expand">False</property> | |
118 | <property name="fill">True</property> | |
119 | <property name="position">0</property> | |
120 | </packing> | |
121 | 79 | </child> |
122 | 80 | <child> |
123 | 81 | <object class="GtkButton"> |
124 | <property name="visible">True</property> | |
125 | <property name="can_focus">True</property> | |
126 | 82 | <property name="receives_default">True</property> |
127 | 83 | <property name="tooltip_text" translatable="yes">Stop Recording</property> |
128 | 84 | <property name="halign">center</property> |
130 | 86 | <property name="action_name">recorder.stop</property> |
131 | 87 | <child> |
132 | 88 | <object class="GtkImage"> |
133 | <property name="visible">True</property> | |
134 | <property name="can_focus">False</property> | |
135 | 89 | <property name="icon_name">media-playback-stop-symbolic</property> |
136 | <property name="icon_size">3</property> | |
90 | <property name="pixel_size">24</property> | |
137 | 91 | </object> |
138 | 92 | </child> |
139 | 93 | <style> |
142 | 96 | <class name="large"/> |
143 | 97 | </style> |
144 | 98 | </object> |
145 | <packing> | |
146 | <property name="expand">False</property> | |
147 | <property name="fill">True</property> | |
148 | <property name="position">1</property> | |
149 | </packing> | |
150 | 99 | </child> |
151 | 100 | <child> |
152 | 101 | <object class="GtkButton"> |
153 | <property name="visible">True</property> | |
154 | <property name="can_focus">True</property> | |
155 | 102 | <property name="receives_default">True</property> |
156 | 103 | <property name="tooltip_text" translatable="yes">Delete Recording</property> |
157 | 104 | <property name="halign">center</property> |
158 | 105 | <property name="valign">center</property> |
159 | 106 | <property name="action_name">recorder.cancel</property> |
160 | <child> | |
161 | <object class="GtkImage"> | |
162 | <property name="visible">True</property> | |
163 | <property name="can_focus">False</property> | |
164 | <property name="icon_name">user-trash-symbolic</property> | |
165 | </object> | |
166 | </child> | |
107 | <property name="icon_name">user-trash-symbolic</property> | |
167 | 108 | <style> |
168 | 109 | <class name="rounded-button"/> |
169 | 110 | </style> |
170 | 111 | </object> |
171 | <packing> | |
172 | <property name="expand">False</property> | |
173 | <property name="fill">True</property> | |
174 | <property name="position">2</property> | |
175 | </packing> | |
176 | 112 | </child> |
177 | 113 | </object> |
178 | <packing> | |
179 | <property name="expand">False</property> | |
180 | <property name="fill">True</property> | |
181 | <property name="pack_type">end</property> | |
182 | <property name="position">1</property> | |
183 | </packing> | |
184 | 114 | </child> |
185 | 115 | </object> |
186 | 116 | </child> |
3 | 3 | <requires lib="gtk+" version="3.20"/> |
4 | 4 | <requires lib="libhandy" version="0.0"/> |
5 | 5 | <template class="Gjs_Row" parent="GtkListBoxRow"> |
6 | <property name="visible">True</property> | |
7 | <property name="can_focus">True</property> | |
8 | 6 | <property name="selectable">False</property> |
9 | 7 | <child> |
10 | 8 | <object class="GtkBox"> |
11 | <property name="visible">True</property> | |
12 | <property name="can_focus">False</property> | |
13 | 9 | <property name="margin_top">12</property> |
14 | 10 | <property name="margin_bottom">12</property> |
15 | 11 | <property name="orientation">vertical</property> |
16 | 12 | <child> |
17 | 13 | <object class="GtkStack" id="mainStack"> |
18 | <property name="visible">True</property> | |
19 | <property name="can_focus">False</property> | |
20 | 14 | <child> |
21 | <object class="GtkBox"> | |
22 | <property name="visible">True</property> | |
23 | <property name="can_focus">False</property> | |
24 | <property name="valign">center</property> | |
25 | <property name="margin_start">12</property> | |
26 | <property name="margin_end">12</property> | |
27 | <property name="hexpand">True</property> | |
28 | <child> | |
29 | <object class="GtkLabel" id="duration"> | |
30 | <property name="visible">True</property> | |
31 | <property name="can_focus">False</property> | |
32 | <property name="halign">end</property> | |
33 | <property name="use_markup">True</property> | |
34 | <attributes> | |
35 | <attribute name="font-features" value="tnum=1"/> | |
36 | </attributes> | |
15 | <object class="GtkStackPage"> | |
16 | <property name="name">display</property> | |
17 | <property name="child"> | |
18 | <object class="GtkBox"> | |
19 | <property name="valign">center</property> | |
20 | <property name="margin_start">12</property> | |
21 | <property name="margin_end">12</property> | |
22 | <property name="hexpand">True</property> | |
23 | <child> | |
24 | <object class="GtkBox"> | |
25 | <property name="orientation">vertical</property> | |
26 | <child> | |
27 | <object class="GtkLabel" id="name"> | |
28 | <property name="ellipsize">end</property> | |
29 | <property name="single_line_mode">True</property> | |
30 | <property name="xalign">0</property> | |
31 | <style> | |
32 | <class name="title"/> | |
33 | </style> | |
34 | </object> | |
35 | </child> | |
36 | <child> | |
37 | <object class="GtkLabel" id="date"> | |
38 | <property name="margin_top">4</property> | |
39 | <property name="xalign">0</property> | |
40 | <style> | |
41 | <class name="subtitle"/> | |
42 | </style> | |
43 | </object> | |
44 | </child> | |
45 | </object> | |
46 | </child> | |
47 | <child> | |
48 | <object class="GtkLabel" id="duration"> | |
49 | <property name="hexpand">True</property> | |
50 | <property name="halign">end</property> | |
51 | <property name="use_markup">True</property> | |
52 | <attributes> | |
53 | <attribute name="font-features" value="tnum=1"/> | |
54 | </attributes> | |
55 | </object> | |
56 | </child> | |
37 | 57 | </object> |
38 | <packing> | |
39 | <property name="pack_type">end</property> | |
40 | <property name="position">0</property> | |
41 | </packing> | |
42 | </child> | |
43 | <child> | |
44 | <object class="GtkBox"> | |
45 | <property name="visible">True</property> | |
46 | <property name="can_focus">False</property> | |
47 | <property name="orientation">vertical</property> | |
48 | <child> | |
49 | <object class="GtkLabel" id="name"> | |
50 | <property name="visible">True</property> | |
51 | <property name="can_focus">False</property> | |
52 | <property name="ellipsize">end</property> | |
53 | <property name="single_line_mode">True</property> | |
54 | <property name="xalign">0</property> | |
55 | <style> | |
56 | <class name="title"/> | |
57 | </style> | |
58 | </object> | |
59 | <packing> | |
60 | <property name="position">0</property> | |
61 | </packing> | |
62 | </child> | |
63 | <child> | |
64 | <object class="GtkLabel" id="date"> | |
65 | <property name="visible">True</property> | |
66 | <property name="can_focus">False</property> | |
67 | <property name="margin_top">4</property> | |
68 | <property name="xalign">0</property> | |
69 | <style> | |
70 | <class name="subtitle"/> | |
71 | </style> | |
72 | </object> | |
73 | <packing> | |
74 | <property name="position">1</property> | |
75 | </packing> | |
76 | </child> | |
77 | </object> | |
78 | <packing> | |
79 | <property name="position">2</property> | |
80 | </packing> | |
81 | </child> | |
58 | </property> | |
82 | 59 | </object> |
83 | <packing> | |
84 | <property name="name">display</property> | |
85 | </packing> | |
86 | 60 | </child> |
87 | 61 | <child> |
88 | <object class="GtkEntry" id="entry"> | |
89 | <property name="visible">True</property> | |
90 | <property name="can_focus">True</property> | |
91 | <property name="margin_start">12</property> | |
92 | <property name="margin_end">12</property> | |
93 | <property name="activates_default">True</property> | |
62 | <object class="GtkStackPage"> | |
63 | <property name="name">edit</property> | |
64 | <property name="child"> | |
65 | <object class="GtkEntry" id="entry"> | |
66 | <property name="margin_start">12</property> | |
67 | <property name="margin_end">12</property> | |
68 | <property name="activates_default">True</property> | |
69 | </object> | |
70 | </property> | |
94 | 71 | </object> |
95 | <packing> | |
96 | <property name="name">edit</property> | |
97 | <property name="position">1</property> | |
98 | </packing> | |
99 | 72 | </child> |
100 | 73 | </object> |
101 | <packing> | |
102 | <property name="position">0</property> | |
103 | </packing> | |
104 | 74 | </child> |
105 | 75 | <child> |
106 | 76 | <object class="GtkRevealer" id="revealer"> |
107 | <property name="visible">True</property> | |
108 | <property name="can_focus">False</property> | |
109 | 77 | <property name="transition_duration">250</property> |
110 | 78 | <property name="transition_type">GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN</property> |
111 | 79 | <child> |
112 | 80 | <object class="GtkBox"> |
113 | <property name="visible">True</property> | |
114 | <property name="can_focus">False</property> | |
115 | 81 | <property name="orientation">vertical</property> |
116 | 82 | <child> |
117 | 83 | <object class="GtkStack" id="waveformStack"> |
118 | <property name="visible">True</property> | |
119 | <property name="can_focus">False</property> | |
120 | 84 | <property name="transition_type">crossfade</property> |
121 | 85 | <child> |
122 | <object class="GtkSpinner"> | |
123 | <property name="visible">True</property> | |
124 | <property name="can_focus">False</property> | |
125 | <property name="active">True</property> | |
126 | </object> | |
127 | <packing> | |
86 | <object class="GtkStackPage"> | |
128 | 87 | <property name="name">loading</property> |
129 | </packing> | |
88 | <property name="child"> | |
89 | <object class="GtkSpinner"> | |
90 | <property name="spinning">True</property> | |
91 | </object> | |
92 | </property> | |
93 | </object> | |
130 | 94 | </child> |
131 | 95 | </object> |
132 | <packing> | |
133 | <property name="position">0</property> | |
134 | </packing> | |
135 | 96 | </child> |
136 | 97 | <child> |
137 | 98 | <object class="GtkBox"> |
138 | <property name="visible">True</property> | |
139 | <property name="can_focus">False</property> | |
140 | 99 | <property name="margin_start">12</property> |
141 | 100 | <property name="margin_end">12</property> |
142 | 101 | <property name="margin_top">18</property> |
143 | 102 | <child> |
144 | <object class="GtkStack" id="rightStack"> | |
145 | <property name="visible">True</property> | |
146 | <property name="can_focus">False</property> | |
147 | <child> | |
148 | <object class="HdySqueezer"> | |
149 | <property name="visible">True</property> | |
150 | <property name="can_focus">False</property> | |
151 | <property name="homogeneous">True</property> | |
152 | <child> | |
153 | <object class="GtkBox"> | |
154 | <property name="visible">True</property> | |
155 | <property name="can_focus">False</property> | |
156 | <property name="spacing">8</property> | |
157 | <child> | |
158 | <object class="GtkButton"> | |
159 | <property name="visible">True</property> | |
160 | <property name="can_focus">True</property> | |
161 | <property name="valign">center</property> | |
162 | <property name="halign">center</property> | |
163 | <property name="receives_default">True</property> | |
164 | <property name="tooltip_text" translatable="yes">Export</property> | |
165 | <property name="action_name">recording.export</property> | |
166 | <child> | |
167 | <object class="GtkImage"> | |
168 | <property name="visible">True</property> | |
169 | <property name="can_focus">False</property> | |
170 | <property name="icon_name">document-save-symbolic</property> | |
171 | </object> | |
172 | </child> | |
173 | <style> | |
174 | <class name="rounded-button"/> | |
175 | </style> | |
176 | </object> | |
177 | <packing> | |
178 | <property name="position">0</property> | |
179 | </packing> | |
180 | </child> | |
181 | <child> | |
182 | <object class="GtkButton"> | |
183 | <property name="visible">True</property> | |
184 | <property name="can_focus">True</property> | |
185 | <property name="valign">center</property> | |
186 | <property name="halign">center</property> | |
187 | <property name="receives_default">True</property> | |
188 | <property name="tooltip_text" translatable="yes">Rename</property> | |
189 | <property name="action_name">recording.rename</property> | |
190 | <child> | |
191 | <object class="GtkImage"> | |
192 | <property name="visible">True</property> | |
193 | <property name="can_focus">False</property> | |
194 | <property name="icon_name">document-edit-symbolic</property> | |
195 | </object> | |
196 | </child> | |
197 | <style> | |
198 | <class name="rounded-button"/> | |
199 | </style> | |
200 | </object> | |
201 | <packing> | |
202 | <property name="position">1</property> | |
203 | </packing> | |
204 | </child> | |
205 | </object> | |
206 | </child> | |
207 | <child> | |
208 | <object class="GtkMenuButton"> | |
209 | <property name="visible">True</property> | |
210 | <property name="can_focus">True</property> | |
211 | <property name="receives_default">True</property> | |
212 | <property name="menu_model">optionMenu</property> | |
213 | <property name="halign">end</property> | |
214 | <property name="valign">center</property> | |
215 | <child> | |
216 | <object class="GtkImage"> | |
217 | <property name="visible">True</property> | |
218 | <property name="can_focus">False</property> | |
219 | <property name="icon_name">view-more-symbolic</property> | |
220 | </object> | |
221 | </child> | |
222 | <style> | |
223 | <class name="rounded-button"/> | |
224 | </style> | |
225 | </object> | |
226 | </child> | |
227 | </object> | |
228 | <packing> | |
229 | <property name="name">options</property> | |
230 | </packing> | |
231 | </child> | |
232 | <child> | |
233 | <object class="GtkButton" id="saveBtn"> | |
234 | <property name="visible">True</property> | |
235 | <property name="can_focus">True</property> | |
236 | <property name="can_default">True</property> | |
237 | <property name="valign">center</property> | |
238 | <property name="halign">end</property> | |
239 | <property name="receives_default">False</property> | |
240 | <property name="tooltip_text" translatable="yes">Save</property> | |
241 | <property name="action_name">recording.save</property> | |
242 | <child> | |
243 | <object class="GtkImage"> | |
244 | <property name="visible">True</property> | |
245 | <property name="can_focus">False</property> | |
246 | <property name="icon_name">emblem-ok-symbolic</property> | |
247 | </object> | |
248 | </child> | |
249 | <style> | |
250 | <class name="rounded-button"/> | |
251 | <class name="suggested-action"/> | |
252 | </style> | |
253 | </object> | |
254 | <packing> | |
255 | <property name="name">save</property> | |
256 | <property name="position">1</property> | |
257 | </packing> | |
258 | </child> | |
259 | </object> | |
260 | <packing> | |
261 | <property name="pack_type">end</property> | |
262 | <property name="position">0</property> | |
263 | </packing> | |
264 | </child> | |
265 | <child> | |
266 | 103 | <object class="GtkBox" id="deleteBtnBox"> |
267 | <property name="visible">True</property> | |
268 | <property name="can_focus">False</property> | |
269 | 104 | <child> |
270 | 105 | <object class="GtkButton"> |
271 | <property name="visible">True</property> | |
272 | <property name="can_focus">True</property> | |
273 | 106 | <property name="valign">center</property> |
274 | 107 | <property name="halign">center</property> |
275 | 108 | <property name="action_name">recording.delete</property> |
276 | 109 | <property name="receives_default">True</property> |
277 | 110 | <property name="tooltip_text" translatable="yes">Delete</property> |
278 | <child> | |
279 | <object class="GtkImage"> | |
280 | <property name="visible">True</property> | |
281 | <property name="can_focus">False</property> | |
282 | <property name="icon_name">user-trash-symbolic</property> | |
283 | </object> | |
284 | </child> | |
111 | <property name="icon_name">user-trash-symbolic</property> | |
285 | 112 | <style> |
286 | 113 | <class name="rounded-button"/> |
287 | 114 | </style> |
288 | 115 | </object> |
289 | <packing> | |
290 | <property name="position">0</property> | |
291 | </packing> | |
292 | </child> | |
293 | </object> | |
294 | <packing> | |
295 | <property name="position">1</property> | |
296 | </packing> | |
116 | </child> | |
117 | </object> | |
297 | 118 | </child> |
298 | 119 | <child> |
299 | 120 | <object class="GtkBox" id="playbackControls"> |
300 | <property name="visible">True</property> | |
301 | <property name="can_focus">False</property> | |
302 | <property name="halign">center</property> | |
121 | <property name="hexpand">True</property> | |
122 | <property name="halign">end</property> | |
303 | 123 | <property name="spacing">18</property> |
304 | 124 | <child> |
305 | 125 | <object class="GtkButton"> |
306 | <property name="visible">True</property> | |
307 | <property name="can_focus">True</property> | |
308 | 126 | <property name="valign">center</property> |
309 | 127 | <property name="halign">center</property> |
310 | 128 | <property name="action_name">recording.seek-backward</property> |
311 | 129 | <property name="receives_default">True</property> |
312 | 130 | <property name="tooltip_text" translatable="yes">Seek 10s Backward</property> |
131 | <property name="icon_name">skip-back-symbolic</property> | |
132 | <style> | |
133 | <class name="rounded-button"/> | |
134 | </style> | |
135 | </object> | |
136 | </child> | |
137 | <child> | |
138 | <object class="GtkStack" id="playbackStack"> | |
313 | 139 | <child> |
314 | <object class="GtkImage"> | |
315 | <property name="visible">True</property> | |
316 | <property name="can_focus">False</property> | |
317 | <property name="icon_name">skip-back-symbolic</property> | |
140 | <object class="GtkStackPage"> | |
141 | <property name="name">play</property> | |
142 | <property name="child"> | |
143 | <object class="GtkButton" id="playBtn"> | |
144 | <property name="valign">center</property> | |
145 | <property name="halign">center</property> | |
146 | <property name="receives_default">True</property> | |
147 | <property name="action_name">recording.play</property> | |
148 | <property name="tooltip_text" translatable="yes">Play</property> | |
149 | <child> | |
150 | <object class="GtkImage"> | |
151 | <property name="icon_name">media-playback-start-symbolic</property> | |
152 | <property name="pixel_size">24</property> | |
153 | </object> | |
154 | </child> | |
155 | <style> | |
156 | <class name="rounded-button"/> | |
157 | <class name="large"/> | |
158 | </style> | |
159 | </object> | |
160 | </property> | |
318 | 161 | </object> |
319 | 162 | </child> |
320 | <style> | |
321 | <class name="rounded-button"/> | |
322 | </style> | |
323 | </object> | |
324 | <packing> | |
325 | <property name="position">0</property> | |
326 | </packing> | |
327 | </child> | |
328 | <child> | |
329 | <object class="GtkStack" id="playbackStack"> | |
330 | <property name="visible">True</property> | |
331 | <property name="can_focus">False</property> | |
332 | 163 | <child> |
333 | <object class="GtkButton" id="playBtn"> | |
334 | <property name="visible">True</property> | |
335 | <property name="can_focus">True</property> | |
336 | <property name="valign">center</property> | |
337 | <property name="halign">center</property> | |
338 | <property name="receives_default">True</property> | |
339 | <property name="action_name">recording.play</property> | |
340 | <property name="tooltip_text" translatable="yes">Play</property> | |
341 | <child> | |
342 | <object class="GtkImage"> | |
343 | <property name="visible">True</property> | |
344 | <property name="can_focus">False</property> | |
345 | <property name="icon_name">media-playback-start-symbolic</property> | |
346 | <property name="icon_size">3</property> | |
164 | <object class="GtkStackPage"> | |
165 | <property name="name">pause</property> | |
166 | <property name="child"> | |
167 | <object class="GtkButton" id="pauseBtn"> | |
168 | <property name="valign">center</property> | |
169 | <property name="halign">center</property> | |
170 | <property name="action_name">recording.pause</property> | |
171 | <property name="receives_default">True</property> | |
172 | <property name="tooltip_text" translatable="yes">Pause</property> | |
173 | <child> | |
174 | <object class="GtkImage"> | |
175 | <property name="icon_name">media-playback-pause-symbolic</property> | |
176 | <property name="pixel_size">24</property> | |
177 | </object> | |
178 | </child> | |
179 | <style> | |
180 | <class name="rounded-button"/> | |
181 | <class name="large"/> | |
182 | </style> | |
347 | 183 | </object> |
348 | </child> | |
349 | <style> | |
350 | <class name="rounded-button"/> | |
351 | <class name="large"/> | |
352 | </style> | |
184 | </property> | |
353 | 185 | </object> |
354 | <packing> | |
355 | <property name="name">play</property> | |
356 | </packing> | |
357 | 186 | </child> |
358 | <child> | |
359 | <object class="GtkButton" id="pauseBtn"> | |
360 | <property name="visible">True</property> | |
361 | <property name="can_focus">True</property> | |
362 | <property name="valign">center</property> | |
363 | <property name="halign">center</property> | |
364 | <property name="action_name">recording.pause</property> | |
365 | <property name="receives_default">True</property> | |
366 | <property name="tooltip_text" translatable="yes">Pause</property> | |
367 | <child> | |
368 | <object class="GtkImage"> | |
369 | <property name="visible">True</property> | |
370 | <property name="can_focus">False</property> | |
371 | <property name="icon_name">media-playback-pause-symbolic</property> | |
372 | <property name="icon_size">3</property> | |
373 | </object> | |
374 | </child> | |
375 | <style> | |
376 | <class name="rounded-button"/> | |
377 | <class name="large"/> | |
378 | </style> | |
379 | </object> | |
380 | <packing> | |
381 | <property name="name">pause</property> | |
382 | <property name="position">1</property> | |
383 | </packing> | |
384 | </child> | |
385 | </object> | |
386 | <packing> | |
387 | <property name="position">1</property> | |
388 | </packing> | |
187 | </object> | |
389 | 188 | </child> |
390 | 189 | <child> |
391 | 190 | <object class="GtkButton"> |
392 | <property name="visible">True</property> | |
393 | <property name="can_focus">True</property> | |
394 | 191 | <property name="valign">center</property> |
395 | 192 | <property name="halign">center</property> |
396 | 193 | <property name="action_name">recording.seek-forward</property> |
397 | 194 | <property name="receives_default">True</property> |
398 | 195 | <property name="tooltip_text" translatable="yes">Seek 10s Forward</property> |
399 | <child> | |
400 | <object class="GtkImage"> | |
401 | <property name="visible">True</property> | |
402 | <property name="can_focus">False</property> | |
403 | <property name="icon_name">skip-forward-symbolic</property> | |
196 | <property name="icon_name">skip-forward-symbolic</property> | |
197 | <style> | |
198 | <class name="rounded-button"/> | |
199 | </style> | |
200 | </object> | |
201 | </child> | |
202 | </object> | |
203 | </child> | |
204 | <child> | |
205 | <object class="GtkStack" id="rightStack"> | |
206 | <property name="hexpand">True</property> | |
207 | <property name="halign">end</property> | |
208 | <child> | |
209 | <object class="GtkStackPage"> | |
210 | <property name="name">options</property> | |
211 | <property name="child"> | |
212 | <object class="HdySqueezer"> | |
213 | <property name="homogeneous">True</property> | |
214 | <child> | |
215 | <object class="GtkBox"> | |
216 | <property name="spacing">8</property> | |
217 | <child> | |
218 | <object class="GtkButton"> | |
219 | <property name="valign">center</property> | |
220 | <property name="halign">center</property> | |
221 | <property name="receives_default">True</property> | |
222 | <property name="tooltip_text" translatable="yes">Export</property> | |
223 | <property name="action_name">recording.export</property> | |
224 | <property name="icon_name">document-save-symbolic</property> | |
225 | <style> | |
226 | <class name="rounded-button"/> | |
227 | </style> | |
228 | </object> | |
229 | </child> | |
230 | <child> | |
231 | <object class="GtkButton"> | |
232 | <property name="valign">center</property> | |
233 | <property name="halign">center</property> | |
234 | <property name="receives_default">True</property> | |
235 | <property name="tooltip_text" translatable="yes">Rename</property> | |
236 | <property name="action_name">recording.rename</property> | |
237 | <property name="icon_name">document-edit-symbolic</property> | |
238 | <style> | |
239 | <class name="rounded-button"/> | |
240 | </style> | |
241 | </object> | |
242 | </child> | |
243 | </object> | |
244 | </child> | |
245 | <child> | |
246 | <object class="GtkMenuButton"> | |
247 | <property name="receives_default">True</property> | |
248 | <property name="menu_model">optionMenu</property> | |
249 | <property name="halign">end</property> | |
250 | <property name="valign">center</property> | |
251 | <property name="icon_name">view-more-symbolic</property> | |
252 | <style> | |
253 | <class name="rounded-button"/> | |
254 | </style> | |
255 | </object> | |
256 | </child> | |
404 | 257 | </object> |
405 | </child> | |
406 | <style> | |
407 | <class name="rounded-button"/> | |
408 | </style> | |
409 | </object> | |
410 | <packing> | |
411 | <property name="position">2</property> | |
412 | </packing> | |
413 | </child> | |
414 | </object> | |
415 | <packing> | |
416 | <property name="expand">True</property> | |
417 | <property name="position">3</property> | |
418 | </packing> | |
258 | </property> | |
259 | </object> | |
260 | </child> | |
261 | <child> | |
262 | <object class="GtkStackPage"> | |
263 | <property name="name">save</property> | |
264 | <property name="child"> | |
265 | <object class="GtkButton" id="saveBtn"> | |
266 | <property name="valign">center</property> | |
267 | <property name="halign">end</property> | |
268 | <property name="receives_default">False</property> | |
269 | <property name="tooltip_text" translatable="yes">Save</property> | |
270 | <property name="action_name">recording.save</property> | |
271 | <property name="icon_name">emblem-ok-symbolic</property> | |
272 | <style> | |
273 | <class name="rounded-button"/> | |
274 | <class name="suggested-action"/> | |
275 | </style> | |
276 | </object> | |
277 | </property> | |
278 | </object> | |
279 | </child> | |
280 | </object> | |
419 | 281 | </child> |
420 | 282 | </object> |
421 | <packing> | |
422 | <property name="position">1</property> | |
423 | </packing> | |
424 | 283 | </child> |
425 | 284 | </object> |
426 | 285 | </child> |
427 | 286 | </object> |
428 | <packing> | |
429 | <property name="position">1</property> | |
430 | </packing> | |
431 | 287 | </child> |
432 | 288 | </object> |
433 | 289 | </child> |
5 | 5 | <template class="Gjs_Window" parent="HdyApplicationWindow"> |
6 | 6 | <property name="width_request">350</property> |
7 | 7 | <property name="height_request">480</property> |
8 | <property name="can_focus">False</property> | |
9 | 8 | <property name="hexpand">True</property> |
10 | 9 | <property name="vexpand">True</property> |
11 | 10 | <property name="default_width">780</property> |
12 | 11 | <property name="default_height">480</property> |
12 | <property name="title" translatable="yes">Sound Recorder</property> | |
13 | 13 | <child> |
14 | 14 | <object class="GtkBox"> |
15 | <property name="visible">True</property> | |
16 | <property name="can_focus">False</property> | |
17 | 15 | <property name="orientation">vertical</property> |
18 | 16 | <child> |
19 | 17 | <object class="GtkRevealer" id="headerRevealer"> |
20 | <property name="visible">True</property> | |
21 | <property name="can_focus">False</property> | |
22 | 18 | <property name="reveal_child">True</property> |
23 | 19 | <child> |
24 | 20 | <object class="HdyHeaderBar"> |
25 | <property name="visible">True</property> | |
26 | <property name="can_focus">False</property> | |
27 | <property name="title" translatable="yes">Sound Recorder</property> | |
28 | <property name="show_close_button">True</property> | |
29 | 21 | <child> |
30 | 22 | <object class="GtkButton"> |
31 | <property name="visible">True</property> | |
32 | <property name="can_focus">True</property> | |
33 | 23 | <property name="receives_default">False</property> |
34 | 24 | <property name="halign">center</property> |
35 | 25 | <property name="valign">center</property> |
36 | 26 | <property name="action_name">recorder.start</property> |
37 | 27 | <child> |
38 | 28 | <object class="GtkBox"> |
39 | <property name="visible">True</property> | |
40 | <property name="can_focus">False</property> | |
41 | 29 | <property name="spacing">4</property> |
42 | 30 | <child> |
43 | 31 | <object class="GtkImage"> |
44 | <property name="visible">True</property> | |
45 | <property name="can_focus">False</property> | |
46 | 32 | <property name="icon_name">media-record-symbolic</property> |
47 | 33 | </object> |
48 | <packing> | |
49 | <property name="expand">False</property> | |
50 | <property name="fill">True</property> | |
51 | <property name="position">0</property> | |
52 | </packing> | |
53 | 34 | </child> |
54 | 35 | <child> |
55 | 36 | <object class="GtkLabel"> |
56 | <property name="visible">True</property> | |
57 | <property name="can_focus">False</property> | |
58 | 37 | <property name="margin_end">4</property> |
59 | 38 | <property name="label" translatable="yes">Record</property> |
60 | 39 | </object> |
61 | <packing> | |
62 | <property name="expand">False</property> | |
63 | <property name="fill">True</property> | |
64 | <property name="position">1</property> | |
65 | </packing> | |
66 | 40 | </child> |
67 | 41 | </object> |
68 | 42 | </child> |
71 | 45 | </style> |
72 | 46 | </object> |
73 | 47 | </child> |
74 | <child> | |
48 | <child type="end"> | |
75 | 49 | <object class="GtkMenuButton"> |
76 | <property name="visible">True</property> | |
77 | <property name="can_focus">True</property> | |
78 | 50 | <property name="receives_default">False</property> |
79 | <property name="action_name">win.open-primary-menu</property> | |
80 | 51 | <property name="menu_model">primaryMenu</property> |
81 | <child> | |
82 | <object class="GtkImage"> | |
83 | <property name="visible">True</property> | |
84 | <property name="can_focus">False</property> | |
85 | <property name="icon_name">open-menu-symbolic</property> | |
86 | </object> | |
87 | </child> | |
52 | <property name="icon_name">open-menu-symbolic</property> | |
88 | 53 | <style> |
89 | 54 | <class name="image-button"/> |
90 | 55 | </style> |
91 | 56 | </object> |
92 | <packing> | |
93 | <property name="pack_type">end</property> | |
94 | <property name="position">1</property> | |
95 | </packing> | |
96 | 57 | </child> |
97 | 58 | <style> |
98 | 59 | <class name="titlebar"/> |
100 | 61 | </object> |
101 | 62 | </child> |
102 | 63 | </object> |
103 | <packing> | |
104 | <property name="expand">False</property> | |
105 | <property name="fill">True</property> | |
106 | <property name="position">0</property> | |
107 | </packing> | |
108 | 64 | </child> |
109 | 65 | <child> |
110 | 66 | <object class="GtkOverlay"> |
111 | <property name="visible">True</property> | |
112 | <property name="can_focus">False</property> | |
113 | 67 | <child> |
114 | 68 | <object class="GtkStack" id="mainStack"> |
115 | <property name="visible">True</property> | |
116 | <property name="can_focus">False</property> | |
117 | 69 | <property name="hexpand">True</property> |
118 | 70 | <property name="vexpand">True</property> |
119 | 71 | <child> |
120 | <object class="HdyStatusPage" id="emptyPage"> | |
121 | <property name="visible">True</property> | |
122 | <property name="title" translatable="yes">Add Recordings</property> | |
123 | <property name="description" translatable="yes">Use the <b>Record</b> button to make sound recordings</property> | |
72 | <object class="GtkStackPage"> | |
73 | <property name="name">empty</property> | |
74 | <property name="child"> | |
75 | <object class="HdyStatusPage" id="emptyPage"> | |
76 | <property name="title" translatable="yes">Add Recordings</property> | |
77 | <property name="description" translatable="yes">Use the <b>Record</b> button to make sound recordings</property> | |
78 | </object> | |
79 | </property> | |
124 | 80 | </object> |
125 | <packing> | |
126 | <property name="name">empty</property> | |
127 | </packing> | |
128 | 81 | </child> |
129 | 82 | <child> |
130 | <object class="GtkScrolledWindow"> | |
131 | <property name="visible">True</property> | |
132 | <property name="can_focus">True</property> | |
133 | <property name="hexpand">True</property> | |
134 | <property name="vexpand">True</property> | |
135 | <property name="hscrollbar_policy">never</property> | |
136 | <child> | |
137 | <object class="HdyClamp" id="column"> | |
138 | <property name="visible">True</property> | |
139 | <property name="can_focus">False</property> | |
140 | <property name="maximum_size">650</property> | |
83 | <object class="GtkStackPage"> | |
84 | <property name="name">recordings</property> | |
85 | <property name="child"> | |
86 | <object class="GtkScrolledWindow"> | |
87 | <property name="hexpand">True</property> | |
88 | <property name="vexpand">True</property> | |
89 | <property name="hscrollbar_policy">never</property> | |
90 | <property name="child"> | |
91 | <object class="GtkViewport"> | |
92 | <property name="scroll_to_focus">True</property> | |
93 | <property name="child"> | |
94 | <object class="HdyClamp" id="column"> | |
95 | <property name="maximum_size">650</property> | |
96 | </object> | |
97 | </property> | |
98 | </object> | |
99 | </property> | |
141 | 100 | </object> |
142 | </child> | |
101 | </property> | |
143 | 102 | </object> |
144 | <packing> | |
145 | <property name="name">recordings</property> | |
146 | <property name="position">1</property> | |
147 | </packing> | |
148 | 103 | </child> |
149 | 104 | </object> |
150 | <packing> | |
151 | <property name="index">-1</property> | |
152 | </packing> | |
153 | 105 | </child> |
154 | 106 | <child type="overlay"> |
155 | 107 | <object class="GtkRevealer" id="notificationRevealer"> |
156 | <property name="visible">True</property> | |
157 | <property name="can_focus">False</property> | |
158 | 108 | <property name="halign">center</property> |
159 | 109 | <property name="valign">start</property> |
160 | 110 | <child> |
161 | 111 | <object class="GtkBox"> |
162 | <property name="visible">True</property> | |
163 | <property name="can_focus">False</property> | |
164 | 112 | <child> |
165 | 113 | <object class="GtkLabel" id="notificationMessage"> |
166 | <property name="visible">True</property> | |
167 | <property name="can_focus">False</property> | |
168 | 114 | <property name="wrap">True</property> |
169 | 115 | <property name="ellipsize">end</property> |
170 | 116 | <property name="xalign">0</property> |
171 | 117 | </object> |
172 | <packing> | |
173 | <property name="expand">False</property> | |
174 | <property name="fill">True</property> | |
175 | <property name="position">0</property> | |
176 | </packing> | |
177 | 118 | </child> |
178 | 119 | <child> |
179 | 120 | <object class="GtkButton" id="notificationUndoBtn"> |
180 | 121 | <property name="label" translatable="yes">Undo</property> |
181 | <property name="visible">True</property> | |
182 | <property name="can_focus">True</property> | |
183 | 122 | <property name="receives_default">True</property> |
184 | 123 | <property name="margin_start">12</property> |
185 | 124 | </object> |
186 | <packing> | |
187 | <property name="expand">False</property> | |
188 | <property name="fill">True</property> | |
189 | <property name="position">1</property> | |
190 | </packing> | |
191 | 125 | </child> |
192 | 126 | <child> |
193 | 127 | <object class="GtkButton" id="notificationCloseBtn"> |
194 | <property name="visible">True</property> | |
195 | <property name="can_focus">True</property> | |
196 | 128 | <property name="receives_default">True</property> |
197 | 129 | <property name="tooltip_text" translatable="yes">Close</property> |
198 | 130 | <property name="margin_start">8</property> |
199 | <property name="relief">none</property> | |
200 | <child> | |
201 | <object class="GtkImage"> | |
202 | <property name="visible">True</property> | |
203 | <property name="can_focus">False</property> | |
204 | <property name="icon_name">window-close-symbolic</property> | |
205 | </object> | |
206 | </child> | |
131 | <property name="has_frame">False</property> | |
132 | <property name="icon_name">window-close-symbolic</property> | |
207 | 133 | </object> |
208 | <packing> | |
209 | <property name="expand">False</property> | |
210 | <property name="fill">True</property> | |
211 | <property name="position">2</property> | |
212 | </packing> | |
213 | 134 | </child> |
214 | 135 | <style> |
215 | 136 | <class name="app-notification"/> |
219 | 140 | </object> |
220 | 141 | </child> |
221 | 142 | </object> |
222 | <packing> | |
223 | <property name="expand">False</property> | |
224 | <property name="fill">True</property> | |
225 | <property name="position">1</property> | |
226 | </packing> | |
227 | 143 | </child> |
228 | 144 | </object> |
229 | 145 | </child> |
36 | 36 | # Lets check whether the dependencies exist |
37 | 37 | dependency('gio-2.0', version: '>= 2.43.4') |
38 | 38 | dependency('glib-2.0', version: '>= 2.39.3') |
39 | dependency('gtk+-3.0', version: '>= 3.13.2') | |
39 | dependency('gtk4', version: '>= 3.99.3') | |
40 | 40 | dependency('gstreamer-player-1.0', version: '>= 1.12') |
41 | dependency('libhandy-1', version: '>= 1.1.90') | |
41 | dependency('libhandy-4', version: '>= 1.0.0') | |
42 | 42 | dependency('gobject-introspection-1.0', version: '>= 1.31.6') |
43 | 43 | |
44 | 44 | gnome = import('gnome') |
30 | 30 | "sources" : [ |
31 | 31 | { |
32 | 32 | "type" : "git", |
33 | "url" : "https://gitlab.gnome.org/GNOME/libhandy.git", | |
34 | "tag" : "1.1.90" | |
33 | "url" : "https://gitlab.gnome.org/exalm/libhandy.git", | |
34 | "branch" : "gtk4" | |
35 | 35 | } |
36 | 36 | ] |
37 | 37 | }, |
65 | 65 | }); |
66 | 66 | this.add_action(quitAction); |
67 | 67 | |
68 | this.add_accelerator('<Primary>q', 'app.quit', null); | |
69 | this.add_accelerator('F10', 'win.open-primary-menu', null); | |
70 | this.add_accelerator('<Primary>question', 'win.show-help-overlay', null); | |
71 | this.add_accelerator('<Primary>r', 'recorder.start', null); | |
72 | this.add_accelerator('space', 'recorder.pause', null); | |
73 | this.add_accelerator('space', 'recorder.resume', null); | |
74 | this.add_accelerator('Delete', 'recorder.cancel', null); | |
75 | this.add_accelerator('s', 'recorder.stop', null); | |
76 | this.add_accelerator('space', 'recording.play', null); | |
77 | this.add_accelerator('space', 'recording.pause', null); | |
78 | this.add_accelerator('b', 'recording.seek-backward', null); | |
79 | this.add_accelerator('n', 'recording.seek-forward', null); | |
80 | this.add_accelerator('F2', 'recording.rename', null); | |
81 | this.add_accelerator('Delete', 'recording.delete', null); | |
82 | this.add_accelerator('<Primary>s', 'recording.export', null); | |
68 | this.set_accels_for_action('app.quit', ['<Primary>q']); | |
69 | this.set_accels_for_action('win.open-primary-menu', ['F10']); | |
70 | this.set_accels_for_action('win.show-help-overlay', ['<Primary>question']); | |
71 | this.set_accels_for_action('recorder.start', ['<Primary>r']); | |
72 | this.set_accels_for_action('recorder.pause', ['space']); | |
73 | this.set_accels_for_action('recorder.resume', ['space']); | |
74 | this.set_accels_for_action('recorder.cancel', ['Delete']); | |
75 | this.set_accels_for_action('recorder.stop', ['s']); | |
76 | /* TODO: Fix recording.* keybindings */ | |
77 | this.set_accels_for_action('recording.play', ['space']); | |
78 | this.set_accels_for_action('recording.pause', ['space']); | |
79 | this.set_accels_for_action('recording.seek-backward', ['b']); | |
80 | this.set_accels_for_action('recording.seek-forward', ['n']); | |
81 | this.set_accels_for_action('recording.rename', ['F2']); | |
82 | this.set_accels_for_action('recording.delete', ['Delete']); | |
83 | this.set_accels_for_action('recording.export', ['<Primary>s']); | |
83 | 84 | } |
84 | 85 | |
85 | 86 | vfunc_startup() { |
89 | 90 | |
90 | 91 | let provider = new Gtk.CssProvider(); |
91 | 92 | provider.load_from_resource('/org/gnome/SoundRecorder/application.css'); |
92 | Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), | |
93 | Gtk.StyleContext.add_provider_for_display(Gdk.Display.get_default(), | |
93 | 94 | provider, |
94 | 95 | Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); |
95 | 96 | |
96 | Gtk.IconTheme.get_default().add_resource_path('/org/gnome/SoundRecorder/icons/'); | |
97 | this.set_resource_base_path('/org/gnome/SoundRecorder/'); | |
97 | 98 | Handy.init(); |
98 | 99 | Gst.init(null); |
99 | 100 | |
137 | 138 | wrap_license: true, |
138 | 139 | modal: true, |
139 | 140 | transient_for: this.window, |
140 | use_header_bar: true, | |
141 | 141 | }); |
142 | 142 | aboutDialog.show(); |
143 | aboutDialog.connect('response', () => { | |
144 | aboutDialog.close(); | |
145 | }); | |
146 | 143 | } |
147 | 144 | }); |
28 | 28 | pkg.initGettext(); |
29 | 29 | pkg.initFormat(); |
30 | 30 | pkg.require({ |
31 | 'Gdk': '3.0', | |
31 | 'Gdk': '4.0', | |
32 | 32 | 'GdkPixbuf': '2.0', |
33 | 33 | 'GLib': '2.0', |
34 | 34 | 'GObject': '2.0', |
35 | 'Gtk': '3.0', | |
35 | 'Gtk': '4.0', | |
36 | 36 | 'Gst': '1.0', |
37 | 37 | 'GstAudio': '1.0', |
38 | 38 | 'GstPlayer': '1.0', |
39 | 39 | 'GstPbutils': '1.0', |
40 | 'Handy': '1', | |
40 | 'Handy': '4', | |
41 | 41 | }); |
42 | 42 | |
43 | 43 | const { Application } = imports.application; |
21 | 21 | 'started': {}, |
22 | 22 | 'stopped': { param_types: [GObject.TYPE_OBJECT] }, |
23 | 23 | }, |
24 | }, class RecorderWidget extends Gtk.Bin { | |
24 | }, class RecorderWidget extends Gtk.Box { | |
25 | 25 | _init(recorder) { |
26 | 26 | super._init({}); |
27 | 27 | this.recorder = recorder; |
30 | 30 | vexpand: true, |
31 | 31 | valign: Gtk.Align.FILL, |
32 | 32 | }, WaveType.RECORDER); |
33 | this._recorderBox.add(this.waveform); | |
33 | this._recorderBox.prepend(this.waveform); | |
34 | 34 | |
35 | 35 | this.recorder.bind_property('current-peak', this.waveform, 'peak', GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.DEFAULT); |
36 | 36 | this.recorder.connect('notify::duration', _recorder => { |
119 | 119 | dialog.close(); |
120 | 120 | }); |
121 | 121 | |
122 | dialog.connect('key-press-event', (_, event) => { | |
123 | const key = event.get_keyval()[1]; | |
124 | if (key === Gdk.KEY_Escape) | |
125 | dialog.response(Gtk.ResponseType.NO); | |
126 | }); | |
127 | ||
128 | 122 | dialog.show(); |
129 | 123 | } |
130 | 124 |
36 | 36 | this.bind_model(model, recording => { |
37 | 37 | let row = new Row(recording); |
38 | 38 | |
39 | row.waveform.connect('button-press-event', _ => { | |
39 | row.waveform.connect('gesture-pressed', _ => { | |
40 | 40 | if (!this.activePlayingRow || this.activePlayingRow !== row) { |
41 | 41 | |
42 | 42 | if (this.activePlayingRow) |
98 | 98 | return row; |
99 | 99 | }); |
100 | 100 | |
101 | this.connect('row-activated', this.rowActivated.bind(this)); | |
102 | ||
101 | 103 | this.show(); |
102 | 104 | } |
103 | 105 | |
104 | vfunc_row_activated(row) { | |
106 | rowActivated(list, row) { | |
105 | 107 | if (row.editMode && row.expanded || this.activeRow && this.activeRow.editMode && this.activeRow.expanded) |
106 | 108 | return; |
107 | 109 |
81 | 81 | }); |
82 | 82 | this.actionGroup.add_action(exportAction); |
83 | 83 | |
84 | let saveRenameAction = new Gio.SimpleAction({ name: 'save', enabled: false }); | |
85 | saveRenameAction.connect('activate', this.onRenameRecording.bind(this)); | |
86 | this.actionGroup.add_action(saveRenameAction); | |
84 | this.saveRenameAction = new Gio.SimpleAction({ name: 'save', enabled: false }); | |
85 | this.saveRenameAction.connect('activate', this.onRenameRecording.bind(this)); | |
86 | this.actionGroup.add_action(this.saveRenameAction); | |
87 | 87 | |
88 | 88 | this.renameAction = new Gio.SimpleAction({ name: 'rename', enabled: true }); |
89 | 89 | this.renameAction.connect('activate', action => { |
90 | 90 | this.editMode = true; |
91 | 91 | action.enabled = false; |
92 | 92 | }); |
93 | this.renameAction.bind_property('enabled', saveRenameAction, 'enabled', GObject.BindingFlags.INVERT_BOOLEAN); | |
93 | this.renameAction.bind_property('enabled', this.saveRenameAction, 'enabled', GObject.BindingFlags.INVERT_BOOLEAN); | |
94 | 94 | this.actionGroup.add_action(this.renameAction); |
95 | 95 | |
96 | 96 | let pauseAction = new Gio.SimpleAction({ name: 'pause', enabled: false }); |
127 | 127 | |
128 | 128 | this.insert_action_group('recording', this.actionGroup); |
129 | 129 | |
130 | this.waveform.connect('button-press-event', _ => { | |
130 | this.waveform.connect('gesture-pressed', _ => { | |
131 | 131 | pauseAction.activate(null); |
132 | 132 | }); |
133 | 133 | |
134 | this._entry.connect('key-press-event', (_, event) => { | |
135 | const key = event.get_keyval()[1]; | |
134 | this.keyController = Gtk.EventControllerKey.new(); | |
135 | this.keyController.connect('key-pressed', (controller, key, _code, _state) => { | |
136 | 136 | this._entry.get_style_context().remove_class('error'); |
137 | 137 | |
138 | if (key === Gdk.KEY_Escape) | |
138 | if (key === Gdk.KEY_Escape) { | |
139 | 139 | this.editMode = false; |
140 | } else { | |
141 | controller.forward(this._entry); | |
142 | } | |
143 | }); | |
144 | this._entry.add_controller(this.keyController); | |
145 | ||
146 | this._entry.connect('activate', _ => { | |
147 | this.saveRenameAction.activate(null); | |
140 | 148 | }); |
141 | 149 | |
142 | 150 | this._recording.connect('peaks-updated', _recording => { |
180 | 188 | if (!this.expanded) |
181 | 189 | this.activate(); |
182 | 190 | this._entry.grab_focus(); |
183 | this._saveBtn.grab_default(); | |
191 | /* TODO: this._saveBtn.grab_default(); */ | |
184 | 192 | this._rightStack.visible_child_name = 'save'; |
185 | 193 | } else { |
186 | 194 | this._rightStack.visible_child_name = 'options'; |
48 | 48 | }, |
49 | 49 | Signals: { |
50 | 50 | 'position-changed': { param_types: [GObject.TYPE_FLOAT] }, |
51 | 'gesture-pressed': {}, | |
51 | 52 | }, |
52 | 53 | }, class WaveForm extends Gtk.DrawingArea { |
53 | 54 | _init(params, type) { |
57 | 58 | this.waveType = type; |
58 | 59 | super._init(params); |
59 | 60 | |
60 | if (this.waveType === WaveType.PLAYER) { | |
61 | this.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | | |
62 | Gdk.EventMask.BUTTON_RELEASE_MASK | | |
63 | Gdk.EventMask.BUTTON1_MOTION_MASK); | |
64 | } | |
65 | ||
66 | 61 | this.rightColor = (IsDark ? [80, 80, 80] : [192, 191, 188]).map(x => x / 255); |
67 | 62 | this.leftColor = (IsDark ? [192, 191, 188] : [46, 52, 54]).map(x => x / 255); |
68 | 63 | this.dividerColor = (this.waveType === WaveType.PLAYER ? [28, 113, 216] : [255, 0, 0]).map(x => x / 255); |
69 | 64 | |
65 | // TODO: Figure out how to mesh these gestures with the row-activated cb and | |
66 | // new event handling | |
67 | if (this.waveType === WaveType.PLAYER) { | |
68 | this.clickGesture = Gtk.GestureClick.new(); | |
69 | this.clickGesture.connect('pressed', this.gesturePressed.bind(this)); | |
70 | this.clickGesture.connect('released', this.gestureReleased.bind(this)); | |
71 | this.add_controller(this.clickGesture); | |
72 | ||
73 | this.motionGesture = Gtk.EventControllerMotion.new(); | |
74 | this.motionGesture.connect('motion', this.onMotion.bind(this)); | |
75 | } | |
76 | ||
77 | this.set_draw_func(this.drawFunc); | |
78 | ||
70 | 79 | this.show(); |
71 | 80 | } |
72 | 81 | |
73 | vfunc_button_press_event(event) { | |
74 | this._startX = event.x; | |
75 | return true; | |
82 | gesturePressed(n_press, x, y) { | |
83 | this._startX = x; | |
84 | this.emit('gesture-pressed'); | |
76 | 85 | } |
77 | 86 | |
78 | vfunc_motion_notify_event(event) { | |
79 | this._position = this._clamped(event.x - this._startX + this._lastX); | |
87 | onMotion(x, y) { | |
88 | this._position = this._clamped(x - this._startX + this._lastX); | |
80 | 89 | this.queue_draw(); |
81 | return true; | |
82 | 90 | } |
83 | 91 | |
84 | vfunc_button_release_event(_) { | |
92 | gestureReleased(n_press, x, y) { | |
85 | 93 | this._lastX = this._position; |
86 | 94 | this.emit('position-changed', this.position); |
87 | return true; | |
88 | 95 | } |
89 | 96 | |
90 | vfunc_draw(ctx) { | |
91 | const maxHeight = this.get_allocated_height(); | |
97 | drawFunc(da, ctx, width, height) { | |
98 | const maxHeight = da.get_allocated_height(); | |
92 | 99 | const vertiCenter = maxHeight / 2; |
93 | const horizCenter = this.get_allocated_width() / 2; | |
100 | const horizCenter = da.get_allocated_width() / 2; | |
94 | 101 | |
95 | let pointer = horizCenter + this._position; | |
102 | let pointer = horizCenter + da._position; | |
96 | 103 | |
97 | 104 | ctx.setLineCap(Cairo.LineCap.ROUND); |
98 | 105 | ctx.setLineWidth(2); |
99 | 106 | |
100 | ctx.setSourceRGB(...this.dividerColor); | |
107 | ctx.setSourceRGB(...da.dividerColor); | |
101 | 108 | |
102 | 109 | ctx.moveTo(horizCenter, vertiCenter - maxHeight); |
103 | 110 | ctx.lineTo(horizCenter, vertiCenter + maxHeight); |
105 | 112 | |
106 | 113 | ctx.setLineWidth(1); |
107 | 114 | |
108 | this._peaks.forEach(peak => { | |
109 | if (this.waveType === WaveType.PLAYER) { | |
115 | da._peaks.forEach(peak => { | |
116 | if (da.waveType === WaveType.PLAYER) { | |
110 | 117 | if (pointer > horizCenter) |
111 | ctx.setSourceRGB(...this.rightColor); | |
118 | ctx.setSourceRGB(...da.rightColor); | |
112 | 119 | else |
113 | ctx.setSourceRGB(...this.leftColor); | |
120 | ctx.setSourceRGB(...da.leftColor); | |
114 | 121 | } else { |
115 | ctx.setSourceRGB(...this.leftColor); | |
122 | ctx.setSourceRGB(...da.leftColor); | |
116 | 123 | } |
117 | 124 | |
118 | 125 | ctx.moveTo(pointer, vertiCenter + peak * maxHeight); |
119 | 126 | ctx.lineTo(pointer, vertiCenter - peak * maxHeight); |
120 | 127 | ctx.stroke(); |
121 | 128 | |
122 | if (this.waveType === WaveType.PLAYER) | |
129 | if (da.waveType === WaveType.PLAYER) | |
123 | 130 | pointer += GUTTER; |
124 | 131 | else |
125 | 132 | pointer -= GUTTER; |
92 | 92 | } |
93 | 93 | this._notificationUndoBtn.disconnect(this.cancelSignalId); |
94 | 94 | }); |
95 | this._column.add(this._recordingListBox); | |
95 | this._column.set_child(this._recordingListBox); | |
96 | 96 | |
97 | 97 | this.recorderWidget.connect('started', this.onRecorderStarted.bind(this)); |
98 | 98 | this.recorderWidget.connect('canceled', this.onRecorderCanceled.bind(this)); |
102 | 102 | this.show(); |
103 | 103 | } |
104 | 104 | |
105 | vfunc_delete_event() { | |
105 | vfunc_close_request() { | |
106 | 106 | this._recordingList.cancellable.cancel(); |
107 | 107 | if (this.itemsSignalId) |
108 | 108 | this._recordingList.disconnect(this.itemsSignalId); |
114 | 114 | } |
115 | 115 | |
116 | 116 | this.recorder.stop(); |
117 | this.application.quit(); | |
117 | 118 | } |
118 | 119 | |
119 | 120 | onRecorderStarted() { |