Skip to content

Commit

Permalink
Re-introduce clang test, fix all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axkg committed Apr 4, 2024
1 parent 321d68b commit edab53d
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 60 deletions.
54 changes: 49 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,43 @@ src = [
'src/wav_write.c'
]

hdr = [
'src/tX_audiodevice.h',
'src/tX_audiofile.h',
'src/tX_capabilities.h',
'src/tX_dial.h',
'src/tX_dialog.h',
'src/tX_endian.h',
'src/tX_engine.h',
'src/tX_event.h',
'src/tX_extdial.h',
'src/tX_flash.h',
'src/tX_global.h',
'src/tX_knobloader.h',
'src/tX_ladspa_class.h',
'src/tX_ladspa.h',
'src/tX_loaddlg.h',
'src/tX_maingui.h',
'src/tX_midiin.h',
'src/tX_mouse.h',
'src/tX_panel.h',
'src/tX_pbutton.h',
'src/tX_prelis.h',
'src/tX_seqpar.h',
'src/tX_sequencer.h',
'src/tX_tape.h',
'src/tX_types.h',
'src/tX_ui_callbacks.h',
'src/tX_ui_interface.h',
'src/tX_ui_support.h',
'src/tX_vttfx.h',
'src/tX_vttgui.h',
'src/tX_vtt.h',
'src/tX_widget.h',
'src/version.h',
'src/wav_file.h'
]

includes = include_directories('src')

xxd = find_program('xxd')
Expand Down Expand Up @@ -202,6 +239,13 @@ executable(meson.project_name(),
install_mode: tX_mode
)

clang_format = find_program('clang-format', required: false)
if clang_format.found()
test('Validating coding style', clang_format,
args: ['--dry-run', '-Werror'] + src + hdr,
workdir: meson.project_source_root())
endif

# docs and supporting files

doc_config = configuration_data()
Expand All @@ -226,7 +270,7 @@ spec_file = configure_file(input: 'terminatorX.spec.in',
# desktop file

desktop_file = configure_file(input: 'terminatorX.desktop',
output: 'terminatorX.desktop',
output: 'org.terminatorx.terminatorX.desktop',
configuration: doc_config,
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
Expand All @@ -239,17 +283,17 @@ endif

# appdata

appdata = configure_file(input: 'terminatorX.appdata.xml',
output: 'terminatorX.appdata.xml',
metainfo = configure_file(input: 'terminatorX.metainfo.xml',
output: 'org.terminatorx.terminatorX.metainfo.xml',
configuration: doc_config,
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

appdata_validator = find_program('appstreamcli', required: false)
if appdata_validator.found()
test('Validating desktop file', appdata_validator,
args: ['validate', '--no-net', '--explain', appdata])
args: ['validate', '--no-net', '--explain', metainfo])
endif

# GNOME online help
Expand Down
4 changes: 2 additions & 2 deletions src/tX_audiofile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ static enum mad_flow tX_mad_error(void* data, struct mad_stream* stream, struct

/* From minimad.c of mad */
static inline signed int scale(mad_fixed_t sample) {
//#ifdef BIG_ENDIAN_MACHINE
// #ifdef BIG_ENDIAN_MACHINE
// swap32_inline(&sample);
//#endif
// #endif
/* round */
sample += (1L << (MAD_F_FRACBITS - 16));

Expand Down
2 changes: 1 addition & 1 deletion src/tX_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void show_about(int nag) {
gtk_container_add(GTK_CONTAINER(scroll), text);
gtk_text_buffer_create_tag(tbuffer, "courier", "family", "courier", NULL);

gtk_text_buffer_insert_with_tags_by_name(tbuffer, &iter, (const gchar*) ___COPYING, ___COPYING_len, "courier", NULL);
gtk_text_buffer_insert_with_tags_by_name(tbuffer, &iter, (const gchar*)___COPYING, ___COPYING_len, "courier", NULL);
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 5);
gtk_widget_set_size_request(GTK_WIDGET(scroll), 640, 200);
Expand Down
2 changes: 1 addition & 1 deletion src/tX_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#ifndef _H_TX_DIALOG_
#define _H_TX_DIALOG_
//#include <gdk/gdk.h>
// #include <gdk/gdk.h>
#include <gtk/gtk.h>
extern GtkWidget* opt_dialog;

Expand Down
8 changes: 4 additions & 4 deletions src/tX_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
extern "C" {
#endif /* __cplusplus */

#include <config.h>
#include "tX_types.h"
#include <config.h>
#include <limits.h>
#include <stdio.h>
#include <zlib.h>
Expand Down Expand Up @@ -336,9 +336,9 @@ extern char* decode_xml(char* dest, const char* src);
} \
}

//#define restore_int_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
//#define restore_float_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
//#define restore_bool_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *)"id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
// #define restore_int_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
// #define restore_float_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
// #define restore_bool_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *)"id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}

extern int _store_compress_xml;

Expand Down
2 changes: 1 addition & 1 deletion src/tX_knobloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/

#include "tX_knobloader.h"
#include "tX_knob_resource.h"
#include "tX_global.h"
#include "tX_knob_resource.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>

Expand Down
2 changes: 1 addition & 1 deletion src/tX_ladspa_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#ifndef _h_tx_ladspa_class
#define _h_tx_ladspa_class 1

#include <config.h>
#include "tX_ladspa.h"
#include "tX_vtt.h"
#include <config.h>
#include <gtk/gtk.h>
#include <list>

Expand Down
3 changes: 1 addition & 2 deletions src/tX_prelis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ extern "C" {
#include <sys/wait.h>
};

#include <config.h>
#include "tX_global.h"
#include <config.h>

#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>


pid_t player_pid = 0;

void prelis_stop() {
Expand Down
4 changes: 2 additions & 2 deletions src/tX_sequencer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ int tX_sequencer ::trig_play() {
return 1;
}

//#define SEQ_DEBUG 1
//#define SEQ_DEBUG_MAX 1
// #define SEQ_DEBUG 1
// #define SEQ_DEBUG_MAX 1

void tX_sequencer ::trig_stop() {
list<tX_event*>::iterator song_event;
Expand Down
2 changes: 1 addition & 1 deletion src/tX_ui_callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

#include <gtk/gtk.h>

#include <config.h>
#include "tX_dialog.h"
#include "tX_global.h"
#include "tX_maingui.h"
#include "tX_sequencer.h"
#include "tX_ui_callbacks.h"
#include "tX_ui_interface.h"
#include "tX_ui_support.h"
#include <config.h>

void on_pref_cancel_clicked(GtkButton* button,
gpointer user_data) {
Expand Down
4 changes: 2 additions & 2 deletions src/tX_vtt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

#include <config.h>

#include "tX_vtt.h"
#include "malloc.h"
#include "tX_global.h"
#include "tX_maingui.h"
#include "tX_sequencer.h"
#include "tX_vtt.h"
#include <glib.h>
#include <math.h>
#include <stdio.h>
Expand Down Expand Up @@ -1628,7 +1628,7 @@ void add_vtt(GtkWidget* ctrl, GtkWidget* audio, char* fn) {
extern void vg_move_fx_panel_up(tX_panel* panel, vtt_class* vtt, bool stereo);
extern void vg_move_fx_panel_down(tX_panel* panel, vtt_class* vtt, bool stereo);

//#define debug_fx_stack(); for (i=list->begin(); i != list->end(); i++) puts((*i)->get_info_string());
// #define debug_fx_stack(); for (i=list->begin(); i != list->end(); i++) puts((*i)->get_info_string());
#define debug_fx_stack() ;

void vtt_class ::effect_move(vtt_fx* effect, int pos) {
Expand Down
2 changes: 1 addition & 1 deletion src/tX_vttfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef _h_tx_vttfx
#define _h_tx_vttfx 1

//#include "tX_vtt.h"
// #include "tX_vtt.h"
#include "tX_ladspa.h"
#include "tX_panel.h"
#include "tX_seqpar.h"
Expand Down
6 changes: 3 additions & 3 deletions src/tX_vttgui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
*/

#include "tX_vttgui.h"
#include "tX_dial.h"
#include "tX_dialog.h"
#include "tX_engine.h"
#include "tX_extdial.h"
#include "tX_flash.h"
#include "tX_global.h"
#include "tX_ladspa.h"
#include "tX_ladspa_class.h"
Expand All @@ -39,12 +41,10 @@
#include "tX_ui_support.h"
#include "tX_vtt.h"
#include "tX_widget.h"
#include "tX_dial.h"
#include "tX_flash.h"

#include <ctype.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>

Expand Down
34 changes: 0 additions & 34 deletions terminatorX.appdata.xml

This file was deleted.

36 changes: 36 additions & 0 deletions terminatorX.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.terminatorx.terminatorX</id>
<name>terminatorX</name>
<metadata_license>CC0</metadata_license>
<project_license>GPL-2.0+</project_license>
<summary>terminatorX is a realtime audio synthesizer</summary>
<description>
<p>
terminatorX facilitates loading sampled audio data of various formats
(*.wav, *.au, *.ogg, *.mp3, etc.) into virtual turntables for
synchronized playback. The user can operate these turntables using
mouse and keyboard inputs in order to &quot;scratch&quot; the way
hiphop-DJs scratch on vinyl records.
</p>
<p>
It features realtime effects (buit-in as well as LADSPA plugin
effects), a sequencer and a MIDI interface - all accessible through
an easy-to-use gtk+ user interface. Audio can be played back either
directly through the hardware using the ALSA and OSS backends or via
an audio routing daemon through the JACK and PulseAudio backends.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://terminatorX.org/appdata/screenshot.png</image>
<caption>terminatorX with three virtual turntables</caption>
</screenshot>
</screenshots>
<url type="homepage">https://terminatorX.org</url>
<url type="bugtracker">https://github.com/axkg/terminatorX/issues</url>
<launchable type="desktop-id">org.terminatorx.terminatorX.desktop</launchable>
<content_rating type="oars-1.0" />
<update_contact>[email protected]</update_contact>
</component>

0 comments on commit edab53d

Please sign in to comment.