mirror of
https://gitlab.com/then-try-this/samplebrain.git
synced 2025-05-12 18:47:21 +00:00
crash fix
This commit is contained in:
parent
9e0aeb9f34
commit
b873e461f6
@ -1,6 +1,6 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
# Makefile for building: samplebrain
|
# Makefile for building: samplebrain
|
||||||
# Generated by qmake (2.01a) (Qt 4.8.1) on: Mon Jul 27 09:28:27 2015
|
# Generated by qmake (2.01a) (Qt 4.8.1) on: Mon Jul 27 16:02:01 2015
|
||||||
# Project: samplebrain.pro
|
# Project: samplebrain.pro
|
||||||
# Template: app
|
# Template: app
|
||||||
# Command: /usr/bin/qmake -o Makefile samplebrain.pro
|
# Command: /usr/bin/qmake -o Makefile samplebrain.pro
|
||||||
@ -10,12 +10,12 @@
|
|||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
DEFINES = -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
|
DEFINES = -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
|
||||||
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
|
CFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
|
||||||
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
|
CXXFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
|
||||||
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I2 -I../src -I.
|
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I2 -I../src -I.
|
||||||
LINK = g++
|
LINK = g++
|
||||||
LFLAGS = -m64 -Wl,-O1
|
LFLAGS = -m64
|
||||||
LIBS = $(SUBLIBS) -L/usr/lib/x86_64-linux-gnu -L.. -lsamplebrain -ljellyfish -lportaudio -lfftw3 -lsndfile -llo -ldl -lm -lQtGui -lQtCore -lpthread
|
LIBS = $(SUBLIBS) -L/usr/lib/x86_64-linux-gnu -L.. -lsamplebrain -ljellyfish -lportaudio -lfftw3 -lsndfile -llo -ldl -lm -lQtGui -lQtCore -lpthread
|
||||||
AR = ar cqs
|
AR = ar cqs
|
||||||
RANLIB =
|
RANLIB =
|
||||||
@ -68,7 +68,7 @@ DIST = /usr/share/qt4/mkspecs/common/unix.conf \
|
|||||||
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
||||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
||||||
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
||||||
/usr/share/qt4/mkspecs/features/release.prf \
|
/usr/share/qt4/mkspecs/features/debug.prf \
|
||||||
/usr/share/qt4/mkspecs/features/default_post.prf \
|
/usr/share/qt4/mkspecs/features/default_post.prf \
|
||||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
||||||
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
||||||
@ -111,6 +111,7 @@ all: Makefile $(TARGET)
|
|||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
|
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
|
||||||
|
{ test -n "$(DESTDIR)" && DESTDIR="$(DESTDIR)" || DESTDIR=.; } && test $$(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $$DESTDIR" -ex quit '$(TARGET)' && test -f $(TARGET).gdb-index && objcopy --add-section '.gdb_index=$(TARGET).gdb-index' --set-section-flags '.gdb_index=readonly' '$(TARGET)' '$(TARGET)' && rm -f $(TARGET).gdb-index || true
|
||||||
|
|
||||||
Makefile: samplebrain.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
|
Makefile: samplebrain.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
|
||||||
/usr/share/qt4/mkspecs/common/linux.conf \
|
/usr/share/qt4/mkspecs/common/linux.conf \
|
||||||
@ -124,7 +125,7 @@ Makefile: samplebrain.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/s
|
|||||||
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
||||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
||||||
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
||||||
/usr/share/qt4/mkspecs/features/release.prf \
|
/usr/share/qt4/mkspecs/features/debug.prf \
|
||||||
/usr/share/qt4/mkspecs/features/default_post.prf \
|
/usr/share/qt4/mkspecs/features/default_post.prf \
|
||||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
||||||
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
||||||
@ -151,7 +152,7 @@ Makefile: samplebrain.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/s
|
|||||||
/usr/share/qt4/mkspecs/features/qt_config.prf:
|
/usr/share/qt4/mkspecs/features/qt_config.prf:
|
||||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
|
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
|
||||||
/usr/share/qt4/mkspecs/features/default_pre.prf:
|
/usr/share/qt4/mkspecs/features/default_pre.prf:
|
||||||
/usr/share/qt4/mkspecs/features/release.prf:
|
/usr/share/qt4/mkspecs/features/debug.prf:
|
||||||
/usr/share/qt4/mkspecs/features/default_post.prf:
|
/usr/share/qt4/mkspecs/features/default_post.prf:
|
||||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
|
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
|
||||||
/usr/share/qt4/mkspecs/features/warn_on.prf:
|
/usr/share/qt4/mkspecs/features/warn_on.prf:
|
||||||
@ -195,6 +196,7 @@ compiler_moc_header_make_all: moc_MainWindow.cpp
|
|||||||
compiler_moc_header_clean:
|
compiler_moc_header_clean:
|
||||||
-$(DEL_FILE) moc_MainWindow.cpp
|
-$(DEL_FILE) moc_MainWindow.cpp
|
||||||
moc_MainWindow.cpp: generated/ui_samplebrain.h \
|
moc_MainWindow.cpp: generated/ui_samplebrain.h \
|
||||||
|
feedback.h \
|
||||||
MainWindow.h
|
MainWindow.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) MainWindow.h -o moc_MainWindow.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) MainWindow.h -o moc_MainWindow.cpp
|
||||||
|
|
||||||
@ -243,6 +245,7 @@ feedback.o: feedback.cpp feedback.h
|
|||||||
|
|
||||||
qtmain.o: qtmain.cpp MainWindow.h \
|
qtmain.o: qtmain.cpp MainWindow.h \
|
||||||
generated/ui_samplebrain.h \
|
generated/ui_samplebrain.h \
|
||||||
|
feedback.h \
|
||||||
process_thread.h \
|
process_thread.h \
|
||||||
audio_thread.h
|
audio_thread.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qtmain.o qtmain.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qtmain.o qtmain.cpp
|
||||||
|
@ -21,6 +21,7 @@ SOURCES += MainWindow.cpp \
|
|||||||
|
|
||||||
INCLUDEPATH += ../src
|
INCLUDEPATH += ../src
|
||||||
LIBS += -L.. -lsamplebrain -ljellyfish -lportaudio -lfftw3 -lsndfile -llo -ldl -lpthread -lm
|
LIBS += -L.. -lsamplebrain -ljellyfish -lportaudio -lfftw3 -lsndfile -llo -ldl -lpthread -lm
|
||||||
|
CONFIG+=debug
|
||||||
|
|
||||||
# assets
|
# assets
|
||||||
RESOURCES = samplebrain.qrc
|
RESOURCES = samplebrain.qrc
|
||||||
|
@ -33,10 +33,18 @@ void renderer::init(brain &source, brain &target) {
|
|||||||
m_search_algo=BASIC;
|
m_search_algo=BASIC;
|
||||||
m_slide_error=1;
|
m_slide_error=1;
|
||||||
m_target_index=0;
|
m_target_index=0;
|
||||||
|
m_last_tgt_shift=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ratio_time = 0;
|
static int ratio_time = 0;
|
||||||
|
|
||||||
|
void renderer::reset() {
|
||||||
|
m_target_time=0;
|
||||||
|
m_render_time=0;
|
||||||
|
m_target_index=0;
|
||||||
|
m_render_blocks.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void renderer::process(u32 nframes, float *buf) {
|
void renderer::process(u32 nframes, float *buf) {
|
||||||
if (!m_playing) return;
|
if (!m_playing) return;
|
||||||
|
|
||||||
@ -44,11 +52,10 @@ void renderer::process(u32 nframes, float *buf) {
|
|||||||
u32 tgt_shift = m_target.get_block_size()-m_target.get_overlap();
|
u32 tgt_shift = m_target.get_block_size()-m_target.get_overlap();
|
||||||
u32 tgt_end = (m_target_time+nframes)/(float)tgt_shift;
|
u32 tgt_end = (m_target_time+nframes)/(float)tgt_shift;
|
||||||
|
|
||||||
if (tgt_end>=m_target.get_num_blocks() || m_source.get_num_blocks()==0) {
|
if (tgt_shift!=m_last_tgt_shift ||
|
||||||
m_target_time=0;
|
tgt_end>=m_target.get_num_blocks() || m_source.get_num_blocks()==0) {
|
||||||
m_render_time=0;
|
reset();
|
||||||
m_target_index=0;
|
m_last_tgt_shift = tgt_shift;
|
||||||
m_render_blocks.clear();
|
|
||||||
// next time...
|
// next time...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
renderer(brain &source, brain &target) :
|
renderer(brain &source, brain &target) :
|
||||||
m_source(source),
|
m_source(source),
|
||||||
m_target(target),
|
m_target(target),
|
||||||
m_search_params(0,0,0,100,1)
|
m_search_params(0,0,0,100,0)
|
||||||
{ init(source,target); }
|
{ init(source,target); }
|
||||||
|
|
||||||
enum search_algo {
|
enum search_algo {
|
||||||
@ -39,6 +39,9 @@ renderer(brain &source, brain &target) :
|
|||||||
};
|
};
|
||||||
|
|
||||||
void init(brain &source, brain &target);
|
void init(brain &source, brain &target);
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
|
||||||
void process(u32 nframes, float *buf);
|
void process(u32 nframes, float *buf);
|
||||||
|
|
||||||
void set_search_algo(search_algo s) { m_search_algo=s; }
|
void set_search_algo(search_algo s) { m_search_algo=s; }
|
||||||
@ -80,7 +83,7 @@ private:
|
|||||||
|
|
||||||
search_algo m_search_algo;
|
search_algo m_search_algo;
|
||||||
double m_slide_error;
|
double m_slide_error;
|
||||||
|
u32 m_last_tgt_shift;
|
||||||
|
|
||||||
std::list<render_block> m_render_blocks;
|
std::list<render_block> m_render_blocks;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user